Fix for a crash related to the feature edge detection at material boundaries.
[blender.git] / source / creator / CMakeLists.txt
1 # $Id$
2 # ***** BEGIN GPL LICENSE BLOCK *****
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 #
18 # The Original Code is Copyright (C) 2006, Blender Foundation
19 # All rights reserved.
20 #
21 # The Original Code is: all of this file.
22 #
23 # Contributor(s): Jacques Beaurain.
24 #
25 # ***** END GPL LICENSE BLOCK *****
26
27 # So BUILDINFO and BLENDERPATH strings are automatically quoted
28 CMAKE_POLICY(SET CMP0005 NEW)
29
30 SETUP_LIBDIRS()
31
32 INCLUDE_DIRECTORIES(../../intern/guardedalloc
33         ../blender/blenlib
34         ../blender/blenkernel
35         ../blender/editors/include
36         ../blender/makesrna
37         ../blender/makesrna/intern
38         ../blender/nodes
39         ../blender/include
40         ../blender/blenloader
41         ../blender/imbuf
42         ../blender/renderconverter
43         ../blender/render/extern/include
44         ../blender/makesdna
45         ../blender/gpu
46         ../blender/freestyle
47         ../blender/windowmanager
48         ../kernel/gen_messaging
49         ../kernel/gen_system
50         ../../extern/glew/include
51 )
52
53 IF(WIN32)
54         INCLUDE_DIRECTORIES(${PTHREADS_INC})
55 ENDIF(WIN32)
56
57 IF(WITH_QUICKTIME)
58         ADD_DEFINITIONS(-DWITH_QUICKTIME)
59 ENDIF(WITH_QUICKTIME)
60
61 IF(WITH_OPENEXR)
62         ADD_DEFINITIONS(-DWITH_OPENEXR)
63 ENDIF(WITH_OPENEXR)
64
65 IF(WITH_TIFF)
66         ADD_DEFINITIONS(-DWITH_TIFF)
67 ENDIF(WITH_TIFF)
68
69 IF(WITH_PYTHON)
70         INCLUDE_DIRECTORIES(../blender/python)
71 ELSE(WITH_PYTHON)
72         ADD_DEFINITIONS(-DDISABLE_PYTHON)
73 ENDIF(WITH_PYTHON)
74
75 IF(NOT WITH_SDL)
76         ADD_DEFINITIONS(-DDISABLE_SDL)
77 ENDIF(NOT WITH_SDL)
78
79 IF(UNIX AND NOT APPLE)
80         SET(BLENDERPATH ${CMAKE_INSTALL_PREFIX}/share/blender/${BLENDER_VERSION})
81         # blender_path in creator.c
82         ADD_DEFINITIONS(-DBLENDERPATH="${BLENDERPATH}")
83 ENDIF(UNIX AND NOT APPLE)
84
85 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
86         ADD_DEFINITIONS(-DWITH_BINRELOC)
87         INCLUDE_DIRECTORIES(${BINRELOC_INC})
88 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
89
90 # Setup the exe sources and buildinfo
91 SET(EXESRC creator.c)
92
93 IF(WIN32)
94         SET(EXESRC ${EXESRC} ../icons/winblender.rc)
95 ENDIF(WIN32)
96
97 IF(WITH_BUILDINFO)
98         ADD_DEFINITIONS(-DBUILD_DATE="${BUILD_DATE}")
99         ADD_DEFINITIONS(-DBUILD_TIME="${BUILD_TIME}")
100         ADD_DEFINITIONS(-DBUILD_REV="${BUILD_REV}")
101         ADD_DEFINITIONS(-DBUILD_PLATFORM="${CMAKE_SYSTEM_NAME}")
102         ADD_DEFINITIONS(-DBUILD_TYPE="${CMAKE_BUILD_TYPE}")
103         
104         SET(EXESRC ${EXESRC} buildinfo.c)
105 ENDIF(WITH_BUILDINFO)
106
107 MESSAGE(STATUS "Configuring blender")
108
109 ADD_EXECUTABLE(blender ${EXETYPE} ${EXESRC})
110
111 # Post build steps for bundling/packaging.
112
113 SET(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
114
115 IF(WITH_INSTALL)
116
117         IF(UNIX)
118                 ADD_CUSTOM_COMMAND(TARGET blender
119                         POST_BUILD
120                         MAIN_DEPENDENCY blender
121                         #COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/plugins ${TARGETDIR}/
122                         #COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/text/* ${TARGETDIR}/
123                 )
124         ENDIF(UNIX)
125
126         IF(UNIX AND NOT APPLE)
127                 
128                 # Local installation, "make install" can be done after this optionally
129                 
130                 ADD_CUSTOM_COMMAND(
131                         TARGET blender POST_BUILD MAIN_DEPENDENCY blender
132                         COMMAND rm -Rf ${TARGETDIR}/.blender
133                         COMMAND mkdir ${TARGETDIR}/.blender/
134                         COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/.blender/
135                 )
136     
137                 IF(WITH_INTERNATIONAL)
138                         ADD_CUSTOM_COMMAND(
139                                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
140                                 COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/.blender/
141                                 COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/.blender/
142                         )
143                 ENDIF(WITH_INTERNATIONAL)
144     
145                 IF(WITH_PYTHON)
146                         ADD_CUSTOM_COMMAND(
147                                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
148                                 COMMENT "copying blender scripts..."
149                                 COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/.blender/
150                                 COMMAND find ${TARGETDIR} -name "*.py?" -prune -exec rm -rf {} "\;"
151                         )
152       
153                         # Copy the systems python into the install directory
154                         # Scons copy in tools/Blender.py
155                         ADD_CUSTOM_COMMAND(
156                                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
157                                 COMMENT "copying a subset of the systems python..."
158         
159                                 COMMAND mkdir ${TARGETDIR}/.blender/python # PYTHONPATH and PYTHONHOME is set here
160                                 COMMAND mkdir ${TARGETDIR}/.blender/python/lib/
161                                 COMMAND cp -R ${PYTHON_LIBPATH}/python${PYTHON_VERSION} ${TARGETDIR}/.blender/python/lib/
162         
163                                 COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/distutils
164                                 COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/lib2to3
165                                 COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/idlelib
166                                 COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/tkinter
167                                 COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/config
168         
169                                 COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/site-packages
170                                 COMMAND mkdir ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/site-packages    # python needs it.
171
172                                 COMMAND rm -f ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/lib-dynload/_tkinter.so
173                                 COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "test" -prune -exec rm -rf {} "\;"
174                                 COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "*.py?" -exec rm -rf {} "\;"
175                                 COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "*.so"-exec strip -s {} "\;"
176                         )
177      
178                 ENDIF(WITH_PYTHON)
179       
180                 ADD_CUSTOM_COMMAND(
181                         TARGET blender POST_BUILD MAIN_DEPENDENCY blender
182                         COMMAND find ${TARGETDIR} -name .svn -prune -exec rm -rf {} "\;"
183                 )
184     
185     
186                 # Above we bundle a portable distrobution in ./bin
187                 # This is an optional "make install" which installs blender on the system.
188                 INSTALL(
189                         PROGRAMS ${TARGETDIR}/blender
190                         DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
191                 )
192
193                 IF(WITH_GAMEENGINE AND WITH_PLAYER)
194                         INSTALL(
195                                 PROGRAMS ${TARGETDIR}/blenderplayer
196                                 DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
197                         )
198                 ENDIF(WITH_GAMEENGINE AND WITH_PLAYER)
199
200                 INSTALL(
201                         DIRECTORY ${TARGETDIR}/.blender/
202                         DESTINATION ${BLENDERPATH}
203                 )
204                 # end "make install"
205     
206         ENDIF(UNIX AND NOT APPLE)
207
208         IF(APPLE)
209                 SET(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app)
210                 SET(SOURCEINFO ${SOURCEDIR}/Contents/Info.plist)
211                 SET(TARGETINFO ${TARGETDIR}/blender.app/Contents/Info.plist)
212
213                 ADD_CUSTOM_COMMAND(
214                         TARGET blender POST_BUILD MAIN_DEPENDENCY blender
215                         COMMAND cp -Rf ${SOURCEINFO} ${TARGETDIR}/blender.app/Contents/
216                         COMMAND cp -Rf ${SOURCEDIR}/Contents/PkgInfo ${TARGETDIR}/blender.app/Contents/
217                         COMMAND cp -Rf ${SOURCEDIR}/Contents/Resources ${TARGETDIR}/blender.app/Contents/
218                         COMMAND cat ${SOURCEINFO} | sed s/VERSION/`cat ${CMAKE_SOURCE_DIR}/release/VERSION`/ | sed s/DATE/`date +'%Y-%b-%d'`/ > ${TARGETINFO}
219                         COMMAND rm -Rf ${TARGETDIR}/blender.app/Contents/MacOS/.blender
220                         COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
221                         COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
222                 )
223       
224                 IF(WITH_INTERNATIONAL)
225                         ADD_CUSTOM_COMMAND(
226                                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
227                                 COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
228                                 COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/Resources/
229                                 COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
230                                 COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/Resources/
231                         )
232                 ENDIF(WITH_INTERNATIONAL)
233       
234                 IF(WITH_PYTHON)
235                         IF(WITH_LIBS10.5)
236                                 SET(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip")
237                         ELSE(WITH_LIBS10.5)
238                                 SET(PYTHON_ZIP "python.zip")
239                         ENDIF(WITH_LIBS10.5)
240                         ADD_CUSTOM_COMMAND(
241                                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
242                                 COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
243                                 COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/
244                                 COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/
245                                 COMMAND find ${TARGETDIR}/blender.app -name "*.py?" -prune -exec rm -rf {} "\;"
246                         )
247                 ENDIF(WITH_PYTHON)      
248     
249                 ADD_CUSTOM_COMMAND(
250                         TARGET blender POST_BUILD MAIN_DEPENDENCY blender    
251                         COMMAND find ${TARGETDIR}/blender.app -name .DS_Store -prune -exec rm -rf {} "\;"
252                         COMMAND find ${TARGETDIR}/blender.app -name .svn -prune -exec rm -rf {} "\;"
253                         COMMAND find ${TARGETDIR}/blender.app -name __MACOSX -prune -exec rm -rf {} "\;"
254                 )
255         ENDIF(APPLE)
256
257         IF(WIN32)
258                 ADD_CUSTOM_COMMAND(TARGET blender
259                         POST_BUILD
260                         MAIN_DEPENDENCY blender
261                         COMMAND if not exist \"${TARGETDIR}\\.blender\" mkdir \"${TARGETDIR}\\.blender\"
262                         COMMAND if not exist \"${TARGETDIR}\\.blender\\locale\" mkdir \"${TARGETDIR}\\.blender\\locale\"
263                         COMMAND if not exist \"${TARGETDIR}\\.blender\\scripts\" mkdir \"${TARGETDIR}\\.blender\\scripts\"
264                         COMMAND if not exist \"${TARGETDIR}\\plugins\" mkdir \"${TARGETDIR}\\plugins\"
265                         COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\bin\\.blender\\.Blanguages\" \"${TARGETDIR}\\.blender\\\" 
266                         COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\bin\\.blender\\.bfont.ttf\" \"${TARGETDIR}\\.blender\\\"
267                         COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\bin\\.blender\\locale\\*.*\" \"${TARGETDIR}\\.blender\\locale\"
268                         COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\release\\scripts\\*.*\" \"${TARGETDIR}\\.blender\\scripts\"
269                         COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\release\\plugins\\*.*\" \"${TARGETDIR}\\plugins\"
270                         COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\text\\*.*\" \"${TARGETDIR}\"
271                         # TODO, copy python bundle
272                         # COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\windows\\extra\\python31.zip\" \"${TARGETDIR}\\\"
273                 )
274     
275                 ADD_CUSTOM_COMMAND(TARGET blender
276                         POST_BUILD
277                         MAIN_DEPENDENCY blender
278                         COMMAND copy /Y \"${LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\\"
279                         COMMAND copy /Y \"${LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\python31_d.zip\"
280                         COMMAND copy /Y \"${LIBDIR}\\gettext\\lib\\gnu_gettext.dll\" \"${TARGETDIR}\\\"
281                         COMMAND copy /Y \"${LIBDIR}\\png\\lib\\libpng.dll\" \"${TARGETDIR}\\\"
282                         COMMAND copy /Y \"${LIBDIR}\\sdl\\lib\\SDL.dll\" \"${TARGETDIR}\\\"
283                         COMMAND copy /Y \"${LIBDIR}\\zlib\\lib\\zlib.dll\" \"${TARGETDIR}\\\"
284                         COMMAND copy /Y \"${LIBDIR}\\python\\lib\\python31.dll\" \"${TARGETDIR}\\\"
285                         COMMAND copy /Y \"${LIBDIR}\\python\\lib\\python31_d.dll\" \"${TARGETDIR}\\\"
286                         COMMAND copy /Y \"${LIBDIR}\\pthreads\\lib\\pthreadVC2.dll\" \"${TARGETDIR}\\\"
287                         # COMMAND copy /Y \"${LIBDIR}\\samplerate\\lib\\libsamplerate-0.dll\" \"${TARGETDIR}\\\"
288                 )
289
290                 IF(WITH_INTERNATIONAL)
291                         ADD_CUSTOM_COMMAND(TARGET blender
292                                 POST_BUILD
293                                 MAIN_DEPENDENCY blender
294                                 COMMAND copy /Y \"${LIBDIR}\\iconv\\lib\\iconv.dll\" \"${TARGETDIR}\\\"
295                         )
296                 ENDIF(WITH_INTERNATIONAL)
297
298                 IF(WITH_FFMPEG)
299                         ADD_CUSTOM_COMMAND(TARGET blender
300                                 POST_BUILD
301                                 MAIN_DEPENDENCY blender
302                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avcodec-52.dll\" \"${TARGETDIR}\\\"
303                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avformat-52.dll\" \"${TARGETDIR}\\\"
304                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avdevice-52.dll\" \"${TARGETDIR}\\\"
305                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avutil-50.dll\" \"${TARGETDIR}\\\"
306                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libfaac-0.dll\" \"${TARGETDIR}\\\"
307                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libfaad-2.dll\" \"${TARGETDIR}\\\"
308                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libmp3lame-0.dll\" \"${TARGETDIR}\\\"
309                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libx264-67.dll\" \"${TARGETDIR}\\\"
310                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\swscale-0.dll\" \"${TARGETDIR}\\\"
311                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\xvidcore.dll\" \"${TARGETDIR}\\\"
312                         )
313                 ENDIF(WITH_FFMPEG)
314
315                 IF(WITH_SNDFILE)
316                         ADD_CUSTOM_COMMAND(TARGET blender
317                                 POST_BUILD
318                                 MAIN_DEPENDENCY blender
319                                 COMMAND copy /Y \"${LIBDIR}\\sndfile\\lib\\libsndfile-1.dll\" \"${TARGETDIR}\\\"
320                         )
321                 ENDIF(WITH_SNDFILE)
322
323                 IF(WITH_JACK)
324                         ADD_CUSTOM_COMMAND(TARGET blender
325                                 POST_BUILD
326                                 MAIN_DEPENDENCY blender
327                                 COMMAND copy /Y \"${LIBDIR}\\jack\\lib\\libjack.dll\" \"${TARGETDIR}\\\"
328                         )
329                 ENDIF(WITH_JACK)
330
331                 IF(WITH_OPENAL)
332                         ADD_CUSTOM_COMMAND(TARGET blender
333                                 POST_BUILD
334                                 MAIN_DEPENDENCY blender
335                                 COMMAND copy /Y \"${LIBDIR}\\openal\\lib\\OpenAL32.dll\" \"${TARGETDIR}\\\"
336                                 COMMAND copy /Y \"${LIBDIR}\\openal\\lib\\wrap_oal.dll\" \"${TARGETDIR}\\\"
337
338                         )
339                 ENDIF(WITH_OPENAL)
340
341
342         ENDIF(WIN32)
343 ENDIF(WITH_INSTALL)
344
345 ADD_DEPENDENCIES(blender makesdna)
346
347 FILE(READ ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt BLENDER_LINK_LIBS)
348
349 SET(BLENDER_LINK_LIBS bf_nodes ${BLENDER_LINK_LIBS} bf_windowmanager bf_editors blender_render)
350
351 IF(WITH_ELBEEM)
352         SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} bf_elbeem)
353 ENDIF(WITH_ELBEEM)
354
355 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
356         SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} extern_binreloc)
357 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
358
359 #IF(UNIX)
360         # Sort libraries
361         SET(BLENDER_SORTED_LIBS
362                 bf_windowmanager
363                 bf_editors
364                 bf_freestyle
365                 blender_BSP 
366                 bf_ghost 
367                 bf_string 
368                 blender_render 
369                 blender_ONL 
370                 bf_python 
371                 bf_gen_python 
372                 bf_ikplugin
373                 bf_modifiers
374                 bf_blenkernel
375                 bf_nodes
376                 bf_gpu
377                 bf_blenloader
378                 bf_blenpluginapi 
379                 bf_imbuf 
380                 bf_blenlib 
381                 bf_avi 
382                 bf_cineon 
383                 bf_openexr 
384                 bf_dds
385                 bf_readblenfile
386                 bf_collada
387                 blender_BSP 
388                 blender_bop 
389                 bf_kernel 
390                 bf_decimation 
391                 bf_elbeem 
392                 bf_IK 
393                 bf_memutil 
394                 bf_guardedalloc 
395                 blender_CTR 
396                 bf_moto 
397                 bf_windowmanager
398                 bf_editors
399                 bf_blroutines 
400                 bf_converter 
401                 bf_dummy 
402                 bf_bullet 
403                 bf_smoke
404                 bf_minilzo
405                 bf_lzma
406                 bf_common 
407                 bf_ketsji 
408                 bf_logic 
409                 bf_rasterizer 
410                 bf_oglrasterizer 
411                 bf_expressions 
412                 bf_scenegraph 
413                 bf_moto 
414                 bf_blroutines 
415                 kx_network 
416                 bf_kernel 
417                 bf_ngnetwork 
418                 extern_bullet 
419                 bf_loopbacknetwork 
420                 bf_ITASC
421                 bf_common 
422                 bf_moto 
423                 bf_python
424                 bf_gen_python
425                 extern_binreloc
426                 extern_glew
427                 extern_libopenjpeg
428                 bf_videotex
429                 bf_rna
430                 bf_dna
431                 bf_blenfont
432                 bf_audaspace
433                 bf_decimation
434         )
435
436         IF(WITH_CXX_GUARDEDALLOC)
437                 SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp)
438         ENDIF(WITH_CXX_GUARDEDALLOC)
439
440         IF(WITH_QUICKTIME)
441                 SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_quicktime)
442         ENDIF(WITH_QUICKTIME)
443
444
445         FOREACH(SORTLIB ${BLENDER_SORTED_LIBS})
446                 SET(REMLIB ${SORTLIB})
447                 FOREACH(SEARCHLIB ${BLENDER_LINK_LIBS})
448                         IF(${SEARCHLIB} STREQUAL ${SORTLIB})
449                                 SET(REMLIB "")
450                         ENDIF(${SEARCHLIB} STREQUAL ${SORTLIB})
451                 ENDFOREACH(SEARCHLIB)
452                 IF(REMLIB)
453                         MESSAGE(STATUS "Removing library ${REMLIB} from blender linking because: not configured")
454                         LIST(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB})
455                 ENDIF(REMLIB)
456         ENDFOREACH(SORTLIB)
457         TARGET_LINK_LIBRARIES(blender ${BLENDER_SORTED_LIBS})
458 #ELSE(UNIX)
459 #       TARGET_LINK_LIBRARIES(blender ${BLENDER_LINK_LIBS})
460 #ENDIF(UNIX)
461
462 SETUP_LIBLINKS(blender)