Merged changes in the trunk up to revision 26856.
[blender-staging.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
54
55 IF(WITH_QUICKTIME)
56         ADD_DEFINITIONS(-DWITH_QUICKTIME)
57 ENDIF(WITH_QUICKTIME)
58
59 IF(WITH_OPENEXR)
60         ADD_DEFINITIONS(-DWITH_OPENEXR)
61 ENDIF(WITH_OPENEXR)
62
63 IF(WITH_PYTHON)
64         INCLUDE_DIRECTORIES(../blender/python)
65 ELSE(WITH_PYTHON)
66         ADD_DEFINITIONS(-DDISABLE_PYTHON)
67 ENDIF(WITH_PYTHON)
68
69 IF(NOT WITH_SDL)
70         ADD_DEFINITIONS(-DDISABLE_SDL)
71 ENDIF(NOT WITH_SDL)
72
73 IF(UNIX AND NOT APPLE)
74         SET(BLENDERPATH ${CMAKE_INSTALL_PREFIX}/share/blender/${BLENDER_VERSION})
75         # blender_path in creator.c
76         ADD_DEFINITIONS(-DBLENDERPATH="${BLENDERPATH}")
77 ENDIF(UNIX AND NOT APPLE)
78
79 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
80         ADD_DEFINITIONS(-DWITH_BINRELOC)
81         INCLUDE_DIRECTORIES(${BINRELOC_INC})
82 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
83
84 # Setup the exe sources and buildinfo
85 SET(EXESRC creator.c)
86
87 IF(WIN32)
88         SET(EXESRC ${EXESRC} ../icons/winblender.rc)
89 ENDIF(WIN32)
90
91 IF(WITH_BUILDINFO)
92         ADD_DEFINITIONS(-DBUILD_DATE="${BUILD_DATE}")
93         ADD_DEFINITIONS(-DBUILD_TIME="${BUILD_TIME}")
94         ADD_DEFINITIONS(-DBUILD_REV="${BUILD_REV}")
95         ADD_DEFINITIONS(-DBUILD_PLATFORM="${CMAKE_SYSTEM_NAME}")
96         ADD_DEFINITIONS(-DBUILD_TYPE="${CMAKE_BUILD_TYPE}")
97         
98         SET(EXESRC ${EXESRC} buildinfo.c)
99 ENDIF(WITH_BUILDINFO)
100
101 MESSAGE(STATUS "Configuring blender")
102
103 ADD_EXECUTABLE(blender ${EXETYPE} ${EXESRC})
104
105 # Post build steps for bundling/packaging.
106
107 SET(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
108
109 IF(WITH_INSTALL)
110
111         IF(UNIX)
112                 ADD_CUSTOM_COMMAND(TARGET blender
113                         POST_BUILD
114                         MAIN_DEPENDENCY blender
115                         #COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/plugins ${TARGETDIR}/
116                         #COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/text/* ${TARGETDIR}/
117                 )
118         ENDIF(UNIX)
119
120         IF(UNIX AND NOT APPLE)
121                 
122                 # Local installation, "make install" can be done after this optionally
123                 
124                 ADD_CUSTOM_COMMAND(
125                         TARGET blender POST_BUILD MAIN_DEPENDENCY blender
126                         COMMAND rm -Rf ${TARGETDIR}/.blender
127                         COMMAND mkdir ${TARGETDIR}/.blender/
128                         COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/.blender/
129                 )
130     
131                 IF(WITH_INTERNATIONAL)
132                         ADD_CUSTOM_COMMAND(
133                                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
134                                 COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/.blender/
135                                 COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/.blender/
136                         )
137                 ENDIF(WITH_INTERNATIONAL)
138     
139                 IF(WITH_PYTHON)
140                         ADD_CUSTOM_COMMAND(
141                                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
142                                 COMMENT "copying blender scripts..."
143                                 COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/.blender/
144                                 COMMAND find ${TARGETDIR} -name "*.py?" -prune -exec rm -rf {} "\;"
145                         )
146       
147                         # Copy the systems python into the install directory
148                         # Scons copy in tools/Blender.py
149                         ADD_CUSTOM_COMMAND(
150                                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
151                                 COMMENT "copying a subset of the systems python..."
152         
153                                 COMMAND mkdir ${TARGETDIR}/.blender/python # PYTHONPATH and PYTHONHOME is set here
154                                 COMMAND mkdir ${TARGETDIR}/.blender/python/lib/
155                                 COMMAND cp -R ${PYTHON_LIBPATH}/python${PYTHON_VERSION} ${TARGETDIR}/.blender/python/lib/
156         
157                                 COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/distutils
158                                 COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/lib2to3
159                                 COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/idlelib
160                                 COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/tkinter
161                                 COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/config
162         
163                                 COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/site-packages
164                                 COMMAND mkdir ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/site-packages    # python needs it.
165
166                                 COMMAND rm -f ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/lib-dynload/_tkinter.so
167                                 COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "test" -prune -exec rm -rf {} "\;"
168                                 COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "*.py?" -exec rm -rf {} "\;"
169                                 COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "*.so"-exec strip -s {} "\;"
170                         )
171      
172                 ENDIF(WITH_PYTHON)
173       
174                 ADD_CUSTOM_COMMAND(
175                         TARGET blender POST_BUILD MAIN_DEPENDENCY blender
176                         COMMAND find ${TARGETDIR} -name .svn -prune -exec rm -rf {} "\;"
177                 )
178     
179     
180                 # Above we bundle a portable distrobution in ./bin
181                 # This is an optional "make install" which installs blender on the system.
182                 INSTALL(
183                         PROGRAMS ${TARGETDIR}/blender
184                         DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
185                 )
186
187                 IF(WITH_GAMEENGINE AND WITH_PLAYER)
188                         INSTALL(
189                                 PROGRAMS ${TARGETDIR}/blenderplayer
190                                 DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
191                         )
192                 ENDIF(WITH_GAMEENGINE AND WITH_PLAYER)
193
194                 INSTALL(
195                         DIRECTORY ${TARGETDIR}/.blender/
196                         DESTINATION ${BLENDERPATH}
197                 )
198                 # end "make install"
199     
200         ENDIF(UNIX AND NOT APPLE)
201
202         IF(APPLE)
203                 SET(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app)
204                 SET(SOURCEINFO ${SOURCEDIR}/Contents/Info.plist)
205                 SET(TARGETINFO ${TARGETDIR}/blender.app/Contents/Info.plist)
206
207                 ADD_CUSTOM_COMMAND(
208                         TARGET blender POST_BUILD MAIN_DEPENDENCY blender
209                         COMMAND cp -Rf ${SOURCEINFO} ${TARGETDIR}/blender.app/Contents/
210                         COMMAND cp -Rf ${SOURCEDIR}/Contents/PkgInfo ${TARGETDIR}/blender.app/Contents/
211                         COMMAND cp -Rf ${SOURCEDIR}/Contents/Resources ${TARGETDIR}/blender.app/Contents/
212                         COMMAND cat ${SOURCEINFO} | sed s/VERSION/`cat ${CMAKE_SOURCE_DIR}/release/VERSION`/ | sed s/DATE/`date +'%Y-%b-%d'`/ > ${TARGETINFO}
213                         COMMAND rm -Rf ${TARGETDIR}/blender.app/Contents/MacOS/.blender
214                         COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
215                         COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
216                 )
217       
218                 IF(WITH_INTERNATIONAL)
219                         ADD_CUSTOM_COMMAND(
220                                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
221                                 COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
222                                 COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/Resources/
223                                 COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
224                                 COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/Resources/
225                         )
226                 ENDIF(WITH_INTERNATIONAL)
227       
228                 IF(WITH_PYTHON)
229                         IF(WITH_LIBS10.5)
230                                 SET(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip")
231                         ELSE(WITH_LIBS10.5)
232                                 SET(PYTHON_ZIP "python.zip")
233                         ENDIF(WITH_LIBS10.5)
234                         ADD_CUSTOM_COMMAND(
235                                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
236                                 COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/blender.app/Contents/MacOS/.blender/
237                                 COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/
238                                 COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/
239                                 COMMAND find ${TARGETDIR}/blender.app -name "*.py?" -prune -exec rm -rf {} "\;"
240                         )
241                 ENDIF(WITH_PYTHON)      
242     
243                 ADD_CUSTOM_COMMAND(
244                         TARGET blender POST_BUILD MAIN_DEPENDENCY blender    
245                         COMMAND find ${TARGETDIR}/blender.app -name .DS_Store -prune -exec rm -rf {} "\;"
246                         COMMAND find ${TARGETDIR}/blender.app -name .svn -prune -exec rm -rf {} "\;"
247                         COMMAND find ${TARGETDIR}/blender.app -name __MACOSX -prune -exec rm -rf {} "\;"
248                 )
249         ENDIF(APPLE)
250
251         IF(WIN32)
252                 FILE(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} WIN_SOURCE_DIR)
253     
254                 ADD_CUSTOM_COMMAND(TARGET blender
255                         POST_BUILD
256                         MAIN_DEPENDENCY blender
257                         COMMAND if not exist \"${TARGETDIR}\\.blender\" mkdir \"${TARGETDIR}\\.blender\"
258                         COMMAND if not exist \"${TARGETDIR}\\.blender\\locale\" mkdir \"${TARGETDIR}\\.blender\\locale\"
259                         COMMAND if not exist \"${TARGETDIR}\\.blender\\scripts\" mkdir \"${TARGETDIR}\\.blender\\scripts\"
260                         COMMAND if not exist \"${TARGETDIR}\\plugins\" mkdir \"${TARGETDIR}\\plugins\"
261                         COMMAND copy /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\.Blanguages\" \"${TARGETDIR}\\.blender\\\" 
262                         COMMAND copy /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\.bfont.ttf\" \"${TARGETDIR}\\.blender\\\"
263                         COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\locale\\*.*\" \"${TARGETDIR}\\.blender\\locale\"
264                         COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\scripts\\*.*\" \"${TARGETDIR}\\.blender\\scripts\"
265                         COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\plugins\\*.*\" \"${TARGETDIR}\\plugins\"
266                         COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\text\\*.*\" \"${TARGETDIR}\"
267                         # TODO, copy python bundle
268                         # COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\windows\\extra\\python31.zip\" \"${TARGETDIR}\\\"
269                 )
270     
271                 FILE(TO_NATIVE_PATH "${LIBDIR}" WIN_LIBDIR)
272     
273                 ADD_CUSTOM_COMMAND(TARGET blender
274                         POST_BUILD
275                         MAIN_DEPENDENCY blender
276                         COMMAND copy /Y \"${WIN_LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\\"
277                         COMMAND copy /Y \"${WIN_LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\python31_d.zip\"
278                         COMMAND copy /Y \"${WIN_LIBDIR}\\gettext\\lib\\gnu_gettext.dll\" \"${TARGETDIR}\\\"
279                         COMMAND copy /Y \"${WIN_LIBDIR}\\png\\lib\\libpng.dll\" \"${TARGETDIR}\\\"
280                         COMMAND copy /Y \"${WIN_LIBDIR}\\sdl\\lib\\SDL.dll\" \"${TARGETDIR}\\\"
281                         COMMAND copy /Y \"${WIN_LIBDIR}\\zlib\\lib\\zlib.dll\" \"${TARGETDIR}\\\"
282                         COMMAND copy /Y \"${WIN_LIBDIR}\\tiff\\lib\\libtiff.dll\" \"${TARGETDIR}\\\"
283                         COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python31.dll\" \"${TARGETDIR}\\\"
284                         COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python31_d.dll\" \"${TARGETDIR}\\\"
285                         COMMAND copy /Y \"${WIN_LIBDIR}\\pthreads\\lib\\pthreadVC2.dll\" \"${TARGETDIR}\\\"
286                         COMMAND copy /Y \"${WIN_LIBDIR}\\samplerate\\lib\\libsamplerate-0.dll\" \"${TARGETDIR}\\\"
287                 )
288
289                 IF(WITH_INTERNATIONAL)
290                         ADD_CUSTOM_COMMAND(TARGET blender
291                                 POST_BUILD
292                                 MAIN_DEPENDENCY blender
293                                 COMMAND copy /Y \"${WIN_LIBDIR}\\iconv\\lib\\iconv.dll\" \"${TARGETDIR}\\\"
294                         )
295                 ENDIF(WITH_INTERNATIONAL)
296
297                 IF(WITH_FFMPEG)
298                         ADD_CUSTOM_COMMAND(TARGET blender
299                                 POST_BUILD
300                                 MAIN_DEPENDENCY blender
301                                 COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avcodec-52.dll\" \"${TARGETDIR}\\\"
302                                 COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avformat-52.dll\" \"${TARGETDIR}\\\"
303                                 COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avdevice-52.dll\" \"${TARGETDIR}\\\"
304                                 COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avutil-50.dll\" \"${TARGETDIR}\\\"
305                                 COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaac-0.dll\" \"${TARGETDIR}\\\"
306                                 COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaad-2.dll\" \"${TARGETDIR}\\\"
307                                 COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libmp3lame-0.dll\" \"${TARGETDIR}\\\"
308                                 COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libx264-67.dll\" \"${TARGETDIR}\\\"
309                                 COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\swscale-0.dll\" \"${TARGETDIR}\\\"
310                                 COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\xvidcore.dll\" \"${TARGETDIR}\\\"
311                         )
312                 ENDIF(WITH_FFMPEG)
313
314                 IF(WITH_SNDFILE)
315                         ADD_CUSTOM_COMMAND(TARGET blender
316                                 POST_BUILD
317                                 MAIN_DEPENDENCY blender
318                                 COMMAND copy /Y \"${WIN_LIBDIR}\\sndfile\\lib\\libsndfile-1.dll\" \"${TARGETDIR}\\\"
319                         )
320                 ENDIF(WITH_SNDFILE)
321
322                 IF(WITH_JACK)
323                         ADD_CUSTOM_COMMAND(TARGET blender
324                                 POST_BUILD
325                                 MAIN_DEPENDENCY blender
326                                 COMMAND copy /Y \"${WIN_LIBDIR}\\jack\\lib\\libjack.dll\" \"${TARGETDIR}\\\"
327                         )
328                 ENDIF(WITH_JACK)
329
330                 IF(WITH_OPENAL)
331                         ADD_CUSTOM_COMMAND(TARGET blender
332                                 POST_BUILD
333                                 MAIN_DEPENDENCY blender
334                                 COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\OpenAL32.dll\" \"${TARGETDIR}\\\"
335                                 COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\wrap_oal.dll\" \"${TARGETDIR}\\\"
336
337                         )
338                 ENDIF(WITH_OPENAL)
339
340
341         ENDIF(WIN32)
342 ENDIF(WITH_INSTALL)
343
344 ADD_DEPENDENCIES(blender makesdna)
345
346 FILE(READ ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt BLENDER_LINK_LIBS)
347
348 SET(BLENDER_LINK_LIBS bf_nodes ${BLENDER_LINK_LIBS} bf_windowmanager bf_editors blender_render)
349
350 IF(WITH_ELBEEM)
351         SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} bf_elbeem)
352 ENDIF(WITH_ELBEEM)
353
354 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
355         SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} extern_binreloc)
356 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
357
358 #IF(UNIX)
359         # Sort libraries
360         SET(BLENDER_SORTED_LIBS
361                 bf_windowmanager
362                 bf_editors
363                 bf_freestyle
364                 bf_decimation 
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_blenkernel 
374                 bf_nodes
375                 bf_gpu
376                 bf_blenloader 
377                 bf_blenpluginapi 
378                 bf_imbuf 
379                 bf_blenlib 
380                 bf_avi 
381                 bf_cineon 
382                 bf_openexr 
383                 bf_dds
384                 bf_readblenfile
385                 bf_collada
386                 blender_BSP 
387                 blender_bop 
388                 bf_kernel 
389                 bf_decimation 
390                 bf_elbeem 
391                 bf_IK 
392                 bf_memutil 
393                 bf_guardedalloc 
394                 blender_CTR 
395                 bf_moto 
396                 bf_windowmanager
397                 bf_editors
398                 bf_blroutines 
399                 bf_converter 
400                 bf_dummy 
401                 bf_bullet 
402                 bf_smoke
403                 bf_minilzo
404                 bf_lzma
405                 bf_common 
406                 bf_ketsji 
407                 bf_logic 
408                 bf_rasterizer 
409                 bf_oglrasterizer 
410                 bf_expressions 
411                 bf_scenegraph 
412                 bf_moto 
413                 bf_blroutines 
414                 kx_network 
415                 bf_kernel 
416                 bf_ngnetwork 
417                 extern_bullet 
418                 bf_loopbacknetwork 
419                 bf_ITASC
420                 bf_common 
421                 bf_moto 
422                 bf_python
423                 bf_gen_python
424                 extern_binreloc
425                 extern_glew
426                 extern_libopenjpeg
427                 bf_videotex
428                 bf_rna
429                 bf_dna
430                 bf_blenfont
431                 bf_audaspace
432         )
433
434         IF(WITH_CXX_GUARDEDALLOC)
435                 SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp)
436         ENDIF(WITH_CXX_GUARDEDALLOC)
437
438         IF(WITH_QUICKTIME)
439                 SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_quicktime)
440         ENDIF(WITH_QUICKTIME)
441
442
443         FOREACH(SORTLIB ${BLENDER_SORTED_LIBS})
444                 SET(REMLIB ${SORTLIB})
445                 FOREACH(SEARCHLIB ${BLENDER_LINK_LIBS})
446                         IF(${SEARCHLIB} STREQUAL ${SORTLIB})
447                                 SET(REMLIB "")
448                         ENDIF(${SEARCHLIB} STREQUAL ${SORTLIB})
449                 ENDFOREACH(SEARCHLIB)
450                 IF(REMLIB)
451                         MESSAGE(STATUS "Removing library ${REMLIB} from blender linking because: not configured")
452                         LIST(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB})
453                 ENDIF(REMLIB)
454         ENDFOREACH(SORTLIB)
455         TARGET_LINK_LIBRARIES(blender ${BLENDER_SORTED_LIBS})
456 #ELSE(UNIX)
457 #       TARGET_LINK_LIBRARIES(blender ${BLENDER_LINK_LIBS})
458 #ENDIF(UNIX)
459
460 SETUP_LIBLINKS(blender)