1 cmake_minimum_required(VERSION 2.4)
2 IF(COMMAND cmake_policy)
3 cmake_policy(SET CMP0003 NEW)
4 ENDIF(COMMAND cmake_policy)
9 SET(LUX_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
10 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LUX_CMAKE_DIR}")
12 # Dade - uncomment to obtain verbose building output
13 #SET(CMAKE_VERBOSE_MAKEFILE true)
15 #Setting Universal Binary Properties, only for Mac OS X
17 SET(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
18 SET(CMAKE_OSX_ARCHITECTURES i386;x86_64)
19 SET(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
23 #############################################################################
24 #############################################################################
25 ### check for the CPU we build for ###
26 #############################################################################
27 #############################################################################
31 COMMAND ${CMAKE_C_COMPILER} -dumpmachine
32 OUTPUT_VARIABLE MACHINE
33 OUTPUT_STRIP_TRAILING_WHITESPACE
35 MESSAGE(STATUS "Building for target ${MACHINE}")
37 STRING(REGEX MATCH "(i.86-*)|(athlon-*)|(pentium-*)" _mach_x86 ${MACHINE})
42 STRING(REGEX MATCH "(x86_64-*)|(X86_64-*)|(AMD64-*)|(amd64-*)" _mach_x86_64 ${MACHINE})
46 #jromang - Hack to avoid boost bug on x64 Ubuntu 8.10 and Fedora 10 (http://www.luxrender.net/mantis/view.php?id=433)
47 ADD_DEFINITIONS(-DBOOST_NO_INTRINSIC_INT64_T)
50 STRING(REGEX MATCH "(ppc-*)|(powerpc-*)" _mach_ppc ${MACHINE})
56 #############################################################################
57 #############################################################################
58 ########################### Find BISON ###########################
59 #############################################################################
60 #############################################################################
61 FIND_PROGRAM(BISON_EXECUTABLE bison)
62 IF (NOT BISON_EXECUTABLE)
63 MESSAGE(FATAL_ERROR "bison not found - aborting")
64 ENDIF (NOT BISON_EXECUTABLE)
67 #############################################################################
68 #############################################################################
69 ########################### Find FLEX ###########################
70 #############################################################################
71 #############################################################################
72 FIND_PROGRAM(FLEX_EXECUTABLE flex)
73 IF (NOT FLEX_EXECUTABLE)
74 MESSAGE(FATAL_ERROR "flex not found - aborting")
75 ENDIF (NOT FLEX_EXECUTABLE)
79 #############################################################################
80 #############################################################################
81 ########################### BOOST LIBRARIES SETUP ###########################
82 #############################################################################
83 #############################################################################
85 FIND_PACKAGE(Boost 1.41 REQUIRED COMPONENTS python)
87 SET(Boost_python_FOUND ${Boost_FOUND})
88 SET(Boost_python_LIBRARIES ${Boost_LIBRARIES})
92 FIND_PACKAGE(Boost 1.41 REQUIRED COMPONENTS thread program_options filesystem serialization iostreams regex system)
95 MESSAGE(STATUS "Boost library directory: " ${Boost_LIBRARY_DIRS})
96 MESSAGE(STATUS "Boost include directory: " ${Boost_INCLUDE_DIRS})
98 MESSAGE(FATAL_ERROR "Could not find Boost")
102 #############################################################################
103 #############################################################################
104 ######################### OPENEXR LIBRARIES SETUP ###########################
105 #############################################################################
106 #############################################################################
108 # !!!!freeimage needs headers from openEXR 1.6x !!!!
109 FIND_PATH(OPENEXR_INCLUDE_DIRS
112 /usr/local/include/OpenEXR
115 /opt/local/include/OpenEXR
116 /opt/csw/include/OpenEXR
120 SET(OPENEXR_LIBRARIES Half IlmImf Iex Imath IlmThread)
122 SET(OPENEXR_LIBRARIES Half IlmImf Iex Imath)
125 #############################################################################
126 #############################################################################
127 ########################### PNG LIBRARIES SETUP ###########################
128 #############################################################################
129 #############################################################################
130 # - Find the native PNG includes and library
132 # This module defines
133 # PNG_INCLUDE_DIR, where to find png.h, etc.
134 # PNG_LIBRARIES, the libraries to link against to use PNG.
135 # PNG_DEFINITIONS - You should ADD_DEFINITONS(${PNG_DEFINITIONS}) before compiling code that includes png library files.
136 # PNG_FOUND, If false, do not try to use PNG.
137 # also defined, but not for general use are
138 # PNG_LIBRARY, where to find the PNG library.
139 # None of the above will be defined unles zlib can be found.
140 # PNG depends on Zlib
144 MESSAGE( STATUS "Warning : could not find PNG - building without png support")
146 #FIND_PACKAGE(PNG REQUIRED)
150 #############################################################################
151 #############################################################################
152 ########################### FREEIMAGE LIBRARIES ###########################
153 #############################################################################
154 #############################################################################
157 FIND_PATH(FREEIMAGE_INCLUDE_DIRS
163 SET(FREEIMAGE_LIBRARIES freeimage)
165 FIND_PACKAGE(FreeImage REQUIRED)
168 MESSAGE(STATUS "FreeImage library directory: " ${FREEIMAGE_LIBRARIES})
169 MESSAGE(STATUS "FreeImage include directory: " ${FREEIMAGE_INCLUDE_PATH})
170 ELSE(FREEIMAGE_FOUND)
171 MESSAGE(FATAL_ERROR "Could not find FreeImage")
172 ENDIF(FREEIMAGE_FOUND)
175 #############################################################################
176 #############################################################################
177 ############################ THREADING LIBRARIES ############################
178 #############################################################################
179 #############################################################################
181 FIND_PATH(THREADS_INCLUDE_DIRS
186 SET(THREADS_LIBRARIES pthread)
188 FIND_PACKAGE(Threads REQUIRED)
191 #############################################################################
192 #############################################################################
193 ########################### SYSTEM LIBRARIES ###########################
194 #############################################################################
195 #############################################################################
197 SET(SYS_LIBRARIES z bz2)
200 SET(SYS_LIBRARIES wsock32 ws2_32)
201 ADD_DEFINITIONS(-D_WIN32_WINNT=0x0551 -D__USE_W32_SOCKETS -D_GLIBCXX__PTHREADS)
204 #############################################################################
205 #############################################################################
206 ############################ DOXYGEN ############################
207 #############################################################################
208 #############################################################################
210 FIND_PACKAGE(Doxygen)
213 MESSAGE( STATUS "Found Doxygen and generating documentation" )
215 SET(DOXYGEN_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/doxygen/doxygen.template)
216 SET(DOXYGEN_INPUT ${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf)
217 SET(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doc)
218 SET(DOXYGEN_OUTPUT ${DOXYGEN_OUTPUT_DIR}/html/index.html)
220 MESSAGE( STATUS "Doxygen output:" ${DOXYGEN_OUTPUT} )
222 IF(DOXYGEN_DOT_FOUND)
223 MESSAGE( STATUS "Found dot" )
224 SET(DOXYGEN_DOT_CONF "HAVE_DOT = YES")
225 ENDIF(DOXYGEN_DOT_FOUND)
228 OUTPUT ${DOXYGEN_OUTPUT}
229 #creating custom doxygen.conf
230 COMMAND cp ${DOXYGEN_TEMPLATE} ${DOXYGEN_INPUT}
231 COMMAND echo "INPUT = " ${CMAKE_CURRENT_SOURCE_DIR} >> ${DOXYGEN_INPUT}
232 COMMAND echo "OUTPUT_DIRECTORY = " ${DOXYGEN_OUTPUT_DIR} >> ${DOXYGEN_INPUT}
233 COMMAND echo ${DOXYGEN_DOT_CONF} >> ${DOXYGEN_INPUT}
235 COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT}
236 DEPENDS ${DOXYGEN_TEMPLATE}
237 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
240 ADD_CUSTOM_TARGET(apidoc ALL DEPENDS ${DOXYGEN_OUTPUT})
241 ENDIF (DOXYGEN_FOUND)
244 #############################################################################
245 #All dependencies OK !
246 #############################################################################
248 #Generate the config.h file
249 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
250 ADD_DEFINITIONS(-DLUX_USE_CONFIG_H)
252 #############################################################################
253 #############################################################################
254 ######################### COMPILER FLAGS ###########################
255 #############################################################################
256 #############################################################################
257 # Dade - default compiler options
258 ADD_DEFINITIONS(-O3 -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall -fPIC -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
259 # The QBVH accelerator needs to be compiled with much reduced optimizations
260 # otherwise gcc produces incorrect code and ruins the render on 64bits machines
262 SET_SOURCE_FILES_PROPERTIES(accelerators/qbvhaccel.cpp COMPILE_FLAGS "-O1")
265 #############################################################################
266 # Compiler flags for specific setup
267 #############################################################################
269 # doug - When linking liblux as a python extension, need to compile with -fPIC
270 #ADD_DEFINITIONS(-fPIC)
272 # Jens - default Mac compiler options with OpenGL
273 #ADD_DEFINITIONS(-O3 -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller -fpic -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H )
274 # Jens - testing Mac compiler options (debug)
275 #ADD_DEFINITIONS(-DHAVE_PTHREAD_H)
277 # Dade - GCC Profiling (remember to uncomment the line at the end of file too)
278 #ADD_DEFINITIONS(-pg -g -O2 -msse2 -mfpmath=sse -ftree-vectorize -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
280 # Dade - GCC 2 pass optimization (remember to uncomment the line at the end of file too)
281 #ADD_DEFINITIONS(-O3 --coverage -march=prescott -mfpmath=sse -ftree-vectorize -funroll-loops -ffast-math -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
282 #ADD_DEFINITIONS(-O3 -fbranch-probabilities -march=prescott -mfpmath=sse -ftree-vectorize -funroll-loops -ffast-math -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
285 #ADD_DEFINITIONS(-g -O0 -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
286 #ADD_DEFINITIONS(-O3 -march=prescott -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
287 #ADD_DEFINITIONS(-O3 -march=athlon-xp -m3dnow -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H )
289 # Dade - Intel CC settings (double pass, 32bit, remember to uncomment the line at the end of file too)
290 # rm -rf CMakeCache.txt CMakeFiles
291 # CC=/opt/intel/cc/10.1.015/bin/icc CXX=/opt/intel/cc/10.1.015/bin/icpc cmake lux
293 #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)"')
295 #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)"')
297 # Dade - Intel CC settings (single pass, 32bit)
298 #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)"')
300 # Dade - Intel CC settings (single pass, 64bit)
301 #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)'")
303 #ADD_DEFINITIONS(-O3 -msse -mfpmath=sse -ftree-vectorize -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
304 #ADD_DEFINITIONS(-O3 -march=athlon-xp -mmmx -m3dnow -msse -mfpmath=sse -ftree-vectorize -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H )
305 #ADD_DEFINITIONS(-O3 -Wall -msse -msse2 -DLUX_USE_SSE -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
306 #ADD_DEFINITIONS(-g -Wall -msse -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
308 #ADD_DEFINITIONS(-O3 -ipo -no-prec-div -static -fp-model fast=2 -rcd)
310 #############################################################################
311 #############################################################################
312 ######################### CUSTOM COMMAND ###########################
313 #############################################################################
314 #############################################################################
315 # Create custom command for flex/lex (note the outputs)
317 SOURCE ${CMAKE_SOURCE_DIR}/core/luxlex.l
318 COMMAND ${FLEX_EXECUTABLE}
319 ARGS -o${CMAKE_BINARY_DIR}/luxlex.cpp
320 ${CMAKE_SOURCE_DIR}/core/luxlex.l
322 #DEPENDS ${CMAKE_BINARY_DIR}/core/pbrtparse.cpp ${lux_BINARY_DIR}/core/pbrtparse.h
323 OUTPUTS ${CMAKE_BINARY_DIR}/luxlex.cpp)
324 SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/luxlex.cpp GENERATED)
326 # Create custom command for bison/yacc (note the DEPENDS)
327 IF(APPLE AND !APPLE_64)
330 #DEPENDS ${CMAKE_BINARY_DIR}/core/luxlex.cpp
331 SOURCE ${CMAKE_SOURCE_DIR}/core/luxparse.y
332 COMMAND ${BISON_EXECUTABLE} -y ${CMAKE_SOURCE_DIR}/core/luxparse.y -o ${CMAKE_BINARY_DIR}/luxparse.cpp -d
333 COMMAND mv ${CMAKE_SOURCE_DIR}/luxparse.cpp.h ${CMAKE_BINARY_DIR}/luxparse.hpp
334 OUTPUTS ${CMAKE_BINARY_DIR}/luxparse.cpp ${CMAKE_BINARY_DIR}/luxparse.hpp)
335 ELSE(APPLE AND !APPLE_64)
337 SOURCE ${CMAKE_SOURCE_DIR}/core/luxparse.y
338 COMMAND ${BISON_EXECUTABLE}
339 ARGS -y ${CMAKE_SOURCE_DIR}/core/luxparse.y
340 -o ${CMAKE_BINARY_DIR}/luxparse.cpp
343 #DEPENDS ${CMAKE_BINARY_DIR}/core/luxlex.cpp
344 OUTPUTS ${CMAKE_BINARY_DIR}/luxparse.cpp ${CMAKE_BINARY_DIR}/luxparse.hpp)
345 ENDIF(APPLE AND !APPLE_64)
346 SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/core/luxparse.cpp GENERATED)
349 #############################################################################
350 #############################################################################
351 ################## APPLE CUSTOM GUI_TYPE MACOSX_BUNDLE ####################
352 #############################################################################
353 #############################################################################
355 ADD_CUSTOM_TARGET(dist DEPENDS luxrenderwx)
357 TARGET dist POST_BUILD
358 COMMAND rm -rf luxrenderwx.app
359 COMMAND mkdir luxrenderwx.app
360 COMMAND mkdir luxrenderwx.app/Contents
361 COMMAND mkdir luxrenderwx.app/Contents/MacOS
362 COMMAND mkdir luxrenderwx.app/Contents/Resources
363 COMMAND cp ../macos/Info.plist luxrenderwx.app/Contents
364 COMMAND cp luxrender.icns luxrenderwx.app/Contents/Resources
365 COMMAND echo APPLnone > luxrenderwx.app/Contents/PkgInfo
366 COMMAND cp luxrenderwx luxrenderwx.app/Contents/MacOS/luxrenderwx)
367 ADD_CUSTOM_TARGET(dist DEPENDS luxrender)
369 TARGET dist POST_BUILD
370 COMMAND rm -rf luxrender.app
371 COMMAND mkdir luxrender.app
372 COMMAND mkdir luxrender.app/Contents
373 COMMAND mkdir luxrender.app/Contents/MacOS
374 COMMAND mkdir luxrender.app/Contents/Resources
375 COMMAND cp ../macos/Info.plist luxrender.app/Contents
376 COMMAND cp luxrender.icns luxrender.app/Contents/Resources
377 COMMAND echo APPLnone > luxrender.app/Contents/PkgInfo
378 COMMAND cp luxrender luxrender.app/Contents/MacOS/luxrender)
380 SET(GUI_TYPE MACOSX_BUNDLE)
381 # SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
382 # Short Version is the "marketing version". It is the version
383 # the user sees in an information panel.
384 SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}")
385 # Bundle version is the version the OS looks at.
386 SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}")
387 SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.luxrender.luxrender" )
388 SET(MACOSX_BUNDLE_BUNDLE_NAME "luxrender" )
389 SET(MACOSX_BUNDLE_ICON_FILE "luxrender.icns")
390 # SET(MACOSX_BUNDLE_COPYRIGHT "")
391 # SET(MACOSX_BUNDLE_INFO_STRING "Info string, localized?")
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/brdftobtdf.cpp
406 core/reflection/bxdf/cooktorrance.cpp
407 core/reflection/bxdf/fresnelblend.cpp
408 core/reflection/bxdf/lafortune.cpp
409 core/reflection/bxdf/lambertian.cpp
410 core/reflection/bxdf/microfacet.cpp
411 core/reflection/bxdf/nulltransmission.cpp
412 core/reflection/bxdf/orennayar.cpp
413 core/reflection/bxdf/schlickbrdf.cpp
414 core/reflection/bxdf/specularreflection.cpp
415 core/reflection/bxdf/speculartransmission.cpp
416 core/reflection/fresnel/fresnelcauchy.cpp
417 core/reflection/fresnel/fresnelconductor.cpp
418 core/reflection/fresnel/fresneldielectric.cpp
419 core/reflection/fresnel/fresnelgeneral.cpp
420 core/reflection/fresnel/fresnelnoop.cpp
421 core/reflection/fresnel/fresnelslick.cpp
422 core/reflection/microfacetdistribution/anisotropic.cpp
423 core/reflection/microfacetdistribution/beckmann.cpp
424 core/reflection/microfacetdistribution/blinn.cpp
425 core/reflection/microfacetdistribution/wardisotropic.cpp
428 ${CMAKE_BINARY_DIR}/luxparse.cpp
429 ${CMAKE_BINARY_DIR}/luxlex.cpp
434 core/contribution.cpp
439 core/geometry/bbox.cpp
440 core/geometry/matrix4x4.cpp
441 core/geometry/quaternion.cpp
442 core/geometry/raydifferential.cpp
443 core/geometry/transform.cpp
449 core/motionsystem.cpp
455 core/queryable/queryable.cpp
456 core/queryable/queryableattribute.cpp
457 core/queryable/queryableregistry.cpp
458 ${lux_core_reflection_src}
460 core/renderinghints.cpp
466 core/spectrumwavelengths.cpp
473 renderer/renderserver.cpp
475 SET(lux_accelerators_src
476 accelerators/bruteforce.cpp
477 accelerators/bvhaccel.cpp
478 accelerators/grid.cpp
479 accelerators/qbvhaccel.cpp
480 accelerators/tabreckdtree.cpp
481 accelerators/unsafekdtree.cpp
484 cameras/environment.cpp
485 cameras/perspective.cpp
486 cameras/orthographic.cpp
487 cameras/realistic.cpp
499 SET(lux_integrators_src
500 integrators/bidirectional.cpp
501 integrators/directlighting.cpp
502 integrators/distributedpath.cpp
503 integrators/emission.cpp
504 integrators/exphotonmap.cpp
507 integrators/single.cpp
513 lights/infinitesample.cpp
514 lights/pointlight.cpp
515 lights/projection.cpp
516 lights/sphericalfunction/photometricdata_ies.cpp
517 lights/sphericalfunction/sphericalfunction.cpp
518 lights/sphericalfunction/sphericalfunction_ies.cpp
523 SET(lux_materials_src
524 materials/carpaint.cpp
528 materials/glossy2.cpp
530 materials/mattetranslucent.cpp
533 materials/mixmaterial.cpp
535 materials/roughglass.cpp
536 materials/shinymetal.cpp
538 SET(lux_pixelsamplers_src
539 pixelsamplers/hilbertpx.cpp
540 pixelsamplers/linear.cpp
541 pixelsamplers/lowdiscrepancypx.cpp
542 pixelsamplers/tilepx.cpp
543 pixelsamplers/vegas.cpp
547 samplers/lowdiscrepancy.cpp
548 samplers/metrosampler.cpp
555 shapes/heightfield.cpp
556 shapes/hyperboloid.cpp
557 shapes/lenscomponent.cpp
558 shapes/loopsubdiv.cpp
560 shapes/meshbarytriangle.cpp
561 shapes/meshquadrilateral.cpp
562 shapes/meshwaldtriangle.cpp
564 shapes/paraboloid.cpp
566 shapes/plymesh/rply.c
571 spds/blackbodyspd.cpp
573 spds/frequencyspd.cpp
580 SET(lux_blender_textures_src
581 textures/blender_base.cpp
582 textures/blender_blend.cpp
583 textures/blender_clouds.cpp
584 textures/blender_distortednoise.cpp
585 textures/blender_magic.cpp
586 textures/blender_marble.cpp
587 textures/blender_musgrave.cpp
588 textures/blender_noise.cpp
589 textures/blender_noiselib.cpp
590 textures/blender_stucci.cpp
591 textures/blender_texlib.cpp
592 textures/blender_voronoi.cpp
593 textures/blender_wood.cpp
595 SET(lux_uniform_textures_src
596 textures/blackbody.cpp
597 textures/constant.cpp
598 textures/equalenergy.cpp
599 textures/frequencytexture.cpp
600 textures/gaussiantexture.cpp
601 textures/irregulardata.cpp
602 textures/lampspectrum.cpp
603 textures/regulardata.cpp
604 textures/tabulateddata.cpp
606 SET(lux_fresnel_textures_src
607 textures/cauchytexture.cpp
608 textures/sellmeiertexture.cpp
609 textures/tabulatedfresnel.cpp
612 ${lux_uniform_textures_src}
613 ${lux_blender_textures_src}
614 ${lux_fresnel_textures_src}
617 textures/checkerboard.cpp
620 textures/harlequin.cpp
621 textures/imagemap.cpp
628 textures/wrinkled.cpp
631 tonemaps/contrast.cpp
632 tonemaps/highcontrast.cpp
633 tonemaps/lineartonemap.cpp
634 tonemaps/maxwhite.cpp
635 tonemaps/nonlinear.cpp
636 tonemaps/reinhard.cpp
639 volumes/clearvolume.cpp
641 volumes/exponential.cpp
642 volumes/homogeneous.cpp
643 volumes/volumegrid.cpp
648 ${lux_accelerators_src}
652 ${lux_integrators_src}
655 ${lux_pixelsamplers_src}
663 INCLUDE_DIRECTORIES(SYSTEM
664 ${Boost_INCLUDE_DIRS}
665 ${CMAKE_SOURCE_DIR}/core/external
669 ${OPENEXR_INCLUDE_DIRS}
671 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/core
672 ${CMAKE_SOURCE_DIR}/core/queryable
673 ${CMAKE_SOURCE_DIR}/core/reflection
674 ${CMAKE_SOURCE_DIR}/core/reflection/bxdf
675 ${CMAKE_SOURCE_DIR}/core/reflection/fresnel
676 ${CMAKE_SOURCE_DIR}/core/reflection/microfacetdistribution
677 ${CMAKE_SOURCE_DIR}/spds
678 ${CMAKE_SOURCE_DIR}/lights/sphericalfunction
685 qtgui/histogramview.cpp
689 qtgui/aboutdialog.cpp
690 qtgui/lightgroupwidget.cpp
691 qtgui/tonemapwidget.cpp
692 qtgui/lenseffectswidget.cpp
693 qtgui/colorspacewidget.cpp
694 qtgui/gammawidget.cpp
695 qtgui/noisereductionwidget.cpp
696 qtgui/histogramwidget.cpp
700 qtgui/histogramview.hxx
702 qtgui/aboutdialog.hxx
705 qtgui/lightgroupwidget.hxx
706 qtgui/tonemapwidget.hxx
707 qtgui/lenseffectswidget.hxx
708 qtgui/colorspacewidget.hxx
709 qtgui/gammawidget.hxx
710 qtgui/noisereductionwidget.hxx
711 qtgui/histogramwidget.hxx
722 qtgui/noisereduction.ui
732 #############################################################################
733 #############################################################################
734 ##################### LINKER INFO ######################
735 #############################################################################
736 #############################################################################
738 LINK_DIRECTORIES(${LINK_DIRECTORIES} ${Boost_LIBRARY_DIRS} )
740 #Here we build the core library
741 ADD_LIBRARY(lux STATIC ${lux_lib_src} )
742 #TARGET_LINK_LIBRARIES(lux ${FREEIMAGE_LIBRARIES} ${Boost_LIBRARIES} )
745 #############################################################################
746 #Here we build the console executable
747 #############################################################################
748 ADD_EXECUTABLE(luxconsole renderer/luxconsole.cpp)
750 TARGET_LINK_LIBRARIES(luxconsole -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${CMAKE_THREAD_LIBS_INIT} ${FREEIMAGE_LIBRARIES} z ${Boost_LIBRARIES} )
752 TARGET_LINK_LIBRARIES(luxconsole -Wl,--whole-archive lux -Wl,--no-whole-archive ${CMAKE_THREAD_LIBS_INIT} ${FREEIMAGE_LIBRARIES} ${Boost_LIBRARIES} ${SYS_LIBRARIES} ${OPENEXR_LIBRARIES} ${PNG_LIBRARY})
755 #############################################################################
756 #Here we build the LuxMerger executable
757 #############################################################################
758 ADD_EXECUTABLE(luxmerger tools/luxmerger.cpp)
760 TARGET_LINK_LIBRARIES(luxmerger -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${CMAKE_THREAD_LIBS_INIT} ${FREEIMAGE_LIBRARIES} z ${Boost_LIBRARIES} )
762 TARGET_LINK_LIBRARIES(luxmerger -Wl,--whole-archive lux -Wl,--no-whole-archive ${CMAKE_THREAD_LIBS_INIT} ${FREEIMAGE_LIBRARIES} ${Boost_LIBRARIES} ${SYS_LIBRARIES} ${OPENEXR_LIBRARIES} ${PNG_LIBRARY})
765 #############################################################################
766 #Here we build the LuxComp executable
767 #############################################################################
768 ADD_EXECUTABLE(luxcomp tools/luxcomp.cpp)
770 TARGET_LINK_LIBRARIES(luxcomp -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${CMAKE_THREAD_LIBS_INIT} ${FREEIMAGE_LIBRARIES} z ${Boost_LIBRARIES} )
772 TARGET_LINK_LIBRARIES(luxcomp -Wl,--whole-archive lux -Wl,--no-whole-archive ${CMAKE_THREAD_LIBS_INIT} ${FREEIMAGE_LIBRARIES} ${Boost_LIBRARIES} ${SYS_LIBRARIES} ${OPENEXR_LIBRARIES} ${PNG_LIBRARY})
775 #############################################################################
776 #Here we build the python module
777 #############################################################################
779 #############################################################################
780 #############################################################################
781 ########################### PYTHON LIBRARIES ###########################
782 #############################################################################
783 #############################################################################
784 FIND_PACKAGE(PythonLibs)
786 MESSAGE(STATUS "Python library directory: " ${PYTHON_LIBRARIES} )
787 MESSAGE(STATUS "Python include directory: " ${PYTHON_INCLUDE_PATH} )
789 INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_PATH})
791 ADD_LIBRARY(pylux MODULE python/binding.cpp)
792 TARGET_LINK_LIBRARIES(pylux -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${CMAKE_THREAD_LIBS_INIT} ${FREEIMAGE_LIBRARIES} ${Boost_LIBRARIES} ${EXTRA_LIBS} z bz2 ${SYS_LIBRARIES} ${PYTHON_LIBRARIES} ${Boost_python_LIBRARIES})
793 ### if XCode used for compiling ###
794 # ADD_CUSTOM_COMMAND(
795 # TARGET pylux POST_BUILD
796 # COMMAND mv release/libpylux.so release/pylux.so
799 ADD_LIBRARY(pylux SHARED python/binding.cpp)
800 TARGET_LINK_LIBRARIES(pylux -Wl,--whole-archive lux -Wl,--no-whole-archive ${CMAKE_THREAD_LIBS_INIT} ${FREEIMAGE_LIBRARIES} ${Boost_LIBRARIES} ${SYS_LIBRARIES} ${PYTHON_LIBRARIES} ${Boost_python_LIBRARIES} ${OPENEXR_LIBRARIES} ${PNG_LIBRARY})
802 TARGET pylux POST_BUILD
803 COMMAND mv libpylux.so pylux.so
806 ELSE(PYTHONLIBS_FOUND)
807 MESSAGE( STATUS "Warning : could not find Python libraries - not building python module")
808 ENDIF(PYTHONLIBS_FOUND)
811 #############################################################################
812 #Here we build the wxWidgets GUI executable
813 #############################################################################
815 #############################################################################
816 #############################################################################
817 ########################### Find OpenGL ##########################
818 #############################################################################
819 #############################################################################
820 SET(OPENGL_LIBRARY ${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
821 INCLUDE(${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
823 MESSAGE(STATUS "OpenGL include directory: " ${OPENGL_INCLUDE_DIR})
825 INCLUDE_DIRECTORIES(SYSTEM ${OPENGL_INCLUDE_DIR})
827 #############################################################################
828 #############################################################################
829 ######################### wxWidgets LIBRARIES SETUP #########################
830 #############################################################################
831 #############################################################################
832 # Here you can define what libraries of wxWidgets you need for your
833 # application. You can figure out what libraries you need here;
834 # http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
835 SET(wxWidgets_USE_LIBS base core gl aui adv )
836 FIND_PACKAGE(wxWidgets)
839 # Include wxWidgets macros
840 INCLUDE(${wxWidgets_USE_FILE})
841 MESSAGE( STATUS "wxWidgets include directory: " ${wxWidgets_INCLUDE_DIRS} )
843 ADD_EXECUTABLE(luxrenderwx ${GUI_TYPE} renderer/wxluxapp.cpp renderer/wxluxgui.cpp renderer/wxluxframe.cpp renderer/wxglviewer.cpp renderer/wxviewer.cpp)
844 INCLUDE_DIRECTORIES(SYSTEM ${wxWidgets_INCLUDE_DIRS} )
847 INCLUDE_DIRECTORIES (SYSTEM /Developer/Headers/FlatCarbon /usr/local/include)
848 FIND_LIBRARY(CARBON_LIBRARY Carbon)
849 FIND_LIBRARY(PYTHON_LIBRARY Python )
850 FIND_LIBRARY(OPENGL_LIBRARY OpenGL )
851 FIND_LIBRARY(AGL_LIBRARY AGL )
852 FIND_LIBRARY(APP_SERVICES_LIBRARY ApplicationServices )
854 MESSAGE(STATUS ${CARBON_LIBRARY})
855 MARK_AS_ADVANCED (CARBON_LIBRARY)
856 MARK_AS_ADVANCED (PYTHON_LIBRARY)
857 MARK_AS_ADVANCED (OPENGL_LIBRARY)
858 MARK_AS_ADVANCED (AGL_LIBRARY)
859 MARK_AS_ADVANCED (APP_SERVICES_LIBRARY)
860 SET(EXTRA_LIBS ${CARBON_LIBRARY} ${OPENGL_LIBRARY} ${AGL_LIBRARY} ${APP_SERVICES_LIBRARY})
861 TARGET_LINK_LIBRARIES(luxrenderwx -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${wxWidgets_LIBRARIES} ${FREEIMAGE_LIBRARIES} ${Boost_LIBRARIES} ${EXTRA_LIBS} z ${BZ2_LIBRARIES} )
863 TARGET_LINK_LIBRARIES(luxrenderwx -Wl,--whole-archive lux -Wl,--no-whole-archive ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARY} ${FREEIMAGE_LIBRARIES} ${Boost_LIBRARIES} ${SYS_LIBRARIES} ${OPENEXR_LIBRARIES} ${PNG_LIBRARY})
865 ELSE(wxWidgets_FOUND)
866 MESSAGE( STATUS "Warning : could not find wxWidgets - not building GUI")
867 ENDIF(wxWidgets_FOUND)
869 #############################################################################
870 #Here we build the QT4 GUI executable
871 #############################################################################
873 #############################################################################
874 #############################################################################
875 ############################ QT4 LIBRARIES #############################
876 #############################################################################
877 #############################################################################
881 MESSAGE(STATUS "Qt library directory: " ${QT_LIBRARY_DIR} )
882 MESSAGE( STATUS "Qt include directory: " ${QT_INCLUDE_DIR} )
883 SET(QT_USE_QTOPENGL TRUE)
884 INCLUDE(${QT_USE_FILE})
886 QT4_ADD_RESOURCES( LUXQTGUI_RC_SRCS ${LUXQTGUI_RCS})
887 QT4_WRAP_UI( LUXQTGUI_UI_HDRS ${LUXQTGUI_UIS} )
888 QT4_WRAP_CPP( LUXQTGUI_MOC_SRCS ${LUXQTGUI_MOC} )
890 #file (GLOB TRANSLATIONS_FILES qtgui/translations/*.ts)
891 #qt4_create_translation(QM_FILES ${FILES_TO_TRANSLATE} ${TRANSLATIONS_FILES})
893 #ADD_EXECUTABLE(luxrender ${GUI_TYPE} ${LUXQTGUI_SRCS} ${LUXQTGUI_MOC_SRCS} ${LUXQTGUI_RC_SRCS} ${LUXQTGUI_UI_HDRS} ${QM_FILES})
894 ADD_EXECUTABLE(luxrender ${GUI_TYPE} ${LUXQTGUI_SRCS} ${LUXQTGUI_MOC_SRCS} ${LUXQTGUI_RC_SRCS} ${LUXQTGUI_UI_HDRS})
896 INCLUDE_DIRECTORIES (SYSTEM /Developer/Headers/FlatCarbon /usr/local/include)
897 FIND_LIBRARY(CARBON_LIBRARY Carbon)
898 FIND_LIBRARY(PYTHON_LIBRARY Python )
899 FIND_LIBRARY(QT_LIBRARY QtCore QtGui QtOpenGL)
900 FIND_LIBRARY(OPENGL_LIBRARY OpenGL )
901 FIND_LIBRARY(AGL_LIBRARY AGL )
902 FIND_LIBRARY(APP_SERVICES_LIBRARY ApplicationServices )
904 MESSAGE(STATUS ${CARBON_LIBRARY})
905 MARK_AS_ADVANCED (CARBON_LIBRARY)
906 MARK_AS_ADVANCED (PYTHON_LIBRARY)
907 MARK_AS_ADVANCED (QT_LIBRARY)
908 MARK_AS_ADVANCED (OPENGL_LIBRARY)
909 MARK_AS_ADVANCED (AGL_LIBRARY)
910 MARK_AS_ADVANCED (APP_SERVICES_LIBRARY)
911 SET(EXTRA_LIBS ${CARBON_LIBRARY} ${QT_LIBRARY} ${OPENGL_LIBRARY} ${AGL_LIBRARY} ${APP_SERVICES_LIBRARY})
912 TARGET_LINK_LIBRARIES(luxrender -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${QT_LIBRARIES} ${FREEIMAGE_LIBRARIES} ${Boost_LIBRARIES} ${EXTRA_LIBS} z ${BZ2_LIBRARIES} )
913 ### if XCode used for compiling ###
914 # ADD_CUSTOM_COMMAND(
915 # TARGET luxrender POST_BUILD
916 # COMMAND rm -rf release/luxrender.app/Contents/Resources
917 # COMMAND mkdir release/luxrender.app/Contents/Resources
918 # COMMAND cp ../macos/luxrender.icns release/luxrender.app/Contents/Resources
919 # COMMAND cp ../macos/luxscene.icns release/luxrender.app/Contents/Resources
922 TARGET_LINK_LIBRARIES(luxrender -Wl,--whole-archive lux -Wl,--no-whole-archive ${QT_LIBRARIES} ${FREEIMAGE_LIBRARIES} ${Boost_LIBRARIES} ${EXTRA_LIBS} ${ZLIB_LIBRARIES} ${BZ2_LIBRARIES} ${SYS_LIBRARIES} ${OPENGL_LIBRARY} ${OPENEXR_LIBRARIES} ${PNG_LIBRARY})
925 MESSAGE( STATUS "Warning : could not find Qt - not building Qt GUI")
928 #############################################################################
932 INSTALL(TARGETS luxrender luxrenderwx luxconsole luxmerger
933 RUNTIME DESTINATION bin
935 ELSE(wxWidgets_FOUND)
936 INSTALL(TARGETS luxrender luxconsole luxmerger
937 RUNTIME DESTINATION bin
939 ENDIF(wxWidgets_FOUND)
942 INSTALL(FILES ${CMAKE_SOURCE_DIR}/core/api.h DESTINATION include/luxrender/)
943 INSTALL(TARGETS lux DESTINATION lib${LIB_SUFFIX})
944 # ELSE(FIND_LIBRARY_USE_LIB64_PATHS) ARCHIVE DESTINATION lib
945 # ENDIF(FIND_LIBRARY_USE_LIB64_PATHS)
948 #Install Desktop files
949 INSTALL(FILES ${CMAKE_SOURCE_DIR}/renderer/luxrender.svg DESTINATION share/pixmaps/)
950 INSTALL(FILES ${CMAKE_SOURCE_DIR}/renderer/luxrender.desktop DESTINATION share/applications/)
952 #Source package target
953 ADD_CUSTOM_TARGET(package mkdir lux-${VERSION}
954 COMMAND cp -R ${CMAKE_SOURCE_DIR}/* lux-${VERSION}
955 COMMAND tar -cf ${CMAKE_BINARY_DIR}/lux-${VERSION}.tar lux-${VERSION}
956 COMMAND bzip2 --best ${CMAKE_BINARY_DIR}/lux-${VERSION}.tar
957 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
958 DEPENDS ${lux_lib_src}
959 COMMENT Building source package
962 # Dade - GCC Profiling (remember to uncomment the line in the middle of file too)
963 #SET_TARGET_PROPERTIES(luxconsole luxmerger luxrender PROPERTIES LINK_FLAGS "-pg")
965 # Dade - GCC 2 pass optimization (remember to uncomment the line in the middle of file too)
966 #SET_TARGET_PROPERTIES(luxconsole luxmerger luxrender PROPERTIES LINK_FLAGS "--coverage")
968 # Dade - Intel Compiler optimization
969 #REMOVE_DEFINITIONS(-ipo)