184 add_custom_target(ENGINECLEAN COMMAND ${SAFE_BUILD_TOOL} "clean" "${PROJECT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}") |
184 add_custom_target(ENGINECLEAN COMMAND ${SAFE_BUILD_TOOL} "clean" "${PROJECT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}") |
185 endif() |
185 endif() |
186 |
186 |
187 |
187 |
188 if(${FFMPEG_FOUND}) |
188 if(${FFMPEG_FOUND}) |
|
189 list(APPEND pascal_flags "-dUSE_VIDEO_RECORDING") |
|
190 |
189 # TODO: this check is only for SDL < 2 |
191 # TODO: this check is only for SDL < 2 |
190 # fpc will take care of linking but we need to have this library installed |
192 # fpc will take care of linking but we need to have this library installed |
191 find_package(GLUT REQUIRED) |
193 find_package(GLUT REQUIRED) |
192 |
194 |
193 #TODO: convert avwrapper to .pas unit so we can skip this step |
|
194 include_directories(${FFMPEG_INCLUDE_DIR}) |
195 include_directories(${FFMPEG_INCLUDE_DIR}) |
195 list(APPEND pascal_flags "-dUSE_VIDEO_RECORDING") |
196 add_library(avwrapper avwrapper.c) |
196 if(WIN32) |
197 #TODO: find good VERSION and SOVERSION values |
197 # there are some problems with linking our avwrapper as static lib, so link it as shared |
198 target_link_libraries(avwrapper ${FFMPEG_LIBRARIES}) |
198 add_library(avwrapper SHARED avwrapper.c) |
199 install(TARGETS avwrapper RUNTIME DESTINATION ${target_binary_install_dir} |
199 target_link_libraries(avwrapper ${FFMPEG_LIBRARIES}) |
200 LIBRARY DESTINATION ${target_library_install_dir} |
200 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}avwrapper${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION ${target_library_install_dir}) |
201 ARCHIVE DESTINATION ${target_library_install_dir}) |
201 else() |
|
202 add_library(avwrapper STATIC avwrapper.c) |
|
203 endif() |
|
204 endif() |
202 endif() |
205 |
203 |
206 |
204 |
207 set(fpc_flags ${pascal_flags} ${hwengine_project}) |
205 set(fpc_flags ${pascal_flags} ${hwengine_project}) |
208 |
206 |