hedgewars/CMakeLists.txt
changeset 7538 2d6e69b392cb
parent 7534 ccb9c2906160
child 7540 cc6c656f70b5
--- a/hedgewars/CMakeLists.txt	Fri Aug 10 17:25:22 2012 +0400
+++ b/hedgewars/CMakeLists.txt	Fri Aug 10 17:35:48 2012 +0400
@@ -185,16 +185,25 @@
     message(STATUS "PNG screenshots disabled per user request, using BMP format")
 endif()
 
-set(fpc_flags ${noexecstack_flags} ${pascal_flags} ${hwengine_project})
+if(NOT NO_VIDEOREC)
+    if(${FFMPEG_FOUND})
+        message(STATUS "Compiling with video recording")
+        include_directories(${FFMPEG_INCLUDE_DIR})
+        set(pascal_flags "-dUSE_VIDEO_RECORDING" ${pascal_flags})
+        IF (WIN32)
+            set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
+            # there are some problems with linking our avwrapper as static lib, so link it as shared
+            add_library(avwrapper SHARED avwrapper.c)
+            target_link_libraries(avwrapper ${FFMPEG_LIBRARIES})
+        ELSE()
+            add_library(avwrapper STATIC avwrapper.c)
+        ENDIF()
+    endif()
+else()
+    message(STATUS "Video recording disabled by user")
+endif()
 
-IF (WIN32)
-    set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
-    include_directories(${FFMPEG_INCLUDE_DIR})
-    add_library(avwrapper SHARED avwrapper.c)
-    target_link_libraries(avwrapper ${FFMPEG_LIBRARIES})
-ELSE()
-    add_library(avwrapper STATIC avwrapper.c)
-ENDIF()
+set(fpc_flags ${noexecstack_flags} ${pascal_flags} ${hwengine_project})
 
 IF(NOT APPLE)
     #here is the command for standard executables or for shared library