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