CMakeLists.txt
author Jean-Philippe Grimaldi <jeanphi@via.ecp.fr>
Wed Jul 07 21:50:58 2010 +0200 (22 months ago)
changeset 2349 45f2ed7f09f7
parent 2255 268f1af2a1d5
child 2358 82d5b08eef95
child 2438 02909419e145
permissions -rw-r--r--
Merge
jeanphi@637
     1
cmake_minimum_required(VERSION 2.4)
jeanphi@637
     2
IF(COMMAND cmake_policy)
jeanphi@637
     3
	cmake_policy(SET CMP0003 NEW)
jeanphi@637
     4
ENDIF(COMMAND cmake_policy)
dade916@717
     5
jromang@112
     6
PROJECT(lux)
jensverwiebe@2082
     7
SET(VERSION 0.7)
jromang@188
     8
tom@2117
     9
SET(LUX_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
tom@2117
    10
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LUX_CMAKE_DIR}")
tom@2117
    11
dade916@564
    12
# Dade - uncomment to obtain verbose building output
dade916@564
    13
#SET(CMAKE_VERBOSE_MAKEFILE true)
dade916@564
    14
neo1975@132
    15
#Setting Universal Binary Properties, only for Mac OS X
jromang@188
    16
IF(APPLE)
jensverwiebe@2133
    17
	SET(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
jensverwiebe@2133
    18
	SET(CMAKE_OSX_ARCHITECTURES i386;x86_64)
jensverwiebe@2133
    19
	SET(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
jromang@188
    20
ENDIF(APPLE)
neo1975@132
    21
jromang@104
    22
neo1975@143
    23
#############################################################################
neo1975@143
    24
#############################################################################
jromang@1093
    25
### check for the CPU we build for                                        ###
jromang@1093
    26
#############################################################################
jromang@1093
    27
#############################################################################
jromang@1093
    28
jensverwiebe@2082
    29
IF(NOT APPLE)
jensverwiebe@2082
    30
	EXECUTE_PROCESS(
jensverwiebe@2082
    31
		COMMAND ${CMAKE_C_COMPILER} -dumpmachine
jensverwiebe@2082
    32
		OUTPUT_VARIABLE MACHINE
jensverwiebe@2082
    33
		OUTPUT_STRIP_TRAILING_WHITESPACE
jensverwiebe@2082
    34
	)
jensverwiebe@2082
    35
	MESSAGE(STATUS "Building for target ${MACHINE}")
jromang@1093
    36
jensverwiebe@2082
    37
	STRING(REGEX MATCH "(i.86-*)|(athlon-*)|(pentium-*)" _mach_x86 ${MACHINE})
jensverwiebe@2082
    38
	IF (_mach_x86)
jensverwiebe@2082
    39
		SET(ARCH_X86 1)
jensverwiebe@2082
    40
	ENDIF (_mach_x86)
jromang@1093
    41
jensverwiebe@2082
    42
	STRING(REGEX MATCH "(x86_64-*)|(X86_64-*)|(AMD64-*)|(amd64-*)" _mach_x86_64 ${MACHINE})
jensverwiebe@2082
    43
	IF (_mach_x86_64)
jensverwiebe@2082
    44
		SET(ARCH_X86_64 1)
jromang@1093
    45
    SET(LIB_SUFFIX 64)
jensverwiebe@2082
    46
		#jromang - Hack to avoid boost bug on x64  Ubuntu 8.10 and Fedora 10 (http://www.luxrender.net/mantis/view.php?id=433)
jensverwiebe@2082
    47
		ADD_DEFINITIONS(-DBOOST_NO_INTRINSIC_INT64_T)
jensverwiebe@2082
    48
	ENDIF (_mach_x86_64)
jromang@1093
    49
jensverwiebe@2082
    50
	STRING(REGEX MATCH "(ppc-*)|(powerpc-*)" _mach_ppc ${MACHINE})
jensverwiebe@2082
    51
	IF (_mach_ppc)
jensverwiebe@2082
    52
		SET(ARCH_PPC 1)
jensverwiebe@2082
    53
	ENDIF (_mach_ppc)
jensverwiebe@2082
    54
ENDIF(NOT APPLE)
jromang@1093
    55
jromang@1093
    56
#############################################################################
jromang@1093
    57
#############################################################################
neo1975@143
    58
###########################      Find BISON       ###########################
neo1975@143
    59
#############################################################################
neo1975@143
    60
#############################################################################
jromang@112
    61
FIND_PROGRAM(BISON_EXECUTABLE bison)
jromang@112
    62
IF (NOT BISON_EXECUTABLE)
dade916@717
    63
	MESSAGE(FATAL_ERROR "bison not found - aborting")
jromang@112
    64
ENDIF (NOT BISON_EXECUTABLE)
jromang@112
    65
jromang@112
    66
neo1975@143
    67
#############################################################################
neo1975@143
    68
#############################################################################
neo1975@143
    69
###########################      Find FLEX        ###########################
neo1975@143
    70
#############################################################################
neo1975@143
    71
#############################################################################
jromang@112
    72
FIND_PROGRAM(FLEX_EXECUTABLE flex)
jromang@112
    73
IF (NOT FLEX_EXECUTABLE)
dade916@717
    74
	MESSAGE(FATAL_ERROR "flex not found - aborting")
jromang@112
    75
ENDIF (NOT FLEX_EXECUTABLE)
jromang@112
    76
jromang@112
    77
dade916@572
    78
dade916@572
    79
#############################################################################
dade916@572
    80
#############################################################################
neo1975@143
    81
########################### BOOST LIBRARIES SETUP ###########################
neo1975@143
    82
#############################################################################
neo1975@143
    83
#############################################################################
jensverwiebe@2103
    84
tom@2135
    85
FIND_PACKAGE(Boost 1.41 REQUIRED COMPONENTS python)
jensverwiebe@2103
    86
jeanphi@1963
    87
SET(Boost_python_FOUND ${Boost_FOUND})
jeanphi@1963
    88
SET(Boost_python_LIBRARIES ${Boost_LIBRARIES})
dade@2015
    89
SET(Boost_FOUND)
dade@2015
    90
SET(Boost_LIBRARIES)
jensverwiebe@2103
    91
tom@2136
    92
FIND_PACKAGE(Boost 1.41 REQUIRED COMPONENTS thread program_options filesystem serialization iostreams regex system)
jensverwiebe@2103
    93
jeanphi@1096
    94
IF(Boost_FOUND)
jeanphi@1096
    95
	MESSAGE(STATUS "Boost library directory: " ${Boost_LIBRARY_DIRS})
jeanphi@1096
    96
	MESSAGE(STATUS "Boost include directory: " ${Boost_INCLUDE_DIRS})
jeanphi@1096
    97
ELSE(Boost_FOUND)
jeanphi@1096
    98
	MESSAGE(FATAL_ERROR "Could not find Boost")
jeanphi@1096
    99
ENDIF(Boost_FOUND)
neo1975@132
   100
neo1975@143
   101
tom@2117
   102
#############################################################################
tom@2117
   103
#############################################################################
tom@2117
   104
######################### OPENEXR LIBRARIES SETUP ###########################
tom@2117
   105
#############################################################################
tom@2117
   106
#############################################################################
jensverwiebe@2131
   107
jensverwiebe@2131
   108
# !!!!freeimage needs headers from openEXR 1.6x !!!!
tom@2117
   109
FIND_PATH(OPENEXR_INCLUDE_DIRS
tom@2117
   110
    ImfXdr.h
tom@2117
   111
    PATHS
tom@2117
   112
    /usr/local/include/OpenEXR
tom@2117
   113
    /usr/include/OpenEXR
tom@2117
   114
    /sw/include/OpenEXR
tom@2117
   115
    /opt/local/include/OpenEXR
tom@2117
   116
    /opt/csw/include/OpenEXR
tom@2117
   117
    /opt/include/OpenEXR
tom@2117
   118
) 
tom@2117
   119
IF(APPLE)
tom@2117
   120
   SET(OPENEXR_LIBRARIES Half IlmImf Iex Imath IlmThread)
tom@2117
   121
ELSE(APPLE)
tom@2117
   122
   SET(OPENEXR_LIBRARIES Half IlmImf Iex Imath)
tom@2117
   123
ENDIF(APPLE)
jromang@112
   124
tom@2117
   125
#############################################################################
tom@2117
   126
#############################################################################
tom@2117
   127
########################### PNG   LIBRARIES SETUP ###########################
tom@2117
   128
#############################################################################
tom@2117
   129
#############################################################################
tom@2117
   130
# - Find the native PNG includes and library
tom@2117
   131
#
tom@2117
   132
# This module defines
tom@2117
   133
#  PNG_INCLUDE_DIR, where to find png.h, etc.
tom@2117
   134
#  PNG_LIBRARIES, the libraries to link against to use PNG.
tom@2117
   135
#  PNG_DEFINITIONS - You should ADD_DEFINITONS(${PNG_DEFINITIONS}) before compiling code that includes png library files.
tom@2117
   136
#  PNG_FOUND, If false, do not try to use PNG.
tom@2117
   137
# also defined, but not for general use are
tom@2117
   138
#  PNG_LIBRARY, where to find the PNG library.
tom@2117
   139
# None of the above will be defined unles zlib can be found.
tom@2117
   140
# PNG depends on Zlib
tom@2117
   141
INCLUDE(FindPNG)
tom@2117
   142
IF(PNG_FOUND)
tom@2117
   143
ELSE(PNG_FOUND)
tom@2117
   144
    MESSAGE( STATUS "Warning : could not find PNG - building without png support")
tom@2117
   145
ENDIF(PNG_FOUND)
tom@2117
   146
#FIND_PACKAGE(PNG REQUIRED)
dade916@572
   147
neo1975@132
   148
neo1975@143
   149
neo1975@143
   150
#############################################################################
neo1975@143
   151
#############################################################################
jensverwiebe@2115
   152
###########################   FREEIMAGE LIBRARIES    ###########################
neo1975@143
   153
#############################################################################
neo1975@143
   154
#############################################################################
neo1975@143
   155
jensverwiebe@2255
   156
IF(APPLE)
jensverwiebe@2255
   157
    FIND_PATH(FREEIMAGE_INCLUDE_DIRS
jensverwiebe@2255
   158
    freeimage.h
jensverwiebe@2255
   159
    PATHS
jensverwiebe@2255
   160
    /usr/local/include/
jensverwiebe@2255
   161
    /usr/include/
jensverwiebe@2255
   162
    )
jensverwiebe@2255
   163
    SET(FREEIMAGE_LIBRARIES freeimage)
jensverwiebe@2255
   164
ELSE(APPLE)
jensverwiebe@2255
   165
    FIND_PACKAGE(FreeImage REQUIRED)
tom@2117
   166
jensverwiebe@2255
   167
    IF(FREEIMAGE_FOUND)
jensverwiebe@2255
   168
        MESSAGE(STATUS "FreeImage library directory: " ${FREEIMAGE_LIBRARIES})
jensverwiebe@2255
   169
        MESSAGE(STATUS "FreeImage include directory: " ${FREEIMAGE_INCLUDE_PATH})
jensverwiebe@2255
   170
    ELSE(FREEIMAGE_FOUND)
jensverwiebe@2255
   171
        MESSAGE(FATAL_ERROR "Could not find FreeImage")
jensverwiebe@2255
   172
    ENDIF(FREEIMAGE_FOUND)
jensverwiebe@2255
   173
ENDIF(APPLE)
dade916@717
   174
ratow@655
   175
#############################################################################
ratow@655
   176
#############################################################################
dade916@669
   177
############################ THREADING LIBRARIES ############################
dade916@669
   178
#############################################################################
dade916@669
   179
#############################################################################
jensverwiebe@2133
   180
IF(APPLE)
jensverwiebe@2133
   181
    FIND_PATH(THREADS_INCLUDE_DIRS
jensverwiebe@2133
   182
    pthread.h
jensverwiebe@2133
   183
    PATHS
jensverwiebe@2133
   184
    /usr/include/pthread
jensverwiebe@2133
   185
    )
jensverwiebe@2133
   186
	SET(THREADS_LIBRARIES pthread)
jensverwiebe@2133
   187
ELSE(APPLE)
jensverwiebe@2133
   188
	FIND_PACKAGE(Threads REQUIRED)
jensverwiebe@2133
   189
ENDIF(APPLE)
dade916@669
   190
jeanphi@1747
   191
#############################################################################
jeanphi@1747
   192
#############################################################################
jeanphi@495
   193
###########################   SYSTEM LIBRARIES    ###########################
jeanphi@495
   194
#############################################################################
jeanphi@495
   195
#############################################################################
jeanphi@495
   196
IF(APPLE)
jensverwiebe@1948
   197
	SET(SYS_LIBRARIES z bz2)
jeanphi@495
   198
ENDIF(APPLE)
jeanphi@495
   199
IF(CYGWIN)
jeanphi@495
   200
	SET(SYS_LIBRARIES wsock32 ws2_32)
jeanphi@495
   201
	ADD_DEFINITIONS(-D_WIN32_WINNT=0x0551 -D__USE_W32_SOCKETS -D_GLIBCXX__PTHREADS)
jeanphi@495
   202
ENDIF(CYGWIN)
jeanphi@495
   203
jromang@1944
   204
#############################################################################
jromang@1993
   205
#############################################################################
jromang@1993
   206
############################    DOXYGEN          ############################
jromang@1993
   207
#############################################################################
jromang@1993
   208
#############################################################################
jromang@1993
   209
jromang@1993
   210
FIND_PACKAGE(Doxygen)
jromang@1993
   211
jromang@1993
   212
IF (DOXYGEN_FOUND)
jeanphi@2009
   213
	MESSAGE( STATUS "Found Doxygen and generating documentation" )
jromang@2008
   214
			
jeanphi@2009
   215
	SET(DOXYGEN_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/doxygen/doxygen.template)
jromang@2013
   216
	SET(DOXYGEN_INPUT ${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf)
jromang@2008
   217
	SET(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doc)
jromang@2008
   218
	SET(DOXYGEN_OUTPUT ${DOXYGEN_OUTPUT_DIR}/html/index.html)
jromang@2008
   219
		
jromang@2008
   220
	MESSAGE( STATUS "Doxygen output:" ${DOXYGEN_OUTPUT} )
jromang@2008
   221
	
jromang@2007
   222
	IF(DOXYGEN_DOT_FOUND)
jromang@2008
   223
		MESSAGE( STATUS "Found dot" )
jromang@2008
   224
		SET(DOXYGEN_DOT_CONF "HAVE_DOT = YES")
jromang@2008
   225
	ENDIF(DOXYGEN_DOT_FOUND)
jromang@2008
   226
	
jromang@2008
   227
	ADD_CUSTOM_COMMAND( 
jromang@2008
   228
	OUTPUT ${DOXYGEN_OUTPUT}
jromang@2008
   229
	#creating custom doxygen.conf
jeanphi@2009
   230
	COMMAND cp ${DOXYGEN_TEMPLATE} ${DOXYGEN_INPUT}
jeanphi@2009
   231
	COMMAND echo "INPUT = " ${CMAKE_CURRENT_SOURCE_DIR} >> ${DOXYGEN_INPUT}
jeanphi@2009
   232
	COMMAND echo "OUTPUT_DIRECTORY = " ${DOXYGEN_OUTPUT_DIR} >> ${DOXYGEN_INPUT}
jeanphi@2009
   233
	COMMAND echo ${DOXYGEN_DOT_CONF} >> ${DOXYGEN_INPUT}
jromang@2008
   234
	#launch doxygen
jeanphi@2009
   235
	COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT}
jeanphi@2009
   236
	DEPENDS ${DOXYGEN_TEMPLATE}
jromang@2008
   237
	WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
jromang@2008
   238
	)
jromang@2007
   239
		
jromang@2008
   240
	ADD_CUSTOM_TARGET(apidoc ALL DEPENDS ${DOXYGEN_OUTPUT})
jromang@1993
   241
ENDIF (DOXYGEN_FOUND)
jromang@1993
   242
jromang@1993
   243
jromang@1993
   244
#############################################################################
jromang@104
   245
#All dependencies OK !
dade916@717
   246
#############################################################################
jromang@320
   247
jromang@320
   248
#Generate the config.h file
jromang@320
   249
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
jromang@320
   250
ADD_DEFINITIONS(-DLUX_USE_CONFIG_H)
jromang@320
   251
neo1975@143
   252
#############################################################################
neo1975@143
   253
#############################################################################
neo1975@143
   254
#########################      COMPILER FLAGS     ###########################
neo1975@143
   255
#############################################################################
neo1975@143
   256
#############################################################################
dade916@717
   257
# Dade - default compiler options
jromang@1944
   258
ADD_DEFINITIONS(-O3 -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall -fPIC -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
jeanphi@2118
   259
# The QBVH accelerator needs to be compiled with much reduced optimizations
jeanphi@2118
   260
# otherwise gcc produces incorrect code and ruins the render on 64bits machines
jensverwiebe@2255
   261
IF(NOT APPLE)
jensverwiebe@2255
   262
	SET_SOURCE_FILES_PROPERTIES(accelerators/qbvhaccel.cpp COMPILE_FLAGS "-O1")
jensverwiebe@2255
   263
ENDIF(NOT APPLE)
dade916@717
   264
dade916@717
   265
#############################################################################
dade916@717
   266
# Compiler flags for specific setup
dade916@717
   267
#############################################################################
dade916@539
   268
tom@1530
   269
# doug - When linking liblux as a python extension, need to compile with -fPIC
tom@1530
   270
#ADD_DEFINITIONS(-fPIC)
tom@1530
   271
jeanphi@1096
   272
# Jens - default Mac compiler options with OpenGL
jensverwiebe@1950
   273
#ADD_DEFINITIONS(-O3 -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller -fpic -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H )
jeanphi@1096
   274
# Jens - testing Mac compiler options (debug)
jeanphi@1096
   275
#ADD_DEFINITIONS(-DHAVE_PTHREAD_H)
jeanphi@1096
   276
dade916@553
   277
# Dade - GCC Profiling (remember to uncomment the line at the end of file too)
tom@2083
   278
#ADD_DEFINITIONS(-pg -g -O2 -msse2 -mfpmath=sse -ftree-vectorize -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
dade916@553
   279
dade916@553
   280
# Dade - GCC 2 pass optimization (remember to uncomment the line at the end of file too)
dade916@553
   281
#ADD_DEFINITIONS(-O3 --coverage -march=prescott -mfpmath=sse -ftree-vectorize -funroll-loops -ffast-math -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
dade916@553
   282
#ADD_DEFINITIONS(-O3 -fbranch-probabilities -march=prescott -mfpmath=sse -ftree-vectorize -funroll-loops -ffast-math -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
dade916@553
   283
dade916@553
   284
# Dade - my settings
dade916@780
   285
#ADD_DEFINITIONS(-g -O0 -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
dade916@717
   286
#ADD_DEFINITIONS(-O3 -march=prescott -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
dade916@717
   287
#ADD_DEFINITIONS(-O3 -march=athlon-xp -m3dnow -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H )
dade916@553
   288
dade916@556
   289
# Dade - Intel CC settings (double pass, 32bit, remember to uncomment the line at the end of file too)
dade916@553
   290
#  rm -rf CMakeCache.txt CMakeFiles
dade916@553
   291
#  CC=/opt/intel/cc/10.1.015/bin/icc CXX=/opt/intel/cc/10.1.015/bin/icpc cmake lux
dade916@553
   292
# Pass 1
dade916@553
   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)"')
dade916@553
   294
# Pass 2
dade916@553
   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)"')
dade916@556
   296
 
dade916@556
   297
# Dade - Intel CC settings (single pass, 32bit)
dade916@556
   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)"')
