mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 11:19:02 +08:00
error out on bad build type
This commit is contained in:
parent
fdaa3f311a
commit
a94f216487
@ -2,13 +2,22 @@ project(Eigen)
|
|||||||
|
|
||||||
cmake_minimum_required(VERSION 2.6.2)
|
cmake_minimum_required(VERSION 2.6.2)
|
||||||
|
|
||||||
|
|
||||||
# guard against in-source builds
|
# guard against in-source builds
|
||||||
|
|
||||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
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 ")
|
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()
|
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 #
|
# retrieve version infomation #
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user