CMakeLists.txt
author David Bucciarelli <dade@ngi.it>
Mon Nov 23 11:33:31 2009 +0100 (2009-11-23)
changeset 1818 37afb7ad630a
parent 1814 f9fc801097d3
parent 1801 0d719801cf15
child 1822 17047f5d1b02
child 1833 5e9d1bfe69a4
permissions -rw-r--r--
Merge
     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 IF(APPLE)
   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)
   103 ELSE(APPLE)
   104 	FIND_PACKAGE(Boost 1.39.0 REQUIRED COMPONENTS thread program_options filesystem serialization iostreams regex system)
   105 ENDIF(APPLE)
   106 IF(Boost_FOUND)
   107 	MESSAGE(STATUS "Boost library directory: " ${Boost_LIBRARY_DIRS})
   108 	MESSAGE(STATUS "Boost include directory: " ${Boost_INCLUDE_DIRS})
   109 ELSE(Boost_FOUND)
   110 	MESSAGE(FATAL_ERROR "Could not find Boost")
   111 ENDIF(Boost_FOUND)
   112 
   113 
   114 #############################################################################
   115 #############################################################################
   116 ######################### OPENEXR LIBRARIES SETUP ###########################
   117 #############################################################################
   118 #############################################################################
   119 FIND_PATH(OPENEXR_INCLUDE_DIRS
   120 	ImfXdr.h
   121 	PATHS
   122 	/usr/local/include/OpenEXR
   123 	/usr/include/OpenEXR
   124 	/sw/include/OpenEXR
   125 	/opt/local/include/OpenEXR
   126 	/opt/csw/include/OpenEXR
   127 	/opt/include/OpenEXR
   128 ) 
   129 IF(APPLE)
   130    SET(OPENEXR_LIBRARIES Half IlmImf Iex Imath IlmThread)
   131 
   132 ELSE(APPLE)
   133    SET(OPENEXR_LIBRARIES Half IlmImf Iex Imath)
   134 ENDIF(APPLE)
   135 
   136 #############################################################################
   137 #############################################################################
   138 ########################### PNG   LIBRARIES SETUP ###########################
   139 #############################################################################
   140 #############################################################################
   141 # - Find the native PNG includes and library
   142 #
   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
   152 INCLUDE(FindPNG)
   153 IF(PNG_FOUND)
   154 ELSE(PNG_FOUND)
   155 	MESSAGE( STATUS "Warning : could not find PNG - building without png support")
   156 ENDIF(PNG_FOUND)
   157 #FIND_PACKAGE(PNG REQUIRED)
   158 
   159 
   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.
   173 INCLUDE(FindTIFF)
   174 #FIND_PACKAGE(TIFF REQUIRED)
   175 IF(TIFF_FOUND)
   176 	MESSAGE( STATUS "Found TIFF: " ${TIFF_LIBRARIES} )
   177 ELSE(TIFF_FOUND)
   178 	MESSAGE( STATUS "Warning : could not find TIFF - building without tiff support")
   179 ENDIF(TIFF_FOUND)
   180 
   181 
   182 #############################################################################
   183 #############################################################################
   184 ########################### JPEG  LIBRARIES SETUP ###########################
   185 #############################################################################
   186 #############################################################################
   187 # - Find JPEG
   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.
   195 INCLUDE(FindJPEG)
   196 #FIND_PACKAGE(JPEG REQUIRED)
   197 IF(JPEG_FOUND)
   198 	MESSAGE( STATUS "JPEG include directory: " ${JPEG_INCLUDE_DIR} )
   199 ELSE(JPEG_FOUND)
   200 	MESSAGE( STATUS "Warning : could not find JPEG - building without jpeg support")
   201 ENDIF(JPEG_FOUND)
   202 
   203 
   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)
   214 IF(wxWidgets_FOUND)
   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)
   221 
   222 
   223 #############################################################################
   224 #############################################################################
   225 ############################ THREADING LIBRARIES ############################
   226 #############################################################################
   227 #############################################################################
   228 
   229 FIND_PACKAGE(Threads REQUIRED)
   230 
   231 #############################################################################
   232 #############################################################################
   233 ############################   QT4 LIBRARIES    #############################
   234 #############################################################################
   235 #############################################################################
   236 
   237 FIND_PACKAGE(Qt4)
   238 IF(QT4_FOUND)
   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})
   243 ELSE(QT4_FOUND)
   244 	MESSAGE( STATUS "Warning : could not find Qt - not building Qt GUI")
   245 ENDIF(QT4_FOUND)
   246 
   247 #############################################################################
   248 #############################################################################
   249 ###########################   SYSTEM LIBRARIES    ###########################
   250 #############################################################################
   251 #############################################################################
   252 IF(APPLE)
   253 	SET(SYS_LIBRARIES z )
   254 ENDIF(APPLE)
   255 IF(CYGWIN)
   256 	SET(SYS_LIBRARIES wsock32 ws2_32)
   257 	ADD_DEFINITIONS(-D_WIN32_WINNT=0x0551 -D__USE_W32_SOCKETS -D_GLIBCXX__PTHREADS)
   258 ENDIF(CYGWIN)
   259 
   260 
   261 #############################################################################
   262 #All dependencies OK !
   263 #############################################################################
   264 
   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)
   268 
   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)
   276 
   277 
   278 #############################################################################
   279 # Compiler flags for specific setup
   280 #############################################################################
   281 
   282 # doug - When linking liblux as a python extension, need to compile with -fPIC
   283 #ADD_DEFINITIONS(-fPIC)
   284 
   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)
   289 
   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)
   292 
   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)
   296 
   297 # Dade - my settings
   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 )
   301 
   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
   305 # Pass 1
   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)"')
   307 # Pass 2
   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)"')
   309  
   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)"')
   312 
   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)'") 
   315 
   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)
   320 #ICC definitions
   321 #ADD_DEFINITIONS(-O3 -ipo -no-prec-div -static -fp-model fast=2 -rcd)
   322 
   323 #############################################################################
   324 #############################################################################
   325 #########################      CUSTOM COMMAND     ###########################
   326 #############################################################################
   327 #############################################################################
   328 # Create custom command for flex/lex (note the outputs)
   329 ADD_CUSTOM_COMMAND(
   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
   334 TARGET LuxLexer
   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)
   338 
   339 # Create custom command for bison/yacc (note the DEPENDS)
   340 IF(APPLE AND !APPLE_64)
   341 	ADD_CUSTOM_COMMAND(
   342 	TARGET LuxParser
   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)
   349 	ADD_CUSTOM_COMMAND(
   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
   354 	     -d
   355 	TARGET LuxParser
   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)
   360 
   361 
   362 #############################################################################
   363 #############################################################################
   364 #########################      APPLE CUSTOM PKG   ###########################
   365 #############################################################################
   366 #############################################################################
   367 IF(APPLE)
   368 	ADD_CUSTOM_TARGET(dist DEPENDS luxrender)
   369 	ADD_CUSTOM_COMMAND(
   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)
   381 	ADD_CUSTOM_COMMAND(
   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)
   392 ENDIF(APPLE)
   393 
   394 
   395 #############################################################################
   396 #############################################################################
   397 #####################      SOURCE FILE FOR lux_lib     ######################
   398 #############################################################################
   399 #############################################################################
   400 
   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
   423 	)
   424 SET(lux_core_src
   425 	${CMAKE_BINARY_DIR}/luxparse.cpp
   426 	${CMAKE_BINARY_DIR}/luxlex.cpp
   427 	core/api.cpp
   428 	core/camera.cpp
   429 	core/color.cpp
   430 	core/context.cpp
   431 	core/epsilon.cpp
   432 	core/contribution.cpp
   433 	core/dynload.cpp
   434 	core/exrio.cpp
   435 	core/film.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
   441 	core/igiio.cpp
   442 	core/imagereader.cpp
   443 	core/light.cpp
   444 	core/material.cpp
   445 	core/mc.cpp
   446 	core/motionsystem.cpp
   447 	core/osfunc.cpp
   448 	core/paramset.cpp
   449 	core/parser.cpp
   450 	core/photonmap.cpp
   451 	core/pngio.cpp
   452 	core/primitive.cpp
   453 	${lux_core_reflection_src}
   454 	core/renderfarm.cpp
   455 	core/sampling.cpp
   456 	core/scene.cpp
   457 	core/shape.cpp
   458 	core/spd.cpp
   459 	core/spectrum.cpp
   460         core/spectrumwavelengths.cpp
   461 	core/texture.cpp
   462 	core/tgaio.cpp
   463 	core/timer.cpp
   464 	core/transport.cpp
   465 	core/util.cpp
   466 	core/volume.cpp
   467 	renderer/renderserver.cpp
   468 	)
   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
   476 	)
   477 SET(lux_cameras_src
   478 	cameras/environment.cpp
   479 	cameras/perspective.cpp
   480 	cameras/orthographic.cpp
   481 	cameras/realistic.cpp
   482 	)
   483 SET(lux_films_src
   484 	film/fleximage.cpp
   485 	)
   486 SET(lux_filters_src
   487 	filters/box.cpp
   488 	filters/gaussian.cpp
   489 	filters/mitchell.cpp
   490 	filters/sinc.cpp
   491 	filters/triangle.cpp
   492 	)
   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
   499 	integrators/igi.cpp
   500 	integrators/path.cpp
   501 	integrators/single.cpp
   502 	)
   503 SET(lux_lights_src
   504 	lights/area.cpp
   505 	lights/distant.cpp
   506 	lights/infinite.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
   513 	lights/spot.cpp
   514 	lights/sky.cpp
   515 	lights/sun.cpp
   516 	)
   517 SET(lux_materials_src
   518 	materials/carpaint.cpp
   519 	materials/glass.cpp
   520 	materials/glossy.cpp
   521 	materials/matte.cpp
   522 	materials/mattetranslucent.cpp
   523 	materials/metal.cpp
   524 	materials/mirror.cpp
   525 	materials/mixmaterial.cpp
   526 	materials/null.cpp
   527 	materials/roughglass.cpp
   528 	materials/shinymetal.cpp
   529 	)
   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
   536 	)
   537 SET(lux_samplers_src
   538 	samplers/erpt.cpp
   539 	samplers/lowdiscrepancy.cpp
   540 	samplers/metrosampler.cpp
   541 	samplers/random.cpp
   542 	)
   543 SET(lux_shapes_src
   544 	shapes/cone.cpp
   545 	shapes/cylinder.cpp
   546 	shapes/disk.cpp
   547 	shapes/heightfield.cpp
   548 	shapes/hyperboloid.cpp
   549 	shapes/lenscomponent.cpp
   550 	shapes/loopsubdiv.cpp
   551 	shapes/mesh.cpp
   552 	shapes/meshbarytriangle.cpp
   553 	shapes/meshquadrilateral.cpp
   554 	shapes/meshwaldtriangle.cpp
   555 	shapes/nurbs.cpp
   556 	shapes/paraboloid.cpp
   557 	shapes/plymesh.cpp
   558 	shapes/plymesh/rply.c
   559 	shapes/sphere.cpp
   560 	shapes/torus.cpp
   561 	)
   562 SET(lux_spds_src
   563 	spds/blackbodyspd.cpp
   564 	spds/equalspd.cpp
   565 	spds/frequencyspd.cpp
   566 	spds/gaussianspd.cpp
   567 	spds/irregular.cpp
   568 	spds/regular.cpp
   569 	spds/rgbillum.cpp
   570 	spds/rgbrefl.cpp
   571 	)
   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
   585 	)
   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
   595 	)
   596 SET(lux_fresnel_textures_src
   597 	textures/cauchytexture.cpp
   598 	textures/sopratexture.cpp
   599 	)
   600 SET(lux_textures_src
   601 	${lux_uniform_textures_src}
   602 	${lux_blender_textures_src}
   603 	${lux_fresnel_textures_src}
   604 	textures/bilerp.cpp
   605 	textures/brick.cpp
   606 	textures/checkerboard.cpp
   607 	textures/dots.cpp
   608         textures/fbm.cpp
   609 	textures/harlequin.cpp
   610 	textures/imagemap.cpp
   611 	textures/marble.cpp
   612 	textures/mix.cpp
   613 	textures/scale.cpp
   614 	textures/uv.cpp
   615 	textures/windy.cpp
   616 	textures/wrinkled.cpp
   617 	)
   618 SET(lux_tonemaps_src
   619 	tonemaps/contrast.cpp
   620 	tonemaps/highcontrast.cpp
   621 	tonemaps/lineartonemap.cpp
   622 	tonemaps/maxwhite.cpp
   623 	tonemaps/nonlinear.cpp
   624 	tonemaps/reinhard.cpp
   625 	)
   626 SET(lux_volumes_src
   627 	volumes/cloud.cpp
   628 	volumes/exponential.cpp
   629 	volumes/homogeneous.cpp
   630 	volumes/volumegrid.cpp
   631 	)
   632 
   633 SET(lux_lib_src
   634 	${lux_core_src}
   635 	${lux_accelerators_src}
   636 	${lux_cameras_src}
   637 	${lux_films_src}
   638 	${lux_filters_src}
   639 	${lux_integrators_src}
   640 	${lux_lights_src}
   641 	${lux_materials_src}
   642 	${lux_pixelsamplers_src}
   643 	${lux_samplers_src}
   644 	${lux_shapes_src}
   645 	${lux_spds_src}
   646 	${lux_textures_src}
   647 	${lux_tonemaps_src}
   648 	${lux_volumes_src}
   649 	)
   650 INCLUDE_DIRECTORIES(SYSTEM ${OPENGL_INCLUDE_DIR}
   651 	${JPEG_INCLUDE_DIR}
   652 	${TIFF_INCLUDE_DIR}
   653 	${PNG_INCLUDE_DIR}
   654 	${OPENEXR_INCLUDE_DIRS}
   655 	${Boost_INCLUDE_DIRS}
   656 	${CMAKE_SOURCE_DIR}/core/external
   657 	)
   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
   665 	${CMAKE_SOURCE_DIR}
   666 	${CMAKE_BINARY_DIR}
   667 	)
   668 
   669 SET( LUXQTGUI_SRCS
   670     qtgui/main.cpp
   671     qtgui/histogramview.cpp
   672     qtgui/mainwindow.cpp
   673     qtgui/renderview.cpp
   674     qtgui/luxapp.cpp
   675     qtgui/aboutdialog.cpp
   676     qtgui/lightgroupwidget.cpp
   677     )
   678 SET( LUXQTGUI_MOC
   679     qtgui/histogramview.hxx
   680     qtgui/mainwindow.hxx
   681     qtgui/aboutdialog.hxx
   682     qtgui/luxapp.hxx
   683     qtgui/renderview.hxx
   684     qtgui/lightgroupwidget.hxx
   685     )
   686 SET(LUXQTGUI_UIS
   687     qtgui/luxrender.ui
   688     qtgui/aboutdialog.ui
   689     qtgui/lightgroup.ui
   690     )
   691 SET( LUXQTGUI_RCS
   692     qtgui/icons.qrc
   693     qtgui/splash.qrc
   694     qtgui/images.qrc
   695     )
   696 
   697 #############################################################################
   698 #############################################################################
   699 #####################            LINKER INFO           ######################
   700 #############################################################################
   701 #############################################################################
   702 
   703 LINK_DIRECTORIES(${LINK_DIRECTORIES} ${Boost_LIBRARY_DIRS} ${OPENEXR_LIB_DIRS} ${PNG_LIBRARY} ${TIFF_LIBRARY} ${JPEG_LIBRARY})
   704 
   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} )
   708 
   709 
   710 #############################################################################
   711 #Here we build the console executable
   712 #############################################################################
   713 ADD_EXECUTABLE(luxconsole renderer/luxconsole.cpp)
   714 IF(APPLE)
   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})
   716 ELSE(APPLE)
   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})
   718 ENDIF(APPLE)
   719 
   720 IF(APPLE)
   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?")
   733 ENDIF(APPLE)
   734 
   735 #############################################################################
   736 #Here we build the luxmerger executable
   737 #############################################################################
   738 ADD_EXECUTABLE(luxmerger tools/luxmerger.cpp)
   739 IF(APPLE)
   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})
   741 ELSE(APPLE)
   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})
   743 ENDIF(APPLE)
   744 
   745 IF(APPLE)
   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?")
   758 ENDIF(APPLE)
   759 
   760 #############################################################################
   761 #Here we build the luxcomp executable
   762 #############################################################################
   763 ADD_EXECUTABLE(luxcomp tools/luxcomp.cpp)
   764 IF(APPLE)
   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})
   766 ELSE(APPLE)
   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})
   768 ENDIF(APPLE)
   769 
   770 IF(APPLE)
   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?")
   783 ENDIF(APPLE)
   784 
   785 #############################################################################
   786 #Here we build the wxWidgets GUI executable
   787 #############################################################################
   788 IF(wxWidgets_FOUND)
   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} )
   791 
   792 	IF(APPLE)
   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 )
   799 
   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})
   808 	ELSE(APPLE)
   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})
   810 	ENDIF(APPLE)
   811 ENDIF(wxWidgets_FOUND)
   812 
   813 #############################################################################
   814 #Here we build the QT4 GUI executable
   815 #############################################################################
   816 IF(QT4_FOUND)
   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} )
   820 
   821 	file (GLOB TRANSLATIONS_FILES qtgui/translations/*.ts)
   822 	qt4_create_translation(QM_FILES ${FILES_TO_TRANSLATE} ${TRANSLATIONS_FILES})
   823 
   824 	ADD_EXECUTABLE(luxrenderqt ${GUI_TYPE} ${LUXQTGUI_SRCS} ${LUXQTGUI_MOC_SRCS} ${LUXQTGUI_RC_SRCS} ${LUXQTGUI_UI_HDRS} ${QM_FILES})
   825 	IF(APPLE)
   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 )
   833 
   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})
   843 	ELSE(APPLE)
   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})
   845 	ENDIF(APPLE)
   846 ENDIF(QT4_FOUND)
   847 
   848 #############################################################################
   849 
   850 #Install target
   851 INSTALL(TARGETS luxrender luxrenderqt luxconsole luxmerger
   852         RUNTIME DESTINATION bin
   853 )
   854 
   855 #Install API/Library
   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)
   860 
   861 
   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/)
   865 
   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
   874 )
   875 
   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")
   878 
   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")
   881 
   882 # Dade - Intel Compiler optimization
   883 #REMOVE_DEFINITIONS(-ipo)