CMakeLists.txt
author Jean-Philippe Grimaldi <jeanphi@via.ecp.fr>
Sun Sep 13 11:14:14 2009 +0200 (2009-09-13)
changeset 1554 52b36551c296
parent 1543 d364ab9febcd
child 1618 4d890a918061
child 1654 874d9025a703
permissions -rw-r--r--
Network rendering fixes.

Jeanphi
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)
jromang@1093
     7
SET(VERSION 0.6)
jromang@188
     8
dade916@564
     9
# Dade - uncomment to obtain verbose building output
dade916@564
    10
#SET(CMAKE_VERBOSE_MAKEFILE true)
dade916@564
    11
neo1975@186
    12
IF(APPLE)
neo1975@186
    13
SET(APPLE_64 0)
neo1975@186
    14
ENDIF(APPLE)
jromang@188
    15
neo1975@132
    16
#Setting Universal Binary Properties, only for Mac OS X
jromang@188
    17
IF(APPLE)
dade916@717
    18
	IF(APPLE_64)
dade916@717
    19
		SET(CMAKE_OSX_ARCHITECTURES ppc64;x86_64)
dade916@717
    20
		SET(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
dade916@717
    21
	ELSE(APPLE_64)
dade916@717
    22
		SET(CMAKE_OSX_ARCHITECTURES ppc;i386)
dade916@717
    23
		SET(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk)
dade916@717
    24
	ENDIF(APPLE_64)
jromang@188
    25
ENDIF(APPLE)
neo1975@132
    26
jromang@104
    27
neo1975@143
    28
#############################################################################
neo1975@143
    29
#############################################################################
jromang@1093
    30
### check for the CPU we build for                                        ###
jromang@1093
    31
#############################################################################
jromang@1093
    32
#############################################################################
jromang@1093
    33
jromang@1093
    34
EXECUTE_PROCESS(
jromang@1093
    35
    COMMAND ${CMAKE_C_COMPILER} -dumpmachine
jromang@1093
    36
    OUTPUT_VARIABLE MACHINE
jromang@1093
    37
    OUTPUT_STRIP_TRAILING_WHITESPACE
jromang@1093
    38
)
jromang@1093
    39
MESSAGE(STATUS "Building for target ${MACHINE}")
jromang@1093
    40
jromang@1093
    41
STRING(REGEX MATCH "(i.86-*)|(athlon-*)|(pentium-*)" _mach_x86 ${MACHINE})
jromang@1093
    42
IF (_mach_x86)
jromang@1093
    43
    SET(ARCH_X86 1)
jromang@1093
    44
ENDIF (_mach_x86)
jromang@1093
    45
jromang@1093
    46
STRING(REGEX MATCH "(x86_64-*)|(X86_64-*)|(AMD64-*)|(amd64-*)" _mach_x86_64 ${MACHINE})
jromang@1093
    47
IF (_mach_x86_64)
jromang@1093
    48
    SET(ARCH_X86_64 1)
jromang@1093
    49
    SET(LIB_SUFFIX 64)
jromang@1093
    50
    #jromang - Hack to avoid boost bug on x64  Ubuntu 8.10 and Fedora 10 (http://www.luxrender.net/mantis/view.php?id=433)
jromang@1093
    51
    ADD_DEFINITIONS(-DBOOST_NO_INTRINSIC_INT64_T)
jromang@1093
    52
ENDIF (_mach_x86_64)
jromang@1093
    53
jromang@1093
    54
STRING(REGEX MATCH "(ppc-*)|(powerpc-*)" _mach_ppc ${MACHINE})
jromang@1093
    55
IF (_mach_ppc)
jromang@1093
    56
    SET(ARCH_PPC 1)
jromang@1093
    57
ENDIF (_mach_ppc)
jromang@1093
    58
jromang@1093
    59
jromang@1093
    60
jromang@1093
    61
jromang@1093
    62
jromang@1093
    63
#############################################################################
jromang@1093
    64
#############################################################################
neo1975@143
    65
###########################      Find BISON       ###########################
neo1975@143
    66
#############################################################################
neo1975@143
    67
#############################################################################
jromang@112
    68
FIND_PROGRAM(BISON_EXECUTABLE bison)
jromang@112
    69
IF (NOT BISON_EXECUTABLE)
dade916@717
    70
	MESSAGE(FATAL_ERROR "bison not found - aborting")
jromang@112
    71
ENDIF (NOT BISON_EXECUTABLE)
jromang@112
    72
jromang@112
    73
neo1975@143
    74
#############################################################################
neo1975@143
    75
#############################################################################
neo1975@143
    76
###########################      Find FLEX        ###########################
neo1975@143
    77
#############################################################################
neo1975@143
    78
#############################################################################
jromang@112
    79
FIND_PROGRAM(FLEX_EXECUTABLE flex)
jromang@112
    80
IF (NOT FLEX_EXECUTABLE)
dade916@717
    81
	MESSAGE(FATAL_ERROR "flex not found - aborting")
jromang@112
    82
ENDIF (NOT FLEX_EXECUTABLE)
jromang@112
    83
jromang@112
    84
neo1975@143
    85
#############################################################################
neo1975@143
    86
#############################################################################
dade916@572
    87
###########################      Find OpenGL       ##########################
dade916@572
    88
#############################################################################
dade916@572
    89
#############################################################################
dade916@572
    90
SET(OPENGL_LIBRARY ${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
dade916@572
    91
INCLUDE(${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
dade916@572
    92
dade916@717
    93
MESSAGE(STATUS "OpenGL include directory: " ${OPENGL_INCLUDE_DIR})
dade916@572
    94
dade916@572
    95
dade916@572
    96
#############################################################################
dade916@572
    97
#############################################################################
neo1975@143
    98
########################### BOOST LIBRARIES SETUP ###########################
neo1975@143
    99
#############################################################################
neo1975@143
   100
#############################################################################
jeanphi@1096
   101
FIND_PACKAGE(Boost REQUIRED)
jeanphi@1096
   102
IF(Boost_FOUND)
jeanphi@1096
   103
	MESSAGE(STATUS "Boost library directory: " ${Boost_LIBRARY_DIRS})
jeanphi@1096
   104
	MESSAGE(STATUS "Boost include directory: " ${Boost_INCLUDE_DIRS})
jeanphi@1096
   105
	IF(CYGWIN)
jeanphi@1096
   106
		SET(Boost_LIBRARIES boost_thread-gcc-mt boost_program_options-gcc-mt boost_filesystem-gcc-mt boost_serialization-gcc-mt boost_iostreams-gcc-mt boost_regex-gcc-mt)
jeanphi@1096
   107
	ELSEIF(APPLE)
tom@1530
   108
		SET(Boost_LIBRARIES boost_system-xgcc40-mt-1_39 boost_thread-xgcc40-mt-1_39 boost_program_options-xgcc40-mt-1_39 boost_filesystem-xgcc40-mt-1_39 boost_serialization-xgcc40-mt-1_39 boost_iostreams-xgcc40-mt-1_39 boost_regex-xgcc40-mt-1_39)
tom@1530
   109
#		SET(Boost_LIBRARIES boost_thread-mt-1_34_1 boost_program_options-mt-1_34_1 boost_filesystem-mt-1_34_1 boost_serialization-mt-1_34_1 boost_iostreams-mt-1_34_1 boost_regex-mt-1_34_1)
jeanphi@1096
   110
	ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
jeanphi@1096
   111
		SET(Boost_LIBRARIES boost_thread boost_program_options boost_filesystem boost_serialization boost_iostreams boost_regex)
jeanphi@1096
   112
	ELSE(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
jeanphi@1096
   113
		SET(Boost_LIBRARIES boost_thread-mt boost_program_options-mt boost_filesystem-mt boost_serialization-mt boost_iostreams-mt boost_regex-mt)
jeanphi@1096
   114
	ENDIF(CYGWIN)
jeanphi@1096
   115
ELSE(Boost_FOUND)
jeanphi@1096
   116
	MESSAGE(FATAL_ERROR "Could not find Boost")
jeanphi@1096
   117
ENDIF(Boost_FOUND)
neo1975@132
   118
neo1975@143
   119
neo1975@143
   120
#############################################################################
neo1975@143
   121
#############################################################################
neo1975@143
   122
######################### OPENEXR LIBRARIES SETUP ###########################
neo1975@143
   123
#############################################################################
neo1975@143
   124
#############################################################################
jeanphi@1096
   125
FIND_PATH(OPENEXR_INCLUDE_DIRS
jeanphi@1096
   126
	ImfXdr.h
jeanphi@1096
   127
	PATHS
jeanphi@1096
   128
	/usr/local/include/OpenEXR
jeanphi@1096
   129
	/usr/include/OpenEXR
jeanphi@1096
   130
	/sw/include/OpenEXR
jeanphi@1096
   131
	/opt/local/include/OpenEXR
jeanphi@1096
   132
	/opt/csw/include/OpenEXR
jeanphi@1096
   133
	/opt/include/OpenEXR
jeanphi@1096
   134
) 
ratow@1115
   135
IF(APPLE)
ratow@1115
   136
   SET(OPENEXR_LIBRARIES Half IlmImf Iex Imath IlmThread)
neo1975@143
   137
ratow@1115
   138
ELSE(APPLE)
ratow@1115
   139
   SET(OPENEXR_LIBRARIES Half IlmImf Iex Imath)
ratow@1115
   140
ENDIF(APPLE)
dade916@717
   141
jromang@163
   142
#############################################################################
jromang@163
   143
#############################################################################
jromang@163
   144
########################### PNG   LIBRARIES SETUP ###########################
jromang@163
   145
#############################################################################
jromang@163
   146
#############################################################################
jromang@163
   147
# - Find the native PNG includes and library
jromang@163
   148
#
jromang@163
   149
# This module defines
jromang@163
   150
#  PNG_INCLUDE_DIR, where to find png.h, etc.
jromang@163
   151
#  PNG_LIBRARIES, the libraries to link against to use PNG.
jromang@163
   152
#  PNG_DEFINITIONS - You should ADD_DEFINITONS(${PNG_DEFINITIONS}) before compiling code that includes png library files.
jromang@163
   153
#  PNG_FOUND, If false, do not try to use PNG.
jromang@163
   154
# also defined, but not for general use are
jromang@163
   155
#  PNG_LIBRARY, where to find the PNG library.
jromang@163
   156
# None of the above will be defined unles zlib can be found.
jromang@163
   157
# PNG depends on Zlib
jromang@165
   158
INCLUDE(FindPNG)
jromang@320
   159
IF(PNG_FOUND)
jromang@320
   160
ELSE(PNG_FOUND)
jromang@320
   161
	MESSAGE( STATUS "Warning : could not find PNG - building without png support")
jromang@320
   162
ENDIF(PNG_FOUND)
jromang@166
   163
#FIND_PACKAGE(PNG REQUIRED)
jromang@163
   164
neo1975@143
   165
jromang@165
   166
#############################################################################
jromang@165
   167
#############################################################################
jromang@165
   168
########################### TIFF  LIBRARIES SETUP ###########################
jromang@165
   169
#############################################################################
jromang@165
   170
#############################################################################
jromang@165
   171
# - Find TIFF library
jromang@165
   172
# Find the native TIFF includes and library
jromang@165
   173
# This module defines
jromang@165
   174
#  TIFF_INCLUDE_DIR, where to find tiff.h, etc.
jromang@165
   175
#  TIFF_LIBRARIES, libraries to link against to use TIFF.
jromang@165
   176
#  TIFF_FOUND, If false, do not try to use TIFF.
jromang@165
   177
# also defined, but not for general use are
jromang@165
   178
#  TIFF_LIBRARY, where to find the TIFF library.
jeanphi@1096
   179
INCLUDE(FindTIFF)
jeanphi@1096
   180
#FIND_PACKAGE(TIFF REQUIRED)
jeanphi@1096
   181
IF(TIFF_FOUND)
jeanphi@1096
   182
	MESSAGE( STATUS "Found TIFF: " ${TIFF_LIBRARIES} )
jeanphi@1096
   183
ELSE(TIFF_FOUND)
jeanphi@1096
   184
	MESSAGE( STATUS "Warning : could not find TIFF - building without tiff support")
jeanphi@1096
   185
ENDIF(TIFF_FOUND)
neo1975@143
   186
neo1975@143
   187
jromang@166
   188
#############################################################################
jromang@166
   189
#############################################################################
jromang@166
   190
########################### JPEG  LIBRARIES SETUP ###########################
jromang@166
   191
#############################################################################
jromang@166
   192
#############################################################################
jromang@166
   193
# - Find JPEG
jromang@166
   194
# Find the native JPEG includes and library
jromang@166
   195
# This module defines
jromang@166
   196
#  JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
jromang@166
   197
#  JPEG_LIBRARIES, the libraries needed to use JPEG.
jromang@166
   198
#  JPEG_FOUND, If false, do not try to use JPEG.
jromang@166
   199
# also defined, but not for general use are
jromang@166
   200
#  JPEG_LIBRARY, where to find the JPEG library.
jeanphi@1096
   201
INCLUDE(FindJPEG)
jeanphi@1096
   202
#FIND_PACKAGE(JPEG REQUIRED)
jeanphi@1096
   203
IF(JPEG_FOUND)
jeanphi@1096
   204
	MESSAGE( STATUS "JPEG include directory: " ${JPEG_INCLUDE_DIR} )
jeanphi@1096
   205
ELSE(JPEG_FOUND)
jeanphi@1096
   206
	MESSAGE( STATUS "Warning : could not find JPEG - building without jpeg support")
jeanphi@1096
   207
ENDIF(JPEG_FOUND)
jromang@166
   208
dade916@717
   209
jeanphi@495
   210
#############################################################################
jeanphi@495
   211
#############################################################################
ratow@655
   212
######################### wxWidgets LIBRARIES SETUP #########################
ratow@655
   213
#############################################################################
ratow@655
   214
#############################################################################
ratow@655
   215
# Here you can define what libraries of wxWidgets you need for your
ratow@655
   216
# application. You can figure out what libraries you need here;
ratow@655
   217
# http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
jeanphi@1096
   218
SET(wxWidgets_USE_LIBS base core gl aui adv )
ratow@655
   219
FIND_PACKAGE(wxWidgets)
ratow@655
   220
IF(wxWidgets_FOUND)
ratow@655
   221
    # Include wxWidgets macros
tom@1530
   222
    INCLUDE(${wxWidgets_USE_FILE})
dade916@717
   223
		MESSAGE( STATUS "wxWidgets include directory: " ${wxWidgets_INCLUDE_DIRS} )
ratow@655
   224
ELSE(wxWidgets_FOUND)
ratow@655
   225
		MESSAGE( STATUS "Warning : could not find wxWidgets - not building GUI")
ratow@655
   226
ENDIF(wxWidgets_FOUND)
ratow@655
   227
dade916@717
   228
ratow@655
   229
#############################################################################
ratow@655
   230
#############################################################################
dade916@669
   231
############################ THREADING LIBRARIES ############################
dade916@669
   232
#############################################################################
dade916@669
   233
#############################################################################
dade916@669
   234
dade916@669
   235
FIND_PACKAGE(Threads REQUIRED)
dade916@669
   236
dade916@717
   237
dade916@669
   238
#############################################################################
dade916@669
   239
#############################################################################
jeanphi@495
   240
###########################   SYSTEM LIBRARIES    ###########################
jeanphi@495
   241
#############################################################################
jeanphi@495
   242
#############################################################################
jeanphi@495
   243
IF(APPLE)
jeanphi@1096
   244
	SET(SYS_LIBRARIES z )
jeanphi@495
   245
ENDIF(APPLE)
jeanphi@495
   246
IF(CYGWIN)
jeanphi@495
   247
	SET(SYS_LIBRARIES wsock32 ws2_32)
jeanphi@495
   248
	ADD_DEFINITIONS(-D_WIN32_WINNT=0x0551 -D__USE_W32_SOCKETS -D_GLIBCXX__PTHREADS)
jeanphi@495
   249
ENDIF(CYGWIN)
jeanphi@495
   250
jromang@166
   251
dade916@717
   252
#############################################################################
jromang@104
   253
#All dependencies OK !
dade916@717
   254
#############################################################################
jromang@320
   255
jromang@320
   256
#Generate the config.h file
jromang@320
   257
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
jromang@320
   258
ADD_DEFINITIONS(-DLUX_USE_CONFIG_H)
jromang@320
   259
neo1975@143
   260
#############################################################################
neo1975@143
   261
#############################################################################
neo1975@143
   262
#########################      COMPILER FLAGS     ###########################
neo1975@143
   263
#############################################################################
neo1975@143
   264
#############################################################################
dade916@717
   265
# Dade - default compiler options
tom@1530
   266
ADD_DEFINITIONS(-O3 -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
dade916@717
   267
dade916@717
   268
dade916@717
   269
#############################################################################
dade916@717
   270
# Compiler flags for specific setup
dade916@717
   271
#############################################################################
dade916@539
   272
tom@1530
   273
# doug - When linking liblux as a python extension, need to compile with -fPIC
tom@1530
   274
#ADD_DEFINITIONS(-fPIC)
tom@1530
   275
jeanphi@1096
   276
# Jens - default Mac compiler options with OpenGL
jeanphi@1098
   277
#ADD_DEFINITIONS(-O3 -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H )
jeanphi@1096
   278
# Jens - testing Mac compiler options (debug)
jeanphi@1096
   279
#ADD_DEFINITIONS(-DHAVE_PTHREAD_H)
jeanphi@1096
   280
dade916@553
   281
# Dade - GCC Profiling (remember to uncomment the line at the end of file too)
dade916@717
   282
#ADD_DEFINITIONS(-pg -g -O2 -march=-msse -mfpmath=sse -ftree-vectorize -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
dade916@553
   283
dade916@553
   284
# Dade - GCC 2 pass optimization (remember to uncomment the line at the end of file too)
dade916@553
   285
#ADD_DEFINITIONS(-O3 --coverage -march=prescott -mfpmath=sse -ftree-vectorize -funroll-loops -ffast-math -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
dade916@553
   286
#ADD_DEFINITIONS(-O3 -fbranch-probabilities -march=prescott -mfpmath=sse -ftree-vectorize -funroll-loops -ffast-math -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
dade916@553
   287
dade916@553
   288
# Dade - my settings
dade916@780
   289
#ADD_DEFINITIONS(-g -O0 -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
dade916@717
   290
#ADD_DEFINITIONS(-O3 -march=prescott -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
dade916@717
   291
#ADD_DEFINITIONS(-O3 -march=athlon-xp -m3dnow -msse2 -mfpmath=sse -ftree-vectorize -funroll-loops -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H )
dade916@553
   292
dade916@556
   293
# Dade - Intel CC settings (double pass, 32bit, remember to uncomment the line at the end of file too)
dade916@553
   294
#  rm -rf CMakeCache.txt CMakeFiles
dade916@553
   295
#  CC=/opt/intel/cc/10.1.015/bin/icc CXX=/opt/intel/cc/10.1.015/bin/icpc cmake lux
dade916@553
   296
# Pass 1
dade916@553
   297
#ADD_DEFINITIONS(-prof-gen -prof-dir /tmp  -O3 -ipo -mtune=core2 -xT -unroll -fp-model fast=2 -rcd -no-prec-div -DLUX_USE_OPENGL -DHAVE_PTHREAD_H '-D"__sync_fetch_and_add(ptr,addend)=_InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(ptr)), addend)"')
dade916@553
   298
# Pass 2
dade916@553
   299
#ADD_DEFINITIONS(-prof-use -prof-dir /tmp  -O3 -ipo -mtune=core2 -xT -unroll -fp-model fast=2 -rcd -no-prec-div -DLUX_USE_OPENGL -DHAVE_PTHREAD_H '-D"__sync_fetch_and_add(ptr,addend)=_InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(ptr)), addend)"')
dade916@556
   300
 
dade916@556
   301
# Dade - Intel CC settings (single pass, 32bit)
dade916@556
   302
#ADD_DEFINITIONS(-O3 -ip -mtune=core2 -xT -unroll -fp-model fast=2 -rcd -no-prec-div -DLUX_USE_OPENGL -DHAVE_PTHREAD_H '-D"__sync_fetch_and_add(ptr,addend)=_InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(ptr)), addend)"')
dade916@553
   303
dade916@556
   304
# Dade - Intel CC settings (single pass, 64bit)
dade916@556
   305
#ADD_DEFINITIONS(-O3 -ip -mtune=core2 -xT -unroll -fp-model fast=2 -rcd -no-prec-div -DLUX_USE_OPENGL -DHAVE_PTHREAD_H '-D"__sync_fetch_and_add(ptr,addend)=_InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(ptr)), addend)"' -DBOOST_NO_INTRINSIC_INT64_T "-D'__builtin_vsnprintf(__out, __size, __fmt, __args)'='__builtin_vsnprintf(__out, __size, __fmt, (char *) __args)'") 
dade916@553
   306
dade916@553
   307
#ADD_DEFINITIONS(-O3 -msse -mfpmath=sse -ftree-vectorize -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
dade916@669
   308
#ADD_DEFINITIONS(-O3 -march=athlon-xp -mmmx -m3dnow -msse -mfpmath=sse -ftree-vectorize -Wall -DLUX_USE_OPENGL -DHAVE_PTHREAD_H )
jromang@358
   309
#ADD_DEFINITIONS(-O3 -Wall -msse -msse2 -DLUX_USE_SSE -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
dade916@539
   310
#ADD_DEFINITIONS(-g -Wall -msse -DLUX_USE_OPENGL -DHAVE_PTHREAD_H)
jromang@182
   311
#ICC definitions
jromang@182
   312
#ADD_DEFINITIONS(-O3 -ipo -no-prec-div -static -fp-model fast=2 -rcd)
jromang@182
   313
neo1975@143
   314
#############################################################################
neo1975@143
   315
#############################################################################
neo1975@143
   316
#########################      CUSTOM COMMAND     ###########################
neo1975@143
   317
#############################################################################
neo1975@143
   318
#############################################################################
jromang@104
   319
# Create custom command for flex/lex (note the outputs)
jromang@104
   320
ADD_CUSTOM_COMMAND(
jromang@104
   321
SOURCE ${CMAKE_SOURCE_DIR}/core/luxlex.l
jromang@104
   322
COMMAND ${FLEX_EXECUTABLE} 
jromang@104
   323
ARGS -o${CMAKE_BINARY_DIR}/luxlex.cpp
jromang@104
   324
      ${CMAKE_SOURCE_DIR}/core/luxlex.l
jromang@104
   325
TARGET LuxLexer
jromang@104
   326
#DEPENDS ${CMAKE_BINARY_DIR}/core/pbrtparse.cpp ${lux_BINARY_DIR}/core/pbrtparse.h
jromang@104
   327
OUTPUTS ${CMAKE_BINARY_DIR}/luxlex.cpp)
jromang@104
   328
SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/luxlex.cpp GENERATED)
jromang@104
   329
jromang@104
   330
# Create custom command for bison/yacc (note the DEPENDS)
neo1975@186
   331
IF(APPLE AND !APPLE_64)
neo1975@186
   332
	ADD_CUSTOM_COMMAND(
neo1975@186
   333
	TARGET LuxParser
neo1975@186
   334
	#DEPENDS ${CMAKE_BINARY_DIR}/core/luxlex.cpp
neo1975@186
   335
	SOURCE ${CMAKE_SOURCE_DIR}/core/luxparse.y
neo1975@186
   336
	COMMAND ${BISON_EXECUTABLE} -y ${CMAKE_SOURCE_DIR}/core/luxparse.y -o ${CMAKE_BINARY_DIR}/luxparse.cpp -d
neo1975@186
   337
	COMMAND mv ${CMAKE_SOURCE_DIR}/luxparse.cpp.h ${CMAKE_BINARY_DIR}/luxparse.hpp
neo1975@186
   338
	OUTPUTS ${CMAKE_BINARY_DIR}/luxparse.cpp ${CMAKE_BINARY_DIR}/luxparse.hpp)
neo1975@186
   339
ELSE(APPLE AND !APPLE_64)
neo1975@186
   340
	ADD_CUSTOM_COMMAND(
neo1975@186
   341
	SOURCE ${CMAKE_SOURCE_DIR}/core/luxparse.y
neo1975@186
   342
	COMMAND ${BISON_EXECUTABLE} 
neo1975@186
   343
	ARGS -y ${CMAKE_SOURCE_DIR}/core/luxparse.y
neo1975@186
   344
	     -o ${CMAKE_BINARY_DIR}/luxparse.cpp
neo1975@186
   345
	     -d
neo1975@186
   346
	TARGET LuxParser
neo1975@186
   347
	#DEPENDS ${CMAKE_BINARY_DIR}/core/luxlex.cpp
neo1975@186
   348
	OUTPUTS ${CMAKE_BINARY_DIR}/luxparse.cpp ${CMAKE_BINARY_DIR}/luxparse.hpp)
neo1975@186
   349
ENDIF(APPLE AND !APPLE_64)
jromang@104
   350
SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/core/luxparse.cpp GENERATED)
jromang@104
   351
neo1975@143
   352
neo1975@143
   353
#############################################################################
neo1975@143
   354
#############################################################################
neo1975@144
   355
#########################      APPLE CUSTOM PKG   ###########################
neo1975@144
   356
#############################################################################
neo1975@144
   357
#############################################################################
neo1975@144
   358
IF(APPLE)
neo1975@144
   359
	ADD_CUSTOM_TARGET(dist DEPENDS luxrender)
neo1975@144
   360
	ADD_CUSTOM_COMMAND(
neo1975@144
   361
	TARGET dist POST_BUILD
neo1975@144
   362
	COMMAND rm -rf LuxRender.app 
neo1975@144
   363
	COMMAND mkdir LuxRender.app 
jromang@384
   364
	COMMAND mkdir LuxRender.app/Contents 
jromang@384
   365
	COMMAND mkdir LuxRender.app/Contents/MacOS 
jeanphi@1096
   366
	COMMAND mkdir LuxRender.app/Contents/Resources
jromang@384
   367
	COMMAND cp ../macos/Info.plist LuxRender.app/Contents
jeanphi@1096
   368
	COMMAND cp LuxRender.icns LuxRender.app/Contents/Resources
jromang@384
   369
	COMMAND echo APPLnone > LuxRender.app/Contents/PkgInfo
jromang@384
   370
	COMMAND cp luxrender LuxRender.app/Contents/MacOS/LuxRender)
neo1975@144
   371
ENDIF(APPLE)
neo1975@144
   372
neo1975@144
   373
neo1975@144
   374
#############################################################################
neo1975@144
   375
#############################################################################
neo1975@143
   376
#####################      SOURCE FILE FOR lux_lib     ######################
neo1975@143
   377
#############################################################################
neo1975@143
   378
#############################################################################
jeanphi@1403
   379
jeanphi@1403
   380
SET(lux_core_reflection_src
tom@1530
   381
	core/reflection/bxdf.cpp
tom@1530
   382
	core/reflection/fresnel.cpp
tom@1530
   383
	core/reflection/microfacetdistribution.cpp
tom@1530
   384
	core/reflection/bxdf/cooktorrance.cpp
tom@1530
   385
	core/reflection/bxdf/fresnelblend.cpp
tom@1530
   386
	core/reflection/bxdf/lafortune.cpp
tom@1530
   387
	core/reflection/bxdf/lambertian.cpp
tom@1530
   388
	core/reflection/bxdf/microfacet.cpp
tom@1530
   389
	core/reflection/bxdf/nulltransmission.cpp
tom@1530
   390
	core/reflection/bxdf/orennayar.cpp
tom@1530
   391
	core/reflection/bxdf/specularreflection.cpp
tom@1530
   392
	core/reflection/bxdf/speculartransmission.cpp
tom@1530
   393
	core/reflection/fresnel/fresnelnoop.cpp
tom@1530
   394
	core/reflection/fresnel/fresneldielectric.cpp
tom@1530
   395
	core/reflection/fresnel/fresnelconductor.cpp
tom@1530
   396
	core/reflection/fresnel/fresnelslick.cpp
tom@1530
   397
	core/reflection/fresnel/fresnelgeneral.cpp
tom@1530
   398
	core/reflection/microfacetdistribution/anisotropic.cpp
tom@1530
   399
	core/reflection/microfacetdistribution/beckmann.cpp
tom@1530
   400
	core/reflection/microfacetdistribution/blinn.cpp
tom@1530
   401
	core/reflection/microfacetdistribution/wardisotropic.cpp
tom@1530
   402
	)
jeanphi@1403
   403
SET(lux_core_src
tom@1530
   404
	${CMAKE_BINARY_DIR}/luxparse.cpp
tom@1530
   405
	${CMAKE_BINARY_DIR}/luxlex.cpp
tom@1530
   406
	core/api.cpp
tom@1530
   407
	core/camera.cpp
tom@1530
   408
	core/color.cpp
tom@1530
   409
	core/context.cpp
jeanphi@1543
   410
	core/contribution.cpp
tom@1530
   411
	core/dynload.cpp
tom@1530
   412
	core/exrio.cpp
tom@1530
   413
	core/film.cpp
tom@1530
   414
	core/geometry/bbox.cpp
tom@1530
   415
	core/geometry/matrix4x4.cpp
tom@1530
   416
	core/geometry/quaternion.cpp
tom@1530
   417
	core/geometry/raydifferential.cpp
tom@1530
   418
	core/geometry/transform.cpp
tom@1530
   419
	core/igiio.cpp
tom@1530
   420
	core/imagereader.cpp
tom@1530
   421
	core/light.cpp
tom@1530
   422
	core/material.cpp
tom@1530
   423
	core/mc.cpp
tom@1530
   424
	core/motionsystem.cpp
tom@1530
   425
	core/osfunc.cpp
tom@1530
   426
	core/paramset.cpp
tom@1530
   427
	core/parser.cpp
tom@1530
   428
	core/photonmap.cpp
tom@1530
   429
	core/pngio.cpp
tom@1530
   430
	core/primitive.cpp
tom@1530
   431
	${lux_core_reflection_src}
tom@1530
   432
	core/renderfarm.cpp
tom@1530
   433
	core/sampling.cpp
tom@1530
   434
	core/scene.cpp
tom@1530
   435
	core/shape.cpp
tom@1530
   436
	core/spd.cpp
tom@1530
   437
	core/spectrum.cpp
tom@1530
   438
        core/spectrumwavelengths.cpp
tom@1530
   439
	core/texture.cpp
tom@1530
   440
	core/tgaio.cpp
tom@1530
   441
	core/timer.cpp
tom@1530
   442
	core/transport.cpp
tom@1530
   443
	core/util.cpp
tom@1530
   444
	core/volume.cpp
tom@1530
   445
	renderer/renderserver.cpp
tom@1530
   446
	)
jeanphi@1403
   447
SET(lux_accelerators_src
tom@1530
   448
	accelerators/bruteforce.cpp
tom@1530
   449
        accelerators/bvhaccel.cpp
tom@1530
   450
	accelerators/grid.cpp
tom@1530
   451
	accelerators/qbvhaccel.cpp
tom@1530
   452
	accelerators/tabreckdtree.cpp
tom@1530
   453
	accelerators/unsafekdtree.cpp
tom@1530
   454
	)
jeanphi@1403
   455
SET(lux_cameras_src
tom@1530
   456
	cameras/environment.cpp
tom@1530
   457
	cameras/perspective.cpp
tom@1530
   458
	cameras/orthographic.cpp
tom@1530
   459
	cameras/realistic.cpp
tom@1530
   460
	)
jeanphi@1403
   461
SET(lux_films_src
tom@1530
   462
	film/fleximage.cpp
tom@1530
   463
	)
jeanphi@1403
   464
SET(lux_filters_src
tom@1530
   465
	filters/box.cpp
tom@1530
   466
	filters/gaussian.cpp
tom@1530
   467
	filters/mitchell.cpp
tom@1530
   468
	filters/sinc.cpp
tom@1530
   469
	filters/triangle.cpp
tom@1530
   470
	)
jeanphi@1403
   471
SET(lux_integrators_src
tom@1530
   472
	integrators/bidirectional.cpp
tom@1530
   473
	integrators/directlighting.cpp
tom@1530
   474
	integrators/distributedpath.cpp
tom@1530
   475
	integrators/emission.cpp
tom@1530
   476
	integrators/exphotonmap.cpp
tom@1530
   477
	integrators/igi.cpp
tom@1530
   478
	integrators/path.cpp
tom@1530
   479
	integrators/single.cpp
tom@1530
   480
	)
jeanphi@1403
   481
SET(lux_lights_src
tom@1530
   482
	lights/area.cpp
tom@1530
   483
	lights/distant.cpp
tom@1530
   484
	lights/infinite.cpp
tom@1530
   485
	lights/infinitesample.cpp
tom@1530
   486
	lights/point.cpp
tom@1530
   487
	lights/projection.cpp
tom@1530
   488
	lights/sphericalfunction/photometricdata_ies.cpp
tom@1530
   489
	lights/sphericalfunction/sphericalfunction.cpp
tom@1530
   490
	lights/sphericalfunction/sphericalfunction_ies.cpp
tom@1530
   491
	lights/spot.cpp
tom@1530
   492
	lights/sky.cpp
tom@1530
   493
	lights/sun.cpp
tom@1530
   494
	)
jeanphi@1403
   495
SET(lux_materials_src
tom@1530
   496
	materials/carpaint.cpp
tom@1530
   497
	materials/glass.cpp
tom@1530
   498
	materials/glossy.cpp
tom@1530
   499
	materials/matte.cpp
tom@1530
   500
	materials/mattetranslucent.cpp
tom@1530
   501
	materials/metal.cpp
tom@1530
   502
	materials/mirror.cpp
tom@1530
   503
	materials/mixmaterial.cpp
tom@1530
   504
	materials/null.cpp
tom@1530
   505
	materials/roughglass.cpp
tom@1530
   506
	materials/shinymetal.cpp
tom@1530
   507
	)
jeanphi@1403
   508
SET(lux_pixelsamplers_src
tom@1530
   509
	pixelsamplers/hilbertpx.cpp
tom@1530
   510
	pixelsamplers/linear.cpp
tom@1530
   511
	pixelsamplers/lowdiscrepancypx.cpp
tom@1530
   512
	pixelsamplers/tilepx.cpp
tom@1530
   513
	pixelsamplers/vegas.cpp
tom@1530
   514
	)
jeanphi@1403
   515
SET(lux_samplers_src
tom@1530
   516
	samplers/erpt.cpp
tom@1530
   517
	samplers/lowdiscrepancy.cpp
tom@1530
   518
	samplers/metrosampler.cpp
tom@1530
   519
	samplers/random.cpp
tom@1530
   520
	)
jeanphi@1403
   521
SET(lux_shapes_src
tom@1530
   522
	shapes/cone.cpp
tom@1530
   523
	shapes/cylinder.cpp
tom@1530
   524
	shapes/disk.cpp
tom@1530
   525
	shapes/heightfield.cpp
tom@1530
   526
	shapes/hyperboloid.cpp
tom@1530
   527
	shapes/lenscomponent.cpp
tom@1530
   528
	shapes/loopsubdiv.cpp
tom@1530
   529
	shapes/mesh.cpp
tom@1530
   530
	shapes/meshbarytriangle.cpp
tom@1530
   531
	shapes/meshquadrilateral.cpp
tom@1530
   532
	shapes/meshwaldtriangle.cpp
tom@1530
   533
	shapes/nurbs.cpp
tom@1530
   534
	shapes/paraboloid.cpp
tom@1530
   535
	shapes/plymesh.cpp
tom@1530
   536
	shapes/plymesh/rply.c
tom@1530
   537
	shapes/quad.cpp
tom@1530
   538
	shapes/quadrilateral.cpp
tom@1530
   539
	shapes/sphere.cpp
tom@1530
   540
	shapes/torus.cpp
tom@1530
   541
	)
jeanphi@1403
   542
SET(lux_spds_src
tom@1530
   543
	spds/blackbodyspd.cpp
tom@1530
   544
	spds/equalspd.cpp
tom@1530
   545
	spds/frequencyspd.cpp
tom@1530
   546
	spds/gaussianspd.cpp
tom@1530
   547
	spds/irregular.cpp
tom@1530
   548
	spds/regular.cpp
tom@1530
   549
	spds/rgbillum.cpp
tom@1530
   550
	spds/rgbrefl.cpp
tom@1530
   551
	)
jeanphi@1403
   552
SET(lux_blender_textures_src
tom@1530
   553
	textures/blender_blend.cpp
tom@1530
   554
	textures/blender_clouds.cpp
tom@1530
   555
	textures/blender_distortednoise.cpp
tom@1530
   556
	textures/blender_magic.cpp
tom@1530
   557
	textures/blender_marble.cpp
tom@1530
   558
	textures/blender_musgrave.cpp
tom@1530
   559
	textures/blender_noise.cpp
tom@1530
   560
	textures/blender_noiselib.cpp
tom@1530
   561
	textures/blender_stucci.cpp
tom@1530
   562
	textures/blender_texlib.cpp
tom@1530
   563
	textures/blender_voronoi.cpp
tom@1530
   564
	textures/blender_wood.cpp
tom@1530
   565
	)
jeanphi@1403
   566
SET(lux_uniform_textures_src
tom@1530
   567
	textures/blackbody.cpp
tom@1530
   568
	textures/constant.cpp
tom@1530
   569
	textures/equalenergy.cpp
tom@1530
   570
	textures/frequencytexture.cpp
tom@1530
   571
	textures/gaussiantexture.cpp
tom@1530
   572
	textures/irregulardata.cpp
tom@1530
   573
	textures/lampspectrum.cpp
tom@1530
   574
	textures/regulardata.cpp
tom@1530
   575
	)
jeanphi@1403
   576
SET(lux_textures_src
tom@1530
   577
	${lux_uniform_textures_src}
tom@1530
   578
	${lux_blender_textures_src}
tom@1530
   579
	textures/bilerp.cpp
tom@1530
   580
	textures/brick.cpp
tom@1530
   581
	textures/checkerboard.cpp
tom@1530
   582
	textures/dots.cpp
jeanphi@1403
   583
        textures/fbm.cpp
tom@1530
   584
	textures/harlequin.cpp
tom@1530
   585
	textures/imagemap.cpp
tom@1530
   586
	textures/marble.cpp
tom@1530
   587
	textures/mix.cpp
tom@1530
   588
	textures/scale.cpp
tom@1530
   589
	textures/uv.cpp
tom@1530
   590
	textures/windy.cpp
tom@1530
   591
	textures/wrinkled.cpp
tom@1530
   592
	)
jeanphi@1403
   593
SET(lux_tonemaps_src
tom@1530
   594
	tonemaps/contrast.cpp
tom@1530
   595
	tonemaps/highcontrast.cpp
tom@1530
   596
	tonemaps/lineartonemap.cpp
tom@1530
   597
	tonemaps/maxwhite.cpp
tom@1530
   598
	tonemaps/nonlinear.cpp
tom@1530
   599
	tonemaps/reinhard.cpp
tom@1530
   600
	)
jeanphi@1403
   601
SET(lux_volumes_src
tom@1530
   602
	volumes/cloud.cpp
tom@1530
   603
	volumes/exponential.cpp
tom@1530
   604
	volumes/homogeneous.cpp
tom@1530
   605
	volumes/volumegrid.cpp
tom@1530
   606
	)
jromang@104
   607
jeanphi@1403
   608
SET(lux_lib_src
tom@1530
   609
	${lux_core_src}
tom@1530
   610
	${lux_accelerators_src}
tom@1530
   611
	${lux_cameras_src}
tom@1530
   612
	${lux_films_src}
tom@1530
   613
	${lux_filters_src}
tom@1530
   614
	${lux_integrators_src}
tom@1530
   615
	${lux_lights_src}
tom@1530
   616
	${lux_materials_src}
tom@1530
   617
	${lux_pixelsamplers_src}
tom@1530
   618
	${lux_samplers_src}
tom@1530
   619
	${lux_shapes_src}
tom@1530
   620
	${lux_spds_src}
tom@1530
   621
	${lux_textures_src}
tom@1530
   622
	${lux_tonemaps_src}
tom@1530
   623
	${lux_volumes_src}
tom@1530
   624
	)
dade916@572
   625
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}
dade916@572
   626
                    ${JPEG_INCLUDE_DIR}
jromang@166
   627
					${TIFF_INCLUDE_DIR}
jromang@165
   628
					${PNG_INCLUDE_DIR}
jromang@163
   629
					${OPENEXR_INCLUDE_DIRS}
ratow@827
   630
					${Boost_INCLUDE_DIRS}
jromang@104
   631
					${CMAKE_SOURCE_DIR}/accelerators ${CMAKE_SOURCE_DIR}/cameras ${CMAKE_SOURCE_DIR}/core
radiance29@515
   632
					${CMAKE_SOURCE_DIR}/core/reflection ${CMAKE_SOURCE_DIR}/core/reflection/bxdf ${CMAKE_SOURCE_DIR}/spds
radiance29@447
   633
					${CMAKE_SOURCE_DIR}/core/reflection/fresnel ${CMAKE_SOURCE_DIR}/core/reflection/microfacetdistribution
jromang@104
   634
					${CMAKE_SOURCE_DIR}/film ${CMAKE_SOURCE_DIR}/filters ${CMAKE_SOURCE_DIR}/integrators
lotuspec@1050
   635
					${CMAKE_SOURCE_DIR}/lights ${CMAKE_SOURCE_DIR}/lights/sphericalfunction
lotuspec@1050
   636
					${CMAKE_SOURCE_DIR}/materials ${CMAKE_SOURCE_DIR}/samplers
jromang@104
   637
					${CMAKE_SOURCE_DIR}/shapes ${CMAKE_SOURCE_DIR}/textures ${CMAKE_SOURCE_DIR}/tonemaps
tomb@279
   638
					${CMAKE_SOURCE_DIR}/volumes ${CMAKE_SOURCE_DIR}/integrationsamplers ${CMAKE_SOURCE_DIR}/pixelsamplers
jromang@291
   639
					${CMAKE_SOURCE_DIR}/renderer/include
jromang@104
   640
					${CMAKE_BINARY_DIR}
jromang@104
   641
					)
jromang@112
   642
neo1975@143
   643
neo1975@143
   644
#############################################################################
neo1975@143
   645
#############################################################################
neo1975@143
   646
#####################            LINKER INFO           ######################
neo1975@143
   647
#############################################################################
neo1975@143
   648
#############################################################################
neo1975@143
   649
ratow@827
   650
LINK_DIRECTORIES(${LINK_DIRECTORIES} ${Boost_LIBRARY_DIRS} ${OPENEXR_LIB_DIRS} ${PNG_LIBRARY} ${TIFF_LIBRARY} ${JPEG_LIBRARY})
ratow@827
   651
jromang@112
   652
#Here we build the core library
jromang@104
   653
ADD_LIBRARY(lux STATIC ${lux_lib_src} )
jeanphi@901
   654
#TARGET_LINK_LIBRARIES(lux ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} )
jromang@104
   655
jromang@112
   656
dade916@717
   657
#############################################################################
jromang@112
   658
#Here we build the console executable
dade916@717
   659
#############################################################################
jromang@112
   660
ADD_EXECUTABLE(luxconsole renderer/luxconsole.cpp)
neo1975@132
   661
IF(APPLE)
jeanphi@1096
   662
	TARGET_LINK_LIBRARIES(luxconsole -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${CMAKE_THREAD_LIBS_INIT} ${OPENEXR_LIBRARIES} z ${Boost_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES})
neo1975@132
   663
ELSE(APPLE)
tom@1530
   664
	TARGET_LINK_LIBRARIES(luxconsole -Wl,--whole-archive lux -Wl,--no-whole-archive ${CMAKE_THREAD_LIBS_INIT} ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} ${SYS_LIBRARIES})
neo1975@132
   665
ENDIF(APPLE)
jromang@112
   666
jromang@384
   667
IF(APPLE)
jromang@384
   668
	SET(GUI_TYPE MACOSX_BUNDLE)
jromang@384
   669
	# SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
jromang@384
   670
	# Short Version is the "marketing version". It is the version
jromang@384
   671
	# the user sees in an information panel.
jromang@384
   672
	SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}")
jromang@384
   673
	# Bundle version is the version the OS looks at.
jromang@384
   674
	SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}")
