diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-10-25 10:15:22 -0400 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-10-25 10:15:22 -0400 |
commit | a94f2164872c7b1c0b23946e3b4832a460e3a4ae (patch) | |
tree | b4d876f005a04130ff0ee34380ad9c303dd1bc2d /CMakeLists.txt | |
parent | fdaa3f311a000aa470dde569d876b192badfb28f (diff) |
error out on bad build type
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index dee8382df..111b8bf04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,13 +2,22 @@ project(Eigen) cmake_minimum_required(VERSION 2.6.2) - # guard against in-source builds if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. (you may need to remove CMakeCache.txt ") endif() +# guard against bad build-type strings + +string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower) +if( NOT cmake_build_type_tolower STREQUAL "debug" + AND NOT cmake_build_type_tolower STREQUAL "release" + AND NOT cmake_build_type_tolower STREQUAL "relwithdebinfo") + message(FATAL_ERROR "Unknown build type ${CMAKE_BUILD_TYPE}. Allowed values are Debug, Release, RelWithDebInfo (case-insensitive).") +endif() + + ############################################################################# # retrieve version infomation # ############################################################################# |