py/rna remove functions now all work in a similar way.
[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(
33         ../../intern/guardedalloc
34         ../blender/blenlib
35         ../blender/blenkernel
36         ../blender/editors/include
37         ../blender/makesrna
38         ../blender/imbuf
39         ../blender/render/extern/include
40         ../blender/makesdna
41         ../blender/gpu
42         ../blender/windowmanager
43         ../kernel/gen_messaging
44         ../kernel/gen_system
45 )
46
47 IF(WIN32)
48         INCLUDE_DIRECTORIES(${PTHREADS_INC})
49 ENDIF(WIN32)
50
51 IF(WITH_QUICKTIME)
52         ADD_DEFINITIONS(-DWITH_QUICKTIME)
53 ENDIF(WITH_QUICKTIME)
54
55 IF(WITH_IMAGE_OPENEXR)
56         ADD_DEFINITIONS(-DWITH_OPENEXR)
57 ENDIF(WITH_IMAGE_OPENEXR)
58
59 IF(WITH_IMAGE_TIFF)
60         ADD_DEFINITIONS(-DWITH_TIFF)
61 ENDIF(WITH_IMAGE_TIFF)
62
63 IF(WITH_IMAGE_DDS)
64         ADD_DEFINITIONS(-DWITH_DDS)
65 ENDIF(WITH_IMAGE_DDS)
66
67 IF(WITH_IMAGE_CINEON)
68         ADD_DEFINITIONS(-DWITH_CINEON)
69 ENDIF(WITH_IMAGE_CINEON)
70
71 IF(WITH_IMAGE_HDR)
72         ADD_DEFINITIONS(-DWITH_HDR)
73 ENDIF(WITH_IMAGE_HDR)
74
75 IF(WITH_PYTHON)
76         INCLUDE_DIRECTORIES(../blender/python)
77 ELSE(WITH_PYTHON)
78         ADD_DEFINITIONS(-DDISABLE_PYTHON)
79 ENDIF(WITH_PYTHON)
80
81 IF(NOT WITH_SDL)
82         ADD_DEFINITIONS(-DDISABLE_SDL)
83 ENDIF(NOT WITH_SDL)
84
85 IF(UNIX AND NOT APPLE)
86         SET(BLENDERPATH ${CMAKE_INSTALL_PREFIX}/share/blender/${BLENDER_VERSION})
87         # blender_path in creator.c
88         ADD_DEFINITIONS(-DBLENDERPATH="${BLENDERPATH}")
89 ENDIF(UNIX AND NOT APPLE)
90
91 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
92         ADD_DEFINITIONS(-DWITH_BINRELOC)
93         INCLUDE_DIRECTORIES(${BINRELOC_INC})
94 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
95
96 # Setup the exe sources and buildinfo
97 SET(EXESRC creator.c)
98
99 IF(WIN32)
100         SET(EXESRC ${EXESRC} ../icons/winblender.rc)
101 ENDIF(WIN32)
102
103 IF(WITH_BUILDINFO)
104         ADD_DEFINITIONS(-DBUILD_DATE="${BUILD_DATE}")
105         ADD_DEFINITIONS(-DBUILD_TIME="${BUILD_TIME}")
106         ADD_DEFINITIONS(-DBUILD_REV="${BUILD_REV}")
107         ADD_DEFINITIONS(-DBUILD_PLATFORM="${CMAKE_SYSTEM_NAME}")
108         ADD_DEFINITIONS(-DBUILD_TYPE="${CMAKE_BUILD_TYPE}")
109         
110         SET(EXESRC ${EXESRC} buildinfo.c)
111 ENDIF(WITH_BUILDINFO)
112
113 MESSAGE(STATUS "Configuring blender")
114
115 ADD_EXECUTABLE(blender ${EXETYPE} ${EXESRC})
116
117 # Post build steps for bundling/packaging.
118
119 SET(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
120
121 IF(WITH_INSTALL)
122
123         IF(UNIX)
124                 ADD_CUSTOM_COMMAND(TARGET blender
125                         POST_BUILD
126                         MAIN_DEPENDENCY blender
127                         #COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/plugins ${TARGETDIR}/
128                         #COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/text/* ${TARGETDIR}/
129                 )
130         ENDIF(UNIX)
131
132         IF(UNIX AND NOT APPLE)
133                 
134                 # Local installation, "make install" can be done after this optionally
135                 
136                 ADD_CUSTOM_COMMAND(
137                         TARGET blender POST_BUILD MAIN_DEPENDENCY blender
138                         COMMAND rm -Rf ${TARGETDIR}/${BLENDER_VERSION}
139                         COMMAND mkdir ${TARGETDIR}/${BLENDER_VERSION}/
140                         COMMAND cp ${CMAKE_SOURCE_DIR}/release/bin/.blender/.bfont.ttf ${TARGETDIR}/${BLENDER_VERSION}/
141                 )
142     
143                 IF(WITH_INTERNATIONAL)
144                         ADD_CUSTOM_COMMAND(
145                                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
146                                 COMMAND cp ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages ${TARGETDIR}/${BLENDER_VERSION}/
147                                 COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale ${TARGETDIR}/${BLENDER_VERSION}/
148                         )
149                 ENDIF(WITH_INTERNATIONAL)
150     
151                 IF(WITH_PYTHON)
152                         ADD_CUSTOM_COMMAND(
153                                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
154                                 COMMENT "copying blender scripts..."
155                                 COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/${BLENDER_VERSION}/
156                                 COMMAND find ${TARGETDIR} -name "*.py?" -prune -exec rm -rf {} "\;"
157                         )
158                         IF(WITH_PYTHON_INSTALL)
159                                 # Copy the systems python into the install directory
160                                 # Scons copy in tools/Blender.py
161                                 ADD_CUSTOM_COMMAND(
162                                         TARGET blender POST_BUILD MAIN_DEPENDENCY blender
163                                         COMMENT "copying a subset of the systems python..."
164
165                                         COMMAND mkdir ${TARGETDIR}/${BLENDER_VERSION}/python # PYTHONPATH and PYTHONHOME is set here
166                                         COMMAND mkdir ${TARGETDIR}/${BLENDER_VERSION}/python/lib/
167                                         COMMAND cp -R ${PYTHON_LIBPATH}/python${PYTHON_VERSION} ${TARGETDIR}/${BLENDER_VERSION}/python/lib/
168
169                                         COMMAND rm -rf ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/distutils
170                                         COMMAND rm -rf ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/lib2to3
171                                         COMMAND rm -rf ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/idlelib
172                                         COMMAND rm -rf ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/tkinter
173                                         COMMAND rm -rf ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/config
174
175                                         COMMAND rm -rf ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/site-packages
176                                         COMMAND mkdir ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/site-packages    # python needs it.
177
178                                         COMMAND rm -f ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION}/lib-dynload/_tkinter.so
179                                         COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION} -name "test" -prune -exec rm -rf {} "\;"
180                                         COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION} -name "*.py?" -exec rm -rf {} "\;"
181                                         COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/python${PYTHON_VERSION} -name "*.so"-exec strip -s {} "\;"
182                                 )
183                         ENDIF(WITH_PYTHON_INSTALL)
184                 ENDIF(WITH_PYTHON)
185       
186                 ADD_CUSTOM_COMMAND(
187                         TARGET blender POST_BUILD MAIN_DEPENDENCY blender
188                         COMMAND find ${TARGETDIR} -name .svn -prune -exec rm -rf {} "\;"
189                 )
190     
191     
192                 # Above we bundle a portable distribution in ./bin
193                 # This is an optional "make install" which installs blender on the system.
194                 INSTALL(
195                         PROGRAMS ${TARGETDIR}/blender
196                         DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
197                 )
198
199                 IF(WITH_GAMEENGINE AND WITH_PLAYER)
200                         INSTALL(
201                                 PROGRAMS ${TARGETDIR}/blenderplayer
202                                 DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
203                         )
204                 ENDIF(WITH_GAMEENGINE AND WITH_PLAYER)
205
206                 INSTALL(
207             FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
208             DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
209         )
210                 INSTALL(
211             FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/blender.svg
212             DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps
213         )
214                 INSTALL(
215                         PROGRAMS ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
216                         DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
217                 )
218                 INSTALL(
219             FILES ${CMAKE_SOURCE_DIR}/doc/blender.1
220             DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1
221         )
222                 INSTALL(
223             DIRECTORY ${CMAKE_SOURCE_DIR}/release/text/
224             DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/blender
225             PATTERN ".svn" EXCLUDE
226         )
227                 INSTALL(
228             DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts/
229             DESTINATION ${BLENDERPATH}/scripts
230             PATTERN ".svn" EXCLUDE
231                         PATTERN "*.pyc" EXCLUDE
232         )
233                 INSTALL(
234                         DIRECTORY ${CMAKE_SOURCE_DIR}/release/datafiles/brushicons/
235                         DESTINATION ${BLENDERPATH}/datafiles/brushicons
236                         PATTERN ".svn" EXCLUDE
237                 )
238                 IF(WITH_INTERNATIONAL)
239                         INSTALL(
240                 DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale/
241                 DESTINATION ${BLENDERPATH}/datafiles/locale
242                 PATTERN ".svn" EXCLUDE
243                 )
244                 ENDIF(WITH_INTERNATIONAL)
245         
246                 # end "make install"
247     
248         ENDIF(UNIX AND NOT APPLE)
249
250         IF(APPLE)
251                 SET(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app)
252                 SET(SOURCEINFO ${SOURCEDIR}/Contents/Info.plist)
253                 SET(TARGETINFO ${TARGETDIR}/blender.app/Contents/Info.plist)
254
255                 ADD_CUSTOM_COMMAND(
256                         TARGET blender POST_BUILD MAIN_DEPENDENCY blender
257                         COMMAND cp -Rf ${SOURCEINFO} ${TARGETDIR}/blender.app/Contents/
258                         COMMAND cp -Rf ${SOURCEDIR}/Contents/PkgInfo ${TARGETDIR}/blender.app/Contents/
259                         COMMAND cp -Rf ${SOURCEDIR}/Contents/Resources ${TARGETDIR}/blender.app/Contents/
260                         COMMAND cat ${SOURCEINFO} | sed s/VERSION/`cat ${CMAKE_SOURCE_DIR}/release/VERSION`/ | sed s/DATE/`date +'%Y-%b-%d'`/ > ${TARGETINFO}
261                         COMMAND rm -Rf ${TARGETDIR}/blender.app/Contents/MacOS/datafiles
262                         COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/
263                         COMMAND cp ${CMAKE_SOURCE_DIR}/release/bin/.blender/.bfont.ttf ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/
264                 )
265       
266                 IF(WITH_INTERNATIONAL)
267                         ADD_CUSTOM_COMMAND(
268                                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
269                                 COMMAND cp ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/
270                                 COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/
271                         )
272                 ENDIF(WITH_INTERNATIONAL)
273       
274                 IF(WITH_PYTHON)
275                         SET(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip")
276                         ADD_CUSTOM_COMMAND(
277                                 TARGET blender POST_BUILD MAIN_DEPENDENCY blender
278                                 COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/scripts ${TARGETDIR}/blender.app/Contents/MacOS/
279                                 COMMAND rm -Rf ${TARGETDIR}/blender.app/Contents/MacOS/python/
280                                 COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/python/
281                                 COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${TARGETDIR}/blender.app/Contents/MacOS/python/
282                                 COMMAND find ${TARGETDIR}/blender.app -name "*.py?" -prune -exec rm -rf {} "\;"
283                         )
284                 ENDIF(WITH_PYTHON)      
285     
286                 ADD_CUSTOM_COMMAND(
287                         TARGET blender POST_BUILD MAIN_DEPENDENCY blender    
288                         COMMAND find ${TARGETDIR}/blender.app -name .DS_Store -prune -exec rm -rf {} "\;"
289                         COMMAND find ${TARGETDIR}/blender.app -name .svn -prune -exec rm -rf {} "\;"
290                         COMMAND find ${TARGETDIR}/blender.app -name __MACOSX -prune -exec rm -rf {} "\;"
291                 )
292         ENDIF(APPLE)
293
294         IF(WIN32)
295                 ADD_CUSTOM_COMMAND(TARGET blender
296                         POST_BUILD
297                         MAIN_DEPENDENCY blender
298                         COMMAND if not exist \"${TARGETDIR}\\.blender\" mkdir \"${TARGETDIR}\\.blender\"
299                         COMMAND if not exist \"${TARGETDIR}\\.blender\\locale\" mkdir \"${TARGETDIR}\\.blender\\locale\"
300                         COMMAND if not exist \"${TARGETDIR}\\.blender\\scripts\" mkdir \"${TARGETDIR}\\.blender\\scripts\"
301                         COMMAND if not exist \"${TARGETDIR}\\plugins\" mkdir \"${TARGETDIR}\\plugins\"
302                         COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\bin\\.blender\\.Blanguages\" \"${TARGETDIR}\\.blender\\\" 
303                         COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\bin\\.blender\\.bfont.ttf\" \"${TARGETDIR}\\.blender\\\"
304                         COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\release\\bin\\.blender\\locale\\*.*\" \"${TARGETDIR}\\.blender\\locale\"
305                         COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\release\\scripts\\*.*\" \"${TARGETDIR}\\.blender\\scripts\"
306                         COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\release\\plugins\\*.*\" \"${TARGETDIR}\\plugins\"
307                         COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\text\\*.*\" \"${TARGETDIR}\"
308                         # TODO, copy python bundle
309                         # COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\windows\\extra\\python31.zip\" \"${TARGETDIR}\\\"
310                 )
311     
312                 ADD_CUSTOM_COMMAND(TARGET blender
313                         POST_BUILD
314                         MAIN_DEPENDENCY blender
315                         COMMAND copy /Y \"${LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\\"
316                         COMMAND copy /Y \"${LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\python31_d.zip\"
317                         COMMAND copy /Y \"${LIBDIR}\\gettext\\lib\\gnu_gettext.dll\" \"${TARGETDIR}\\\"
318                         COMMAND copy /Y \"${LIBDIR}\\png\\lib\\libpng.dll\" \"${TARGETDIR}\\\"
319                         COMMAND copy /Y \"${LIBDIR}\\sdl\\lib\\SDL.dll\" \"${TARGETDIR}\\\"
320                         COMMAND copy /Y \"${LIBDIR}\\zlib\\lib\\zlib.dll\" \"${TARGETDIR}\\\"
321                         COMMAND copy /Y \"${LIBDIR}\\python\\lib\\python31.dll\" \"${TARGETDIR}\\\"
322                         COMMAND copy /Y \"${LIBDIR}\\python\\lib\\python31_d.dll\" \"${TARGETDIR}\\\"
323                         COMMAND copy /Y \"${LIBDIR}\\pthreads\\lib\\pthreadVC2.dll\" \"${TARGETDIR}\\\"
324                         # COMMAND copy /Y \"${LIBDIR}\\samplerate\\lib\\libsamplerate-0.dll\" \"${TARGETDIR}\\\"
325                 )
326
327                 IF(WITH_INTERNATIONAL)
328                         ADD_CUSTOM_COMMAND(TARGET blender
329                                 POST_BUILD
330                                 MAIN_DEPENDENCY blender
331                                 COMMAND copy /Y \"${LIBDIR}\\iconv\\lib\\iconv.dll\" \"${TARGETDIR}\\\"
332                         )
333                 ENDIF(WITH_INTERNATIONAL)
334
335                 IF(WITH_FFMPEG)
336                         ADD_CUSTOM_COMMAND(TARGET blender
337                                 POST_BUILD
338                                 MAIN_DEPENDENCY blender
339                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avcodec-52.dll\" \"${TARGETDIR}\\\"
340                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avformat-52.dll\" \"${TARGETDIR}\\\"
341                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avdevice-52.dll\" \"${TARGETDIR}\\\"
342                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avutil-50.dll\" \"${TARGETDIR}\\\"
343                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libfaac-0.dll\" \"${TARGETDIR}\\\"
344                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libfaad-2.dll\" \"${TARGETDIR}\\\"
345                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libmp3lame-0.dll\" \"${TARGETDIR}\\\"
346                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libx264-67.dll\" \"${TARGETDIR}\\\"
347                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\swscale-0.dll\" \"${TARGETDIR}\\\"
348                                 COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\xvidcore.dll\" \"${TARGETDIR}\\\"
349                         )
350                 ENDIF(WITH_FFMPEG)
351
352                 IF(WITH_SNDFILE)
353                         ADD_CUSTOM_COMMAND(TARGET blender
354                                 POST_BUILD
355                                 MAIN_DEPENDENCY blender
356                                 COMMAND copy /Y \"${LIBDIR}\\sndfile\\lib\\libsndfile-1.dll\" \"${TARGETDIR}\\\"
357                         )
358                 ENDIF(WITH_SNDFILE)
359
360                 IF(WITH_JACK)
361                         ADD_CUSTOM_COMMAND(TARGET blender
362                                 POST_BUILD
363                                 MAIN_DEPENDENCY blender
364                                 COMMAND copy /Y \"${LIBDIR}\\jack\\lib\\libjack.dll\" \"${TARGETDIR}\\\"
365                         )
366                 ENDIF(WITH_JACK)
367
368                 IF(WITH_OPENAL)
369                         ADD_CUSTOM_COMMAND(TARGET blender
370                                 POST_BUILD
371                                 MAIN_DEPENDENCY blender
372                                 COMMAND copy /Y \"${LIBDIR}\\openal\\lib\\OpenAL32.dll\" \"${TARGETDIR}\\\"
373                                 COMMAND copy /Y \"${LIBDIR}\\openal\\lib\\wrap_oal.dll\" \"${TARGETDIR}\\\"
374
375                         )
376                 ENDIF(WITH_OPENAL)
377
378
379         ENDIF(WIN32)
380 ENDIF(WITH_INSTALL)
381
382 ADD_DEPENDENCIES(blender makesdna)
383
384 FILE(READ ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt BLENDER_LINK_LIBS)
385
386 SET(BLENDER_LINK_LIBS bf_nodes ${BLENDER_LINK_LIBS} bf_windowmanager bf_render)
387
388 IF(WITH_FLUID)
389         SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} bf_intern_elbeem)
390 ENDIF(WITH_FLUID)
391
392 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
393         SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} extern_binreloc)
394 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
395
396 #IF(UNIX)
397         # Sort libraries
398         SET(BLENDER_SORTED_LIBS
399                 bf_windowmanager
400
401         bf_editor_space_api
402         bf_editor_space_action
403         bf_editor_space_buttons
404         bf_editor_space_console
405         bf_editor_space_file
406         bf_editor_space_graph
407         bf_editor_space_image
408         bf_editor_space_info
409         bf_editor_space_logic
410         bf_editor_space_nla
411         bf_editor_space_node
412         bf_editor_space_outliner
413         bf_editor_space_script
414         bf_editor_space_sequencer
415         bf_editor_space_sound
416         bf_editor_space_time
417         bf_editor_space_userpref
418         bf_editor_space_view3d
419
420         bf_editor_text
421         bf_editor_transform
422         bf_editor_util
423         bf_editor_uvedit
424         bf_editor_curve
425         bf_editor_armature
426         bf_editor_gpencil
427         bf_editor_interface
428         bf_editor_mesh
429         bf_editor_metaball
430         bf_editor_object
431         bf_editor_physics
432         bf_editor_render
433         bf_editor_screen
434         bf_editor_sculpt_paint
435         bf_editor_sound
436         bf_editor_animation
437         bf_editor_datafiles
438
439                 bf_intern_bsp 
440                 bf_render 
441                 bf_intern_opennl 
442                 bf_python 
443                 bf_python_ext 
444                 bf_ikplugin
445                 bf_modifiers
446                 bf_blenkernel
447                 bf_nodes
448                 bf_gpu
449                 bf_blenloader
450                 bf_blenlib
451                 bf_intern_ghost
452                 bf_intern_string
453                 bf_blenpluginapi 
454                 bf_imbuf 
455                 bf_avi 
456                 bf_cineon 
457                 bf_openexr 
458                 bf_dds
459                 bf_readblenfile
460                 bf_collada
461                 bf_intern_bsp 
462                 bf_intern_bop 
463                 bf_kernel 
464                 bf_intern_decimate 
465                 bf_intern_elbeem 
466                 bf_intern_ik 
467                 bf_intern_memutil 
468                 bf_intern_guardedalloc 
469                 bf_intern_ctr 
470                 bf_intern_moto 
471                 bf_windowmanager
472                 bf_blroutines 
473                 bf_converter 
474                 bf_dummy 
475                 bf_bullet 
476                 bf_intern_smoke
477                 extern_minilzo
478                 extern_lzma
479                 bf_common 
480                 bf_ketsji 
481                 bf_logic 
482                 bf_rasterizer 
483                 bf_oglrasterizer 
484                 bf_expressions 
485                 bf_scenegraph 
486                 bf_intern_moto 
487                 bf_blroutines 
488                 kx_network 
489                 bf_kernel 
490                 bf_ngnetwork 
491                 extern_bullet 
492                 bf_loopbacknetwork 
493                 bf_intern_itasc
494                 bf_common 
495                 bf_intern_moto 
496                 bf_python
497                 bf_python_ext
498                 extern_binreloc
499                 extern_glew
500                 extern_openjpeg
501                 bf_videotex
502                 bf_rna
503                 bf_dna
504                 bf_blenfont
505                 bf_intern_audaspace
506                 bf_intern_decimate
507
508         )
509
510         IF(WITH_CXX_GUARDEDALLOC)
511                 SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_intern_guardedalloc_cpp)
512         ENDIF(WITH_CXX_GUARDEDALLOC)
513
514         IF(WITH_QUICKTIME)
515                 SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_quicktime)
516         ENDIF(WITH_QUICKTIME)
517
518
519         FOREACH(SORTLIB ${BLENDER_SORTED_LIBS})
520                 SET(REMLIB ${SORTLIB})
521                 FOREACH(SEARCHLIB ${BLENDER_LINK_LIBS})
522                         IF(${SEARCHLIB} STREQUAL ${SORTLIB})
523                                 SET(REMLIB "")
524                         ENDIF(${SEARCHLIB} STREQUAL ${SORTLIB})
525                 ENDFOREACH(SEARCHLIB)
526                 IF(REMLIB)
527                         MESSAGE(STATUS "Removing library ${REMLIB} from blender linking because: not configured")
528                         LIST(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB})
529                 ENDIF(REMLIB)
530         ENDFOREACH(SORTLIB)
531         TARGET_LINK_LIBRARIES(blender ${BLENDER_SORTED_LIBS})
532 #ELSE(UNIX)
533 #       TARGET_LINK_LIBRARIES(blender ${BLENDER_LINK_LIBS})
534 #ENDIF(UNIX)
535
536 SETUP_LIBLINKS(blender)