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 #############################################################################
102 FIND_PACKAGE(Boost 1.39.0 REQUIRED COMPONENTS system-xgcc40-mt-1_39 thread-xgcc40-mt-1_39 program_options-xgcc40-mt-1_39 filesystem-xgcc40-mt-1_39 serialization-xgcc40-mt-1_39 iostreams-xgcc40-mt-1_39 regex-xgcc40-mt-1_39)
104 FIND_PACKAGE(Boost 1.39.0 REQUIRED COMPONENTS thread program_options filesystem serialization iostreams regex system)
107 MESSAGE(STATUS "Boost library directory: " ${Boost_LIBRARY_DIRS})
108 MESSAGE(STATUS "Boost include directory: " ${Boost_INCLUDE_DIRS})
110 MESSAGE(FATAL_ERROR "Could not find Boost")
114 #############################################################################
115 #############################################################################
116 ######################### OPENEXR LIBRARIES SETUP ###########################
117 #############################################################################
118 #############################################################################
119 FIND_PATH(OPENEXR_INCLUDE_DIRS
122 /usr/local/include/OpenEXR
125 /opt/local/include/OpenEXR
126 /opt/csw/include/OpenEXR
130 SET(OPENEXR_LIBRARIES Half IlmImf Iex Imath IlmThread)
133 SET(OPENEXR_LIBRARIES Half IlmImf Iex Imath)
136 #############################################################################
137 #############################################################################
138 ########################### PNG LIBRARIES SETUP ###########################
139 #############################################################################
140 #############################################################################
141 # - Find the native PNG includes and library
143 # This module defines
144 # PNG_INCLUDE_DIR, where to find png.h, etc.
145 # PNG_LIBRARIES, the libraries to link against to use PNG.
146 # PNG_DEFINITIONS - You should ADD_DEFINITONS(${PNG_DEFINITIONS}) before compiling code that includes png library files.
147 # PNG_FOUND, If false, do not try to use PNG.
148 # also defined, but not for general use are
149 # PNG_LIBRARY, where to find the PNG library.
150 # None of the above will be defined unles zlib can be found.
151 # PNG depends on Zlib
155 MESSAGE( STATUS "Warning : could not find PNG - building without png support")
157 #FIND_PACKAGE(PNG REQUIRED)
160 #############################################################################
161 #############################################################################
162 ########################### TIFF LIBRARIES SETUP ###########################
163 #############################################################################
164 #############################################################################
165 # - Find TIFF library
166 # Find the native TIFF includes and library
167 # This module defines
168 # TIFF_INCLUDE_DIR, where to find tiff.h, etc.
169 # TIFF_LIBRARIES, libraries to link against to use TIFF.
170 # TIFF_FOUND, If false, do not try to use TIFF.
171 # also defined, but not for general use are
172 # TIFF_LIBRARY, where to find the TIFF library.
174 #FIND_PACKAGE(TIFF REQUIRED)
176 MESSAGE( STATUS "Found TIFF: " ${TIFF_LIBRARIES} )
178 MESSAGE( STATUS "Warning : could not find TIFF - building without tiff support")
182 #############################################################################
183 #############################################################################
184 ########################### JPEG LIBRARIES SETUP ###########################
185 #############################################################################
186 #############################################################################
188 # Find the native JPEG includes and library
189 # This module defines
190 # JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
191 # JPEG_LIBRARIES, the libraries needed to use JPEG.
192 # JPEG_FOUND, If false, do not try to use JPEG.
193 # also defined, but not for general use are
194 # JPEG_LIBRARY, where to find the JPEG library.
196 #FIND_PACKAGE(JPEG REQUIRED)
198 MESSAGE( STATUS "JPEG include directory: " ${JPEG_INCLUDE_DIR} )
200 MESSAGE( STATUS "Warning : could not find JPEG - building without jpeg support")
204 #############################################################################
205 #############################################################################
206 ######################### wxWidgets LIBRARIES SETUP #########################
207 #############################################################################
208 #############################################################################
209 # Here you can define what libraries of wxWidgets you need for your
210 # application. You can figure out what libraries you need here;
211 # http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
212 SET(wxWidgets_USE_LIBS base core gl aui adv )
213 FIND_PACKAGE(wxWidgets)
215 # Include wxWidgets macros
216 INCLUDE(${wxWidgets_USE_FILE})
217 MESSAGE( STATUS "wxWidgets include directory: " ${wxWidgets_INCLUDE_DIRS} )
218 ELSE(wxWidgets_FOUND)
219 MESSAGE( STATUS "Warning : could not find wxWidgets - not building GUI")
220 ENDIF(wxWidgets_FOUND)
223 #############################################################################
224 #############################################################################
225 ############################ THREADING LIBRARIES ############################
226 #############################################################################
227 #############################################################################
229 FIND_PACKAGE(Threads REQUIRED)
231 #############################################################################
232 #############################################################################
233 ############################ QT4 LIBRARIES #############################
234 #############################################################################
235 #############################################################################
239 MESSAGE(STATUS "Qt library directory: " ${QT_LIBRARY_DIR} )
240 MESSAGE( STATUS "Qt include directory: " ${QT_INCLUDE_DIR} )
241 SET(QT_USE_QTOPENGL TRUE)
242 INCLUDE(${QT_USE_FILE})
244 MESSAGE( STATUS "Warning : could not find Qt - not building Qt GUI")
247 #############################################################################
248 #############################################################################
249 ########################### SYSTEM LIBRARIES ###########################
250 #############################################################################
251 #############################################################################
253 SET(SYS_LIBRARIES z )
256 SET(SYS_LIBRARIES wsock32 ws2_32)
257 ADD_DEFINITIONS(-D_WIN32_WINNT=0x0551 -D__USE_W32_SOCKETS -D_GLIBCXX__PTHREADS)
261 #############################################################################
262 #All dependencies OK !
263 #############################################################################
265 #Generate the config.h file
266 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
267 ADD_DEFINITIONS(-DLUX_USE_CONFIG_H)
269 #############################################################################
270 #############################################################################
271 ######################### COMPILER FLAGS ###########################
272 #############################################################################
273 #############################################################################
274 # Dade - default compiler options
275 ADD_DEFINITIONS(-O3 -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
278 #############################################################################
279 # Compiler flags for specific setup
280 #############################################################################
282 # doug - When linking liblux as a python extension, need to compile with -fPIC
283 #ADD_DEFINITIONS(-fPIC)
285 # Jens - default Mac compiler options with OpenGL
286 #ADD_DEFINITIONS(-O3 -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H )
287 # Jens - testing Mac compiler options (debug)
288 #ADD_DEFINITIONS(-DHAVE_PTHREAD_H)
290 # Dade - GCC Profiling (remember to uncomment the line at the end of file too)
291 #ADD_DEFINITIONS(-pg -g -O2 -march=-msse -mfpmath=sse -ftree-vectorize -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
293 # Dade - GCC 2 pass optimization (remember to uncomment the line at the end of file too)
294 #ADD_DEFINITIONS(-O3 --coverage -march=prescott -mfpmath=sse -ftree-vectorize -funroll-loops -ffast-math -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
295 #ADD_DEFINITIONS(-O3 -fbranch-probabilities -march=prescott -mfpmath=sse -ftree-vectorize -funroll-loops -ffast-math -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
298 #ADD_DEFINITIONS(-g -O0 -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
299 #ADD_DEFINITIONS(-O3 -march=prescott -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
300 #ADD_DEFINITIONS(-O3 -march=athlon-xp -m3dnow -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H )
302 # Dade - Intel CC settings (double pass, 32bit, remember to uncomment the line at the end of file too)
303 # rm -rf CMakeCache.txt CMakeFiles
304 # CC=/opt/intel/cc/10.1.015/bin/icc CXX=/opt/intel/cc/10.1.015/bin/icpc cmake lux
306 #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)"')
308 #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)"')
310 # Dade - Intel CC settings (single pass, 32bit)
311 #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)"')
313 # Dade - Intel CC settings (single pass, 64bit)
314 #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)'")
316 #ADD_DEFINITIONS(-O3 -msse -mfpmath=sse -ftree-vectorize -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
317 #ADD_DEFINITIONS(-O3 -march=athlon-xp -mmmx -m3dnow -msse -mfpmath=sse -ftree-vectorize -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H )
318 #ADD_DEFINITIONS(-O3 -Wall -msse -msse2 -DLUX_USE_SSE -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
319 #ADD_DEFINITIONS(-g -Wall -msse -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
321 #ADD_DEFINITIONS(-O3 -ipo -no-prec-div -static -fp-model fast=2 -rcd)
323 #############################################################################
324 #############################################################################
325 ######################### CUSTOM COMMAND ###########################
326 #############################################################################
327 #############################################################################
328 # Create custom command for flex/lex (note the outputs)
330 SOURCE ${CMAKE_SOURCE_DIR}/core/luxlex.l
331 COMMAND ${FLEX_EXECUTABLE}
332 ARGS -o${CMAKE_BINARY_DIR}/luxlex.cpp
333 ${CMAKE_SOURCE_DIR}/core/luxlex.l
335 #DEPENDS ${CMAKE_BINARY_DIR}/core/pbrtparse.cpp ${lux_BINARY_DIR}/core/pbrtparse.h
336 OUTPUTS ${CMAKE_BINARY_DIR}/luxlex.cpp)
337 SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/luxlex.cpp GENERATED)
339 # Create custom command for bison/yacc (note the DEPENDS)
340 IF(APPLE AND !APPLE_64)
343 #DEPENDS ${CMAKE_BINARY_DIR}/core/luxlex.cpp
344 SOURCE ${CMAKE_SOURCE_DIR}/core/luxparse.y
345 COMMAND ${BISON_EXECUTABLE} -y ${CMAKE_SOURCE_DIR}/core/luxparse.y -o ${CMAKE_BINARY_DIR}/luxparse.cpp -d
346 COMMAND mv ${CMAKE_SOURCE_DIR}/luxparse.cpp.h ${CMAKE_BINARY_DIR}/luxparse.hpp
347 OUTPUTS ${CMAKE_BINARY_DIR}/luxparse.cpp ${CMAKE_BINARY_DIR}/luxparse.hpp)
348 ELSE(APPLE AND !APPLE_64)
350 SOURCE ${CMAKE_SOURCE_DIR}/core/luxparse.y
351 COMMAND ${BISON_EXECUTABLE}
352 ARGS -y ${CMAKE_SOURCE_DIR}/core/luxparse.y
353 -o ${CMAKE_BINARY_DIR}/luxparse.cpp
356 #DEPENDS ${CMAKE_BINARY_DIR}/core/luxlex.cpp
357 OUTPUTS ${CMAKE_BINARY_DIR}/luxparse.cpp ${CMAKE_BINARY_DIR}/luxparse.hpp)
358 ENDIF(APPLE AND !APPLE_64)
359 SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/core/luxparse.cpp GENERATED)
362 #############################################################################
363 #############################################################################
364 ######################### APPLE CUSTOM PKG ###########################
365 #############################################################################
366 #############################################################################
368 ADD_CUSTOM_TARGET(dist DEPENDS luxrender)
370 TARGET dist POST_BUILD
371 COMMAND rm -rf LuxRender.app
372 COMMAND mkdir LuxRender.app
373 COMMAND mkdir LuxRender.app/Contents
374 COMMAND mkdir LuxRender.app/Contents/MacOS
375 COMMAND mkdir LuxRender.app/Contents/Resources
376 COMMAND cp ../macos/Info.plist LuxRender.app/Contents
377 COMMAND cp LuxRender.icns LuxRender.app/Contents/Resources
378 COMMAND echo APPLnone > LuxRender.app/Contents/PkgInfo
379 COMMAND cp luxrender LuxRender.app/Contents/MacOS/LuxRender)
380 ADD_CUSTOM_TARGET(dist DEPENDS luxrenderqt)
382 TARGET dist POST_BUILD
383 COMMAND rm -rf luxrenderqt.app
384 COMMAND mkdir luxrenderqt.app
385 COMMAND mkdir luxrenderqt.app/Contents
386 COMMAND mkdir luxrenderqt.app/Contents/MacOS
387 COMMAND mkdir luxrenderqt.app/Contents/Resources
388 COMMAND cp ../macos/Info.plist luxrenderqt.app/Contents
389 COMMAND cp luxrender.icns luxrenderqt.app/Contents/Resources
390 COMMAND echo APPLnone > luxrenderqt.app/Contents/PkgInfo
391 COMMAND cp luxrenderqt luxrenderqt.app/Contents/MacOS/luxrenderqt)
395 #############################################################################
396 #############################################################################
397 ##################### SOURCE FILE FOR lux_lib ######################
398 #############################################################################
399 #############################################################################
401 SET(lux_core_reflection_src
402 core/reflection/bxdf.cpp
403 core/reflection/fresnel.cpp
404 core/reflection/microfacetdistribution.cpp
405 core/reflection/bxdf/cooktorrance.cpp
406 core/reflection/bxdf/fresnelblend.cpp
407 core/reflection/bxdf/lafortune.cpp
408 core/reflection/bxdf/lambertian.cpp
409 core/reflection/bxdf/microfacet.cpp
410 core/reflection/bxdf/nulltransmission.cpp
411 core/reflection/bxdf/orennayar.cpp
412 core/reflection/bxdf/specularreflection.cpp
413 core/reflection/bxdf/speculartransmission.cpp
414 core/reflection/fresnel/fresnelnoop.cpp
415 core/reflection/fresnel/fresneldielectric.cpp
416 core/reflection/fresnel/fresnelconductor.cpp
417 core/reflection/fresnel/fresnelslick.cpp
418 core/reflection/fresnel/fresnelgeneral.cpp
419 core/reflection/microfacetdistribution/anisotropic.cpp
420 core/reflection/microfacetdistribution/beckmann.cpp
421 core/reflection/microfacetdistribution/blinn.cpp
422 core/reflection/microfacetdistribution/wardisotropic.cpp
425 ${CMAKE_BINARY_DIR}/luxparse.cpp
426 ${CMAKE_BINARY_DIR}/luxlex.cpp
432 core/contribution.cpp
436 core/geometry/bbox.cpp
437 core/geometry/matrix4x4.cpp
438 core/geometry/quaternion.cpp
439 core/geometry/raydifferential.cpp
440 core/geometry/transform.cpp
446 core/motionsystem.cpp
453 ${lux_core_reflection_src}
460 core/spectrumwavelengths.cpp
467 renderer/renderserver.cpp
469 SET(lux_accelerators_src
470 accelerators/bruteforce.cpp
471 accelerators/bvhaccel.cpp
472 accelerators/grid.cpp
473 accelerators/qbvhaccel.cpp
474 accelerators/tabreckdtree.cpp
475 accelerators/unsafekdtree.cpp
478 cameras/environment.cpp
479 cameras/perspective.cpp
480 cameras/orthographic.cpp
481 cameras/realistic.cpp
493 SET(lux_integrators_src
494 integrators/bidirectional.cpp
495 integrators/directlighting.cpp
496 integrators/distributedpath.cpp
497 integrators/emission.cpp
498 integrators/exphotonmap.cpp
501 integrators/single.cpp
507 lights/infinitesample.cpp
508 lights/pointlight.cpp
509 lights/projection.cpp
510 lights/sphericalfunction/photometricdata_ies.cpp
511 lights/sphericalfunction/sphericalfunction.cpp
512 lights/sphericalfunction/sphericalfunction_ies.cpp
517 SET(lux_materials_src
518 materials/carpaint.cpp
522 materials/mattetranslucent.cpp
525 materials/mixmaterial.cpp
527 materials/roughglass.cpp
528 materials/shinymetal.cpp
530 SET(lux_pixelsamplers_src
531 pixelsamplers/hilbertpx.cpp
532 pixelsamplers/linear.cpp
533 pixelsamplers/lowdiscrepancypx.cpp
534 pixelsamplers/tilepx.cpp
535 pixelsamplers/vegas.cpp
539 samplers/lowdiscrepancy.cpp
540 samplers/metrosampler.cpp
547 shapes/heightfield.cpp
548 shapes/hyperboloid.cpp
549 shapes/lenscomponent.cpp
550 shapes/loopsubdiv.cpp
552 shapes/meshbarytriangle.cpp
553 shapes/meshquadrilateral.cpp
554 shapes/meshwaldtriangle.cpp
556 shapes/paraboloid.cpp
558 shapes/plymesh/rply.c
563 spds/blackbodyspd.cpp
565 spds/frequencyspd.cpp
572 SET(lux_blender_textures_src
573 textures/blender_blend.cpp
574 textures/blender_clouds.cpp
575 textures/blender_distortednoise.cpp
576 textures/blender_magic.cpp
577 textures/blender_marble.cpp
578 textures/blender_musgrave.cpp
579 textures/blender_noise.cpp
580 textures/blender_noiselib.cpp
581 textures/blender_stucci.cpp
582 textures/blender_texlib.cpp
583 textures/blender_voronoi.cpp
584 textures/blender_wood.cpp
586 SET(lux_uniform_textures_src
587 textures/blackbody.cpp
588 textures/constant.cpp
589 textures/equalenergy.cpp
590 textures/frequencytexture.cpp
591 textures/gaussiantexture.cpp
592 textures/irregulardata.cpp
593 textures/lampspectrum.cpp
594 textures/regulardata.cpp
596 SET(lux_fresnel_textures_src
597 textures/cauchytexture.cpp
598 textures/sopratexture.cpp
601 ${lux_uniform_textures_src}
602 ${lux_blender_textures_src}
603 ${lux_fresnel_textures_src}
606 textures/checkerboard.cpp
609 textures/harlequin.cpp
610 textures/imagemap.cpp
616 textures/wrinkled.cpp
619 tonemaps/contrast.cpp
620 tonemaps/highcontrast.cpp
621 tonemaps/lineartonemap.cpp
622 tonemaps/maxwhite.cpp
623 tonemaps/nonlinear.cpp
624 tonemaps/reinhard.cpp
628 volumes/exponential.cpp
629 volumes/homogeneous.cpp
630 volumes/volumegrid.cpp
635 ${lux_accelerators_src}
639 ${lux_integrators_src}
642 ${lux_pixelsamplers_src}
650 INCLUDE_DIRECTORIES(SYSTEM ${OPENGL_INCLUDE_DIR}
654 ${OPENEXR_INCLUDE_DIRS}
655 ${Boost_INCLUDE_DIRS}
656 ${CMAKE_SOURCE_DIR}/core/external
658 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/core
659 ${CMAKE_SOURCE_DIR}/core/reflection
660 ${CMAKE_SOURCE_DIR}/core/reflection/bxdf
661 ${CMAKE_SOURCE_DIR}/core/reflection/fresnel
662 ${CMAKE_SOURCE_DIR}/core/reflection/microfacetdistribution
663 ${CMAKE_SOURCE_DIR}/spds
664 ${CMAKE_SOURCE_DIR}/lights/sphericalfunction
671 qtgui/histogramview.cpp
675 qtgui/aboutdialog.cpp
676 qtgui/lightgroupwidget.cpp
679 qtgui/histogramview.hxx
681 qtgui/aboutdialog.hxx
684 qtgui/lightgroupwidget.hxx
697 #############################################################################
698 #############################################################################
699 ##################### LINKER INFO ######################
700 #############################################################################
701 #############################################################################
703 LINK_DIRECTORIES(${LINK_DIRECTORIES} ${Boost_LIBRARY_DIRS} ${OPENEXR_LIB_DIRS} ${PNG_LIBRARY} ${TIFF_LIBRARY} ${JPEG_LIBRARY})
705 #Here we build the core library
706 ADD_LIBRARY(lux STATIC ${lux_lib_src} )
707 #TARGET_LINK_LIBRARIES(lux ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} )
710 #############################################################################
711 #Here we build the console executable
712 #############################################################################
713 ADD_EXECUTABLE(luxconsole renderer/luxconsole.cpp)
715 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})
717 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})
721 SET(GUI_TYPE MACOSX_BUNDLE)
722 # SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
723 # Short Version is the "marketing version". It is the version
724 # the user sees in an information panel.
725 SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}")
726 # Bundle version is the version the OS looks at.
727 SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}")
728 SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.luxrender.luxrender" )
729 SET(MACOSX_BUNDLE_BUNDLE_NAME "luxrender" )
730 SET(MACOSX_BUNDLE_ICON_FILE "LuxRender.icns")
731 # SET(MACOSX_BUNDLE_COPYRIGHT "")
732 # SET(MACOSX_BUNDLE_INFO_STRING "Info string, localized?")
735 #############################################################################
736 #Here we build the luxmerger executable
737 #############################################################################
738 ADD_EXECUTABLE(luxmerger tools/luxmerger.cpp)
740 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})
742 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})
746 SET(GUI_TYPE MACOSX_BUNDLE)
747 # SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
748 # Short Version is the "marketing version". It is the version
749 # the user sees in an information panel.
750 SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}")
751 # Bundle version is the version the OS looks at.
752 SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}")
753 SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.luxrender.luxrender" )
754 SET(MACOSX_BUNDLE_BUNDLE_NAME "luxrender" )
755 SET(MACOSX_BUNDLE_ICON_FILE "LuxRender.icns")
756 # SET(MACOSX_BUNDLE_COPYRIGHT "")
757 # SET(MACOSX_BUNDLE_INFO_STRING "Info string, localized?")
760 #############################################################################
761 #Here we build the luxcomp executable
762 #############################################################################
763 ADD_EXECUTABLE(luxcomp tools/luxcomp.cpp)
765 TARGET_LINK_LIBRARIES(luxcomp -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})
767 TARGET_LINK_LIBRARIES(luxcomp -Wl,--whole-archive lux -Wl,--no-whole-archive ${CMAKE_THREAD_LIBS_INIT} ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} ${SYS_LIBRARIES})
771 SET(GUI_TYPE MACOSX_BUNDLE)
772 # SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
773 # Short Version is the "marketing version". It is the version
774 # the user sees in an information panel.
775 SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}")
776 # Bundle version is the version the OS looks at.
777 SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}")
778 SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.luxrender.luxrender" )
779 SET(MACOSX_BUNDLE_BUNDLE_NAME "luxrender" )
780 SET(MACOSX_BUNDLE_ICON_FILE "LuxRender.icns")
781 # SET(MACOSX_BUNDLE_COPYRIGHT "")
782 # SET(MACOSX_BUNDLE_INFO_STRING "Info string, localized?")
785 #############################################################################
786 #Here we build the wxWidgets GUI executable
787 #############################################################################
789 ADD_EXECUTABLE(luxrender ${GUI_TYPE} renderer/wxluxapp.cpp renderer/wxluxgui.cpp renderer/wxluxframe.cpp renderer/wxglviewer.cpp renderer/wxviewer.cpp)
790 INCLUDE_DIRECTORIES( ${wxWidgets_INCLUDE_DIRS} )
793 INCLUDE_DIRECTORIES ( /Developer/Headers/FlatCarbon /usr/local/include)
794 FIND_LIBRARY(CARBON_LIBRARY Carbon)
795 FIND_LIBRARY(QUICKTIME_LIBRARY QuickTime )
796 FIND_LIBRARY(OPENGL_LIBRARY OpenGL )
797 FIND_LIBRARY(AGL_LIBRARY AGL )
798 FIND_LIBRARY(APP_SERVICES_LIBRARY ApplicationServices )
800 MESSAGE(STATUS ${CARBON_LIBRARY})
801 MARK_AS_ADVANCED (CARBON_LIBRARY)
802 MARK_AS_ADVANCED (QUICKTIME_LIBRARY)
803 MARK_AS_ADVANCED (OPENGL_LIBRARY)
804 MARK_AS_ADVANCED (AGL_LIBRARY)
805 MARK_AS_ADVANCED (APP_SERVICES_LIBRARY)
806 SET(EXTRA_LIBS ${CARBON_LIBRARY} ${QUICKTIME_LIBRARY} ${OPENGL_LIBRARY} ${AGL_LIBRARY} ${APP_SERVICES_LIBRARY})
807 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})
809 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})
811 ENDIF(wxWidgets_FOUND)
813 #############################################################################
814 #Here we build the QT4 GUI executable
815 #############################################################################
817 QT4_ADD_RESOURCES( LUXQTGUI_RC_SRCS ${LUXQTGUI_RCS})
818 QT4_WRAP_UI( LUXQTGUI_UI_HDRS ${LUXQTGUI_UIS} )
819 QT4_WRAP_CPP( LUXQTGUI_MOC_SRCS ${LUXQTGUI_MOC} )
821 file (GLOB TRANSLATIONS_FILES qtgui/translations/*.ts)
822 qt4_create_translation(QM_FILES ${FILES_TO_TRANSLATE} ${TRANSLATIONS_FILES})
824 ADD_EXECUTABLE(luxrenderqt ${GUI_TYPE} ${LUXQTGUI_SRCS} ${LUXQTGUI_MOC_SRCS} ${LUXQTGUI_RC_SRCS} ${LUXQTGUI_UI_HDRS} ${QM_FILES})
826 INCLUDE_DIRECTORIES ( /Developer/Headers/FlatCarbon /usr/local/include)
827 FIND_LIBRARY(CARBON_LIBRARY Carbon)
828 FIND_LIBRARY(QUICKTIME_LIBRARY QuickTime )
829 FIND_LIBRARY(QT_LIBRARY QTCore QTGui QTOpenGL)
830 FIND_LIBRARY(OPENGL_LIBRARY OpenGL )
831 FIND_LIBRARY(AGL_LIBRARY AGL )
832 FIND_LIBRARY(APP_SERVICES_LIBRARY ApplicationServices )
834 MESSAGE(STATUS ${CARBON_LIBRARY})
835 MARK_AS_ADVANCED (CARBON_LIBRARY)
836 MARK_AS_ADVANCED (QUICKTIME_LIBRARY)
837 MARK_AS_ADVANCED (QT_LIBRARY)
838 MARK_AS_ADVANCED (OPENGL_LIBRARY)
839 MARK_AS_ADVANCED (AGL_LIBRARY)
840 MARK_AS_ADVANCED (APP_SERVICES_LIBRARY)
841 SET(EXTRA_LIBS ${CARBON_LIBRARY} ${QUICKTIME_LIBRARY} ${QT_LIBRARY} ${OPENGL_LIBRARY} ${AGL_LIBRARY} ${APP_SERVICES_LIBRARY})
842 TARGET_LINK_LIBRARIES(luxrenderqt -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${QT_LIBRARIES} ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${EXTRA_LIBS} z ${BZ2_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES})
844 TARGET_LINK_LIBRARIES(luxrenderqt -Wl,--whole-archive lux -Wl,--no-whole-archive ${QT_LIBRARIES} ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${EXTRA_LIBS} ${ZLIB_LIBRARIES} ${BZ2_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} ${SYS_LIBRARIES} ${OPENGL_LIBRARY})
848 #############################################################################
851 INSTALL(TARGETS luxrender luxrenderqt luxconsole luxmerger
852 RUNTIME DESTINATION bin
856 INSTALL(FILES ${CMAKE_SOURCE_DIR}/core/api.h DESTINATION include/luxrender/)
857 INSTALL(TARGETS lux DESTINATION lib${LIB_SUFFIX})
858 # ELSE(FIND_LIBRARY_USE_LIB64_PATHS) ARCHIVE DESTINATION lib
859 # ENDIF(FIND_LIBRARY_USE_LIB64_PATHS)
862 #Install Desktop files
863 INSTALL(FILES ${CMAKE_SOURCE_DIR}/renderer/luxrender.svg DESTINATION share/pixmaps/)
864 INSTALL(FILES ${CMAKE_SOURCE_DIR}/renderer/luxrender.desktop DESTINATION share/applications/)
866 #Source package target
867 ADD_CUSTOM_TARGET(package mkdir lux-${VERSION}
868 COMMAND cp -R ${CMAKE_SOURCE_DIR}/* lux-${VERSION}
869 COMMAND tar -cf ${CMAKE_BINARY_DIR}/lux-${VERSION}.tar lux-${VERSION}
870 COMMAND bzip2 --best ${CMAKE_BINARY_DIR}/lux-${VERSION}.tar
871 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
872 DEPENDS ${lux_lib_src}
873 COMMENT Building source package
876 # Dade - GCC Profiling (remember to uncomment the line in the middle of file too)
877 #SET_TARGET_PROPERTIES(luxconsole luxmerger luxrender PROPERTIES LINK_FLAGS "-pg")
879 # Dade - GCC 2 pass optimization (remember to uncomment the line in the middle of file too)
880 #SET_TARGET_PROPERTIES(luxconsole luxmerger luxrender PROPERTIES LINK_FLAGS "--coverage")
882 # Dade - Intel Compiler optimization
883 #REMOVE_DEFINITIONS(-ipo)