118 |
118 |
119 #add user framework directory |
119 #add user framework directory |
120 set(pascal_compiler_flags_cmn "-Ff~/Library/Frameworks" ${pascal_compiler_flags_cmn}) |
120 set(pascal_compiler_flags_cmn "-Ff~/Library/Frameworks" ${pascal_compiler_flags_cmn}) |
121 #set deployment target |
121 #set deployment target |
122 set(pascal_compiler_flags_cmn "-k-macosx_version_min" "-k${minimum_macosx_version}" "-XR${CMAKE_OSX_SYSROOT}" ${pascal_compiler_flags_cmn}) |
122 set(pascal_compiler_flags_cmn "-k-macosx_version_min" "-k${minimum_macosx_version}" "-XR${CMAKE_OSX_SYSROOT}" ${pascal_compiler_flags_cmn}) |
123 #link with liblua.a (which requires readline) |
|
124 set(pascal_compiler_flags_cmn "-k${CMAKE_BINARY_DIR}/bin/liblua.a" "-k-lreadline" ${pascal_compiler_flags_cmn}) |
|
125 #link with libsdlmain.a (when building an executable) |
123 #link with libsdlmain.a (when building an executable) |
126 if(NOT BUILD_ENGINE_LIBRARY) |
124 if(NOT BUILD_ENGINE_LIBRARY) |
127 set(pascal_compiler_flags_cmn "-k${CMAKE_BINARY_DIR}/bin/libSDLmain.a" ${pascal_compiler_flags_cmn}) |
125 set(pascal_compiler_flags_cmn "-k${CMAKE_BINARY_DIR}/bin/libSDLmain.a" ${pascal_compiler_flags_cmn}) |
128 endif() |
126 endif() |
129 |
127 |
144 message(STATUS "Building Release") |
142 message(STATUS "Building Release") |
145 set(Optz true) |
143 set(Optz true) |
146 endif() |
144 endif() |
147 |
145 |
148 |
146 |
149 #set default flags values for all the project |
147 #set default flags values for all projects |
150 set(CMAKE_C_FLAGS "-pipe ${CMAKE_C_FLAGS}") |
148 set(CMAKE_C_FLAGS "-pipe ${CMAKE_C_FLAGS}") |
151 set(CMAKE_C_FLAGS_RELEASE "-w -Os -fomit-frame-pointer ${CMAKE_C_FLAGS_RELEASE}") |
149 set(CMAKE_C_FLAGS_RELEASE "-w -Os -fomit-frame-pointer ${CMAKE_C_FLAGS_RELEASE}") |
152 set(CMAKE_C_FLAGS_DEBUG "-Wall -O0 -g -DDEBUG ${CMAKE_C_FLAGS_DEBUG}") |
150 set(CMAKE_C_FLAGS_DEBUG "-Wall -O0 -g -DDEBUG ${CMAKE_C_FLAGS_DEBUG}") |
153 set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS}) |
151 set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS}) |
154 set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) |
152 set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) |
155 set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) |
153 set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) |
156 |
154 |
157 set(pascal_compiler_flags_cmn "-B" "-FE../bin" "-Cs2000000" "-vewn" ${pascal_compiler_flags_cmn}) |
155 separate_arguments(FPFLAGSINT UNIX_COMMAND ${FPFLAGS}) |
|
156 set(pascal_compiler_flags_cmn ${FPFLAGSINT} "-B" "-FE../bin" "-Cs2000000" "-vewn" ${pascal_compiler_flags_cmn}) |
158 set(haskell_compiler_flags_cmn "-O2" ${haskell_compiler_flags_cmn}) |
157 set(haskell_compiler_flags_cmn "-O2" ${haskell_compiler_flags_cmn}) |
159 |
158 |
160 if(Optz) |
159 if(Optz) |
161 # set(pascal_compiler_flags_cmn "-O3" "-OpPENTIUM4" "-CfSSE3" "-Xs" "-Si" ${pascal_compiler_flags_cmn}) |
160 # set(pascal_compiler_flags_cmn "-O3" "-OpPENTIUM4" "-CfSSE3" "-Xs" "-Si" ${pascal_compiler_flags_cmn}) |
162 set(pascal_compiler_flags_cmn "-Os" "-Ooregvar" "-Xs" "-Si" ${pascal_compiler_flags_cmn}) |
161 set(pascal_compiler_flags_cmn "-Os" "-Ooregvar" "-Xs" "-Si" ${pascal_compiler_flags_cmn}) |
187 endif() |
186 endif() |
188 else(WITH_SERVER) |
187 else(WITH_SERVER) |
189 set(HAVE_NETSERVER false) |
188 set(HAVE_NETSERVER false) |
190 endif(WITH_SERVER) |
189 endif(WITH_SERVER) |
191 |
190 |
192 add_subdirectory(misc/liblua) |
191 find_package(Lua) |
|
192 if(NOT ${LUA_FOUND}) |
|
193 message(STATUS "Lua library not found, building bundled dependency") |
|
194 add_subdirectory(misc/liblua) |
|
195 #link with liblua.a (which requires readline) |
|
196 set(pascal_compiler_flags_cmn "-k${CMAKE_BINARY_DIR}/bin/liblua.a" "-k-lreadline" ${pascal_compiler_flags_cmn}) |
|
197 endif() |
193 add_subdirectory(hedgewars) |
198 add_subdirectory(hedgewars) |
194 |
199 |
195 #run cmake -DBUILD_ANDROID_PORT=1 to enable this |
200 #run cmake -DBUILD_ANDROID_PORT=1 to enable this |
196 if(ANDROID) |
201 if(ANDROID) |
197 add_subdirectory(project_files/Android-build) |
202 add_subdirectory(project_files/Android-build) |
198 endif() |
203 endif() |
199 |
204 |
200 if(NOT BUILD_ENGINE_LIBRARY) |
205 if(NOT (BUILD_ENGINE_LIBRARY OR ANDROID)) |
201 add_subdirectory(bin) |
206 add_subdirectory(bin) |
202 add_subdirectory(misc/quazip) |
207 add_subdirectory(misc/quazip) |
203 add_subdirectory(QTfrontend) |
208 add_subdirectory(QTfrontend) |
204 add_subdirectory(share) |
209 add_subdirectory(share) |
205 add_subdirectory(tools) |
210 add_subdirectory(tools) |