forked from sony/nmos-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsafeguards.cmake
More file actions
17 lines (14 loc) · 785 Bytes
/
safeguards.cmake
File metadata and controls
17 lines (14 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
if(${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR})
message(WARNING "In-source builds not recommended. Please make a new directory (called a build directory) and run CMake from there.")
endif()
string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower)
string(TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_toupper)
if(NOT cmake_build_type_tolower STREQUAL "debug" AND
NOT cmake_build_type_tolower STREQUAL "release" AND
NOT cmake_build_type_tolower STREQUAL "relwithdebinfo" AND
NOT cmake_build_type_tolower STREQUAL "minsizerel")
message(FATAL_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Release, RelWithDebInfo, MinSizeRel (case-insensitive).")
endif()