dade916@553
   299
dade916@556
   300
# Dade - Intel CC settings (single pass, 64bit)
dade916@556
   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)'") 
dade916@553
   302
dade916@553
   303
#ADD_DEFINITIONS(-O3 -msse -mfpmath=sse -ftree-vectorize -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
dade916@669
   304
#ADD_DEFINITIONS(-O3 -march=athlon-xp -mmmx -m3dnow -msse -mfpmath=sse -ftree-vectorize -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H )
jromang@358
   305
#ADD_DEFINITIONS(-O3 -Wall -msse -msse2 -DLUX_USE_SSE -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
dade916@539
   306
#ADD_DEFINITIONS(-g -Wall -msse -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
jromang@182
   307
#ICC definitions
jromang@182
   308
#ADD_DEFINITIONS(-O3 -ipo -no-prec-div -static -fp-model fast=2 -rcd)
jromang@182
   309
neo1975@143
   310
#############################################################################
neo1975@143
   311
#############################################################################
neo1975@143
   312
#########################      CUSTOM COMMAND     ###########################
neo1975@143
   313
#############################################################################
neo1975@143
   314
#############################################################################
jromang@104
   315
# Create custom command for flex/lex (note the outputs)
jromang@104
   316
ADD_CUSTOM_COMMAND(
jromang@104
   317
SOURCE ${CMAKE_SOURCE_DIR}/core/luxlex.l
jromang@104
   318
COMMAND ${FLEX_EXECUTABLE} 
jromang@104
   319
ARGS -o${CMAKE_BINARY_DIR}/luxlex.cpp
jromang@104
   320
      ${CMAKE_SOURCE_DIR}/core/luxlex.l
jromang@104
   321
TARGET LuxLexer
jromang@104
   322
#DEPENDS ${CMAKE_BINARY_DIR}/core/pbrtparse.cpp ${lux_BINARY_DIR}/core/pbrtparse.h
jromang@104
   323
OUTPUTS ${CMAKE_BINARY_DIR}/luxlex.cpp)
jromang@104
   324
SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/luxlex.cpp GENERATED)
jromang@104
   325
jromang@104
   326
# Create custom command for bison/yacc (note the DEPENDS)
neo1975@186
   327
IF(APPLE AND !APPLE_64)
neo1975@186
   328
	ADD_CUSTOM_COMMAND(
neo1975@186
   329
	TARGET LuxParser
neo1975@186
   330
	#DEPENDS ${CMAKE_BINARY_DIR}/core/luxlex.cpp
neo1975@186
   331
	SOURCE ${CMAKE_SOURCE_DIR}/core/luxparse.y
neo1975@186
   332
	COMMAND ${BISON_EXECUTABLE} -y ${CMAKE_SOURCE_DIR}/core/luxparse.y -o ${CMAKE_BINARY_DIR}/luxparse.cpp -d
neo1975@186
   333
	COMMAND mv ${CMAKE_SOURCE_DIR}/luxparse.cpp.h ${CMAKE_BINARY_DIR}/luxparse.hpp
neo1975@186
   334
	OUTPUTS ${CMAKE_BINARY_DIR}/luxparse.cpp ${CMAKE_BINARY_DIR}/luxparse.hpp)
neo1975@186
   335
ELSE(APPLE AND !APPLE_64)
neo1975@186
   336
	ADD_CUSTOM_COMMAND(
neo1975@186
   337
	SOURCE ${CMAKE_SOURCE_DIR}/core/luxparse.y
neo1975@186
   338
	COMMAND ${BISON_EXECUTABLE} 
neo1975@186
   339
	ARGS -y ${CMAKE_SOURCE_DIR}/core/luxparse.y
neo1975@186
   340
	     -o ${CMAKE_BINARY_DIR}/luxparse.cpp
neo1975@186
   341
	     -d
neo1975@186
   342
	TARGET LuxParser
neo1975@186
   343
	#DEPENDS ${CMAKE_BINARY_DIR}/core/luxlex.cpp
neo1975@186
   344
	OUTPUTS ${CMAKE_BINARY_DIR}/luxparse.cpp ${CMAKE_BINARY_DIR}/luxparse.hpp)
neo1975@186
   345
ENDIF(APPLE AND !APPLE_64)
jromang@104
   346
SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/core/luxparse.cpp GENERATED)
jromang@104
   347
neo1975@143
   348
neo1975@143
   349
#############################################################################
neo1975@143
   350
#############################################################################
jensverwiebe@2133
   351
##################  APPLE CUSTOM GUI_TYPE MACOSX_BUNDLE  ####################
neo1975@144
   352
#############################################################################
neo1975@144
   353
#############################################################################
neo1975@144
   354
IF(APPLE)
tom@2081
   355
	ADD_CUSTOM_TARGET(dist DEPENDS luxrenderwx)
