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 option(NOAUTOUPDATE "Disable OS X Sparkle update checking" OFF) |
58 option(NOAUTOUPDATE "Disable OS X Sparkle update checking" OFF) |
59 option(CROSSAPPLE "Enable OSX when not on OSX [default: off]" OFF) |
59 option(CROSSAPPLE "Enable OSX when not on OSX [default: off]" OFF) |
60 |
60 option(MINIMAL_FLAGS "Respect system flags as much as possible [default: off]" OFF) |
61 |
61 |
62 #bundle .app setup |
62 #bundle .app setup |
63 if(APPLE OR CROSSAPPLE) |
63 if(APPLE OR CROSSAPPLE) |
64 #paths for creating the bundle |
64 #paths for creating the bundle |
65 set(bundle_name Hedgewars.app) |
65 set(bundle_name Hedgewars.app) |
155 endif () |
155 endif () |
156 else (CMAKE_BUILD_TYPE) |
156 else (CMAKE_BUILD_TYPE) |
157 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) |
158 endif (CMAKE_BUILD_TYPE) |
158 endif (CMAKE_BUILD_TYPE) |
159 |
159 |
160 |
160 #set default flags values for all projects (unless MINIMAL_FLAGS is true) |
161 #set default flags values for all projects |
161 if(NOT MINIMAL_FLAGS) |
162 set(CMAKE_C_FLAGS "-pipe ${CMAKE_C_FLAGS}") |
162 set(CMAKE_C_FLAGS "-pipe") |
163 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") |
164 set(CMAKE_C_FLAGS_DEBUG "-Wall -O0 -g -DDEBUG ${CMAKE_C_FLAGS_DEBUG}") |
164 set(CMAKE_C_FLAGS_DEBUG "-Wall -O0 -g -DDEBUG") |
165 set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS}) |
165 set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS}) |
166 set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) |
166 set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) |
167 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() |
168 |
175 |
169 #parse additional parameters |
176 #parse additional parameters |
170 if(FPFLAGS OR GHFLAGS) |
177 if(FPFLAGS OR GHFLAGS) |
171 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}") |
172 if(cmake_version LESS "020800") |
179 if(cmake_version LESS "020800") |