Network rendering fixes.
Jeanphi
1 cmake_minimum_required(VERSION 2.4)
2 IF(COMMAND cmake_policy)
3 cmake_policy(SET CMP0003 NEW)
4 ENDIF(COMMAND cmake_policy)
9 # Dade - uncomment to obtain verbose building output
10 #SET(CMAKE_VERBOSE_MAKEFILE true)
16 #Setting Universal Binary Properties, only for Mac OS X
19 SET(CMAKE_OSX_ARCHITECTURES ppc64;x86_64)
20 SET(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
22 SET(CMAKE_OSX_ARCHITECTURES ppc;i386)
23 SET(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk)
28 #############################################################################
29 #############################################################################
30 ### check for the CPU we build for ###
31 #############################################################################
32 #############################################################################
35 COMMAND ${CMAKE_C_COMPILER} -dumpmachine
36 OUTPUT_VARIABLE MACHINE
37 OUTPUT_STRIP_TRAILING_WHITESPACE
39 MESSAGE(STATUS "Building for target ${MACHINE}")
41 STRING(REGEX MATCH "(i.86-*)|(athlon-*)|(pentium-*)" _mach_x86 ${MACHINE})
46 STRING(REGEX MATCH "(x86_64-*)|(X86_64-*)|(AMD64-*)|(amd64-*)" _mach_x86_64 ${MACHINE})
50 #jromang - Hack to avoid boost bug on x64 Ubuntu 8.10 and Fedora 10 (http://www.luxrender.net/mantis/view.php?id=433)
51 ADD_DEFINITIONS(-DBOOST_NO_INTRINSIC_INT64_T)
54 STRING(REGEX MATCH "(ppc-*)|(powerpc-*)" _mach_ppc ${MACHINE})
63 #############################################################################
64 #############################################################################
65 ########################### Find BISON ###########################
66 #############################################################################
67 #############################################################################
68 FIND_PROGRAM(BISON_EXECUTABLE bison)
69 IF (NOT BISON_EXECUTABLE)
70 MESSAGE(FATAL_ERROR "bison not found - aborting")
71 ENDIF (NOT BISON_EXECUTABLE)
74 #############################################################################
75 #############################################################################
76 ########################### Find FLEX ###########################
77 #############################################################################
78 #############################################################################
79 FIND_PROGRAM(FLEX_EXECUTABLE flex)
80 IF (NOT FLEX_EXECUTABLE)
81 MESSAGE(FATAL_ERROR "flex not found - aborting")
82 ENDIF (NOT FLEX_EXECUTABLE)
85 #############################################################################
86 #############################################################################
87 ########################### Find OpenGL ##########################
88 #############################################################################
89 #############################################################################
90 SET(OPENGL_LIBRARY ${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
91 INCLUDE(${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
93 MESSAGE(STATUS "OpenGL include directory: " ${OPENGL_INCLUDE_DIR})
96 #############################################################################
97 #############################################################################
98 ########################### BOOST LIBRARIES SETUP ###########################
99 #############################################################################
100 #############################################################################
101 FIND_PACKAGE(Boost REQUIRED)
103 MESSAGE(STATUS "Boost library directory: " ${Boost_LIBRARY_DIRS})
104 MESSAGE(STATUS "Boost include directory: " ${Boost_INCLUDE_DIRS})
106 SET(Boost_LIBRARIES boost_thread-gcc-mt boost_program_options-gcc-mt boost_filesystem-gcc-mt boost_serialization-gcc-mt boost_iostreams-gcc-mt boost_regex-gcc-mt)
108 SET(Boost_LIBRARIES boost_system-xgcc40-mt-1_39 boost_thread-xgcc40-mt-1_39 boost_program_options-xgcc40-mt-1_39 boost_filesystem-xgcc40-mt-1_39 boost_serialization-xgcc40-mt-1_39 boost_iostreams-xgcc40-mt-1_39 boost_regex-xgcc40-mt-1_39)
109 # SET(Boost_LIBRARIES boost_thread-mt-1_34_1 boost_program_options-mt-1_34_1 boost_filesystem-mt-1_34_1 boost_serialization-mt-1_34_1 boost_iostreams-mt-1_34_1 boost_regex-mt-1_34_1)
110 ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
111 SET(Boost_LIBRARIES boost_thread boost_program_options boost_filesystem boost_serialization boost_iostreams boost_regex)
112 ELSE(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
113 SET(Boost_LIBRARIES boost_thread-mt boost_program_options-mt boost_filesystem-mt boost_serialization-mt boost_iostreams-mt boost_regex-mt)
116 MESSAGE(FATAL_ERROR "Could not find Boost")
120 #############################################################################
121 #############################################################################
122 ######################### OPENEXR LIBRARIES SETUP ###########################
123 #############################################################################
124 #############################################################################
125 FIND_PATH(OPENEXR_INCLUDE_DIRS
128 /usr/local/include/OpenEXR
131 /opt/local/include/OpenEXR
132 /opt/csw/include/OpenEXR
136 SET(OPENEXR_LIBRARIES Half IlmImf Iex Imath IlmThread)
139 SET(OPENEXR_LIBRARIES Half IlmImf Iex Imath)
142 #############################################################################
143 #############################################################################
144 ########################### PNG LIBRARIES SETUP ###########################
145 #############################################################################
146 #############################################################################
147 # - Find the native PNG includes and library
149 # This module defines
150 # PNG_INCLUDE_DIR, where to find png.h, etc.
151 # PNG_LIBRARIES, the libraries to link against to use PNG.
152 # PNG_DEFINITIONS - You should ADD_DEFINITONS(${PNG_DEFINITIONS}) before compiling code that includes png library files.
153 # PNG_FOUND, If false, do not try to use PNG.
154 # also defined, but not for general use are
155 # PNG_LIBRARY, where to find the PNG library.
156 # None of the above will be defined unles zlib can be found.
157 # PNG depends on Zlib
161 MESSAGE( STATUS "Warning : could not find PNG - building without png support")
163 #FIND_PACKAGE(PNG REQUIRED)
166 #############################################################################
167 #############################################################################
168 ########################### TIFF LIBRARIES SETUP ###########################
169 #############################################################################
170 #############################################################################
171 # - Find TIFF library
172 # Find the native TIFF includes and library
173 # This module defines
174 # TIFF_INCLUDE_DIR, where to find tiff.h, etc.
175 # TIFF_LIBRARIES, libraries to link against to use TIFF.
176 # TIFF_FOUND, If false, do not try to use TIFF.
177 # also defined, but not for general use are
178 # TIFF_LIBRARY, where to find the TIFF library.
180 #FIND_PACKAGE(TIFF REQUIRED)
182 MESSAGE( STATUS "Found TIFF: " ${TIFF_LIBRARIES} )
184 MESSAGE( STATUS "Warning : could not find TIFF - building without tiff support")
188 #############################################################################
189 #############################################################################
190 ########################### JPEG LIBRARIES SETUP ###########################
191 #############################################################################
192 #############################################################################
194 # Find the native JPEG includes and library
195 # This module defines
196 # JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
197 # JPEG_LIBRARIES, the libraries needed to use JPEG.
198 # JPEG_FOUND, If false, do not try to use JPEG.
199 # also defined, but not for general use are
200 # JPEG_LIBRARY, where to find the JPEG library.
202 #FIND_PACKAGE(JPEG REQUIRED)
204 MESSAGE( STATUS "JPEG include directory: " ${JPEG_INCLUDE_DIR} )
206 MESSAGE( STATUS "Warning : could not find JPEG - building without jpeg support")
210 #############################################################################
211 #############################################################################
212 ######################### wxWidgets LIBRARIES SETUP #########################
213 #############################################################################
214 #############################################################################
215 # Here you can define what libraries of wxWidgets you need for your
216 # application. You can figure out what libraries you need here;
217 # http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
218 SET(wxWidgets_USE_LIBS base core gl aui adv )
219 FIND_PACKAGE(wxWidgets)
221 # Include wxWidgets macros
222 INCLUDE(${wxWidgets_USE_FILE})
223 MESSAGE( STATUS "wxWidgets include directory: " ${wxWidgets_INCLUDE_DIRS} )
224 ELSE(wxWidgets_FOUND)
225 MESSAGE( STATUS "Warning : could not find wxWidgets - not building GUI")
226 ENDIF(wxWidgets_FOUND)
229 #############################################################################
230 #############################################################################
231 ############################ THREADING LIBRARIES ############################
232 #############################################################################
233 #############################################################################
235 FIND_PACKAGE(Threads REQUIRED)
238 #############################################################################
239 #############################################################################
240 ########################### SYSTEM LIBRARIES ###########################
241 #############################################################################
242 #############################################################################
244 SET(SYS_LIBRARIES z )
247 SET(SYS_LIBRARIES wsock32 ws2_32)
248 ADD_DEFINITIONS(-D_WIN32_WINNT=0x0551 -D__USE_W32_SOCKETS -D_GLIBCXX__PTHREADS)
252 #############################################################################
253 #All dependencies OK !
254 #############################################################################
256 #Generate the config.h file
257 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
258 ADD_DEFINITIONS(-DLUX_USE_CONFIG_H)
260 #############################################################################
261 #############################################################################
262 ######################### COMPILER FLAGS ###########################
263 #############################################################################
264 #############################################################################
265 # Dade - default compiler options
266 ADD_DEFINITIONS(-O3 -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
269 #############################################################################
270 # Compiler flags for specific setup
271 #############################################################################
273 # doug - When linking liblux as a python extension, need to compile with -fPIC
274 #ADD_DEFINITIONS(-fPIC)
276 # Jens - default Mac compiler options with OpenGL
277 #ADD_DEFINITIONS(-O3 -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H )
278 # Jens - testing Mac compiler options (debug)
279 #ADD_DEFINITIONS(-DHAVE_PTHREAD_H)
281 # Dade - GCC Profiling (remember to uncomment the line at the end of file too)
282 #ADD_DEFINITIONS(-pg -g -O2 -march=-msse -mfpmath=sse -ftree-vectorize -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
284 # Dade - GCC 2 pass optimization (remember to uncomment the line at the end of file too)
285 #ADD_DEFINITIONS(-O3 --coverage -march=prescott -mfpmath=sse -ftree-vectorize -funroll-loops -ffast-math -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
286 #ADD_DEFINITIONS(-O3 -fbranch-probabilities -march=prescott -mfpmath=sse -ftree-vectorize -funroll-loops -ffast-math -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
289 #ADD_DEFINITIONS(-g -O0 -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
290 #ADD_DEFINITIONS(-O3 -march=prescott -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
291 #ADD_DEFINITIONS(-O3 -march=athlon-xp -m3dnow -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H )
293 # Dade - Intel CC settings (double pass, 32bit, remember to uncomment the line at the end of file too)
294 # rm -rf CMakeCache.txt CMakeFiles
295 # CC=/opt/intel/cc/10.1.015/bin/icc CXX=/opt/intel/cc/10.1.015/bin/icpc cmake lux
297 #ADD_DEFINITIONS(-prof-gen -prof-dir /tmp -O3 -ipo -mtune=core2 -xT -unroll -fp-model fast=2 -rcd -no-prec-div -DLUX_USE_OPENGL -DHAVE_PTHREAD_H '-D"__sync_fetch_and_add(ptr,addend)=_InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(ptr)), addend)"')
299 #ADD_DEFINITIONS(-prof-use -prof-dir /tmp -O3 -ipo -mtune=core2 -xT -unroll -fp-model fast=2 -rcd -no-prec-div -DLUX_USE_OPENGL -DHAVE_PTHREAD_H '-D"__sync_fetch_and_add(ptr,addend)=_InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(ptr)), addend)"')
301 # Dade - Intel CC settings (single pass, 32bit)
302 #ADD_DEFINITIONS(-O3 -ip -mtune=core2 -xT -unroll -fp-model fast=2 -rcd -no-prec-div -DLUX_USE_OPENGL -DHAVE_PTHREAD_H '-D"__sync_fetch_and_add(ptr,addend)=_InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(ptr)), addend)"')
304 # Dade - Intel CC settings (single pass, 64bit)
305 #ADD_DEFINITIONS(-O3 -ip -mtune=core2 -xT -unroll -fp-model fast=2 -rcd -no-prec-div -DLUX_USE_OPENGL -DHAVE_PTHREAD_H '-D"__sync_fetch_and_add(ptr,addend)=_InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(ptr)), addend)"' -DBOOST_NO_INTRINSIC_INT64_T "-D'__builtin_vsnprintf(__out, __size, __fmt, __args)'='__builtin_vsnprintf(__out, __size, __fmt, (char *) __args)'")
307 #ADD_DEFINITIONS(-O3 -msse -mfpmath=sse -ftree-vectorize -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
308 #ADD_DEFINITIONS(-O3 -march=athlon-xp -mmmx -m3dnow -msse -mfpmath=sse -ftree-vectorize -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H )
309 #ADD_DEFINITIONS(-O3 -Wall -msse -msse2 -DLUX_USE_SSE -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
310 #ADD_DEFINITIONS(-g -Wall -msse -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
312 #ADD_DEFINITIONS(-O3 -ipo -no-prec-div -static -fp-model fast=2 -rcd)
314 #############################################################################
315 #############################################################################
316 ######################### CUSTOM COMMAND ###########################
317 #############################################################################
318 #############################################################################
319 # Create custom command for flex/lex (note the outputs)
321 SOURCE ${CMAKE_SOURCE_DIR}/core/luxlex.l
322 COMMAND ${FLEX_EXECUTABLE}
323 ARGS -o${CMAKE_BINARY_DIR}/luxlex.cpp
324 ${CMAKE_SOURCE_DIR}/core/luxlex.l
326 #DEPENDS ${CMAKE_BINARY_DIR}/core/pbrtparse.cpp ${lux_BINARY_DIR}/core/pbrtparse.h
327 OUTPUTS ${CMAKE_BINARY_DIR}/luxlex.cpp)
328 SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/luxlex.cpp GENERATED)
330 # Create custom command for bison/yacc (note the DEPENDS)
331 IF(APPLE AND !APPLE_64)
334 #DEPENDS ${CMAKE_BINARY_DIR}/core/luxlex.cpp
335 SOURCE ${CMAKE_SOURCE_DIR}/core/luxparse.y
336 COMMAND ${BISON_EXECUTABLE} -y ${CMAKE_SOURCE_DIR}/core/luxparse.y -o ${CMAKE_BINARY_DIR}/luxparse.cpp -d
337 COMMAND mv ${CMAKE_SOURCE_DIR}/luxparse.cpp.h ${CMAKE_BINARY_DIR}/luxparse.hpp
338 OUTPUTS ${CMAKE_BINARY_DIR}/luxparse.cpp ${CMAKE_BINARY_DIR}/luxparse.hpp)
339 ELSE(APPLE AND !APPLE_64)
341 SOURCE ${CMAKE_SOURCE_DIR}/core/luxparse.y
342 COMMAND ${BISON_EXECUTABLE}
343 ARGS -y ${CMAKE_SOURCE_DIR}/core/luxparse.y
344 -o ${CMAKE_BINARY_DIR}/luxparse.cpp
347 #DEPENDS ${CMAKE_BINARY_DIR}/core/luxlex.cpp
348 OUTPUTS ${CMAKE_BINARY_DIR}/luxparse.cpp ${CMAKE_BINARY_DIR}/luxparse.hpp)
349 ENDIF(APPLE AND !APPLE_64)
350 SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/core/luxparse.cpp GENERATED)
353 #############################################################################
354 #############################################################################
355 ######################### APPLE CUSTOM PKG ###########################
356 #############################################################################
357 #############################################################################
359 ADD_CUSTOM_TARGET(dist DEPENDS luxrender)
361 TARGET dist POST_BUILD
362 COMMAND rm -rf LuxRender.app
363 COMMAND mkdir LuxRender.app
364 COMMAND mkdir LuxRender.app/Contents
365 COMMAND mkdir LuxRender.app/Contents/MacOS
366 COMMAND mkdir LuxRender.app/Contents/Resources
367 COMMAND cp ../macos/Info.plist LuxRender.app/Contents
368 COMMAND cp LuxRender.icns LuxRender.app/Contents/Resources
369 COMMAND echo APPLnone > LuxRender.app/Contents/PkgInfo
370 COMMAND cp luxrender LuxRender.app/Contents/MacOS/LuxRender)
374 #############################################################################
375 #############################################################################
376 ##################### SOURCE FILE FOR lux_lib ######################
377 #############################################################################
378 #############################################################################
380 SET(lux_core_reflection_src
381 core/reflection/bxdf.cpp
382 core/reflection/fresnel.cpp
383 core/reflection/microfacetdistribution.cpp
384 core/reflection/bxdf/cooktorrance.cpp
385 core/reflection/bxdf/fresnelblend.cpp
386 core/reflection/bxdf/lafortune.cpp
387 core/reflection/bxdf/lambertian.cpp
388 core/reflection/bxdf/microfacet.cpp
389 core/reflection/bxdf/nulltransmission.cpp
390 core/reflection/bxdf/orennayar.cpp
391 core/reflection/bxdf/specularreflection.cpp
392 core/reflection/bxdf/speculartransmission.cpp
393 core/reflection/fresnel/fresnelnoop.cpp
394 core/reflection/fresnel/fresneldielectric.cpp
395 core/reflection/fresnel/fresnelconductor.cpp
396 core/reflection/fresnel/fresnelslick.cpp
397 core/reflection/fresnel/fresnelgeneral.cpp
398 core/reflection/microfacetdistribution/anisotropic.cpp
399 core/reflection/microfacetdistribution/beckmann.cpp
400 core/reflection/microfacetdistribution/blinn.cpp
401 core/reflection/microfacetdistribution/wardisotropic.cpp
404 ${CMAKE_BINARY_DIR}/luxparse.cpp
405 ${CMAKE_BINARY_DIR}/luxlex.cpp
410 core/contribution.cpp
414 core/geometry/bbox.cpp
415 core/geometry/matrix4x4.cpp
416 core/geometry/quaternion.cpp
417 core/geometry/raydifferential.cpp
418 core/geometry/transform.cpp
424 core/motionsystem.cpp
431 ${lux_core_reflection_src}
438 core/spectrumwavelengths.cpp
445 renderer/renderserver.cpp
447 SET(lux_accelerators_src
448 accelerators/bruteforce.cpp
449 accelerators/bvhaccel.cpp
450 accelerators/grid.cpp
451 accelerators/qbvhaccel.cpp
452 accelerators/tabreckdtree.cpp
453 accelerators/unsafekdtree.cpp
456 cameras/environment.cpp
457 cameras/perspective.cpp
458 cameras/orthographic.cpp
459 cameras/realistic.cpp
471 SET(lux_integrators_src
472 integrators/bidirectional.cpp
473 integrators/directlighting.cpp
474 integrators/distributedpath.cpp
475 integrators/emission.cpp
476 integrators/exphotonmap.cpp
479 integrators/single.cpp
485 lights/infinitesample.cpp
487 lights/projection.cpp
488 lights/sphericalfunction/photometricdata_ies.cpp
489 lights/sphericalfunction/sphericalfunction.cpp
490 lights/sphericalfunction/sphericalfunction_ies.cpp
495 SET(lux_materials_src
496 materials/carpaint.cpp
500 materials/mattetranslucent.cpp
503 materials/mixmaterial.cpp
505 materials/roughglass.cpp
506 materials/shinymetal.cpp
508 SET(lux_pixelsamplers_src
509 pixelsamplers/hilbertpx.cpp
510 pixelsamplers/linear.cpp
511 pixelsamplers/lowdiscrepancypx.cpp
512 pixelsamplers/tilepx.cpp
513 pixelsamplers/vegas.cpp
517 samplers/lowdiscrepancy.cpp
518 samplers/metrosampler.cpp
525 shapes/heightfield.cpp
526 shapes/hyperboloid.cpp
527 shapes/lenscomponent.cpp
528 shapes/loopsubdiv.cpp
530 shapes/meshbarytriangle.cpp
531 shapes/meshquadrilateral.cpp
532 shapes/meshwaldtriangle.cpp
534 shapes/paraboloid.cpp
536 shapes/plymesh/rply.c
538 shapes/quadrilateral.cpp
543 spds/blackbodyspd.cpp
545 spds/frequencyspd.cpp
552 SET(lux_blender_textures_src
553 textures/blender_blend.cpp
554 textures/blender_clouds.cpp
555 textures/blender_distortednoise.cpp
556 textures/blender_magic.cpp
557 textures/blender_marble.cpp
558 textures/blender_musgrave.cpp
559 textures/blender_noise.cpp
560 textures/blender_noiselib.cpp
561 textures/blender_stucci.cpp
562 textures/blender_texlib.cpp
563 textures/blender_voronoi.cpp
564 textures/blender_wood.cpp
566 SET(lux_uniform_textures_src
567 textures/blackbody.cpp
568 textures/constant.cpp
569 textures/equalenergy.cpp
570 textures/frequencytexture.cpp
571 textures/gaussiantexture.cpp
572 textures/irregulardata.cpp
573 textures/lampspectrum.cpp
574 textures/regulardata.cpp
577 ${lux_uniform_textures_src}
578 ${lux_blender_textures_src}
581 textures/checkerboard.cpp
584 textures/harlequin.cpp
585 textures/imagemap.cpp
591 textures/wrinkled.cpp
594 tonemaps/contrast.cpp
595 tonemaps/highcontrast.cpp
596 tonemaps/lineartonemap.cpp
597 tonemaps/maxwhite.cpp
598 tonemaps/nonlinear.cpp
599 tonemaps/reinhard.cpp
603 volumes/exponential.cpp
604 volumes/homogeneous.cpp
605 volumes/volumegrid.cpp
610 ${lux_accelerators_src}
614 ${lux_integrators_src}
617 ${lux_pixelsamplers_src}
625 INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}
629 ${OPENEXR_INCLUDE_DIRS}
630 ${Boost_INCLUDE_DIRS}
631 ${CMAKE_SOURCE_DIR}/accelerators ${CMAKE_SOURCE_DIR}/cameras ${CMAKE_SOURCE_DIR}/core
632 ${CMAKE_SOURCE_DIR}/core/reflection ${CMAKE_SOURCE_DIR}/core/reflection/bxdf ${CMAKE_SOURCE_DIR}/spds
633 ${CMAKE_SOURCE_DIR}/core/reflection/fresnel ${CMAKE_SOURCE_DIR}/core/reflection/microfacetdistribution
634 ${CMAKE_SOURCE_DIR}/film ${CMAKE_SOURCE_DIR}/filters ${CMAKE_SOURCE_DIR}/integrators
635 ${CMAKE_SOURCE_DIR}/lights ${CMAKE_SOURCE_DIR}/lights/sphericalfunction
636 ${CMAKE_SOURCE_DIR}/materials ${CMAKE_SOURCE_DIR}/samplers
637 ${CMAKE_SOURCE_DIR}/shapes ${CMAKE_SOURCE_DIR}/textures ${CMAKE_SOURCE_DIR}/tonemaps
638 ${CMAKE_SOURCE_DIR}/volumes ${CMAKE_SOURCE_DIR}/integrationsamplers ${CMAKE_SOURCE_DIR}/pixelsamplers
639 ${CMAKE_SOURCE_DIR}/renderer/include
644 #############################################################################
645 #############################################################################
646 ##################### LINKER INFO ######################
647 #############################################################################
648 #############################################################################
650 LINK_DIRECTORIES(${LINK_DIRECTORIES} ${Boost_LIBRARY_DIRS} ${OPENEXR_LIB_DIRS} ${PNG_LIBRARY} ${TIFF_LIBRARY} ${JPEG_LIBRARY})
652 #Here we build the core library
653 ADD_LIBRARY(lux STATIC ${lux_lib_src} )
654 #TARGET_LINK_LIBRARIES(lux ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} )
657 #############################################################################
658 #Here we build the console executable
659 #############################################################################
660 ADD_EXECUTABLE(luxconsole renderer/luxconsole.cpp)
662 TARGET_LINK_LIBRARIES(luxconsole -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${CMAKE_THREAD_LIBS_INIT} ${OPENEXR_LIBRARIES} z ${Boost_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES})
664 TARGET_LINK_LIBRARIES(luxconsole -Wl,--whole-archive lux -Wl,--no-whole-archive ${CMAKE_THREAD_LIBS_INIT} ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} ${SYS_LIBRARIES})
668 SET(GUI_TYPE MACOSX_BUNDLE)
669 # SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
670 # Short Version is the "marketing version". It is the version
671 # the user sees in an information panel.
672 SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}")
673 # Bundle version is the version the OS looks at.
674 SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}")
675 SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.luxrender.luxrender" )
676 SET(MACOSX_BUNDLE_BUNDLE_NAME "luxrender" )
677 SET(MACOSX_BUNDLE_ICON_FILE "LuxRender.icns")
678 # SET(MACOSX_BUNDLE_COPYRIGHT "")
679 # SET(MACOSX_BUNDLE_INFO_STRING "Info string, localized?")
682 #############################################################################
683 #Here we build the luxmerger executable
684 #############################################################################
685 ADD_EXECUTABLE(luxmerger tools/luxmerger.cpp)
687 TARGET_LINK_LIBRARIES(luxmerger -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${CMAKE_THREAD_LIBS_INIT} ${OPENEXR_LIBRARIES} z ${Boost_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES})
689 TARGET_LINK_LIBRARIES(luxmerger -Wl,--whole-archive lux -Wl,--no-whole-archive ${CMAKE_THREAD_LIBS_INIT} ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} ${SYS_LIBRARIES})
693 SET(GUI_TYPE MACOSX_BUNDLE)
694 # SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
695 # Short Version is the "marketing version". It is the version
696 # the user sees in an information panel.
697 SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}")
698 # Bundle version is the version the OS looks at.
699 SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}")
700 SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.luxrender.luxrender" )
701 SET(MACOSX_BUNDLE_BUNDLE_NAME "luxrender" )
702 SET(MACOSX_BUNDLE_ICON_FILE "LuxRender.icns")
703 # SET(MACOSX_BUNDLE_COPYRIGHT "")
704 # SET(MACOSX_BUNDLE_INFO_STRING "Info string, localized?")
707 #############################################################################
708 #Here we build the wxWidgets GUI executable
709 #############################################################################
711 ADD_EXECUTABLE(luxrender ${GUI_TYPE} renderer/wxluxapp.cpp renderer/wxluxgui.cpp renderer/wxluxframe.cpp renderer/wxglviewer.cpp renderer/wxviewer.cpp)
712 INCLUDE_DIRECTORIES( ${wxWidgets_INCLUDE_DIRS} )
715 INCLUDE_DIRECTORIES ( /Developer/Headers/FlatCarbon /usr/local/include)
716 FIND_LIBRARY(CARBON_LIBRARY Carbon)
717 FIND_LIBRARY(QUICKTIME_LIBRARY QuickTime )
718 FIND_LIBRARY(OPENGL_LIBRARY OpenGL )
719 FIND_LIBRARY(AGL_LIBRARY AGL )
720 FIND_LIBRARY(APP_SERVICES_LIBRARY ApplicationServices )
722 MESSAGE(STATUS ${CARBON_LIBRARY})
723 MARK_AS_ADVANCED (CARBON_LIBRARY)
724 MARK_AS_ADVANCED (QUICKTIME_LIBRARY)
725 MARK_AS_ADVANCED (OPENGL_LIBRARY)
726 MARK_AS_ADVANCED (AGL_LIBRARY)
727 MARK_AS_ADVANCED (APP_SERVICES_LIBRARY)
728 SET(EXTRA_LIBS ${CARBON_LIBRARY} ${QUICKTIME_LIBRARY} ${OPENGL_LIBRARY} ${AGL_LIBRARY} ${APP_SERVICES_LIBRARY})
729 TARGET_LINK_LIBRARIES(luxrender -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${wxWidgets_LIBRARIES} ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${EXTRA_LIBS} z ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES})
731 TARGET_LINK_LIBRARIES(luxrender -Wl,--whole-archive lux -Wl,--no-whole-archive ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARY} ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} ${SYS_LIBRARIES})
733 ENDIF(wxWidgets_FOUND)
737 #############################################################################
740 INSTALL(TARGETS luxrender luxconsole luxmerger
741 RUNTIME DESTINATION bin
745 INSTALL(FILES ${CMAKE_SOURCE_DIR}/core/api.h DESTINATION include/luxrender/)
746 INSTALL(TARGETS lux DESTINATION lib${LIB_SUFFIX})
747 # ELSE(FIND_LIBRARY_USE_LIB64_PATHS) ARCHIVE DESTINATION lib
748 # ENDIF(FIND_LIBRARY_USE_LIB64_PATHS)
751 #Install Desktop files
752 INSTALL(FILES ${CMAKE_SOURCE_DIR}/renderer/luxrender.svg DESTINATION share/pixmaps/)
753 INSTALL(FILES ${CMAKE_SOURCE_DIR}/renderer/luxrender.desktop DESTINATION share/applications/)
755 #Source package target
756 ADD_CUSTOM_TARGET(package mkdir lux-${VERSION}
757 COMMAND cp -R ${CMAKE_SOURCE_DIR}/* lux-${VERSION}
758 COMMAND tar -cf ${CMAKE_BINARY_DIR}/lux-${VERSION}.tar lux-${VERSION}
759 COMMAND bzip2 --best ${CMAKE_BINARY_DIR}/lux-${VERSION}.tar
760 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
761 DEPENDS ${lux_lib_src}
762 COMMENT Building source package
765 # Dade - GCC Profiling (remember to uncomment the line in the middle of file too)
766 #SET_TARGET_PROPERTIES(luxconsole luxmerger luxrender PROPERTIES LINK_FLAGS "-pg")
768 # Dade - GCC 2 pass optimization (remember to uncomment the line in the middle of file too)
769 #SET_TARGET_PROPERTIES(luxconsole luxmerger luxrender PROPERTIES LINK_FLAGS "--coverage")
771 # Dade - Intel Compiler optimization
772 #REMOVE_DEFINITIONS(-ipo)