jromang@384
   675
	SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.luxrender.luxrender" )
jromang@384
   676
	SET(MACOSX_BUNDLE_BUNDLE_NAME "luxrender" )
jeanphi@1096
   677
	SET(MACOSX_BUNDLE_ICON_FILE "LuxRender.icns")
jromang@384
   678
	# SET(MACOSX_BUNDLE_COPYRIGHT "")
jromang@384
   679
	# SET(MACOSX_BUNDLE_INFO_STRING "Info string, localized?")
jromang@384
   680
ENDIF(APPLE)
jromang@384
   681
dade916@717
   682
#############################################################################
lordcrc@1551
   683
#Here we build the luxmerger executable
lordcrc@1551
   684
#############################################################################
lordcrc@1551
   685
ADD_EXECUTABLE(luxmerger tools/luxmerger.cpp)
lordcrc@1551
   686
IF(APPLE)
lordcrc@1551
   687
	TARGET_LINK_LIBRARIES(luxmerger -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${CMAKE_THREAD_LIBS_INIT} ${OPENEXR_LIBRARIES} z ${Boost_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES})
lordcrc@1551
   688
ELSE(APPLE)
lordcrc@1551
   689
	TARGET_LINK_LIBRARIES(luxmerger -Wl,--whole-archive lux -Wl,--no-whole-archive ${CMAKE_THREAD_LIBS_INIT} ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} ${SYS_LIBRARIES})