tom@2081
   356
	ADD_CUSTOM_COMMAND(
tom@2081
   357
	TARGET dist POST_BUILD
jensverwiebe@2082
   358
	COMMAND rm -rf luxrenderwx.app 
jensverwiebe@2082
   359
	COMMAND mkdir luxrenderwx.app 
jensverwiebe@2082
   360
	COMMAND mkdir luxrenderwx.app/Contents 
jensverwiebe@2082
   361
	COMMAND mkdir luxrenderwx.app/Contents/MacOS 
jensverwiebe@2082
   362
	COMMAND mkdir luxrenderwx.app/Contents/Resources
jensverwiebe@2082
   363
	COMMAND cp ../macos/Info.plist luxrenderwx.app/Contents
jensverwiebe@2082
   364
	COMMAND cp luxrender.icns luxrenderwx.app/Contents/Resources
jensverwiebe@2082
   365
	COMMAND echo APPLnone > luxrenderwx.app/Contents/PkgInfo
jensverwiebe@2082
   366
	COMMAND cp luxrenderwx luxrenderwx.app/Contents/MacOS/luxrenderwx)
neo1975@144
   367
	ADD_CUSTOM_TARGET(dist DEPENDS luxrender)
neo1975@144
   368
	ADD_CUSTOM_COMMAND(
neo1975@144
   369
	TARGET dist POST_BUILD
tom@2081
   370
	COMMAND rm -rf luxrender.app 
tom@2081
   371
	COMMAND mkdir luxrender.app 
tom@2081
   372
	COMMAND mkdir luxrender.app/Contents 
tom@2081
   373
	COMMAND mkdir luxrender.app/Contents/MacOS 
tom@2081
   374
	COMMAND mkdir luxrender.app/Contents/Resources
tom@2081
   375
	COMMAND cp ../macos/Info.plist luxrender.app/Contents
tom@2081
   376
	COMMAND cp luxrender.icns luxrender.app/Contents/Resources
tom@2081
   377
	COMMAND echo APPLnone > luxrender.app/Contents/PkgInfo
tom@2081
   378
	COMMAND cp luxrender luxrender.app/Contents/MacOS/luxrender)
jensverwiebe@2133
   379
jensverwiebe@2133
   380
	SET(GUI_TYPE MACOSX_BUNDLE)
jensverwiebe@2133
   381
	# SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
jensverwiebe@2133
   382
	# Short Version is the "marketing version". It is the version
jensverwiebe@2133
   383
	# the user sees in an information panel.
jensverwiebe@2133
   384
	SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}")
jensverwiebe@2133
   385
	# Bundle version is the version the OS looks at.
jensverwiebe@2133
   386
	SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}")
jensverwiebe@2133
   387
	SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.luxrender.luxrender" )
jensverwiebe@2133
   388
	SET(MACOSX_BUNDLE_BUNDLE_NAME "luxrender" )
jensverwiebe@2133
   389
	SET(MACOSX_BUNDLE_ICON_FILE "luxrender.icns")
jensverwiebe@2133
   390
	# SET(MACOSX_BUNDLE_COPYRIGHT "")
jensverwiebe@2133
   391
	# SET(MACOSX_BUNDLE_INFO_STRING "Info string, localized?")
neo1975@144
   392
ENDIF(APPLE)
neo1975@144
   393
neo1975@144
   394
neo1975@144
   395
#############################################################################
neo1975@144
   396
#############################################################################
neo1975@143
   397
#####################      SOURCE FILE FOR lux_lib     ######################
neo1975@143
   398
#############################################################################
neo1975@143
   399
#############################################################################
jeanphi@1403
   400
jeanphi@1403
   401
SET(lux_core_reflection_src
tom@1530
   402
	core/reflection/bxdf.cpp
tom@1530
   403
	core/reflection/fresnel.cpp
tom@1530
   404
	core/reflection/microfacetdistribution.cpp
jeanphi@1982
   405
	core/reflection/bxdf/brdftobtdf.cpp
tom@1530
   406
	core/reflection/bxdf/cooktorrance.cpp
tom@1530
   407
	core/reflection/bxdf/fresnelblend.cpp
tom@1530
   408
	core/reflection/bxdf/lafortune.cpp
tom@1530
   409
	core/reflection/bxdf/lambertian.cpp
tom@1530
   410
	core/reflection/bxdf/microfacet.cpp
tom@1530
   411
	core/reflection/bxdf/nulltransmission.cpp
tom@1530
   412
	core/reflection/bxdf/orennayar.cpp
jeanphi@1835
   413
	core/reflection/bxdf/schlickbrdf.cpp
tom@1530
   414
	core/reflection/bxdf/specularreflection.cpp
tom@1530
   415
	core/reflection/bxdf/speculartransmission.cpp
jeanphi@2039
   416
	core/reflection/fresnel/fresnelcauchy.cpp
jeanphi@2039
   417
	core/reflection/fresnel/fresnelconductor.cpp
jeanphi@2039
   418
	core/reflection/fresnel/fresneldielectric.cpp
jeanphi@2039
   419
	core/reflection/fresnel/fresnelgeneral.cpp
tom@1530
   420
	core/reflection/fresnel/fresnelnoop.cpp
tom@1530
   421
	core/reflection/fresnel/fresnelslick.cpp
tom@1530
   422
	core/reflection/microfacetdistribution/anisotropic.cpp
tom@1530
   423
	core/reflection/microfacetdistribution/beckmann.cpp
tom@1530
   424
	core/reflection/microfacetdistribution/blinn.cpp
tom@1530
   425
	core/reflection/microfacetdistribution/wardisotropic.cpp
tom@1530
   426
	)
jeanphi@1403
   427
SET(lux_core_src
tom@1530
   428
	${CMAKE_BINARY_DIR}/luxparse.cpp
tom@1530
   429
	${CMAKE_BINARY_DIR}/luxlex.cpp
tom@1530
   430
	core/api.cpp
tom@1530
   431
	core/camera.cpp
tom@1530
   432
	core/color.cpp
tom@1530
   433
	core/context.cpp
jeanphi@1543
   434
	core/contribution.cpp
tom@1530
   435
	core/dynload.cpp
dade@1822
   436
	core/epsilon.cpp
tom@1530
   437
	core/exrio.cpp
tom@1530
   438
	core/film.cpp
tom@1530
   439
	core/geometry/bbox.cpp
tom@1530
   440
	core/geometry/matrix4x4.cpp
tom@1530
   441
	core/geometry/quaternion.cpp
tom@1530
   442
	core/geometry/raydifferential.cpp
tom@1530
   443
	core/geometry/transform.cpp
tom@1530
   444
	core/igiio.cpp
tom@1530
   445
	core/imagereader.cpp
tom@1530
   446
	core/light.cpp
tom@1530
   447
	core/material.cpp
tom@1530
   448
	core/mc.cpp
tom@1530
   449
	core/motionsystem.cpp
tom@1530
   450
	core/osfunc.cpp
tom@1530
   451
	core/paramset.cpp
tom@1530
   452
	core/photonmap.cpp
tom@1530
   453
	core/pngio.cpp
tom@1530
   454
	core/primitive.cpp
jeanphi@1989
   455
	core/queryable/queryable.cpp
jeanphi@1989
   456
	core/queryable/queryableattribute.cpp
jromang@2006
   457
	core/queryable/queryableregistry.cpp
tom@1530
   458
	${lux_core_reflection_src}
tom@1530
   459
	core/renderfarm.cpp
dade@1917
   460
	core/renderinghints.cpp
tom@1530
   461
	core/sampling.cpp
tom@1530
   462
	core/scene.cpp
tom@1530
   463
	core/shape.cpp
tom@1530
   464
	core/spd.cpp
tom@1530
   465
	core/spectrum.cpp
dade@1917
   466
	core/spectrumwavelengths.cpp
tom@1530
   467
	core/texture.cpp
tom@1530
   468
	core/tgaio.cpp
tom@1530
   469
	core/timer.cpp
tom@1530
   470
	core/transport.cpp
tom@1530
   471
	core/util.cpp
tom@1530
   472
	core/volume.cpp
tom@1530
   473
	renderer/renderserver.cpp
tom@1530
   474
	)
jeanphi@1403
   475
