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 |
58 |
59 option(NOAUTOUPDATE "Disable OS X Sparkle update checking" OFF) |
59 option(NOAUTOUPDATE "Disable OS X Sparkle update checking" OFF) |
60 option(CROSSAPPLE "Enable OSX when not on OSX [default: off]" OFF) |
60 option(CROSSAPPLE "Enable OSX when not on OSX [default: off]" OFF) |
61 |
61 option(MINIMAL_FLAGS "Respect system flags as much as possible [default: off]" OFF) |
62 |
62 |
63 #bundle .app setup |
63 #bundle .app setup |
64 if(APPLE OR CROSSAPPLE) |
64 if(APPLE OR CROSSAPPLE) |
65 #paths for creating the bundle |
65 #paths for creating the bundle |
66 set(bundle_name Hedgewars.app) |
66 set(bundle_name Hedgewars.app) |
156 endif () |
156 endif () |
157 else (CMAKE_BUILD_TYPE) |
157 else (CMAKE_BUILD_TYPE) |
158 set (CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Choose the build type, options are: Debug Release." FORCE) |
158 set (CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Choose the build type, options are: Debug Release." FORCE) |
159 endif (CMAKE_BUILD_TYPE) |
159 endif (CMAKE_BUILD_TYPE) |
160 |
160 |
161 |
161 #set default flags values for all projects (unless MINIMAL_FLAGS is true) |
162 #set default flags values for all projects |
162 if(NOT MINIMAL_FLAGS) |
163 set(CMAKE_C_FLAGS "-pipe ${CMAKE_C_FLAGS}") |
163 set(CMAKE_C_FLAGS "-pipe") |
164 set(CMAKE_C_FLAGS_RELEASE "-w -Os -fomit-frame-pointer ${CMAKE_C_FLAGS_RELEASE}") |
164 set(CMAKE_C_FLAGS_RELEASE "-w -Os -fomit-frame-pointer") |
165 set(CMAKE_C_FLAGS_DEBUG "-Wall -O0 -g -DDEBUG ${CMAKE_C_FLAGS_DEBUG}") |
165 set(CMAKE_C_FLAGS_DEBUG "-Wall -O0 -g -DDEBUG") |
166 set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS}) |
166 set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS}) |
167 set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) |
167 set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) |
168 set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) |
168 set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) |
|
169 else() |
|
170 #CMake adds a lot of additional configuration flags, so let's clear them up |
|
171 set(CMAKE_C_FLAGS_RELEASE "") |
|
172 set(CMAKE_C_FLAGS_DEBUG "-Wall -DDEBUG") |
|
173 set(CMAKE_CXX_FLAGS_RELEASE "") |
|
174 set(CMAKE_CXX_FLAGS_DEBUG "-Wall -DDEBUG") |
|
175 endif() |
169 |
176 |
170 #parse additional parameters |
177 #parse additional parameters |
171 if(FPFLAGS OR GHFLAGS) |
178 if(FPFLAGS OR GHFLAGS) |
172 math(EXPR cmake_version "${CMAKE_MAJOR_VERSION}*10000 + ${CMAKE_MINOR_VERSION}*100 + ${CMAKE_PATCH_VERSION}") |
179 math(EXPR cmake_version "${CMAKE_MAJOR_VERSION}*10000 + ${CMAKE_MINOR_VERSION}*100 + ${CMAKE_PATCH_VERSION}") |
173 if(cmake_version LESS "020800") |
180 if(cmake_version LESS "020800") |