CMakeLists.txt
author Jean-Philippe Grimaldi <jeanphi@via.ecp.fr>
Sun Sep 13 11:14:14 2009 +0200 (2009-09-13)
changeset 1554 52b36551c296
parent 1543 d364ab9febcd
child 1618 4d890a918061
child 1654 874d9025a703
permissions -rw-r--r--
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)
     5 
     6 PROJECT(lux)
     7 SET(VERSION 0.6)
     8 
     9 # Dade - uncomment to obtain verbose building output
    10 #SET(CMAKE_VERBOSE_MAKEFILE true)
    11 
    12 IF(APPLE)
    13 SET(APPLE_64 0)
    14 ENDIF(APPLE)
    15 
    16 #Setting Universal Binary Properties, only for Mac OS X
    17 IF(APPLE)
    18 	IF(APPLE_64)
    19 		SET(CMAKE_OSX_ARCHITECTURES ppc64;x86_64)
    20 		SET(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
    21 	ELSE(APPLE_64)
    22 		SET(CMAKE_OSX_ARCHITECTURES ppc;i386)
    23 		SET(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk)
    24 	ENDIF(APPLE_64)
    25 ENDIF(APPLE)
    26 
    27 
    28 #############################################################################
    29 #############################################################################
    30 ### check for the CPU we build for                                        ###
    31 #############################################################################
    32 #############################################################################
    33 
    34 EXECUTE_PROCESS(
    35     COMMAND ${CMAKE_C_COMPILER} -dumpmachine
    36     OUTPUT_VARIABLE MACHINE
    37     OUTPUT_STRIP_TRAILING_WHITESPACE
    38 )
    39 MESSAGE(STATUS "Building for target ${MACHINE}")
    40 
    41 STRING(REGEX MATCH "(i.86-*)|(athlon-*)|(pentium-*)" _mach_x86 ${MACHINE})
    42 IF (_mach_x86)
    43     SET(ARCH_X86 1)
    44 ENDIF (_mach_x86)
    45 
    46 STRING(REGEX MATCH "(x86_64-*)|(X86_64-*)|(AMD64-*)|(amd64-*)" _mach_x86_64 ${MACHINE})
    47 IF (_mach_x86_64)
    48     SET(ARCH_X86_64 1)
    49     SET(LIB_SUFFIX 64)
    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)
    52 ENDIF (_mach_x86_64)
    53 
    54 STRING(REGEX MATCH "(ppc-*)|(powerpc-*)" _mach_ppc ${MACHINE})
    55 IF (_mach_ppc)
    56     SET(ARCH_PPC 1)
    57 ENDIF (_mach_ppc)
    58 
    59 
    60 
    61 
    62 
    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)
    72 
    73 
    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)
    83 
    84 
    85 #############################################################################
    86 #############################################################################
    87 ###########################      Find OpenGL       ##########################
    88 #############################################################################
    89 #############################################################################
    90 SET(OPENGL_LIBRARY ${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
    91 INCLUDE(${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
    92 
    93 MESSAGE(STATUS "OpenGL include directory: " ${OPENGL_INCLUDE_DIR})
    94 
    95 
    96 #############################################################################
    97 #############################################################################
    98 ########################### BOOST LIBRARIES SETUP ###########################
    99 #############################################################################
   100 #############################################################################
   101 FIND_PACKAGE(Boost REQUIRED)
   102 IF(Boost_FOUND)
   103 	MESSAGE(STATUS "Boost library directory: " ${Boost_LIBRARY_DIRS})
   104 	MESSAGE(STATUS "Boost include directory: " ${Boost_INCLUDE_DIRS})
   105 	IF(CYGWIN)
   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)
   107 	ELSEIF(APPLE)
   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)
   114 	ENDIF(CYGWIN)
   115 ELSE(Boost_FOUND)
   116 	MESSAGE(FATAL_ERROR "Could not find Boost")
   117 ENDIF(Boost_FOUND)
   118 
   119 
   120 #############################################################################
   121 #############################################################################
   122 ######################### OPENEXR LIBRARIES SETUP ###########################
   123 #############################################################################
   124 #############################################################################
   125 FIND_PATH(OPENEXR_INCLUDE_DIRS
   126 	ImfXdr.h
   127 	PATHS
   128 	/usr/local/include/OpenEXR
   129 	/usr/include/OpenEXR
   130 	/sw/include/OpenEXR
   131 	/opt/local/include/OpenEXR
   132 	/opt/csw/include/OpenEXR
   133 	/opt/include/OpenEXR
   134 ) 
   135 IF(APPLE)
   136    SET(OPENEXR_LIBRARIES Half IlmImf Iex Imath IlmThread)
   137 
   138 ELSE(APPLE)
   139    SET(OPENEXR_LIBRARIES Half IlmImf Iex Imath)
   140 ENDIF(APPLE)
   141 
   142 #############################################################################
   143 #############################################################################
   144 ########################### PNG   LIBRARIES SETUP ###########################
   145 #############################################################################
   146 #############################################################################
   147 # - Find the native PNG includes and library
   148 #
   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
   158 INCLUDE(FindPNG)
   159 IF(PNG_FOUND)
   160 ELSE(PNG_FOUND)
   161 	MESSAGE( STATUS "Warning : could not find PNG - building without png support")
   162 ENDIF(PNG_FOUND)
   163 #FIND_PACKAGE(PNG REQUIRED)
   164 
   165 
   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.
   179 INCLUDE(FindTIFF)
   180 #FIND_PACKAGE(TIFF REQUIRED)
   181 IF(TIFF_FOUND)
   182 	MESSAGE( STATUS "Found TIFF: " ${TIFF_LIBRARIES} )
   183 ELSE(TIFF_FOUND)
   184 	MESSAGE( STATUS "Warning : could not find TIFF - building without tiff support")
   185 ENDIF(TIFF_FOUND)
   186 
   187 
   188 #############################################################################
   189 #############################################################################
   190 ########################### JPEG  LIBRARIES SETUP ###########################
   191 #############################################################################
   192 #############################################################################
   193 # - Find JPEG
   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.
   201 INCLUDE(FindJPEG)
   202 #FIND_PACKAGE(JPEG REQUIRED)
   203 IF(JPEG_FOUND)
   204 	MESSAGE( STATUS "JPEG include directory: " ${JPEG_INCLUDE_DIR} )
   205 ELSE(JPEG_FOUND)
   206 	MESSAGE( STATUS "Warning : could not find JPEG - building without jpeg support")
   207 ENDIF(JPEG_FOUND)
   208 
   209 
   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)
   220 IF(wxWidgets_FOUND)
   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)
   227 
   228 
   229 #############################################################################
   230 #############################################################################
   231 ############################ THREADING LIBRARIES ############################
   232 #############################################################################
   233 #############################################################################
   234 
   235 FIND_PACKAGE(Threads REQUIRED)
   236 
   237 
   238 #############################################################################
   239 #############################################################################
   240 ###########################   SYSTEM LIBRARIES    ###########################
   241 #############################################################################
   242 #############################################################################
   243 IF(APPLE)
   244 	SET(SYS_LIBRARIES z )
   245 ENDIF(APPLE)
   246 IF(CYGWIN)
   247 	SET(SYS_LIBRARIES wsock32 ws2_32)
   248 	ADD_DEFINITIONS(-D_WIN32_WINNT=0x0551 -D__USE_W32_SOCKETS -D_GLIBCXX__PTHREADS)
   249 ENDIF(CYGWIN)
   250 
   251 
   252 #############################################################################
   253 #All dependencies OK !
   254 #############################################################################
   255 
   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)
   259 
   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)
   267 
   268 
   269 #############################################################################
   270 # Compiler flags for specific setup
   271 #############################################################################
   272 
   273 # doug - When linking liblux as a python extension, need to compile with -fPIC
   274 #ADD_DEFINITIONS(-fPIC)
   275 
   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)
   280 
   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)
   283 
   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)
   287 
   288 # Dade - my settings
   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 )
   292 
   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
   296 # Pass 1
   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)"')
   298 # Pass 2
   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)"')
   300  
   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)"')
   303 
   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)'") 
   306 
   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)
   311 #ICC definitions
   312 #ADD_DEFINITIONS(-O3 -ipo -no-prec-div -static -fp-model fast=2 -rcd)
   313 
   314 #############################################################################
   315 #############################################################################
   316 #########################      CUSTOM COMMAND     ###########################
   317 #############################################################################
   318 #############################################################################
   319 # Create custom command for flex/lex (note the outputs)
   320 ADD_CUSTOM_COMMAND(
   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
   325 TARGET LuxLexer
   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)
   329 
   330 # Create custom command for bison/yacc (note the DEPENDS)
   331 IF(APPLE AND !APPLE_64)
   332 	ADD_CUSTOM_COMMAND(
   333 	TARGET LuxParser
   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)
   340 	ADD_CUSTOM_COMMAND(
   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
   345 	     -d
   346 	TARGET LuxParser
   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)
   351 
   352 
   353 #############################################################################
   354 #############################################################################
   355 #########################      APPLE CUSTOM PKG   ###########################
   356 #############################################################################
   357 #############################################################################
   358 IF(APPLE)
   359 	ADD_CUSTOM_TARGET(dist DEPENDS luxrender)
   360 	ADD_CUSTOM_COMMAND(
   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)
   371 ENDIF(APPLE)
   372 
   373 
   374 #############################################################################
   375 #############################################################################
   376 #####################      SOURCE FILE FOR lux_lib     ######################
   377 #############################################################################
   378 #############################################################################
   379 
   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
   402 	)
   403 SET(lux_core_src
   404 	${CMAKE_BINARY_DIR}/luxparse.cpp
   405 	${CMAKE_BINARY_DIR}/luxlex.cpp
   406 	core/api.cpp
   407 	core/camera.cpp
   408 	core/color.cpp
   409 	core/context.cpp
   410 	core/contribution.cpp
   411 	core/dynload.cpp
   412 	core/exrio.cpp
   413 	core/film.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
   419 	core/igiio.cpp
   420 	core/imagereader.cpp
   421 	core/light.cpp
   422 	core/material.cpp
   423 	core/mc.cpp
   424 	core/motionsystem.cpp
   425 	core/osfunc.cpp
   426 	core/paramset.cpp
   427 	core/parser.cpp
   428 	core/photonmap.cpp
   429 	core/pngio.cpp
   430 	core/primitive.cpp
   431 	${lux_core_reflection_src}
   432 	core/renderfarm.cpp
   433 	core/sampling.cpp
   434 	core/scene.cpp
   435 	core/shape.cpp
   436 	core/spd.cpp
   437 	core/spectrum.cpp
   438         core/spectrumwavelengths.cpp
   439 	core/texture.cpp
   440 	core/tgaio.cpp
   441 	core/timer.cpp
   442 	core/transport.cpp
   443 	core/util.cpp
   444 	core/volume.cpp
   445 	renderer/renderserver.cpp
   446 	)
   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
   454 	)
   455 SET(lux_cameras_src
   456 	cameras/environment.cpp
   457 	cameras/perspective.cpp
   458 	cameras/orthographic.cpp
   459 	cameras/realistic.cpp
   460 	)
   461 SET(lux_films_src
   462 	film/fleximage.cpp
   463 	)
   464 SET(lux_filters_src
   465 	filters/box.cpp
   466 	filters/gaussian.cpp
   467 	filters/mitchell.cpp
   468 	filters/sinc.cpp
   469 	filters/triangle.cpp
   470 	)
   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
   477 	integrators/igi.cpp
   478 	integrators/path.cpp
   479 	integrators/single.cpp
   480 	)
   481 SET(lux_lights_src
   482 	lights/area.cpp
   483 	lights/distant.cpp
   484 	lights/infinite.cpp
   485 	lights/infinitesample.cpp
   486 	lights/point.cpp
   487 	lights/projection.cpp
   488 	lights/sphericalfunction/photometricdata_ies.cpp
   489 	lights/sphericalfunction/sphericalfunction.cpp
   490 	lights/sphericalfunction/sphericalfunction_ies.cpp
   491 	lights/spot.cpp
   492 	lights/sky.cpp
   493 	lights/sun.cpp
   494 	)
   495 SET(lux_materials_src
   496 	materials/carpaint.cpp
   497 	materials/glass.cpp
   498 	materials/glossy.cpp
   499 	materials/matte.cpp
   500 	materials/mattetranslucent.cpp
   501 	materials/metal.cpp
   502 	materials/mirror.cpp
   503 	materials/mixmaterial.cpp
   504 	materials/null.cpp
   505 	materials/roughglass.cpp
   506 	materials/shinymetal.cpp
   507 	)
   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
   514 	)
   515 SET(lux_samplers_src
   516 	samplers/erpt.cpp
   517 	samplers/lowdiscrepancy.cpp
   518 	samplers/metrosampler.cpp
   519 	samplers/random.cpp
   520 	)
   521 SET(lux_shapes_src
   522 	shapes/cone.cpp
   523 	shapes/cylinder.cpp
   524 	shapes/disk.cpp
   525 	shapes/heightfield.cpp
   526 	shapes/hyperboloid.cpp
   527 	shapes/lenscomponent.cpp
   528 	shapes/loopsubdiv.cpp
   529 	shapes/mesh.cpp
   530 	shapes/meshbarytriangle.cpp
   531 	shapes/meshquadrilateral.cpp
   532 	shapes/meshwaldtriangle.cpp
   533 	shapes/nurbs.cpp
   534 	shapes/paraboloid.cpp
   535 	shapes/plymesh.cpp
   536 	shapes/plymesh/rply.c
   537 	shapes/quad.cpp
   538 	shapes/quadrilateral.cpp
   539 	shapes/sphere.cpp
   540 	shapes/torus.cpp
   541 	)
   542 SET(lux_spds_src
   543 	spds/blackbodyspd.cpp
   544 	spds/equalspd.cpp
   545 	spds/frequencyspd.cpp
   546 	spds/gaussianspd.cpp
   547 	spds/irregular.cpp
   548 	spds/regular.cpp
   549 	spds/rgbillum.cpp
   550 	spds/rgbrefl.cpp
   551 	)
   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
   565 	)
   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
   575 	)
   576 SET(lux_textures_src
   577 	${lux_uniform_textures_src}
   578 	${lux_blender_textures_src}
   579 	textures/bilerp.cpp
   580 	textures/brick.cpp
   581 	textures/checkerboard.cpp
   582 	textures/dots.cpp
   583         textures/fbm.cpp
   584 	textures/harlequin.cpp
   585 	textures/imagemap.cpp
   586 	textures/marble.cpp
   587 	textures/mix.cpp
   588 	textures/scale.cpp
   589 	textures/uv.cpp
   590 	textures/windy.cpp
   591 	textures/wrinkled.cpp
   592 	)
   593 SET(lux_tonemaps_src
   594 	tonemaps/contrast.cpp
   595 	tonemaps/highcontrast.cpp
   596 	tonemaps/lineartonemap.cpp
   597 	tonemaps/maxwhite.cpp
   598 	tonemaps/nonlinear.cpp
   599 	tonemaps/reinhard.cpp
   600 	)
   601 SET(lux_volumes_src
   602 	volumes/cloud.cpp
   603 	volumes/exponential.cpp
   604 	volumes/homogeneous.cpp
   605 	volumes/volumegrid.cpp
   606 	)
   607 
   608 SET(lux_lib_src
   609 	${lux_core_src}
   610 	${lux_accelerators_src}
   611 	${lux_cameras_src}
   612 	${lux_films_src}
   613 	${lux_filters_src}
   614 	${lux_integrators_src}
   615 	${lux_lights_src}
   616 	${lux_materials_src}
   617 	${lux_pixelsamplers_src}
   618 	${lux_samplers_src}
   619 	${lux_shapes_src}
   620 	${lux_spds_src}
   621 	${lux_textures_src}
   622 	${lux_tonemaps_src}
   623 	${lux_volumes_src}
   624 	)
   625 INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}
   626                     ${JPEG_INCLUDE_DIR}
   627 					${TIFF_INCLUDE_DIR}
   628 					${PNG_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
   640 					${CMAKE_BINARY_DIR}
   641 					)
   642 
   643 
   644 #############################################################################
   645 #############################################################################
   646 #####################            LINKER INFO           ######################
   647 #############################################################################
   648 #############################################################################
   649 
   650 LINK_DIRECTORIES(${LINK_DIRECTORIES} ${Boost_LIBRARY_DIRS} ${OPENEXR_LIB_DIRS} ${PNG_LIBRARY} ${TIFF_LIBRARY} ${JPEG_LIBRARY})
   651 
   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} )
   655 
   656 
   657 #############################################################################
   658 #Here we build the console executable
   659 #############################################################################
   660 ADD_EXECUTABLE(luxconsole renderer/luxconsole.cpp)
   661 IF(APPLE)
   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})
   663 ELSE(APPLE)
   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})
   665 ENDIF(APPLE)
   666 
   667 IF(APPLE)
   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?")
   680 ENDIF(APPLE)
   681 
   682 #############################################################################
   683 #Here we build the luxmerger executable
   684 #############################################################################
   685 ADD_EXECUTABLE(luxmerger tools/luxmerger.cpp)
   686 IF(APPLE)
   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})
   688 ELSE(APPLE)
   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})
   690 ENDIF(APPLE)
   691 
   692 IF(APPLE)
   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?")
   705 ENDIF(APPLE)
   706 
   707 #############################################################################
   708 #Here we build the wxWidgets GUI executable
   709 #############################################################################
   710 IF(wxWidgets_FOUND)
   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} )
   713 
   714 	IF(APPLE)
   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 )
   721 
   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})
   730 	ELSE(APPLE)
   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})
   732 	ENDIF(APPLE)
   733 ENDIF(wxWidgets_FOUND)
   734 
   735 
   736 
   737 #############################################################################
   738 
   739 #Install target
   740 INSTALL(TARGETS luxrender luxconsole luxmerger
   741         RUNTIME DESTINATION bin
   742 )
   743 
   744 #Install API/Library
   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)
   749 
   750 
   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/)
   754 
   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
   763 )
   764 
   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")
   767 
   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")
   770 
   771 # Dade - Intel Compiler optimization
   772 #REMOVE_DEFINITIONS(-ipo)