diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-05-23 18:56:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-05-23 18:56:14 +0400 |
commit | b69c1e8f1a277f3fef3ec91c61cf68cc151c92cb (patch) | |
tree | 661bc7252798f738cc9492fe26ef671542f902fb /CMakeLists.txt | |
parent | 929606008284ef2b6c889bd3a4b2a8a6e8bcf283 (diff) |
CMake changes
- don't allow building if the LIBDIR is not found on mac/windows.
- by default use -O2 rather then -O3 for GCC release flags, was crashing some GCC versions and blender releases are supposed to use -O2.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 83e6705e498..a8fc301906f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,33 +55,19 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules/") # quiet output for Makefiles, 'make -s' helps too # set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) -# ignore system set flag, use our own -# must be before project(...) -# if the user wants to add their own its ok after first run. -if(DEFINED CMAKE_C_STANDARD_LIBRARIES) - set(_reset_standard_libraries OFF) -else() - set(_reset_standard_libraries ON) -endif() +#----------------------------------------------------------------------------- +# Load some macros. +include(build_files/cmake/macros.cmake) -project(Blender) +#----------------------------------------------------------------------------- +# Initialize project. +blender_project_hack_pre() -if (_reset_standard_libraries) - # Must come after project(...) - # - # MINGW workaround for -ladvapi32 being included which surprisingly causes - # string formatting of floats, eg: printf("%.*f", 3, value). to crash blender - # with a meaningless stack trace. by overriding this flag we ensure we only - # have libs we define and that cmake & scons builds match. - set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE) - set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE) - mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES) - mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES) -endif() -unset(_reset_standard_libraries) +project(Blender) +blender_project_hack_post() enable_testing() @@ -92,10 +78,6 @@ set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "" FORCE ) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" FORCE ) #----------------------------------------------------------------------------- -# Load some macros. -include(build_files/cmake/macros.cmake) - -#----------------------------------------------------------------------------- # Set default config options get_blender_version() @@ -984,6 +966,12 @@ endif() #----------------------------------------------------------------------------- # Common. +if(APPLE OR WIN32) + if(NOT IS_DIRECTORY "${LIBDIR}") + message(FATAL_ERROR "Apple and Windows require pre-compiled libs at: '${LIBDIR}'") + endif() +endif() + if(WITH_RAYOPTIMIZATION) if(CMAKE_COMPILER_IS_GNUCC) if(SUPPORT_SSE_BUILD) |