CMakeLists.txt
branchphysfslayer
changeset 8019 b216953c2617
parent 7951 c64c0b413ff7
parent 7994 706218709157
child 8022 10b3b93c1f56
equal deleted inserted replaced
7971:fcbaa236a2d5 8019:b216953c2617
    10 ENDFOREACH()
    10 ENDFOREACH()
    11 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
    11 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
    12 
    12 
    13 
    13 
    14 #detect Mercurial revision (if present)
    14 #detect Mercurial revision (if present)
    15 set(version_suffix "") #UNSET THIS VARIABLE AT RELEASE TIME
    15 set(version_suffix "-dev") #UNSET THIS VARIABLE AT RELEASE TIME
    16 set(HGCHANGED "")
    16 set(HGCHANGED "")
    17 IF(version_suffix MATCHES "-dev")
    17 IF(version_suffix MATCHES "-dev")
    18     set(HW_DEV true)
    18     set(HW_DEV true)
    19     set(default_build_type "DEBUG")
    19     set(default_build_type "DEBUG")
    20     IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.hg)
    20     IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.hg)
    41 
    41 
    42 
    42 
    43 #versioning
    43 #versioning
    44 set(CPACK_PACKAGE_VERSION_MAJOR 0)
    44 set(CPACK_PACKAGE_VERSION_MAJOR 0)
    45 set(CPACK_PACKAGE_VERSION_MINOR 9)
    45 set(CPACK_PACKAGE_VERSION_MINOR 9)
    46 set(CPACK_PACKAGE_VERSION_PATCH 18${version_suffix})
    46 set(CPACK_PACKAGE_VERSION_PATCH 19${version_suffix})
    47 set(HEDGEWARS_PROTO_VER 43)
    47 set(HEDGEWARS_PROTO_VER 44)
    48 set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
    48 set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
    49 
    49 
    50 
    50 
    51 #set some default values
    51 #set some default values
    52 option(NOSERVER "Disable gameServer build [default: auto]" OFF)
    52 option(NOSERVER "Disable gameServer build [default: auto]" OFF)
    53 option(NOPNG "Disable screenshoot compression [default: auto]" OFF)
    53 option(NOPNG "Disable screenshoot compression [default: auto]" OFF)
    54 option(NOVIDEOREC "Disable video recording [default: auto]" OFF)
    54 option(NOVIDEOREC "Disable video recording [default: auto]" OFF)
    55 
    55 
    56 option(BUILD_ENGINE_LIBRARY "Enable hwengine library [default: off]" OFF)
    56 option(BUILD_ENGINE_LIBRARY "Enable hwengine library [default: off]" OFF)
    57 option(ANDROID "Enable Android build [default: off]" OFF)
    57 option(ANDROID "Enable Android build [default: off]" OFF)
    58 
       
    59 option(NOAUTOUPDATE "Disable OS X Sparkle update checking" OFF)
    58 option(NOAUTOUPDATE "Disable OS X Sparkle update checking" OFF)
    60 option(CROSSAPPLE "Enable OSX when not on OSX [default: off]" OFF)
    59 option(CROSSAPPLE "Enable OSX when not on OSX [default: off]" OFF)
    61 
    60 option(MINIMAL_FLAGS "Respect system flags as much as possible [default: off]" OFF)
    62 
    61 
    63 #bundle .app setup
    62 #bundle .app setup
    64 if(APPLE OR CROSSAPPLE)
    63 if(APPLE OR CROSSAPPLE)
    65     #paths for creating the bundle
    64     #paths for creating the bundle
    66     set(bundle_name Hedgewars.app)
    65     set(bundle_name Hedgewars.app)
   156     endif ()
   155     endif ()
   157 else (CMAKE_BUILD_TYPE)
   156 else (CMAKE_BUILD_TYPE)
   158     set (CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Choose the build type, options are: Debug Release." FORCE)
   157     set (CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Choose the build type, options are: Debug Release." FORCE)
   159 endif (CMAKE_BUILD_TYPE)
   158 endif (CMAKE_BUILD_TYPE)
   160 
   159 
   161 
   160 #set default flags values for all projects (unless MINIMAL_FLAGS is true)
   162 #set default flags values for all projects
   161 if(NOT MINIMAL_FLAGS)
   163 set(CMAKE_C_FLAGS "-pipe ${CMAKE_C_FLAGS}")
   162     set(CMAKE_C_FLAGS "-pipe")
   164 set(CMAKE_C_FLAGS_RELEASE "-w -Os -fomit-frame-pointer ${CMAKE_C_FLAGS_RELEASE}")
   163     set(CMAKE_C_FLAGS_RELEASE "-w -Os -fomit-frame-pointer")
   165 set(CMAKE_C_FLAGS_DEBUG "-Wall -O0 -g -DDEBUG ${CMAKE_C_FLAGS_DEBUG}")
   164     set(CMAKE_C_FLAGS_DEBUG "-Wall -O0 -g -DDEBUG")
   166 set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
   165     set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
   167 set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
   166     set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
   168 set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
   167     set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
       
   168 else()
       
   169     #CMake adds a lot of additional configuration flags, so let's clear them up
       
   170     set(CMAKE_C_FLAGS_RELEASE "")
       
   171     set(CMAKE_C_FLAGS_DEBUG "-Wall -DDEBUG")
       
   172     set(CMAKE_CXX_FLAGS_RELEASE "")
       
   173     set(CMAKE_CXX_FLAGS_DEBUG "-Wall -DDEBUG")
       
   174 endif()
   169 
   175 
   170 #parse additional parameters
   176 #parse additional parameters
   171 if(FPFLAGS OR GHFLAGS)
   177 if(FPFLAGS OR GHFLAGS)
   172     math(EXPR cmake_version "${CMAKE_MAJOR_VERSION}*10000 + ${CMAKE_MINOR_VERSION}*100 + ${CMAKE_PATCH_VERSION}")
   178     math(EXPR cmake_version "${CMAKE_MAJOR_VERSION}*10000 + ${CMAKE_MINOR_VERSION}*100 + ${CMAKE_PATCH_VERSION}")
   173     if(cmake_version LESS "020800")
   179     if(cmake_version LESS "020800")