CMakeLists.txt
changeset 15451 3102d95a870e
parent 15450 47cf2cf736e7
child 15466 c788c38f238d
child 15855 9dceb83331d5
equal deleted inserted replaced
15450:47cf2cf736e7 15451:3102d95a870e
    52 
    52 
    53 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)
    53 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)
    54 
    54 
    55 
    55 
    56 if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
    56 if(BUILD_ENGINE_C AND NOT NOVIDEOREC)
    57     if((CMAKE_BUILD_TYPE MATCHES "Release") OR (CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo"))
    57     if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
    58         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
    58         message("NOTE: Video recorder support disabled. It's incompatible with BUILD_ENGINE_C")
    59         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
    59         set(BUILD_ENGINE_C ON CACHE STRING "Required for BUILD_ENGINE_JS" FORCE)
    60     else()
    60     else()
    61         message("WARNING: Video recorder support is currently incompatible with BUILD_ENGINE_C, the video recorder won't work (but demos are fine)! See <https://issues.hedgewars.org/show_bug.cgi?id=722>.")
    61         message("WARNING: Video recorder support is currently incompatible with BUILD_ENGINE_C, the video recorder won't work (but demos are fine)! See <https://issues.hedgewars.org/show_bug.cgi?id=722>.")
    62     endif()
    62     endif()
    91 #versioning
    91 #versioning
    92 set(CPACK_PACKAGE_VERSION_MAJOR 1)
    92 set(CPACK_PACKAGE_VERSION_MAJOR 1)
    93 set(CPACK_PACKAGE_VERSION_MINOR 0)
    93 set(CPACK_PACKAGE_VERSION_MINOR 0)
    94 set(CPACK_PACKAGE_VERSION_PATCH 0)
    94 set(CPACK_PACKAGE_VERSION_PATCH 0)
    95 set(HEDGEWARS_PROTO_VER 59)
    95 set(HEDGEWARS_PROTO_VER 59)
    96 if((CMAKE_BUILD_TYPE MATCHES "Release") OR (CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo"))
    96 if((CMAKE_BUILD_TYPE STREQUAL "Release") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
    97     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
    97     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
    98 else()
    98 else()
    99     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
    99     set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-dev")
   100 endif()
   100 endif()
   101 include(${CMAKE_MODULE_PATH}/revinfo.cmake)
   101 include(${CMAKE_MODULE_PATH}/revinfo.cmake)
   110 include(${CMAKE_MODULE_PATH}/platform.cmake)
   110 include(${CMAKE_MODULE_PATH}/platform.cmake)
   111 
   111 
   112 
   112 
   113 #when build type is not specified, assume Debug/Release according to build version information
   113 #when build type is not specified, assume Debug/Release according to build version information
   114 if(CMAKE_BUILD_TYPE)
   114 if(CMAKE_BUILD_TYPE)
   115     if(NOT((CMAKE_BUILD_TYPE MATCHES "Release") OR
   115     if(NOT((CMAKE_BUILD_TYPE STREQUAL "Release") OR
   116            (CMAKE_BUILD_TYPE MATCHES "Debug") OR
   116            (CMAKE_BUILD_TYPE STREQUAL "Debug") OR
   117            (CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")))
   117            (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")))
   118         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
   118         set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
   119         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
   119         message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
   120     endif()
   120     endif()
   121 else(CMAKE_BUILD_TYPE)
   121 else(CMAKE_BUILD_TYPE)
   122     set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
   122     set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
   165 endif()
   165 endif()
   166 
   166 
   167 
   167 
   168 #get BUILD_TYPE and enable/disable optimisation
   168 #get BUILD_TYPE and enable/disable optimisation
   169 message(STATUS "Using ${CMAKE_BUILD_TYPE} configuration")
   169 message(STATUS "Using ${CMAKE_BUILD_TYPE} configuration")
   170 if(CMAKE_BUILD_TYPE MATCHES "Debug")
   170 if(CMAKE_BUILD_TYPE STREQUAL "Debug")
   171     list(APPEND haskell_flags "-Wall"       # all warnings
   171     list(APPEND haskell_flags "-Wall"       # all warnings
   172                               "-debug"      # debug mode
   172                               "-debug"      # debug mode
   173                               "-fno-warn-unused-do-bind"
   173                               "-fno-warn-unused-do-bind"
   174                               "-O0"
   174                               "-O0"
   175                               )
   175                               )