Unverified Commit 0241f1fd authored by Robert Kimball's avatar Robert Kimball Committed by GitHub

Add error check for user setting CMAKE_BUILD_TYPE (#2360)

* Add error check for user setting CMAKE_BUILD_TYPE

* fix case where CMAKE_BUILD_TYPE is not set
parent 31071957
......@@ -27,6 +27,14 @@ if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
message(FATAL_ERROR "Ninja generator not supported.")
endif()
if (CMAKE_BUILD_TYPE)
set(RELEASE_TYPES Debug Release RelWithDebInfo MinSizeRel)
list(FIND RELEASE_TYPES ${CMAKE_BUILD_TYPE} INDEX_FOUND)
if (${INDEX_FOUND} EQUAL -1)
message(FATAL_ERROR "CMAKE_BUILD_TYPE must be one of Debug, Release, RelWithDebInfo, or MinSizeRel")
endif()
endif()
include(git_tags)
include(var_functions)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment