diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 114 |
1 files changed, 85 insertions, 29 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c016fc8224..cc4c9c53d62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,6 +116,68 @@ set(TESTS_OUTPUT_DIR ${EXECUTABLE_OUTPUT_PATH}/tests CACHE INTERNAL "" FORCE) get_blender_version() + +#----------------------------------------------------------------------------- +# Platform Specific Defaults + +# list of var-names +set(_init_vars) + +# initialize to ON +macro(option_defaults_init) + foreach(_var ${ARGV}) + set(${_var} ON) + list(APPEND _init_vars "${_var}") + endforeach() + unset(_INC) +endmacro() + +# remove from namespace +macro(option_defaults_clear) + foreach(_var ${_init_vars}) + unset(${_var}) + endforeach() + unset(_var) + unset(_init_vars) +endmacro() + + +# values to initialize WITH_**** +option_defaults_init( + _init_BUILDINFO + _init_CODEC_FFMPEG + _init_CYCLES_OSL + _init_IMAGE_OPENEXR + _init_IMAGE_REDCODE + _init_INPUT_NDOF + _init_JACK + _init_LIBMV_SCHUR_SPECIALIZATION + _init_OPENCOLLADA + _init_OPENCOLORIO + _init_SDL + _init_FFTW3 + _init_GAMEENGINE +) + +# customize... +if(UNIX AND NOT APPLE) + # some of these libraries are problematic on Linux + # disable less important dependencies by default + set(_init_BUILDINFO OFF) + set(_init_CODEC_FFMPEG OFF) + set(_init_CYCLES_OSL OFF) + set(_init_IMAGE_OPENEXR OFF) + set(_init_IMAGE_REDCODE OFF) + set(_init_INPUT_NDOF OFF) + set(_init_JACK OFF) + set(_init_LIBMV_SCHUR_SPECIALIZATION OFF) + set(_init_OPENCOLLADA OFF) + set(_init_OPENCOLORIO OFF) + set(_init_SDL OFF) + set(_init_FFTW3 OFF) + set(_init_GAMEENGINE OFF) +endif() + # Blender internal features option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON) mark_as_advanced(WITH_BLENDER) @@ -134,7 +196,7 @@ if(APPLE) option(WITH_PYTHON_FRAMEWORK "Enable building using the Python available in the framework (OSX only)" OFF) endif() -option(WITH_BUILDINFO "Include extra build details (only disable for development & faster builds)" ON) +option(WITH_BUILDINFO "Include extra build details (only disable for development & faster builds)" ${_init_BUILDINFO}) if(${CMAKE_VERSION} VERSION_LESS 2.8.8) # add_library OBJECT arg unsupported set(WITH_BUILDINFO OFF) @@ -142,13 +204,13 @@ endif() option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON) option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON) -option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" ON) +option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" ${_init_FFTW3}) option(WITH_BULLET "Enable Bullet (Physics Engine)" ON) option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" ) mark_as_advanced(WITH_SYSTEM_BULLET) -option(WITH_GAMEENGINE "Enable Game Engine" ON) +option(WITH_GAMEENGINE "Enable Game Engine" ${_init_GAMEENGINE}) option(WITH_PLAYER "Build Player" OFF) -option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ON) +option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ${_init_OPENCOLORIO}) option(WITH_COMPOSITOR "Enable the tile based nodal compositor" ON) # GHOST Windowing Library Options @@ -191,13 +253,7 @@ endif() # (unix defaults to System OpenJPEG On) -if(UNIX AND NOT APPLE) - set(PLATFORM_DEFAULT ON) -else() - set(PLATFORM_DEFAULT OFF) -endif() -option(WITH_SYSTEM_OPENJPEG "Use the operating systems OpenJPEG library" ${PLATFORM_DEFAULT}) -unset(PLATFORM_DEFAULT) +option(WITH_SYSTEM_OPENJPEG "Use the operating systems OpenJPEG library" OFF) # Modifiers @@ -210,40 +266,33 @@ option(WITH_MOD_REMESH "Enable Remesh Modifier" ON) option(WITH_MOD_OCEANSIM "Enable Ocean Modifier" OFF) # Image format support -option(WITH_OPENIMAGEIO "Enable OpenImageIO Support (http://www.openimageio.org)" OFF) -option(WITH_IMAGE_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON) +option(WITH_OPENIMAGEIO "Enable OpenImageIO Support (http://www.openimageio.org)" ON) +option(WITH_IMAGE_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ${_init_IMAGE_OPENEXR}) option(WITH_IMAGE_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org)" ON) option(WITH_IMAGE_TIFF "Enable LibTIFF Support" ON) option(WITH_IMAGE_DDS "Enable DDS Image Support" ON) option(WITH_IMAGE_CINEON "Enable CINEON and DPX Image Support" ON) option(WITH_IMAGE_HDR "Enable HDR Image Support" ON) -option(WITH_IMAGE_REDCODE "Enable RedCode Image Support" OFF) +option(WITH_IMAGE_REDCODE "Enable RedCode Image Support" ${_init_IMAGE_REDCODE}) option(WITH_IMAGE_FRAMESERVER "Enable image FrameServer Support for rendering" ON) # Audio/Video format support option(WITH_CODEC_AVI "Enable Blenders own AVI file support (raw/jpeg)" ON) -option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" OFF) +option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" ${_init_CODEC_FFMPEG}) option(WITH_CODEC_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF) if(APPLE) - option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" ON) option(WITH_CODEC_QUICKTIME "Enable Quicktime Support" ON) -else() - option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" OFF) endif() # 3D format support # Disable opencollada when we don't have precompiled libs -if(APPLE OR WIN32) - option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ON) -else() - option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" OFF) -endif() +option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ${_init_OPENCOLLADA}) # Sound output -option(WITH_SDL "Enable SDL for sound and joystick support" ON) +option(WITH_SDL "Enable SDL for sound and joystick support" ${_init_SDL}) option(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON) -option(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF) +option(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" ${_init_JACK}) if(UNIX AND NOT APPLE) option(WITH_JACK_DYNLOAD "Enable runtime dynamic Jack libraries loading" OFF) endif() @@ -254,13 +303,14 @@ option(WITH_LZMA "Enable best LZMA compression, (used for pointcache)" # Camera/motion tracking option(WITH_LIBMV "Enable libmv structure from motion library" ON) -option(WITH_LIBMV_SCHUR_SPECIALIZATIONS "Enable fixed-size schur specializations." ON) +option(WITH_LIBMV_SCHUR_SPECIALIZATIONS "Enable fixed-size schur specializations." ${_init_LIBMV_SCHUR_SPECIALIZATION}) +mark_as_advanced(WITH_LIBMV_SCHUR_SPECIALIZATIONS) # Freestyle option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON) # Misc -option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON) +option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ${_init_INPUT_NDOF}) option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON) option(WITH_OPENNL "Enable use of Open Numerical Library" ON) if(UNIX AND NOT APPLE) @@ -288,7 +338,7 @@ endif() option(WITH_CYCLES "Enable cycles Render Engine" ON) option(WITH_CYCLES_STANDALONE "Build cycles standalone application" OFF) option(WITH_CYCLES_STANDALONE_GUI "Build cycles standalone with GUI" OFF) -option(WITH_CYCLES_OSL "Build Cycles with OSL support" OFF) +option(WITH_CYCLES_OSL "Build Cycles with OSL support" ${_init_CYCLES_OSL}) 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 CACHE STRING "CUDA architectures to build binaries for") mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH) @@ -373,6 +423,12 @@ if(MSVC) set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${}) endif() +# avoid using again +option_defaults_clear() + +# end option(...) + + # By default we want to install to the directory we are compiling our executables # unless specified otherwise, which we currently do not allow @@ -580,7 +636,7 @@ endif() # auto enable llvm for cycles_osl if(WITH_CYCLES_OSL) - set(WITH_LLVM ON CACHE BOOL "ON" FORCE) + set(WITH_LLVM ON CACHE BOOL "" FORCE) endif() # don't store paths to libs for portable distribution |