-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
113 lines (99 loc) · 3.23 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
CMAKE_MINIMUM_REQUIRED ( VERSION 2.8.11 )
PROJECT ( BifrostTools )
INCLUDE ( CPack )
ADD_DEFINITIONS ( -DMAJOR_VERSION_NUMBER=${CPACK_PACKAGE_VERSION_MAJOR} -DMINOR_VERSION_NUMBER=${CPACK_PACKAGE_VERSION_MINOR} -DPATCH_VERSION_NUMBER=${CPACK_PACKAGE_VERSION_PATCH} )
IF (WIN32)
ADD_DEFINITIONS ( -DBOOST_ALL_NO_LIB=1 )
ENDIF ()
IF ( BUILD_HOUDINI_TOOLS )
IF (WIN32)
ADD_DEFINITIONS ( -DBOOST_PROGRAM_OPTIONS_DYN_LINK )
ENDIF ()
FIND_PACKAGE ( Boost 1.55 REQUIRED COMPONENTS program_options )
ELSE ()
FIND_PACKAGE ( Boost 1.52 REQUIRED COMPONENTS program_options )
ENDIF()
FIND_PACKAGE ( Maya REQUIRED )
FIND_PACKAGE ( Bifrost REQUIRED )
IF ( ${BIFROST_VERSION} GREATER 30 )
ADD_DEFINITIONS ( -DBIFROST_API_IMPL )
ENDIF ()
FIND_PACKAGE ( OpenGL REQUIRED )
IF ( BUILD_OPENGL_TOOLS )
FIND_PACKAGE ( GLEW REQUIRED )
INCLUDE_DIRECTORIES ( ${GLEW_INCLUDE_DIR} )
ENDIF ()
FIND_PACKAGE ( ZLIB REQUIRED )
FIND_PACKAGE ( ILMBase REQUIRED )
IF (BUILD_TOOLS)
FIND_PACKAGE ( GLFW3 REQUIRED )
IF ( BUILD_HOUDINI_TOOLS )
FIND_PACKAGE ( HDK 15.5 REQUIRED )
FIND_PACKAGE ( TBB REQUIRED )
INCLUDE_DIRECTORIES ( ${HDK_INCLUDE_DIR} )
ELSE ()
FIND_PACKAGE ( S2AA REQUIRED )
FIND_PACKAGE ( MtoA REQUIRED )
INCLUDE_DIRECTORIES ( ${MTOA_INCLUDE_DIR} )
ENDIF ()
IF (WIN32)
FIND_PACKAGE ( ZLIB REQUIRED )
INCLUDE_DIRECTORIES ( ${ZLIB_INCLUDE_DIR} )
ADD_DEFINITIONS ( -D_USE_MATH_DEFINES ) # For M_PI
ENDIF ()
INCLUDE_DIRECTORIES ( ${S2AA_INCLUDE_DIR} )
INCLUDE_DIRECTORIES ( ${GLEW_INCLUDE_DIR} )
INCLUDE_DIRECTORIES ( ${GLFW3_INCLUDE_DIR} )
ENDIF (BUILD_TOOLS)
INCLUDE_DIRECTORIES ( ${ILMBASE_INCLUDE_DIRS} )
INCLUDE_DIRECTORIES ( ${Boost_INCLUDE_DIR} )
INCLUDE_DIRECTORIES ( ${BIFROST_INCLUDE_DIR} )
# Temporary whilst Bifrost SDK is in a flux
# For the single point of header include of Bifrost headers
INCLUDE_DIRECTORIES ( . )
SET ( BIFROST_REQUIRED_LIBRARIES
${Bifrost_api_LIBRARY}
)
IF ( WIN32 )
ADD_DEFINITIONS ( /D_CRT_SECURE_NO_WARNINGS )
ELSE ()
ADD_DEFINITIONS ( -std=c++0x )
ENDIF ()
# Deprecated (we are using Bifrost CMake macros)
# SET ( BIFROST_BASE_DIR ${MAYA_LOCATION} )
# LINK_DIRECTORIES ( ${MAYA_LIBRARY_DIR} )
#MESSAGE ( "MAYA_LIBRARY_DIR = ${MAYA_LIBRARY_DIR}")
IF (APPLE)
SET ( BIFROST_RPATH "${BIFROST_LOCATION}/bin")
# MESSAGE ( "BIFROST_RPATH = ${BIFROST_RPATH}")
SET ( CMAKE_INSTALL_RPATH ${BIFROST_RPATH} )
ELSE (APPLE)
# Todo : follow OS X way
SET ( CMAKE_INSTALL_RPATH "${MAYA_LOCATION}/plug-ins/bifrost/lib:${MAYA_LOCATION}/lib" )
IF (BUILD_HOUDINI_TOOLS)
SET ( CMAKE_INSTALL_RPATH
"$ENV{HDSO}:${CMAKE_INSTALL_RPATH}"
)
ENDIF ()
# MESSAGE ( "DEBUGGING = ${MAYA_LOCATION}/plug-ins/bifrost/lib")
LINK_DIRECTORIES (
${MAYA_LOCATION}/plug-ins/bifrost/lib
${MAYA_LOCATION}/lib
)
ENDIF ()
INCLUDE_DIRECTORIES ( . )
ADD_SUBDIRECTORY ( utils )
ADD_SUBDIRECTORY ( dev )
ADD_SUBDIRECTORY ( applications )
IF ( BUILD_TOOLS )
# Houdini requirement are stringent and often at odds
# with other DCC application, as such, we can't build
# them together.
# The strategy is to build and package them separately
IF ( BUILD_HOUDINI_TOOLS )
ADD_SUBDIRECTORY ( houdini )
ELSE ( BUILD_HOUDINI_TOOLS )
ADD_SUBDIRECTORY ( maya )
ADD_SUBDIRECTORY ( procedural )
ENDIF ( BUILD_HOUDINI_TOOLS )
ENDIF ( BUILD_TOOLS )