Changeset View
Changeset View
Standalone View
Standalone View
CMakeLists.txt
| Show First 20 Lines • Show All 461 Lines • ▼ Show 20 Lines | |||||
| option(WITH_BOOST "Enable features depending on boost" ON) | option(WITH_BOOST "Enable features depending on boost" ON) | ||||
| # Unit testsing | # Unit testsing | ||||
| option(WITH_GTESTS "Enable GTest unit testing" OFF) | option(WITH_GTESTS "Enable GTest unit testing" OFF) | ||||
| option(WITH_OPENGL_RENDER_TESTS "Enable OpenGL render related unit testing (Experimental)" OFF) | option(WITH_OPENGL_RENDER_TESTS "Enable OpenGL render related unit testing (Experimental)" OFF) | ||||
| option(WITH_OPENGL_DRAW_TESTS "Enable OpenGL UI drawing related unit testing (Experimental)" OFF) | option(WITH_OPENGL_DRAW_TESTS "Enable OpenGL UI drawing related unit testing (Experimental)" OFF) | ||||
| # Documentation | # Documentation | ||||
| if(UNIX AND NOT APPLE) | if(UNIX AND NOT APPLE) | ||||
| option(WITH_DOC_MANPAGE "Create a manual page (Unix manpage)" OFF) | option(WITH_DOC_MANPAGE "Create a manual page (Unix manpage)" OFF) | ||||
| endif() | endif() | ||||
| # OpenGL | # OpenGL | ||||
| ▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | |||||
| # The following only works with the Ninja generator in CMake >= 3.0. | # The following only works with the Ninja generator in CMake >= 3.0. | ||||
| if("${CMAKE_GENERATOR}" MATCHES "Ninja") | if("${CMAKE_GENERATOR}" MATCHES "Ninja") | ||||
| option(WITH_NINJA_POOL_JOBS | option(WITH_NINJA_POOL_JOBS | ||||
| "Enable Ninja pools of jobs, to try to ease building on machines with 16GB of RAM or less (if not yet defined, will try to set best values based on detected machine specifications)." | "Enable Ninja pools of jobs, to try to ease building on machines with 16GB of RAM or less (if not yet defined, will try to set best values based on detected machine specifications)." | ||||
| OFF) | OFF) | ||||
| mark_as_advanced(WITH_NINJA_POOL_JOBS) | mark_as_advanced(WITH_NINJA_POOL_JOBS) | ||||
| endif() | endif() | ||||
| if(UNIX AND NOT APPLE) | |||||
| option(WITH_CXX11_ABI "Use native C++11 ABI of compiler" ON) | |||||
| mark_as_advanced(WITH_CXX11_ABI) | |||||
| endif() | |||||
| # avoid using again | # avoid using again | ||||
| option_defaults_clear() | option_defaults_clear() | ||||
| # end option(...) | # end option(...) | ||||
| # By default we want to install to the directory we are compiling our executables | # By default we want to install to the directory we are compiling our executables | ||||
| ▲ Show 20 Lines • Show All 1,041 Lines • ▼ Show 20 Lines | if( | ||||
| CMAKE_COMPILER_IS_GNUCC OR | CMAKE_COMPILER_IS_GNUCC OR | ||||
| (CMAKE_C_COMPILER_ID MATCHES "Clang" AND (NOT MSVC)) OR | (CMAKE_C_COMPILER_ID MATCHES "Clang" AND (NOT MSVC)) OR | ||||
| (CMAKE_C_COMPILER_ID MATCHES "Intel") | (CMAKE_C_COMPILER_ID MATCHES "Intel") | ||||
| ) | ) | ||||
| # Use C11 + GNU extensions, works with GCC, Clang, ICC | # Use C11 + GNU extensions, works with GCC, Clang, ICC | ||||
| set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11") | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11") | ||||
| endif() | endif() | ||||
| if(UNIX AND NOT APPLE) | |||||
| if(NOT WITH_CXX11_ABI) | |||||
| set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0") | |||||
| endif() | |||||
| endif() | |||||
| # Include warnings first, so its possible to disable them with user defined flags | # Include warnings first, so its possible to disable them with user defined flags | ||||
| # eg: -Wno-uninitialized | # eg: -Wno-uninitialized | ||||
| set(CMAKE_C_FLAGS "${C_WARNINGS} ${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS}") | set(CMAKE_C_FLAGS "${C_WARNINGS} ${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS}") | ||||
| set(CMAKE_CXX_FLAGS "${CXX_WARNINGS} ${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS}") | set(CMAKE_CXX_FLAGS "${CXX_WARNINGS} ${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS}") | ||||
| # defined above, platform specific but shared names | # defined above, platform specific but shared names | ||||
| mark_as_advanced( | mark_as_advanced( | ||||
| CYCLES_OSL | CYCLES_OSL | ||||
| ▲ Show 20 Lines • Show All 197 Lines • Show Last 20 Lines | |||||