From 60a1de67e17a4730d1db48be849f85d1819ee38e Mon Sep 17 00:00:00 2001 From: Davis King Date: Sun, 19 Jun 2011 18:12:46 -0400 Subject: [PATCH] Simplified the cmake files by putting the stuff to make Release the default build into a single file. --- dlib/release_build_by_default | 9 +++++++++ examples/CMakeLists.txt | 6 +----- tools/htmlify/CMakeLists.txt | 6 +----- tools/imglab/CMakeLists.txt | 8 +------- tools/mltool/CMakeLists.txt | 7 +------ 5 files changed, 13 insertions(+), 23 deletions(-) create mode 100644 dlib/release_build_by_default diff --git a/dlib/release_build_by_default b/dlib/release_build_by_default new file mode 100644 index 000000000..1b0e95831 --- /dev/null +++ b/dlib/release_build_by_default @@ -0,0 +1,9 @@ + +#set default build type to Release +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release" CACHE STRING + "Choose the type of build, options are: Debug Release + RelWithDebInfo MinSizeRel." FORCE) +endif() + + diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 07a13d2ca..a2829a13f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -13,11 +13,7 @@ endif() #set default build type to Release -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING - "Choose the type of build, options are: Debug Release - RelWithDebInfo MinSizeRel." FORCE) -endif() +include(../dlib/release_build_by_default) diff --git a/tools/htmlify/CMakeLists.txt b/tools/htmlify/CMakeLists.txt index 186ba56d0..11e1d4c78 100644 --- a/tools/htmlify/CMakeLists.txt +++ b/tools/htmlify/CMakeLists.txt @@ -41,9 +41,5 @@ INSTALL(TARGETS ${target_name} #set default build type to Release -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING - "Choose the type of build, options are: Debug Release - RelWithDebInfo MinSizeRel." FORCE) -endif() +include(../../dlib/release_build_by_default) diff --git a/tools/imglab/CMakeLists.txt b/tools/imglab/CMakeLists.txt index 5155025f5..e745b746f 100644 --- a/tools/imglab/CMakeLists.txt +++ b/tools/imglab/CMakeLists.txt @@ -39,11 +39,5 @@ INSTALL(TARGETS ${target_name} RUNTIME DESTINATION bin ) - #set default build type to Release -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING - "Choose the type of build, options are: Debug Release - RelWithDebInfo MinSizeRel." FORCE) -endif() - +include(../../dlib/release_build_by_default) diff --git a/tools/mltool/CMakeLists.txt b/tools/mltool/CMakeLists.txt index e7b38f049..f5d0ed731 100644 --- a/tools/mltool/CMakeLists.txt +++ b/tools/mltool/CMakeLists.txt @@ -41,11 +41,6 @@ INSTALL(TARGETS ${target_name} RUNTIME DESTINATION bin ) - #set default build type to Release -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING - "Choose the type of build, options are: Debug Release - RelWithDebInfo MinSizeRel." FORCE) -endif() +include(../../dlib/release_build_by_default)