46 set(CPACK_PACKAGE_VERSION_PATCH 18${version_suffix}) |
46 set(CPACK_PACKAGE_VERSION_PATCH 18${version_suffix}) |
47 set(HEDGEWARS_PROTO_VER 42) |
47 set(HEDGEWARS_PROTO_VER 42) |
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 safe values |
51 #set some default values |
52 IF(NOT BUILD_ENGINE_LIBRARY) |
52 option(NOSERVER "Disable gameServer build [default: auto]" OFF) |
53 SET(BUILD_ENGINE_LIBRARY 0) |
53 option(NOPNG "Disable screenshoot compression [default: auto]" OFF) |
54 ENDIF(NOT BUILD_ENGINE_LIBRARY) |
54 option(NOVIDEOREC "Disable video recording [default: auto]" OFF) |
55 set(target_dir "bin") |
55 |
|
56 option(BUILD_ENGINE_LIBRARY "Enable hwengine library [default: off]" OFF) |
|
57 option(ANDROID "Enable Android build [default: off]" OFF) |
|
58 option(CROSSAPPLE "Enable OSX when not on OSX [default: off]" OFF) |
|
59 |
56 |
60 |
57 #bundle .app setup |
61 #bundle .app setup |
58 if(APPLE OR CROSSAPPLE) |
62 if(APPLE OR CROSSAPPLE) |
59 #paths for creating the bundle |
63 #paths for creating the bundle |
60 set(bundle_name Hedgewars.app) |
64 set(bundle_name Hedgewars.app) |
61 set(frameworks_dir ${bundle_name}/Contents/Frameworks/) |
65 set(frameworks_dir ${bundle_name}/Contents/Frameworks/) |
62 set(CMAKE_INSTALL_PREFIX ${bundle_name}/Contents/MacOS/) |
66 set(CMAKE_INSTALL_PREFIX ${bundle_name}/Contents/MacOS/) |
63 set(DATA_INSTALL_DIR "../Resources/") |
67 set(DATA_INSTALL_DIR "../Resources/") |
64 set(target_dir ".") |
68 set(target_dir ".") |
65 set(minimum_macosx_version "10.6") |
69 set(minimum_macosx_version "10.6") |
|
70 else() |
|
71 set(target_dir "bin") |
66 endif() |
72 endif() |
67 |
73 |
68 if(APPLE) |
74 if(APPLE) |
69 set(CMAKE_FIND_FRAMEWORK "FIRST") |
75 set(CMAKE_FIND_FRAMEWORK "FIRST") |
70 |
76 |
204 endif() |
211 endif() |
205 |
212 |
206 if(ghc_executable) |
213 if(ghc_executable) |
207 set(HAVE_NETSERVER true) |
214 set(HAVE_NETSERVER true) |
208 add_subdirectory(gameServer) |
215 add_subdirectory(gameServer) |
|
216 message(STATUS "Found GHC: ${ghc_executable}") |
209 else() |
217 else() |
210 message(STATUS "No GHC executable found, server will not be built") |
218 message(STATUS "Could NOT find GHC, server will not be built") |
211 set(HAVE_NETSERVER false) |
219 set(HAVE_NETSERVER false) |
212 endif() |
220 endif() |
213 else() |
221 else() |
214 message(STATUS "Server will not be built per user request") |
222 message(STATUS "Server will not be built per user request") |
215 set(HAVE_NETSERVER false) |
223 set(HAVE_NETSERVER false) |
217 |
225 |
218 |
226 |
219 #lua discovery |
227 #lua discovery |
220 find_package(Lua) |
228 find_package(Lua) |
221 if(LUA_FOUND) |
229 if(LUA_FOUND) |
222 message(STATUS "Lua library is present on your system (${LUA_DEFAULT})") |
230 message(STATUS "LUA found: ${LUA_DEFAULT}") |
223 else() |
231 else() |
224 message(STATUS "Lua library not found, building bundled dependency") |
232 message(STATUS "Cound NOT find LUA, building bundled dependency") |
225 add_subdirectory(misc/liblua) |
233 add_subdirectory(misc/liblua) |
226 #linking with liblua.a requires system readline -- this works everywhere, right? |
234 #linking with liblua.a requires system readline -- this works everywhere, right? |
227 set(pascal_flags "-k${EXECUTABLE_OUTPUT_PATH}/lib${LUA_LIBRARY}.a" "-k-lreadline" ${pascal_flags}) |
235 set(pascal_flags "-k${EXECUTABLE_OUTPUT_PATH}/lib${LUA_LIBRARY}.a" "-k-lreadline" ${pascal_flags}) |
228 endif() |
236 endif() |
229 |
237 |