equal
deleted
inserted
replaced
1 find_package(SDL) |
1 find_package(SDL) |
2 find_package(SDL_image) |
2 find_package(SDL_image) |
3 find_package(SDL_net) |
3 find_package(SDL_net) |
4 find_package(SDL_ttf) |
4 find_package(SDL_ttf) |
5 find_package(SDL_mixer) |
5 find_package(SDL_mixer) |
6 set(FFMPEG_FIND_QUIETLY true) |
|
7 find_package(FFMPEG) |
|
8 |
6 |
9 include(${CMAKE_MODULE_PATH}/FindSDL_Extras.cmake) |
7 include(${CMAKE_MODULE_PATH}/FindSDL_Extras.cmake) |
10 |
8 |
11 configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc) |
9 configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc) |
12 |
10 |
161 |
159 |
162 if(fpc_version) |
160 if(fpc_version) |
163 string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" fpc_vers_major "${fpc_version}") |
161 string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" fpc_vers_major "${fpc_version}") |
164 string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" fpc_vers_minor "${fpc_version}") |
162 string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" fpc_vers_minor "${fpc_version}") |
165 string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" fpc_vers_patch "${fpc_version}") |
163 string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" fpc_vers_patch "${fpc_version}") |
166 message(STATUS "Freepascal version installed: ${fpc_vers_major}.${fpc_vers_minor}") |
164 message(STATUS "Found Freepascal: ${fpc_executable} (version ${fpc_vers_major}.${fpc_vers_minor})") |
167 math(EXPR fpc_version "${fpc_vers_major}*10000 + ${fpc_vers_minor}*100 + ${fpc_vers_patch}") |
165 math(EXPR fpc_version "${fpc_vers_major}*10000 + ${fpc_vers_minor}*100 + ${fpc_vers_patch}") |
168 |
166 |
169 if(fpc_version LESS "020200") |
167 if(fpc_version LESS "020200") |
170 message(FATAL_ERROR "Minimum required version of FreePascal is 2.2.0") |
168 message(FATAL_ERROR "Minimum required version of FreePascal is 2.2.0") |
171 elseif(APPLE AND (fpc_version LESS "020600")) |
169 elseif(APPLE AND (fpc_version LESS "020600")) |
179 #DEPENDECIES AND EXECUTABLES SECTION |
177 #DEPENDECIES AND EXECUTABLES SECTION |
180 if(NOT NOPNG) |
178 if(NOT NOPNG) |
181 find_package(PNG) |
179 find_package(PNG) |
182 if(${PNG_FOUND}) |
180 if(${PNG_FOUND}) |
183 set(pascal_flags "-dPNG_SCREENSHOTS" ${pascal_flags}) |
181 set(pascal_flags "-dPNG_SCREENSHOTS" ${pascal_flags}) |
184 if(APPLE) # easier to explictly link with the static lib |
182 if(APPLE) # fpc png unit doesn't pull the library (see bug 21833) |
185 string(REGEX REPLACE "(.*)libpng.*" "\\1" PNG_LIBDIR "${PNG_LIBRARY}") |
183 set(pascal_flags "-k${PNG_LIBRARY}" ${pascal_flags}) |
186 set(pascal_flags "-k${PNG_LIBDIR}/libpng.a" ${pascal_flags}) |
|
187 endif() |
184 endif() |
188 else() |
185 else() |
189 message(STATUS "Screenshots will be in BMP format because libpng was not found") |
186 message(STATUS "Screenshots will be in BMP format because libpng was not found") |
190 endif() |
187 endif() |
191 else() |
188 else() |
199 add_custom_target(ENGINECLEAN COMMAND ${CMAKE_BUILD_TOOL} "clean" "${PROJECT_BINARY_DIR}" "${hedgewars_SOURCE_DIR}/hedgewars") |
196 add_custom_target(ENGINECLEAN COMMAND ${CMAKE_BUILD_TOOL} "clean" "${PROJECT_BINARY_DIR}" "${hedgewars_SOURCE_DIR}/hedgewars") |
200 endif() |
197 endif() |
201 |
198 |
202 |
199 |
203 if(NOT NOVIDEOREC) |
200 if(NOT NOVIDEOREC) |
|
201 set(FFMPEG_FIND_QUIETLY true) |
|
202 find_package(FFMPEG) |
204 if(${FFMPEG_FOUND}) |
203 if(${FFMPEG_FOUND}) |
205 include_directories(${FFMPEG_INCLUDE_DIR}) |
204 include_directories(${FFMPEG_INCLUDE_DIR}) |
206 set(pascal_flags "-dUSE_VIDEO_RECORDING" ${pascal_flags}) |
205 set(pascal_flags "-dUSE_VIDEO_RECORDING" ${pascal_flags}) |
207 IF (WIN32) |
206 IF (WIN32) |
208 # there are some problems with linking our avwrapper as static lib, so link it as shared |
207 # there are some problems with linking our avwrapper as static lib, so link it as shared |
260 if(NOT LUA_FOUND) |
259 if(NOT LUA_FOUND) |
261 add_dependencies(${engine_output_name} lua) |
260 add_dependencies(${engine_output_name} lua) |
262 endif() |
261 endif() |
263 |
262 |
264 #this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6 |
263 #this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6 |
265 if(fpc_version LESS "020600") |
264 if((fpc_version LESS "020600") AND (NOVIDEOREC OR NOT ${FFMPEG_FOUND})) |
266 if(NO_VIDEOREC OR NOT ${FFMPEG_FOUND}) |
265 add_dependencies(${engine_output_name} ENGINECLEAN) |
267 add_dependencies(${engine_output_name} ENGINECLEAN) |
|
268 endif() |
|
269 endif() |
266 endif() |
270 |
267 |
271 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir}) |
268 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir}) |