hedgewars/CMakeLists.txt
branch0.9.18
changeset 7942 17b3937de37b
parent 7940 d5e49cf042d9
child 7954 a5f0a6d46c52
equal deleted inserted replaced
7940:d5e49cf042d9 7942:17b3937de37b
   217             install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}avwrapper${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION ${target_dir})
   217             install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}avwrapper${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION ${target_dir})
   218         ELSE()
   218         ELSE()
   219             add_library(avwrapper STATIC avwrapper.c)
   219             add_library(avwrapper STATIC avwrapper.c)
   220             set(pascal_flags "-k${FFMPEG_LIBAVCODEC}" "-k${FFMPEG_LIBAVFORMAT}" "-k${FFMPEG_LIBAVUTIL}" ${pascal_flags})
   220             set(pascal_flags "-k${FFMPEG_LIBAVCODEC}" "-k${FFMPEG_LIBAVFORMAT}" "-k${FFMPEG_LIBAVUTIL}" ${pascal_flags})
   221         ENDIF()
   221         ENDIF()
   222         if(fpc_version LESS "020600")
       
   223             add_dependencies(avwrapper ENGINECLEAN)
       
   224         endif()
       
   225     else()
   222     else()
   226         message(STATUS "Could NOT find FFMPEG/LibAV, video recording will be disabled")
   223         message(STATUS "Could NOT find FFMPEG/LibAV, video recording will be disabled")
   227     endif()
   224     endif()
   228 else()
   225 else()
   229     message(STATUS "Video recording disabled by user")
   226     message(STATUS "Video recording disabled by user")
   265 #when system Lua is not found we need to compile it before engine
   262 #when system Lua is not found we need to compile it before engine
   266 if(NOT LUA_FOUND)
   263 if(NOT LUA_FOUND)
   267     add_dependencies(${engine_output_name} lua)
   264     add_dependencies(${engine_output_name} lua)
   268 endif()
   265 endif()
   269 
   266 
       
   267 #when ffmpeg/libav is found we need to compile it before engine
       
   268 #TODO: convert avwrapper to .pas unit so we can skip this
       
   269 if(${FFMPEG_FOUND})
       
   270     add_dependencies(${engine_output_name} avwrapper)
       
   271 endif()
       
   272 
   270 #this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6
   273 #this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6
   271 if((fpc_version LESS "020600") AND (NOVIDEOREC OR NOT ${FFMPEG_FOUND}))
   274 if((fpc_version LESS "020600") AND (NOVIDEOREC OR NOT ${FFMPEG_FOUND}))
   272     add_dependencies(${engine_output_name} ENGINECLEAN)
   275     add_dependencies(${engine_output_name} ENGINECLEAN)
   273 endif()
   276 endif()
   274 
   277