# HG changeset patch # User Wuzzy # Date 1570637529 -7200 # Node ID 3102d95a870e61385ee6951e30dc3be739210093 # Parent 47cf2cf736e7964a1392937aa542b208c8183bf1 CMAKE_BUILD_TYPE: Replace MATCHES with STREQUAL diff -r 47cf2cf736e7 -r 3102d95a870e CMakeLists.txt --- a/CMakeLists.txt Wed Oct 09 18:08:37 2019 +0200 +++ b/CMakeLists.txt Wed Oct 09 18:12:09 2019 +0200 @@ -54,7 +54,7 @@ if(BUILD_ENGINE_C AND NOT NOVIDEOREC) - if((CMAKE_BUILD_TYPE MATCHES "Release") OR (CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")) + if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "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 +93,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 "RelWithDebInfo")) +if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "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,9 +112,9 @@ #when build type is not specified, assume Debug/Release according to build version information if(CMAKE_BUILD_TYPE) - if(NOT((CMAKE_BUILD_TYPE MATCHES "Release") OR - (CMAKE_BUILD_TYPE MATCHES "Debug") OR - (CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo"))) + if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR + (CMAKE_BUILD_TYPE STREQUAL "Debug") OR + (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))) set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE) message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})") endif() @@ -167,7 +167,7 @@ #get BUILD_TYPE and enable/disable optimisation message(STATUS "Using ${CMAKE_BUILD_TYPE} configuration") -if(CMAKE_BUILD_TYPE MATCHES "Debug") +if(CMAKE_BUILD_TYPE STREQUAL "Debug") list(APPEND haskell_flags "-Wall" # all warnings "-debug" # debug mode "-fno-warn-unused-do-bind" diff -r 47cf2cf736e7 -r 3102d95a870e QTfrontend/CMakeLists.txt --- a/QTfrontend/CMakeLists.txt Wed Oct 09 18:08:37 2019 +0200 +++ b/QTfrontend/CMakeLists.txt Wed Oct 09 18:12:09 2019 +0200 @@ -213,9 +213,9 @@ #when debugging, always prompt a console to see fronted messages #TODO: check it doesn't interfere on UNIX -if(CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") +if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") set(console_access "WIN32") -endif(CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") +endif(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") add_executable(hedgewars ${console_access} ${hwfr_src} diff -r 47cf2cf736e7 -r 3102d95a870e cmake_modules/compilerchecks.cmake --- a/cmake_modules/compilerchecks.cmake Wed Oct 09 18:08:37 2019 +0200 +++ b/cmake_modules/compilerchecks.cmake Wed Oct 09 18:12:09 2019 +0200 @@ -62,7 +62,7 @@ endif() endif() - if(CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") + if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") set(CMAKE_REQUIRED_FLAGS "-Wl,--as-needed") check_c_compiler_flag("" HAVE_ASNEEDED) if(HAVE_ASNEEDED) diff -r 47cf2cf736e7 -r 3102d95a870e cmake_modules/cpackvars.cmake --- a/cmake_modules/cpackvars.cmake Wed Oct 09 18:08:37 2019 +0200 +++ b/cmake_modules/cpackvars.cmake Wed Oct 09 18:12:09 2019 +0200 @@ -1,6 +1,6 @@ # revision information in cpack-generated names -if(CMAKE_BUILD_TYPE MATCHES "Debug") +if(CMAKE_BUILD_TYPE STREQUAL "Debug") set(full_suffix "${HEDGEWARS_VERSION}-r${HEDGEWARS_REVISION}") else() set(full_suffix "${HEDGEWARS_VERSION}")