SET(lux_accelerators_src
tom@1530
   476
	accelerators/bruteforce.cpp
tom@1530
   477
        accelerators/bvhaccel.cpp
tom@1530
   478
	accelerators/grid.cpp
tom@1530
   479
	accelerators/qbvhaccel.cpp
tom@1530
   480
	accelerators/tabreckdtree.cpp
tom@1530
   481
	accelerators/unsafekdtree.cpp
tom@1530
   482
	)
jeanphi@1403
   483
SET(lux_cameras_src
tom@1530
   484
	cameras/environment.cpp
tom@1530
   485
	cameras/perspective.cpp
tom@1530
   486
	cameras/orthographic.cpp
tom@1530
   487
	cameras/realistic.cpp
tom@1530
   488
	)
jeanphi@1403
   489
SET(lux_films_src
tom@1530
   490
	film/fleximage.cpp
tom@1530
   491
	)
jeanphi@1403
   492
SET(lux_filters_src
tom@1530
   493
	filters/box.cpp
tom@1530
   494
	filters/gaussian.cpp
tom@1530
   495
	filters/mitchell.cpp
tom@1530
   496
	filters/sinc.cpp
tom@1530
   497
	filters/triangle.cpp
tom@1530
   498
	)
jeanphi@1403
   499
SET(lux_integrators_src
tom@1530
   500
	integrators/bidirectional.cpp
tom@1530
   501
	integrators/directlighting.cpp
tom@1530
   502
	integrators/distributedpath.cpp
tom@1530
   503
	integrators/emission.cpp
tom@1530
   504
	integrators/exphotonmap.cpp
tom@1530
   505
	integrators/igi.cpp
tom@1530
   506
	integrators/path.cpp
tom@1530
   507
	integrators/single.cpp
tom@1530
   508
	)
jeanphi@1403
   509
SET(lux_lights_src
tom@1530
   510
	lights/area.cpp
tom@1530
   511
	lights/distant.cpp
tom@1530
   512
	lights/infinite.cpp
tom@1530
   513
	lights/infinitesample.cpp
jeanphi@1789
   514
	lights/pointlight.cpp
tom@1530
   515
	lights/projection.cpp
tom@1530
   516
	lights/sphericalfunction/photometricdata_ies.cpp
tom@1530
   517
	lights/sphericalfunction/sphericalfunction.cpp
tom@1530
   518
	lights/sphericalfunction/sphericalfunction_ies.cpp
tom@1530
   519
	lights/spot.cpp
tom@1530
   520
	lights/sky.cpp
tom@1530
   521
	lights/sun.cpp
tom@1530
   522
	)
jeanphi@1403
   523
SET(lux_materials_src
tom@1530
   524
	materials/carpaint.cpp
tom@1530
   525
	materials/glass.cpp
jeanphi@2019
   526
	materials/glass2.cpp
tom@1530
   527
	materials/glossy.cpp
jeanphi@1835
   528
	materials/glossy2.cpp
tom@1530
   529
	materials/matte.cpp
tom@1530
   530
	materials/mattetranslucent.cpp
tom@1530
   531
	materials/metal.cpp
tom@1530
   532
	materials/mirror.cpp
tom@1530
   533
	materials/mixmaterial.cpp
tom@1530
   534
	materials/null.cpp
tom@1530
   535
	materials/roughglass.cpp
tom@1530
   536
	materials/shinymetal.cpp
tom@1530
   537
	)
jeanphi@1403
   538
SET(lux_pixelsamplers_src
tom@1530
   539
	pixelsamplers/hilbertpx.cpp
tom@1530
   540
	pixelsamplers/linear.cpp
tom@1530
   541
	pixelsamplers/lowdiscrepancypx.cpp
tom@1530
   542
	pixelsamplers/tilepx.cpp
tom@1530
   543
	pixelsamplers/vegas.cpp
tom@1530
   544
	)
jeanphi@1403
   545
SET(lux_samplers_src
tom@1530
   546
	samplers/erpt.cpp
tom@1530
   547
	samplers/lowdiscrepancy.cpp
tom@1530
   548
	samplers/metrosampler.cpp
tom@1530
   549
	samplers/random.cpp
tom@1530
   550
	)
jeanphi@1403
   551
SET(lux_shapes_src
tom@1530
   552
	shapes/cone.cpp
tom@1530
   553
	shapes/cylinder.cpp
tom@1530
   554
	shapes/disk.cpp
tom@1530
   555
	shapes/heightfield.cpp
tom@1530
   556
	shapes/hyperboloid.cpp
tom@1530
   557
	shapes/lenscomponent.cpp
tom@1530
   558
	shapes/loopsubdiv.cpp
tom@1530
   559
	shapes/mesh.cpp
tom@1530
   560
	shapes/meshbarytriangle.cpp
tom@1530
   561
	shapes/meshquadrilateral.cpp
tom@1530
   562
	shapes/meshwaldtriangle.cpp
tom@1530
   563
	shapes/nurbs.cpp
tom@1530
   564
	shapes/paraboloid.cpp
tom@1530
   565
	shapes/plymesh.cpp
tom@1530
   566
	shapes/plymesh/rply.c
tom@1530
   567
	shapes/sphere.cpp
tom@1530
   568
	shapes/torus.cpp
tom@1530
   569
	)
jeanphi@1403
   570
SET(lux_spds_src
tom@1530
   571
	spds/blackbodyspd.cpp
tom@1530
   572
	spds/equalspd.cpp
tom@1530
   573
	spds/frequencyspd.cpp
tom@1530
   574
	spds/gaussianspd.cpp
tom@1530
   575
	spds/irregular.cpp
tom@1530
   576
	spds/regular.cpp
tom@1530
   577
	spds/rgbillum.cpp
tom@1530
   578
	spds/rgbrefl.cpp
tom@1530
   579
	)
jeanphi@1403
   580
SET(lux_blender_textures_src
jeanphi@1833
   581
	textures/blender_base.cpp
tom@1530
   582
	textures/blender_blend.cpp
tom@1530
   583
	textures/blender_clouds.cpp
tom@1530
   584
	textures/blender_distortednoise.cpp
tom@1530
   585
	textures/blender_magic.cpp
tom@1530
   586
	textures/blender_marble.cpp
tom@1530
   587
	textures/blender_musgrave.cpp
tom@1530
   588
	textures/blender_noise.cpp
tom@1530
   589
	textures/blender_noiselib.cpp
tom@1530
   590
	textures/blender_stucci.cpp
tom@1530
   591
	textures/blender_texlib.cpp
tom@1530
   592
	textures/blender_voronoi.cpp
tom@1530
   593
	textures/blender_wood.cpp
tom@1530
   594
	)
jeanphi@1403
   595
SET(lux_uniform_textures_src
tom@1530
   596
	textures/blackbody.cpp
tom@1530
   597
	textures/constant.cpp
tom@1530
   598
	textures/equalenergy.cpp
tom@1530
   599
	textures/frequencytexture.cpp
tom@1530
   600
	textures/gaussiantexture.cpp
tom@1530
   601
	textures/irregulardata.cpp
tom@1530
   602
	textures/lampspectrum.cpp
tom@1530
   603
	textures/regulardata.cpp
lordcrc@2065
   604
	textures/tabulateddata.cpp
tom@1530
   605
	)
jeanphi@1799
   606
SET(lux_fresnel_textures_src
jeanphi@1799
   607
	textures/cauchytexture.cpp
jeanphi@2057
   608
	textures/sellmeiertexture.cpp
jeanphi@2057
   609
	textures/tabulatedfresnel.cpp
jeanphi@1799
   610
	)
jeanphi@1403
   611
SET(lux_textures_src
tom@1530
   612
	${lux_uniform_textures_src}
tom@1530
   613
	${lux_blender_textures_src}
jeanphi@1799
   614
	${lux_fresnel_textures_src}
tom@1530
   615
	textures/bilerp.cpp
tom@1530
   616
	textures/brick.cpp
tom@1530
   617
	textures/checkerboard.cpp
tom@1530
   618
	textures/dots.cpp
jeanphi@1403
   619
        textures/fbm.cpp
tom@1530
   620
	textures/harlequin.cpp
tom@1530
   621
	textures/imagemap.cpp
tom@1530
   622
	textures/marble.cpp
tom@1530
   623
	textures/mix.cpp
tom@1530
   624
	textures/scale.cpp
tom@1530
   625
	textures/uv.cpp
jeanphi@2251
   626
	textures/uvmask.cpp
tom@1530
   627
	textures/windy.cpp
tom@1530
   628
	textures/wrinkled.cpp
tom@1530
   629
	)