lordcrc@1551
   690
ENDIF(APPLE)
lordcrc@1551
   691
lordcrc@1551
   692
IF(APPLE)
lordcrc@1551
   693
	SET(GUI_TYPE MACOSX_BUNDLE)
lordcrc@1551
   694
	# SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
lordcrc@1551
   695
	# Short Version is the "marketing version". It is the version
lordcrc@1551
   696
	# the user sees in an information panel.
lordcrc@1551
   697
	SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}")
lordcrc@1551
   698
	# Bundle version is the version the OS looks at.
lordcrc@1551
   699
	SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}")
lordcrc@1551
   700
	SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.luxrender.luxrender" )
lordcrc@1551
   701
	SET(MACOSX_BUNDLE_BUNDLE_NAME "luxrender" )
lordcrc@1551
   702
	SET(MACOSX_BUNDLE_ICON_FILE "LuxRender.icns")
lordcrc@1551
   703
	# SET(MACOSX_BUNDLE_COPYRIGHT "")
lordcrc@1551
   704
	# SET(MACOSX_BUNDLE_INFO_STRING "Info string, localized?")
lordcrc@1551
   705
ENDIF(APPLE)
lordcrc@1551
   706
lordcrc@1551
   707
#############################################################################
ratow@827
   708
#Here we build the wxWidgets GUI executable
dade916@717
   709
