This repository has been archived by the owner on Jul 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
107 lines (80 loc) · 3.55 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
###########################################################################
# 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 2.8)
# 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)
if(NOT (${CMAKE_VERSION} VERSION_LESS 3.0))
# Keep until CMake-3.0 is min requirement.
cmake_policy(SET CMP0043 OLD)
endif()
###########################################################################
# Initialize project.
project(Cycles)
###########################################################################
# Macros and utilities.
list(APPEND CMAKE_MODULE_PATH
"${PROJECT_SOURCE_DIR}/src/cmake"
"${PROJECT_SOURCE_DIR}/src/cmake/Modules"
)
include("${PROJECT_SOURCE_DIR}/src/cmake/macros.cmake")
###########################################################################
# 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_DEBUG DEBUG _DEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE NDEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL NDEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_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" OFF)
option(WITH_CYCLES_OPENSUBDIV "Build Cycles with OpenSubdiv support" OFF)
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_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 CACHE STRING "CUDA architectures to build binaries for")
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
option(WITH_CUDA_DYNLOAD "Dynamically load CUDA libraries at runtime" ON)
mark_as_advanced(WITH_CUDA_DYNLOAD)
###########################################################################
# Configuration.
include(CheckCXXCompilerFlag)
include(configure_build)
###########################################################################
# Include directories.
include_directories(
third_party/cuew/include
third_party/clew/include
)
###########################################################################
# Sources.
add_subdirectory(src)
add_subdirectory(third_party)