jeanphi@1403
   630
SET(lux_tonemaps_src
tom@1530
   631
	tonemaps/contrast.cpp
tom@1530
   632
	tonemaps/highcontrast.cpp
tom@1530
   633
	tonemaps/lineartonemap.cpp
tom@1530
   634
	tonemaps/maxwhite.cpp
tom@1530
   635
	tonemaps/nonlinear.cpp
tom@1530
   636
	tonemaps/reinhard.cpp
tom@1530
   637
	)
jeanphi@1403
   638
SET(lux_volumes_src
jeanphi@2011
   639
	volumes/clearvolume.cpp
tom@1530
   640
	volumes/cloud.cpp
tom@1530
   641
	volumes/exponential.cpp
tom@1530
   642
	volumes/homogeneous.cpp
tom@1530
   643
	volumes/volumegrid.cpp
tom@1530
   644
	)
jromang@104
   645
jeanphi@1403
   646
SET(lux_lib_src
tom@1530
   647
	${lux_core_src}
tom@1530
   648
	${lux_accelerators_src}
tom@1530
   649
	${lux_cameras_src}
tom@1530
   650
	${lux_films_src}
tom@1530
   651
	${lux_filters_src}
tom@1530
   652
	${lux_integrators_src}
tom@1530
   653
	${lux_lights_src}
tom@1530
   654
	${lux_materials_src}
tom@1530
   655
	${lux_pixelsamplers_src}
tom@1530
   656
	${lux_samplers_src}
tom@1530
   657
	${lux_shapes_src}
tom@1530
   658
	${lux_spds_src}
tom@1530
   659
	${lux_textures_src}
tom@1530
   660
	${lux_tonemaps_src}
tom@1530
   661
	${lux_volumes_src}
tom@1530
   662
	)
jeanphi@1971
   663
INCLUDE_DIRECTORIES(SYSTEM
jeanphi@1971
   664
	${Boost_INCLUDE_DIRS}
jeanphi@1971
   665
	${CMAKE_SOURCE_DIR}/core/external
jeanphi@1747
   666
	${JPEG_INCLUDE_DIR}
jeanphi@1747
   667
	${TIFF_INCLUDE_DIR}
jeanphi@1747
   668
	${PNG_INCLUDE_DIR}
jeanphi@1747
   669
	${OPENEXR_INCLUDE_DIRS}
jeanphi@1747
   670
	)
jeanphi@1747
   671
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/core
jeanphi@1989
   672
	${CMAKE_SOURCE_DIR}/core/queryable
jeanphi@1747
   673
	${CMAKE_SOURCE_DIR}/core/reflection
jeanphi@1747
   674
	${CMAKE_SOURCE_DIR}/core/reflection/bxdf
jeanphi@1747
   675
	${CMAKE_SOURCE_DIR}/core/reflection/fresnel
jeanphi@1747
   676
	${CMAKE_SOURCE_DIR}/core/reflection/microfacetdistribution
jeanphi@1747
   677
	${CMAKE_SOURCE_DIR}/spds
jeanphi@1747
   678
	${CMAKE_SOURCE_DIR}/lights/sphericalfunction
tom@1800
   679
	${CMAKE_SOURCE_DIR}
jeanphi@1747
   680
	${CMAKE_BINARY_DIR}
jeanphi@1747
   681
	)
neo1975@143
   682
tom@1679
   683
SET( LUXQTGUI_SRCS
tom@2073
   684
	qtgui/main.cpp
tom@2073
   685
	qtgui/histogramview.cpp
tom@2073
   686
	qtgui/mainwindow.cpp
tom@2073
   687
	qtgui/renderview.cpp
tom@2073
   688
	qtgui/luxapp.cpp
tom@2073
   689
	qtgui/aboutdialog.cpp
tom@2073
   690
	qtgui/lightgroupwidget.cpp
tom@2073
   691
	qtgui/tonemapwidget.cpp
tom@2073
   692
	qtgui/lenseffectswidget.cpp
tom@2073
   693
	qtgui/colorspacewidget.cpp
tom@2073
   694
	qtgui/gammawidget.cpp
tom@2073
   695
	qtgui/noisereductionwidget.cpp
tom@2073
   696
	qtgui/histogramwidget.cpp
tom@2083
   697
	qtgui/panewidget.cpp
tom@2073
   698
	)
tom@1679
   699
SET( LUXQTGUI_MOC
tom@2073
   700
	qtgui/histogramview.hxx
tom@2073
   701
	qtgui/mainwindow.hxx
tom@2073
   702
	qtgui/aboutdialog.hxx
tom@2073
   703
	qtgui/luxapp.hxx
tom@2073
   704
	qtgui/renderview.hxx
tom@2073
   705
	qtgui/lightgroupwidget.hxx
tom@2073
   706
	qtgui/tonemapwidget.hxx
tom@2073
   707
	qtgui/lenseffectswidget.hxx
tom@2073
   708
	qtgui/colorspacewidget.hxx
tom@2073
   709
	qtgui/gammawidget.hxx
tom@2073
   710
	qtgui/noisereductionwidget.hxx
tom@2073
   711
	qtgui/histogramwidget.hxx
tom@2083
   712
	qtgui/panewidget.hxx
tom@2073
   713
	)
tom@1679
   714
SET(LUXQTGUI_UIS
tom@2073
   715
	qtgui/luxrender.ui
tom@2073
   716
	qtgui/aboutdialog.ui
tom@2073
   717
	qtgui/lightgroup.ui
tom@2073
   718
	qtgui/tonemap.ui
tom@2073
   719
	qtgui/lenseffects.ui
tom@2073
   720
	qtgui/colorspace.ui
tom@2073
   721
	qtgui/gamma.ui
tom@2073
   722
	qtgui/noisereduction.ui
tom@2073
   723
	qtgui/histogram.ui
tom@2083
   724
	qtgui/pane.ui
tom@2073
   725
	)
tom@1679
   726
SET( LUXQTGUI_RCS
tom@2073
   727
	qtgui/icons.qrc
tom@2073
   728
	qtgui/splash.qrc
tom@2073
   729
	qtgui/images.qrc
tom@2073
   730
	)
neo1975@143
   731
neo1975@143
   732
#############################################################################
neo1975@143
   733
#############################################################################
neo1975@143
   734
#####################            LINKER INFO           ######################
neo1975@143
   735
#############################################################################
neo1975@143
   736
#############################################################################
neo1975@143
   737
tom@2117
   738
LINK_DIRECTORIES(${LINK_DIRECTORIES} ${Boost_LIBRARY_DIRS} )
ratow@827
   739
jromang@112
   740
#Here we build the core library
jromang@104
   741
ADD_LIBRARY(lux STATIC ${lux_lib_src} )
jensverwiebe@2115
   742
#TARGET_LINK_LIBRARIES(lux ${FREEIMAGE_LIBRARIES} ${Boost_LIBRARIES} )
jromang@104
   743
jromang@112
   744
dade916@717
   745
#############################################################################
jromang@112
   746
#Here we build the console executable
dade916@717
   747
#############################################################################
jromang@1951
   748
ADD_EXECUTABLE(luxconsole renderer/luxconsole.cpp)
neo1975@132
   749
IF(APPLE)
jensverwiebe@2115
   750
	TARGET_LINK_LIBRARIES(luxconsole -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${CMAKE_THREAD_LIBS_INIT} ${FREEIMAGE_LIBRARIES} z ${Boost_LIBRARIES} )
neo1975@132
   751
ELSE(APPLE)
tom@2256
   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})
jromang@384
   753
ENDIF(APPLE)
jromang@384
   754
dade916@717
   755
#############################################################################
jensverwiebe@1948
   756
#Here we build the LuxMerger executable
lordcrc@1551
   757
#############################################################################
jromang@1951
   758
ADD_EXECUTABLE(luxmerger tools/luxmerger.cpp)
lordcrc@1551
   759
