-
Notifications
You must be signed in to change notification settings - Fork 15
/
CMakeLists.txt
123 lines (108 loc) · 3.56 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
114
115
116
117
118
119
120
121
122
123
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
PROJECT(openexrid)
IF(NOT DEFINED BUILD_LIB)
SET(BUILD_LIB 1)
ENDIF()
IF(NOT DEFINED BUILD_PLUGINS)
SET(BUILD_PLUGINS 1)
ENDIF()
SET(OPENEXRID_ROOT "${CMAKE_CURRENT_LIST_DIR}")
INCLUDE(cmake/compile_definitions.cmake)
INCLUDE(cmake/output_folders.cmake)
IF(USE_CONAN)
IF(NOT DEFINED CONAN_BUILD_INFO_DIR)
SET(CONAN_BUILD_INFO_DIR ${CMAKE_BINARY_DIR})
ENDIF()
INCLUDE(${CONAN_BUILD_INFO_DIR}/conanbuildinfo.cmake)
CONAN_BASIC_SETUP()
SET(OPENEXR_LOCATION ${CONAN_OPENEXR_ROOT})
SET(OPENIMAGEIO_ROOT ${CONAN_OPENIMAGEIO_ROOT})
SET(BOOST_LIBRARIES ${CONAN_LIBS_BOOST})
SET(OFX_DIR ${CONAN_OPENFX_ROOT})
ENDIF()
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
FIND_PACKAGE ( IlmBase REQUIRED )
FIND_PACKAGE ( OpenEXR REQUIRED )
FIND_PACKAGE ( ZLIB REQUIRED )
FIND_PACKAGE ( OpenGL REQUIRED )
IF(BUILD_PLUGINS)
FIND_PACKAGE ( re2 REQUIRED )
FIND_PACKAGE ( OpenImageIO REQUIRED )
FIND_PACKAGE ( Threads REQUIRED )
FIND_PACKAGE ( Nuke111 )
FIND_PACKAGE ( Nuke112 )
FIND_PACKAGE ( Nuke113 )
FIND_PACKAGE ( Nuke120 )
FIND_PACKAGE ( Nuke121 )
FIND_PACKAGE ( Nuke122 )
FIND_PACKAGE ( Nuke130 )
FIND_PACKAGE ( Nuke132 )
FIND_PACKAGE ( Nuke140 )
FIND_PACKAGE ( Nuke151 )
FIND_PACKAGE ( OFX )
ENDIF()
SET(CMAKE_CONFIGURATION_TYPES "Release;RelWithDebInfo;Debug")
message("CMAKE_CXX_STANDARD ${CMAKE_CXX_STANDARD}")
#Use solution folders.
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
# Compilation flags
IF(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /MP")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG /Zi")
SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Ob0")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
ADD_COMPILE_DEFINITIONS(OPENEXRID_CONFIG=$(Configuration))
ELSEIF(UNIX)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC -MD -msse2 -fno-strict-aliasing -fno-omit-frame-pointer -Wno-deprecated")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG -ggdb")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -DNDEBUG -ggdb")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -D_DEBUG -ggdb")
ADD_COMPILE_DEFINITIONS(OPENEXRID_CONFIG=${CMAKE_BUILD_TYPE})
ADD_COMPILE_DEFINITIONS(_FILE_OFFSET_BITS=64)
ADD_COMPILE_DEFINITIONS(_LARGE_FILES)
ADD_COMPILE_DEFINITIONS(linux)
SET(CMAKE_SKIP_RPATH TRUE)
ENDIF(WIN32)
#####################
# Projects to compile
IF(BUILD_LIB)
ADD_SUBDIRECTORY (openexrid)
ENDIF()
IF(BUILD_PLUGINS)
IF(OFX_FOUND)
ADD_SUBDIRECTORY (openfx)
ENDIF()
IF(Nuke111_FOUND)
ADD_SUBDIRECTORY (nuke11.1)
ENDIF()
IF(Nuke112_FOUND)
ADD_SUBDIRECTORY (nuke11.2)
ENDIF()
IF(Nuke113_FOUND)
ADD_SUBDIRECTORY (nuke11.3)
ENDIF()
IF(Nuke120_FOUND)
ADD_SUBDIRECTORY (nuke12.0)
ENDIF()
IF(Nuke121_FOUND)
ADD_SUBDIRECTORY (nuke12.1)
ENDIF()
IF(Nuke122_FOUND)
ADD_SUBDIRECTORY (nuke12.2)
ENDIF()
IF(Nuke130_FOUND)
ADD_SUBDIRECTORY (nuke13.0)
ENDIF()
IF(Nuke132_FOUND)
ADD_SUBDIRECTORY (nuke13.2)
ENDIF()
IF(Nuke140_FOUND)
ADD_SUBDIRECTORY (nuke14.0)
ENDIF()
IF(Nuke151_FOUND)
ADD_SUBDIRECTORY (nuke15.1)
ENDIF()
ENDIF()