#############################################################################
dade916@717
   710
IF(wxWidgets_FOUND)
ratow@890
   711
	ADD_EXECUTABLE(luxrender ${GUI_TYPE} renderer/wxluxapp.cpp renderer/wxluxgui.cpp renderer/wxluxframe.cpp renderer/wxglviewer.cpp renderer/wxviewer.cpp)
tom@1530
   712
	INCLUDE_DIRECTORIES( ${wxWidgets_INCLUDE_DIRS} )
dade916@717
   713
dade916@717
   714
	IF(APPLE)
dade916@717
   715
		INCLUDE_DIRECTORIES ( /Developer/Headers/FlatCarbon /usr/local/include)
dade916@717
   716
		FIND_LIBRARY(CARBON_LIBRARY Carbon)
dade916@717
   717
		FIND_LIBRARY(QUICKTIME_LIBRARY QuickTime )
dade916@717
   718
		FIND_LIBRARY(OPENGL_LIBRARY OpenGL )
dade916@717
   719
		FIND_LIBRARY(AGL_LIBRARY AGL )
dade916@717
   720
		FIND_LIBRARY(APP_SERVICES_LIBRARY ApplicationServices )
dade916@717
   721
dade916@717
   722
		MESSAGE(STATUS ${CARBON_LIBRARY})
