[Bf-blender-cvs] [b796ce0f26c] master: CMake: Only set CMAKE_BUILD_TYPE_INIT when not set
Campbell Barton
noreply at git.blender.org
Tue Jun 27 01:45:50 CEST 2017
Commit: b796ce0f26c1bf206194eb8c004d214806c2828b
Author: Campbell Barton
Date: Tue Jun 27 09:50:35 2017 +1000
Branches: master
https://developer.blender.org/rBb796ce0f26c1bf206194eb8c004d214806c2828b
CMake: Only set CMAKE_BUILD_TYPE_INIT when not set
Convenience makefile now uses CMAKE_BUILD_TYPE_INIT,
this means you can change the build type of an existing build
and it won't be overwritten when running `make`.
Useful if you want to add debug info to a release build for profiling.
===================================================================
M CMakeLists.txt
M GNUmakefile
===================================================================
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e7917278434..04237812d87 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,7 +58,9 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/platform")
# avoid having empty buildtype
-set(CMAKE_BUILD_TYPE_INIT "Release")
+if(NOT DEFINED CMAKE_BUILD_TYPE_INIT)
+ set(CMAKE_BUILD_TYPE_INIT "Release")
+endif()
# quiet output for Makefiles, 'make -s' helps too
# set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
diff --git a/GNUmakefile b/GNUmakefile
index 86964e68873..ba7f89c3097 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -104,7 +104,7 @@ endif
CMAKE_CONFIG = cmake $(BUILD_CMAKE_ARGS) \
-H"$(BLENDER_DIR)" \
-B"$(BUILD_DIR)" \
- -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE)
+ -DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE)
# -----------------------------------------------------------------------------
More information about the Bf-blender-cvs
mailing list