forked from aditiapratama/cycles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
136 lines (105 loc) · 4.27 KB
/
CMakeLists.txt
File metadata and controls
136 lines (105 loc) · 4.27 KB
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
124
125
126
127
128
129
130
131
132
133
134
135
136
###########################################################################
# Disable insource build
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR
"CMake generation for Cycles is not allowed within the source directory!"
"\n Remove the CMakeCache.txt file and try again from another folder, e.g.:"
"\n "
"\n rm CMakeCache.txt"
"\n cd .."
"\n mkdir cmake-make"
"\n cd cmake-make"
"\n cmake ../cycles"
)
endif()
###########################################################################
# Policies
cmake_minimum_required(VERSION 3.13)
# So library linking is more sane.
cmake_policy(SET CMP0003 NEW)
# So syntax problems are errors.
cmake_policy(SET CMP0010 NEW)
# So BUILDINFO and BLENDERPATH strings are automatically quoted.
cmake_policy(SET CMP0005 NEW)
# Input directories must have CMakeLists.txt
cmake_policy(SET CMP0014 NEW)
# Compile definitions.
cmake_policy(SET CMP0043 NEW)
# Use ROOT variables in find_package.
cmake_policy(SET CMP0074 NEW)
###########################################################################
# Initialize project.
project(Cycles)
###########################################################################
# Macros and utilities.
list(APPEND CMAKE_MODULE_PATH
"${PROJECT_SOURCE_DIR}/src/cmake"
"${PROJECT_SOURCE_DIR}/src/cmake/Modules"
)
include(compiler_utils)
include(macros)
###########################################################################
# Global settings.
# Avoid having empty buildtype.
set(CMAKE_BUILD_TYPE_INIT "Release")
# Some stuff is different when building stabdalone Cycles from inside
# Blender source code and when building it from it's own repository.
set(CYCLES_STANDALONE_REPOSITORY TRUE)
# Force standalone build.
set(WITH_CYCLES_STANDALONE TRUE)
# Global compile definitions since add_definitions() adds for all.
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
$<$<CONFIG:Debug>:DEBUG;_DEBUG>
$<$<CONFIG:Release>:NDEBUG>
$<$<CONFIG:MinSizeRel>:NDEBUG>
$<$<CONFIG:RelWithDebInfo>:NDEBUG>
)
###########################################################################
# Options.
option(WITH_CPU_SSE "Enable SIMD instruction if they're detected on the host machine" ON)
option(WITH_CYCLES_STANDALONE_GUI "Build Cycles standalone with GUI" ON)
option(WITH_CYCLES_OSL "Build Cycles with OSL support" ON)
option(WITH_CYCLES_OPENCOLORIO "Build Cycles with OpenColorIO support" ON)
option(WITH_CYCLES_OPENSUBDIV "Build Cycles with OpenSubdiv support" ON)
option(WITH_CYCLES_OPENIMAGEDENOISE "Build Cycles with OpenImageDenoise support" ON)
option(WITH_CYCLES_OPENVDB "Build Cycles with OpenVDB support" ON)
option(WITH_CYCLES_EMBREE "Build Cycles with embree support" ON)
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" OFF)
option(WITH_CYCLES_DEBUG "Build Cycles with with extra debug capabilties" OFF)
option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 sm_50 sm_52 CACHE STRING "CUDA architectures to build binaries for")
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
if(UNIX AND NOT APPLE)
option(WITH_CXX11_ABI "Build with glibc C++11 ABI. Precompiled libraries are built with the older ABI" ON)
endif()
option(WITH_CUDA_DYNLOAD "Dynamically load CUDA libraries at runtime" ON)
mark_as_advanced(WITH_CUDA_DYNLOAD)
# ====== Tangent Rez Deps
if(DEFINED ENV{TA_USING_REZ})
message(STATUS "Building with REZ")
include(src/cmake/rez_deps.cmake)
elseif(DEFINED HOUDINI_ROOT)
message(STATUS "Building with Houdini")
include(src/cmake/hou_deps.cmake)
elseif(DEFINED USD_ROOT)
message(STATUS "Building with Pixar")
include(src/cmake/pxr_deps.cmake)
else()
set(USE_OPENGL TRUE)
add_definitions(-DUSE_OPENGL)
endif()
include(external_libs)
###########################################################################
# Configuration.
include(CheckCXXCompilerFlag)
include(configure_build)
###########################################################################
# Include directories.
include_directories(
third_party/cuew/include
third_party/clew/include
)
###########################################################################
# Sources.
add_subdirectory(third_party)
add_subdirectory(src)