dade916@717
   723
		MARK_AS_ADVANCED (CARBON_LIBRARY)
dade916@717
   724
		MARK_AS_ADVANCED (QUICKTIME_LIBRARY)
dade916@717
   725
		MARK_AS_ADVANCED (OPENGL_LIBRARY)
dade916@717
   726
		MARK_AS_ADVANCED (AGL_LIBRARY)
dade916@717
   727
		MARK_AS_ADVANCED (APP_SERVICES_LIBRARY)
dade916@717
   728
		SET(EXTRA_LIBS ${CARBON_LIBRARY} ${QUICKTIME_LIBRARY} ${OPENGL_LIBRARY} ${AGL_LIBRARY} ${APP_SERVICES_LIBRARY})
jeanphi@1099
   729
		TARGET_LINK_LIBRARIES(luxrender -Wl,-undefined -Wl,dynamic_lookup -all_load lux -noall_load ${wxWidgets_LIBRARIES} ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${EXTRA_LIBS} z ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES})
dade916@717
   730
	ELSE(APPLE)
tom@1530
   731
		TARGET_LINK_LIBRARIES(luxrender -Wl,--whole-archive lux -Wl,--no-whole-archive ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARY} ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES} ${JPEG_LIBRARIES} ${SYS_LIBRARIES})
