1 # ***** BEGIN GPL LICENSE BLOCK *****
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ***** END GPL LICENSE BLOCK *****
19 ########################################################################
20 # Copy all generated files to the proper strucure as blender prefers
21 ########################################################################
23 if(NOT DEFINED HARVEST_TARGET)
24 set(HARVEST_TARGET ${CMAKE_CURRENT_SOURCE_DIR}/Harvest)
26 message("HARVEST_TARGET = ${HARVEST_TARGET}")
29 if(BUILD_MODE STREQUAL Release)
30 add_custom_target(Harvest_Release_Results
31 COMMAND # jpeg rename libfile + copy include
32 ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
33 ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
35 ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/include ${HARVEST_TARGET}/OpenImageIO/include &&
36 ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/lib ${HARVEST_TARGET}/OpenImageIO/lib &&
37 ${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenImageIO/bin/idiff.exe ${HARVEST_TARGET}/OpenImageIO/bin/idiff.exe &&
39 ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
40 ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
42 ${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib &&
43 ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ &&
45 ${CMAKE_COMMAND} -E copy ${LIBDIR}/glew/lib/libglew32.lib ${HARVEST_TARGET}/opengl/lib/glew.lib &&
46 ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/glew/include/ ${HARVEST_TARGET}/opengl/include/ &&
48 ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/lib/libsndfile.dll.a ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.lib &&
49 ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/bin/libsndfile-1.dll ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.dll &&
50 ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/include/sndfile.h ${HARVEST_TARGET}/sndfile/include/sndfile.h &&
52 ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
53 ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/ &&
55 ${CMAKE_COMMAND} -E copy ${LIBDIR}/BlendThumb64/bin/blendthumb.dll ${HARVEST_TARGET}/ThumbHandler/lib/BlendThumb64.dll &&
56 ${CMAKE_COMMAND} -E copy ${LIBDIR}/BlendThumb32/bin/blendthumb.dll ${HARVEST_TARGET}/ThumbHandler/lib/BlendThumb.dll &&
58 ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hidapi/ ${HARVEST_TARGET}/hidapi/ &&
59 # webp, straight up copy
60 ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/webp ${HARVEST_TARGET}/webp &&
65 if(BUILD_MODE STREQUAL Debug)
66 add_custom_target(Harvest_Debug_Results
68 COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib &&
69 ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib &&
71 ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/python/ ${HARVEST_TARGET}/python/ &&
73 ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hdf5/lib ${HARVEST_TARGET}/hdf5/lib &&
75 ${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}d.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_numpy_${NUMPY_SHORT_VERSION}d.tar.gz &&
77 ${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.tar.gz
78 DEPENDS Package_Python
84 function(harvest from to)
90 if(pattern STREQUAL "")
91 get_filename_component(dirpath ${to} DIRECTORY)
92 get_filename_component(filename ${to} NAME)
94 FILES ${LIBDIR}/${from}
95 DESTINATION ${HARVEST_TARGET}/${dirpath}
99 DIRECTORY ${LIBDIR}/${from}/
100 DESTINATION ${HARVEST_TARGET}/${to}
101 USE_SOURCE_PERMISSIONS
102 FILES_MATCHING PATTERN ${pattern}
103 PATTERN "pkgconfig" EXCLUDE
104 PATTERN "cmake" EXCLUDE
105 PATTERN "clang" EXCLUDE
106 PATTERN "__pycache__" EXCLUDE
107 PATTERN "tests" EXCLUDE)
111 harvest(alembic/include alembic/include "*.h")
112 harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
113 harvest(alembic/bin alembic/bin "*")
114 harvest(boost/include boost/include "*")
115 harvest(boost/lib boost/lib "*.a")
116 harvest(ffmpeg/include ffmpeg/include "*.h")
117 harvest(ffmpeg/lib ffmpeg/lib "*.a")
118 harvest(fftw3/include fftw3/include "*.h")
119 harvest(fftw3/lib fftw3/lib "*.a")
120 harvest(flac/lib sndfile/lib "libFLAC.a")
121 harvest(freetype/include freetype/include "*.h")
122 harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
123 harvest(glew/include glew/include "*.h")
124 harvest(glew/lib glew/lib "*.a")
125 harvest(ilmbase openexr "*")
126 harvest(ilmbase/include openexr/include "*.h")
127 harvest(jemalloc/include jemalloc/include "*.h")
128 harvest(jemalloc/lib jemalloc/lib "*.a")
129 harvest(jpg/include jpeg/include "*.h")
130 harvest(jpg/lib jpeg/lib "libjpeg.a")
131 harvest(lame/lib ffmpeg/lib "*.a")
132 harvest(llvm/bin llvm/bin "llvm-config")
133 harvest(llvm/lib llvm/lib "libLLVM*.a")
134 harvest(ogg/lib ffmpeg/lib "*.a")
135 harvest(openal/include openal/include "*.h")
136 if(UNIX AND NOT APPLE)
137 harvest(openal/lib openal/lib "*.a")
139 harvest(blosc/include blosc/include "*.h")
140 harvest(blosc/lib blosc/lib "*.a")
142 harvest(zlib/include zlib/include "*.h")
143 harvest(zlib/lib zlib/lib "*.a")
145 harvest(xml2/include xml2/include "*.h")
146 harvest(xml2/lib xml2/lib "*.a")
148 harvest(blosc/lib openvdb/lib "*.a")
149 harvest(xml2/lib opencollada/lib "*.a")
151 harvest(opencollada/include/opencollada opencollada/include "*.h")
152 harvest(opencollada/lib/opencollada opencollada/lib "*.a")
153 harvest(opencolorio/include opencolorio/include "*.h")
154 harvest(opencolorio/lib opencolorio/lib "*.a")
155 harvest(opencolorio/lib/static opencolorio/lib "*.a")
156 harvest(openexr/include openexr/include "*.h")
157 harvest(openexr/lib openexr/lib "*.a")
158 harvest(openimageio/bin openimageio/bin "idiff")
159 harvest(openimageio/bin openimageio/bin "maketx")
160 harvest(openimageio/bin openimageio/bin "oiiotool")
161 harvest(openimageio/include openimageio/include "*")
162 harvest(openimageio/lib openimageio/lib "*.a")
163 harvest(openjpeg/include/openjpeg-2.3 openjpeg/include "*.h")
164 harvest(openjpeg/lib openjpeg/lib "*.a")
165 harvest(opensubdiv/include opensubdiv/include "*.h")
166 harvest(opensubdiv/lib opensubdiv/lib "*.a")
167 harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h")
168 harvest(openvdb/lib openvdb/lib "*.a")
169 harvest(osl/bin osl/bin "oslc")
170 harvest(osl/include osl/include "*.h")
171 harvest(osl/lib osl/lib "*.a")
172 harvest(osl/shaders osl/shaders "*.h")
173 harvest(png/include png/include "*.h")
174 harvest(png/lib png/lib "*.a")
175 harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}m")
176 harvest(python/include python/include "*h")
177 harvest(python/lib python/lib "*")
178 harvest(sdl/include/SDL2 sdl/include "*.h")
179 harvest(sdl/lib sdl/lib "libSDL2.a")
180 harvest(sndfile/include sndfile/include "*.h")
181 harvest(sndfile/lib sndfile/lib "*.a")
182 harvest(spnav/include spnav/include "*.h")
183 harvest(spnav/lib spnav/lib "*.a")
184 harvest(tbb/include tbb/include "*.h")
185 harvest(tbb/lib/libtbb_static.a tbb/lib/libtbb.a)
186 harvest(theora/lib ffmpeg/lib "*.a")
187 harvest(tiff/include tiff/include "*.h")
188 harvest(tiff/lib tiff/lib "*.a")
189 harvest(vorbis/lib ffmpeg/lib "*.a")
190 harvest(vpx/lib ffmpeg/lib "*.a")
191 harvest(webp/lib ffmpeg/lib "*.a")
192 harvest(x264/lib ffmpeg/lib "*.a")
193 harvest(xvidcore/lib ffmpeg/lib "*.a")
194 harvest(embree/include embree/include "*.h")
195 harvest(embree/lib embree/lib "*.a")