Fix CMAKE_BUILD_TYPE case-sensitivity, project-wide. Also fix draft
authorraptor <buckyballreaction@gmail.com>
Tue, 08 Oct 2019 11:10:58 -0600
changeset 15471 404d71b43347
parent 15470 1c342763102f
Fix CMAKE_BUILD_TYPE case-sensitivity, project-wide. Also fix typos in usage of RELWITHDEBINFO
CMakeLists.txt
--- a/CMakeLists.txt	Mon Oct 07 23:14:39 2019 +0200
+++ b/CMakeLists.txt	Tue Oct 08 11:10:58 2019 -0600
@@ -53,8 +53,13 @@
 option(NOVERSIONINFOUPDATE "Disable update of version_info.txt. To be used if source is in a git/repo that is NOT the hedgewars repo" OFF)
 
 
+# Uppercase CMAKE_BUILD_TYPE because all checks are done in a case-sensitive manner
+string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
+message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+
+
 if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
-    if((CMAKE_BUILD_TYPE MATCHES "RELEASE") OR (CMAKE_BUILD_TYPE MATCHES "RELWITHDEBUGINFO"))
+    if((CMAKE_BUILD_TYPE MATCHES "RELEASE") OR (CMAKE_BUILD_TYPE MATCHES "RELWITHDEBINFO"))
         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
     else()
@@ -93,7 +98,7 @@
 set(CPACK_PACKAGE_VERSION_MINOR 0)
 set(CPACK_PACKAGE_VERSION_PATCH 0)
 set(HEDGEWARS_PROTO_VER 59)
-if((CMAKE_BUILD_TYPE MATCHES "RELEASE") OR (CMAKE_BUILD_TYPE MATCHES "RELWITHDEBUGINFO"))
+if((CMAKE_BUILD_TYPE MATCHES "RELEASE") OR (CMAKE_BUILD_TYPE MATCHES "RELWITHDEBINFO"))
     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
 else()
     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
@@ -112,7 +117,6 @@
 
 #when build type is not specified, assume Debug/Release according to build version information
 if(CMAKE_BUILD_TYPE)
-    string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
     if(NOT((CMAKE_BUILD_TYPE MATCHES "RELEASE") OR
            (CMAKE_BUILD_TYPE MATCHES "DEBUG") OR
            (CMAKE_BUILD_TYPE MATCHES "RELWITHDEBINFO")))