ratow@655
   732
	ENDIF(APPLE)
ratow@655
   733
ENDIF(wxWidgets_FOUND)
ratow@655
   734
dade916@717
   735
jromang@1093
   736
dade916@717
   737
#############################################################################
dade916@717
   738
jromang@321
   739
#Install target
lordcrc@1551
   740
INSTALL(TARGETS luxrender luxconsole luxmerger
jromang@375
   741
        RUNTIME DESTINATION bin
jromang@321
   742
)
jromang@321
   743
jromang@374
   744
#Install API/Library
jromang@375
   745
INSTALL(FILES ${CMAKE_SOURCE_DIR}/core/api.h DESTINATION include/luxrender/)
jromang@1093
   746
INSTALL(TARGETS lux DESTINATION lib${LIB_SUFFIX})
jromang@1093
   747
#	ELSE(FIND_LIBRARY_USE_LIB64_PATHS) ARCHIVE DESTINATION lib
jromang@1093
   748
#	ENDIF(FIND_LIBRARY_USE_LIB64_PATHS)
jromang@1093
   749
jromang@374
   750
jromang@374
   751
#Install Desktop files
jromang@383
   752
INSTALL(FILES ${CMAKE_SOURCE_DIR}/renderer/luxrender.svg DESTINATION share/pixmaps/)
jromang@375
   753