IF(APPLE)
jensverwiebe@2115
   760
	TARGET_LINK_LIBRARIES(luxmerger -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${CMAKE_THREAD_LIBS_INIT} ${FREEIMAGE_LIBRARIES} z ${Boost_LIBRARIES} )
lordcrc@1551
   761
ELSE(APPLE)
tom@2256
   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})
lordcrc@1551
   763
ENDIF(APPLE)
lordcrc@1551
   764
lordcrc@1551
   765
#############################################################################
jensverwiebe@1948
   766
#Here we build the LuxComp executable
dade@1618
   767
#############################################################################
jromang@1951
   768
ADD_EXECUTABLE(luxcomp tools/luxcomp.cpp)
dade@1618
   769
IF(APPLE)
jensverwiebe@2115
   770
	TARGET_LINK_LIBRARIES(luxcomp -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${CMAKE_THREAD_LIBS_INIT} ${FREEIMAGE_LIBRARIES} z ${Boost_LIBRARIES} )
dade@1618
   771
ELSE(APPLE)
tom@2256
   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})
dade@1618
   773
ENDIF(APPLE)
dade@1618
   774
dade@1618
   775
#############################################################################
jeanphi@1971
   776
#Here we build the python module
jeanphi@1971
   777
#############################################################################
jeanphi@1971
   778
jeanphi@1971
   779
#############################################################################
jeanphi@1971
   780
#############################################################################
jeanphi@1971
   781
###########################   PYTHON LIBRARIES    ###########################
jeanphi@1971
   782
#############################################################################
jeanphi@1971
   783
#############################################################################
jeanphi@1971
   784
FIND_PACKAGE(PythonLibs)
jeanphi@1971
   785
IF(PYTHONLIBS_FOUND)
jeanphi@1971
   786
	MESSAGE(STATUS "Python library directory: " ${PYTHON_LIBRARIES} )
jeanphi@1971
   787
	MESSAGE(STATUS "Python include directory: " ${PYTHON_INCLUDE_PATH} )
jeanphi@1971
   788
jeanphi@1971
   789
	INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_PATH})
jeanphi@1971
   790
	IF(APPLE)
jeanphi@1971
   791
		ADD_LIBRARY(pylux MODULE python/binding.cpp)
jensverwiebe@2115
   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})
jensverwiebe@2255
   793
### if XCode used for compiling ###
jensverwiebe@2255
   794
#		ADD_CUSTOM_COMMAND(
jensverwiebe@2255
   795
#			TARGET pylux POST_BUILD
jensverwiebe@2255
   796
#			COMMAND mv release/libpylux.so release/pylux.so
jensverwiebe@2255
   797
#		)
jeanphi@1971
   798
	ELSE(APPLE)
jeanphi@1971
   799
		ADD_LIBRARY(pylux SHARED python/binding.cpp)
tom@2256
   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})
jeanphi@1971
   801
		ADD_CUSTOM_COMMAND(
jeanphi@1971
   802
			TARGET pylux POST_BUILD
jeanphi@1971
   803
			COMMAND mv libpylux.so pylux.so
jeanphi@1971
   804
			)
jeanphi@1971
   805
	ENDIF(APPLE)
jeanphi@1971
   806
ELSE(PYTHONLIBS_FOUND)
jeanphi@1971
   807
	MESSAGE( STATUS "Warning : could not find Python libraries - not building python module")
jeanphi@1971
   808
ENDIF(PYTHONLIBS_FOUND)
jeanphi@1971
   809
jeanphi@1971
   810
jeanphi@1971
   811
#############################################################################
ratow@827
   812
#Here we build the wxWidgets GUI executable
dade916@717
   813
#############################################################################
jeanphi@1971
   814
jeanphi@1971
   815
#############################################################################
jeanphi@1971
   816
#############################################################################
jeanphi@1971
   817
###########################      Find OpenGL       ##########################
jeanphi@1971
   818
#############################################################################
jeanphi@1971
   819
#############################################################################
jeanphi@1971
   820
SET(OPENGL_LIBRARY ${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
jeanphi@1971
   821
INCLUDE(${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
jeanphi@1971
   822
jeanphi@1971
   823
MESSAGE(STATUS "OpenGL include directory: " ${OPENGL_INCLUDE_DIR})
jeanphi@1971
   824
jeanphi@1971
   825
INCLUDE_DIRECTORIES(SYSTEM ${OPENGL_INCLUDE_DIR})
jeanphi@1971
   826
jeanphi@1971
   827
#############################################################################
jeanphi@1971
   828
#############################################################################
jeanphi@1971
   829
######################### wxWidgets LIBRARIES SETUP #########################
jeanphi@1971
   830
#############################################################################
jeanphi@1971
   831
#############################################################################
jeanphi@1971
   832
# Here you can define what libraries of wxWidgets you need for your
jeanphi@1971
   833
# application. You can figure out what libraries you need here;
jeanphi@1971
   834
# http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
jeanphi@1971
   835
SET(wxWidgets_USE_LIBS base core gl aui adv )
jeanphi@1971
   836
FIND_PACKAGE(wxWidgets)
jeanphi@1971
   837
dade916@717
   838
IF(wxWidgets_FOUND)
jeanphi@1971
   839
	# Include wxWidgets macros
jeanphi@1971
   840
	INCLUDE(${wxWidgets_USE_FILE})
jeanphi@1971
   841
	MESSAGE( STATUS "wxWidgets include directory: " ${wxWidgets_INCLUDE_DIRS} )
jeanphi@1971
   842
tom@2081
   843
	ADD_EXECUTABLE(luxrenderwx ${GUI_TYPE} renderer/wxluxapp.cpp renderer/wxluxgui.cpp renderer/wxluxframe.cpp renderer/wxglviewer.cpp renderer/wxviewer.cpp)
jeanphi@1971
   844
	INCLUDE_DIRECTORIES(SYSTEM ${wxWidgets_INCLUDE_DIRS} )
dade916@717
   845
dade916@717
   846
	IF(APPLE)
jeanphi@1971
   847
		INCLUDE_DIRECTORIES (SYSTEM /Developer/Headers/FlatCarbon /usr/local/include)
dade916@717
   848
		FIND_LIBRARY(CARBON_LIBRARY Carbon)
jensverwiebe@1948
   849
		FIND_LIBRARY(PYTHON_LIBRARY Python )
dade916@717
   850
		FIND_LIBRARY(OPENGL_LIBRARY OpenGL )
dade916@717
   851
		FIND_LIBRARY(AGL_LIBRARY AGL )
dade916@717
   852
		FIND_LIBRARY(APP_SERVICES_LIBRARY ApplicationServices )
dade916@717
   853
dade916@717
   854
		MESSAGE(STATUS ${CARBON_LIBRARY})
dade916@717
   855
		MARK_AS_ADVANCED (CARBON_LIBRARY)
jensverwiebe@1948
   856
		MARK_AS_ADVANCED (PYTHON_LIBRARY)
dade916@717
   857
		MARK_AS_ADVANCED (OPENGL_LIBRARY)
dade916@717
   858
		MARK_AS_ADVANCED (AGL_LIBRARY)
dade916@717
   859
		MARK_AS_ADVANCED (APP_SERVICES_LIBRARY)
jensverwiebe@2133
   860
		SET(EXTRA_LIBS ${CARBON_LIBRARY} ${OPENGL_LIBRARY} ${AGL_LIBRARY} ${APP_SERVICES_LIBRARY})
jensverwiebe@2115
   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} )
dade916@717
   862
	ELSE(APPLE)
tom@2256
   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})
ratow@655
   864
	ENDIF(APPLE)
jeanphi@1971
   865
ELSE(wxWidgets_FOUND)
jeanphi@1971
   866
	MESSAGE( STATUS "Warning : could not find wxWidgets - not building GUI")
ratow@655
   867
ENDIF(wxWidgets_FOUND)
ratow@655
   868
dade916@717
   869
#############################################################################
tom@1679
   870
#Here we build the QT4 GUI executable
tom@1679
   871
#############################################################################
jeanphi@1971
   872
jeanphi@1971
   873
#############################################################################
jeanphi@1971
   874
#############################################################################
jeanphi@1971
   875
############################   QT4 LIBRARIES    #############################
jeanphi@1971
   876
#############################################################################
jeanphi@1971
   877
#############################################################################
jeanphi@1971
   878
jeanphi@1971
   879
FIND_PACKAGE(Qt4)
lordcrc@1703
   880
IF(QT4_FOUND)
jeanphi@1971
   881
	MESSAGE(STATUS "Qt library directory: " ${QT_LIBRARY_DIR} )
jeanphi@1971
   882
	MESSAGE( STATUS "Qt include directory: " ${QT_INCLUDE_DIR} )
jeanphi@1971
   883
	SET(QT_USE_QTOPENGL TRUE)
jeanphi@1971
   884
	INCLUDE(${QT_USE_FILE})
jeanphi@1971
   885
jeanphi@1685
   886
	QT4_ADD_RESOURCES( LUXQTGUI_RC_SRCS ${LUXQTGUI_RCS}) 
jeanphi@1685
   887
	QT4_WRAP_UI( LUXQTGUI_UI_HDRS ${LUXQTGUI_UIS} )
jeanphi@1685
   888
	QT4_WRAP_CPP( LUXQTGUI_MOC_SRCS ${LUXQTGUI_MOC} )
dade916@717
   889
tom@2256
   890
	#file (GLOB TRANSLATIONS_FILES qtgui/translations/*.ts)
tom@2256
   891
	#qt4_create_translation(QM_FILES ${FILES_TO_TRANSLATE} ${TRANSLATIONS_FILES})
tom@1712
   892
tom@2256
   893
	#ADD_EXECUTABLE(luxrender ${GUI_TYPE} ${LUXQTGUI_SRCS} ${LUXQTGUI_MOC_SRCS} ${LUXQTGUI_RC_SRCS} ${LUXQTGUI_UI_HDRS} ${QM_FILES})
tom@2256
   894
	ADD_EXECUTABLE(luxrender ${GUI_TYPE} ${LUXQTGUI_SRCS} ${LUXQTGUI_MOC_SRCS} ${LUXQTGUI_RC_SRCS} ${LUXQTGUI_UI_HDRS})
jensverwiebe@1722
   895
	IF(APPLE)
jeanphi@1971
   896
		INCLUDE_DIRECTORIES (SYSTEM /Developer/Headers/FlatCarbon /usr/local/include)
jensverwiebe@1722
   897
		FIND_LIBRARY(CARBON_LIBRARY Carbon)
jensverwiebe@1948
   898
		FIND_LIBRARY(PYTHON_LIBRARY Python )
jensverwiebe@2110
   899
		FIND_LIBRARY(QT_LIBRARY QtCore QtGui QtOpenGL)
jensverwiebe@1722
   900
		FIND_LIBRARY(OPENGL_LIBRARY OpenGL )
jensverwiebe@1722
   901
		FIND_LIBRARY(AGL_LIBRARY AGL )
jensverwiebe@1722
   902
		FIND_LIBRARY(APP_SERVICES_LIBRARY ApplicationServices )
jensverwiebe@1722
   903
jensverwiebe@1722
   904
		MESSAGE(STATUS ${CARBON_LIBRARY})
jensverwiebe@1722
   905
		MARK_AS_ADVANCED (CARBON_LIBRARY)
jensverwiebe@1948
   906
		MARK_AS_ADVANCED (PYTHON_LIBRARY)
jensverwiebe@1722
   907
		MARK_AS_ADVANCED (QT_LIBRARY)
jensverwiebe@1722
   908
		MARK_AS_ADVANCED (OPENGL_LIBRARY)
jensverwiebe@1722
   909
		MARK_AS_ADVANCED (AGL_LIBRARY)
jensverwiebe@1722
   910
		MARK_AS_ADVANCED (APP_SERVICES_LIBRARY)
jensverwiebe@2133
   911
		SET(EXTRA_LIBS ${CARBON_LIBRARY} ${QT_LIBRARY} ${OPENGL_LIBRARY} ${AGL_LIBRARY} ${APP_SERVICES_LIBRARY})
jensverwiebe@2115
   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} )
jensverwiebe@2255
   913
### if XCode used for compiling ###
jensverwiebe@2255
   914
#		ADD_CUSTOM_COMMAND(
jensverwiebe@2255
   915
#			TARGET luxrender POST_BUILD
jensverwiebe@2255
   916
#			COMMAND rm -rf release/luxrender.app/Contents/Resources
jensverwiebe@2255
   917
#			COMMAND mkdir release/luxrender.app/Contents/Resources
jensverwiebe@2255
   918
#			COMMAND cp ../macos/luxrender.icns release/luxrender.app/Contents/Resources
jensverwiebe@2255
   919
#			COMMAND cp ../macos/luxscene.icns release/luxrender.app/Contents/Resources
jensverwiebe@2255
   920
#			)
jensverwiebe@1722
   921
	ELSE(APPLE)
tom@2256
   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})
jensverwiebe@1722
   923
	ENDIF(APPLE)
jeanphi@1971
   924
ELSE(QT4_FOUND)
jeanphi@1971
   925
	MESSAGE( STATUS "Warning : could not find Qt - not building Qt GUI")
lordcrc@1703
   926
ENDIF(QT4_FOUND)
jromang@1093
   927
dade916@717
   928
#############################################################################
dade916@717
   929
jromang@321
   930
#Install target
jensverwiebe@2131
   931
IF(wxWidgets_FOUND)
jensverwiebe@2131
   932
	INSTALL(TARGETS luxrender luxrenderwx luxconsole luxmerger
jensverwiebe@2131
   933
      	  RUNTIME DESTINATION bin
jensverwiebe@2131
   934
	)
jensverwiebe@2131
   935
ELSE(wxWidgets_FOUND)
jensverwiebe@2131
   936
	INSTALL(TARGETS luxrender luxconsole luxmerger
jensverwiebe@2131
   937
      	  RUNTIME DESTINATION bin
jensverwiebe@2131
   938
	)
jensverwiebe@2131
   939
ENDIF(wxWidgets_FOUND)
jromang@321
   940
jromang@374
   941
#Install API/Library
jromang@375
   942
INSTALL(FILES ${CMAKE_SOURCE_DIR}/core/api.h DESTINATION include/luxrender/)
jromang@1093
   943
INSTALL(TARGETS lux DESTINATION lib${LIB_SUFFIX})
jromang@1093
   944
#	ELSE(FIND_LIBRARY_USE_LIB64_PATHS) ARCHIVE DESTINATION lib
jromang@1093
   945
#	ENDIF(FIND_LIBRARY_USE_LIB64_PATHS)
jromang@1093
   946
jromang@374
   947
jromang@374
   948
#Install Desktop files
jromang@383
   949
INSTALL(FILES ${CMAKE_SOURCE_DIR}/renderer/luxrender.svg DESTINATION share/pixmaps/)
jromang@375
   950
INSTALL(FILES ${CMAKE_SOURCE_DIR}/renderer/luxrender.desktop DESTINATION share/applications/)
jromang@324
   951
jromang@321
   952
#Source package target
jromang@321
   953
ADD_CUSTOM_TARGET(package mkdir lux-${VERSION}
jromang@321
   954
	COMMAND cp -R ${CMAKE_SOURCE_DIR}/* lux-${VERSION}
jromang@321
   955
	COMMAND tar -cf ${CMAKE_BINARY_DIR}/lux-${VERSION}.tar lux-${VERSION}
jromang@321
   956
	COMMAND bzip2 --best ${CMAKE_BINARY_DIR}/lux-${VERSION}.tar
jromang@321
   957
	WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
jromang@321
   958
	DEPENDS ${lux_lib_src}
jromang@321
   959
	COMMENT Building source package
jromang@321
   960
)
dade916@553
   961
dade916@553
   962
# Dade - GCC Profiling (remember to uncomment the line in the middle of file too)
lordcrc@1551
   963
#SET_TARGET_PROPERTIES(luxconsole luxmerger luxrender PROPERTIES LINK_FLAGS "-pg")
dade916@553
   964
dade916@553
   965
# Dade - GCC 2 pass optimization (remember to uncomment the line in the middle of file too)
lordcrc@1551
   966
#SET_TARGET_PROPERTIES(luxconsole luxmerger luxrender PROPERTIES LINK_FLAGS "--coverage")
dade916@553
   967
dade916@553
   968
# Dade - Intel Compiler optimization
jensverwiebe@1949
   969
#REMOVE_DEFINITIONS(-ipo)