INSTALL(FILES ${CMAKE_SOURCE_DIR}/renderer/luxrender.desktop DESTINATION share/applications/)
jromang@324
   754
jromang@321
   755
#Source package target
jromang@321
   756
ADD_CUSTOM_TARGET(package mkdir lux-${VERSION}
jromang@321
   757
	COMMAND cp -R ${CMAKE_SOURCE_DIR}/* lux-${VERSION}
jromang@321
   758
	COMMAND tar -cf ${CMAKE_BINARY_DIR}/lux-${VERSION}.tar lux-${VERSION}
jromang@321
   759
	COMMAND bzip2 --best ${CMAKE_BINARY_DIR}/lux-${VERSION}.tar
jromang@321
   760
	WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
jromang@321
   761
	DEPENDS ${lux_lib_src}
jromang@321
   762
	COMMENT Building source package
jromang@321
   763
)
dade916@553
   764
dade916@553
   765
# Dade - GCC Profiling (remember to uncomment the line in the middle of file too)
lordcrc@1551
   766
#SET_TARGET_PROPERTIES(luxconsole luxmerger luxrender PROPERTIES LINK_FLAGS "-pg")
dade916@553
   767
dade916@553
   768
# Dade - GCC 2 pass optimization (remember to uncomment the line in the middle of file too)
lordcrc@1551
   769
#SET_TARGET_PROPERTIES(luxconsole luxmerger luxrender PROPERTIES LINK_FLAGS "--coverage")
dade916@553
   770
dade916@553
   771
# Dade - Intel Compiler optimization
jeanphi@1098
   772
#REMOVE_DEFINITIONS(-ipo)