From ecbec126af49c0ea7a7a198a7cbcf91bd2075397 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 22 Mar 2015 15:24:20 -0400 Subject: [PATCH 1/3] Allow disabling GPL only components. Only works for Linux right now. --- CMakeLists.txt | 54 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d0d04bc31f..614e3c8255 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,32 +39,35 @@ set(CPACK_PACKAGE_NAME "StepMania") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Rhythm Game Simulator") # Prep options that are needed for each platform. -option(WITH_NETWORKING "Build with networking support" ON) +option(WITH_NETWORKING "Build with networking support." ON) # This option is not yet working, but will likely default to ON in the future. -option(WITH_LTO "Build with Link Time Optimization (LTO)/Whole Program Optimization" OFF) +option(WITH_LTO "Build with Link Time Optimization (LTO)/Whole Program Optimization." OFF) -option(WITH_SSE2 "Build with SSE2 Optimizations" ON) +option(WITH_SSE2 "Build with SSE2 Optimizations." ON) # This option may go away in the future: if it does, JPEG will always be required. -option(WITH_JPEG "Build with JPEG Image Support" ON) +option(WITH_JPEG "Build with JPEG Image Support." ON) # Turn this on to set this to a specific release mode. option(WITH_FULL_RELEASE "Build as a proper, full release." OFF) +# Turn this option off to not use the GPL exclusive components. +option(WITH_GPL_LIBS "Build with GPL libraries." ON) + if(WIN32) - option(WITH_MINIMAID "Build with Mimimaid Lights Support" OFF) + option(WITH_MINIMAID "Build with Mimimaid Lights Support." OFF) else() if(LINUX) - option(WITH_FFMPEG "Build with FFMPEG" ON) - option(WITH_TTY "Build with Linux TTY Input Support" OFF) - option(WITH_PROFILING "Build with Profiling Support" OFF) - option(WITH_GLES2 "Build with OpenGL ES 2.0 Support" ON) - option(WITH_GTK2 "Build with GTK2 Support" ON) - option(WITH_OGG "Build with OGG/Vorbis Support" ON) - option(WITH_MP3 "Build with MP3 Support" ON) - option(WITH_PARALLEL_PORT "Build with Parallel Lights I/O Support" OFF) - option(WITH_CRASH_HANDLER "Build with Crash Handler Support" ON) + option(WITH_FFMPEG "Build with FFMPEG." ON) + option(WITH_TTY "Build with Linux TTY Input Support." OFF) + option(WITH_PROFILING "Build with Profiling Support." OFF) + option(WITH_GLES2 "Build with OpenGL ES 2.0 Support." ON) + option(WITH_GTK2 "Build with GTK2 Support." ON) + option(WITH_OGG "Build with OGG/Vorbis Support." ON) + option(WITH_MP3 "Build with MP3 Support." ON) + option(WITH_PARALLEL_PORT "Build with Parallel Lights I/O Support." OFF) + option(WITH_CRASH_HANDLER "Build with Crash Handler Support." ON) endif() endif() @@ -167,6 +170,11 @@ elseif(LINUX) include(TestBigEndian) include(ExternalProject) + if(NOT WITH_GPL_LIBS) + message("Disabling GPL exclusive libraries: no MP3 support.") + set(WITH_MP3 OFF) + endif() + if(WITH_GTK2) find_package("GTK2" 2.0) if (${GTK2_FOUND}) @@ -274,6 +282,22 @@ elseif(LINUX) endif() if(WITH_FFMPEG) + list(APPEND FFMPEG_CONFIGURE + "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg/configure" + "--disable-programs" + "--disable-doc" + "--disable-avdevice" + "--disable-swresample" + "--disable-postproc" + "--disable-avfilter" + "--disable-shared" + "--enable-static" + ) + if(WITH_GPL_LIBS) + list(APPEND FFMPEG_CONFIGURE + "--enable-gpl" + ) + endif() # NEVER use the system ffmpeg. Not worth the hassle. # --shlibdir=$our_installdir/stepmania-$VERSION externalproject_add("ffmpeg" @@ -281,7 +305,7 @@ elseif(LINUX) PREFIX "${SM_EXTERN_DIR}/ffmpeg-linux" GIT_REPOSITORY "git://source.ffmpeg.org/ffmpeg.git" GIT_TAG "n2.1.3" - CONFIGURE_COMMAND "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg/configure" "--enable-gpl" "--disable-programs" "--disable-doc" "--disable-avdevice" "--disable-swresample" "--disable-postproc" "--disable-avfilter" "--disable-shared" "--enable-static" + CONFIGURE_COMMAND ${FFMPEG_CONFIGURE} BUILD_COMMAND "make" UPDATE_COMMAND "" INSTALL_COMMAND "" From 33f183938eb5ae7c5c1ecae9e9fd3ab628b40fae Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 22 Mar 2015 15:46:53 -0400 Subject: [PATCH 2/3] Allow for system pcre to take precedence. --- CMake/Modules/FindPcre.cmake | 17 +++++++++++++++++ CMakeLists.txt | 5 +++++ extern/CMakeLists.txt | 4 +++- src/CMakeLists.txt | 12 +++++++++++- 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 CMake/Modules/FindPcre.cmake diff --git a/CMake/Modules/FindPcre.cmake b/CMake/Modules/FindPcre.cmake new file mode 100644 index 0000000000..493f006329 --- /dev/null +++ b/CMake/Modules/FindPcre.cmake @@ -0,0 +1,17 @@ +# Find pcre using standard tools. + +# The following will be set: + +# PCRE_INCLUDE_DIR +# PCRE_LIBRARY +# PCRE_FOUND + +find_path(PCRE_INCLUDE_DIR NAMES pcre.h) +find_library(PCRE_LIBRARY NAMES pcre) + +# Properly pass QUIETLY and REQUIRED. +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_INCLUDE_DIR PCRE_LIBRARY) + +mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARY) + diff --git a/CMakeLists.txt b/CMakeLists.txt index 614e3c8255..e6db967839 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,6 +106,7 @@ set(ENDIANNESS "ENDIAN_LITTLE") if(WIN32) set(HAS_OGG TRUE) set(HAS_MP3 TRUE) + set(SYSTEM_PCRE_FOUND FALSE) find_package(DirectX REQUIRED) # FFMPEG...it can be evil. @@ -131,6 +132,7 @@ if(WIN32) elseif(MACOSX) set(HAS_OGG TRUE) set(HAS_MP3 TRUE) + set(SYSTEM_PCRE_FOUND FALSE) set(WITH_CRASH_HANDLER TRUE) # Apple Archs needs to be 32-bit for now. # When SDL2 is introduced, this may change. @@ -189,6 +191,9 @@ elseif(LINUX) find_package(X11) + find_package(Pcre) + set(SYSTEM_PCRE_FOUND ${PCRE_FOUND}) + find_package("BZip2") if (NOT(${BZIP2_FOUND})) message(FATAL_ERROR "Bzip2 support required.") diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 0620eb04d2..3570229ad7 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -1,7 +1,9 @@ include(CMakeProject-lua.cmake) include(CMakeProject-glew.cmake) include(CMakeProject-json.cmake) -include(CMakeProject-pcre.cmake) +if (NOT SYSTEM_PCRE_FOUND) + include(CMakeProject-pcre.cmake) +endif() include(CMakeProject-tomcrypt.cmake) include(CMakeProject-tommath.cmake) if (APPLE OR MSVC) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 38f4b43543..8aeb6a95e2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -296,10 +296,13 @@ list(APPEND SMDATA_LINK_LIB "mad" "png" "glew" - "pcre" "jpeg" ) +if (NOT SYSTEM_PCRE_FOUND) + list(INSERT SMDATA_LINK_LIB 8 "pcre") +endif() + if (WIN32) list(APPEND SMDATA_LINK_LIB # The misc libraries are here. @@ -444,6 +447,10 @@ else() # Unix / Linux list(APPEND SMDATA_LINK_LIB ${X11_LIBRARIES}) endif() + if(PCRE_FOUND) + list(APPEND SMDATA_LINK_LIB ${PCRE_LIBRARY}) + endif() + list(APPEND SMDATA_LINK_LIB ${XRANDR_LIBRARIES} ) @@ -481,6 +488,9 @@ if(NOT APPLE) if (X11_FOUND) list(APPEND SM_INCLUDE_DIRS "${X11_INCLUDE_DIR}") endif() + if (PCRE_FOUND) + list(APPEND SM_INCLUDE_DIRS "${PCRE_INCLUDE_DIR}") + endif() endif() else() list(APPEND SM_INCLUDE_DIRS From 05d341485dc95339061e435e4fbc13198f6fe1fa Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 22 Mar 2015 16:03:38 -0400 Subject: [PATCH 3/3] Allow for system ffmpeg usage. Warning: this is NOT advised right now. --- CMake/Modules/FindFFMPEG.cmake | 224 +++++++++++++++++++++++++++++++++ CMakeLists.txt | 67 ++++++---- src/CMakeLists.txt | 36 ++++-- 3 files changed, 291 insertions(+), 36 deletions(-) create mode 100644 CMake/Modules/FindFFMPEG.cmake diff --git a/CMake/Modules/FindFFMPEG.cmake b/CMake/Modules/FindFFMPEG.cmake new file mode 100644 index 0000000000..af0ee70e28 --- /dev/null +++ b/CMake/Modules/FindFFMPEG.cmake @@ -0,0 +1,224 @@ +# This was copied from the robotology/ycm project. + +#.rst: +# FindFFMPEG +# ---------- +# +# Find the native FFMPEG includes and library +# +# This module defines:: +# +# FFMPEG_INCLUDE_DIR, where to find avcodec.h, avformat.h ... +# FFMPEG_LIBRARIES, the libraries to link against to use FFMPEG. +# FFMPEG_FOUND, If false, do not try to use FFMPEG. +# +# also defined, but not for general use are:: +# +# FFMPEG_avformat_LIBRARY, where to find the FFMPEG avformat library. +# FFMPEG_avcodec_LIBRARY, where to find the FFMPEG avcodec library. +# +# This is useful to do it this way so that we can always add more libraries +# if needed to ``FFMPEG_LIBRARIES`` if ffmpeg ever changes... + +#============================================================================= +# Copyright: 1993-2008 Ken Martin, Will Schroeder, Bill Lorensen +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of YCM, substitute the full +# License text for the above reference.) + +# Originally from VTK project + + +find_path(FFMPEG_INCLUDE_DIR1 avformat.h + $ENV{FFMPEG_DIR} + $ENV{FFMPEG_DIR}/ffmpeg + $ENV{FFMPEG_DIR}/libavformat + $ENV{FFMPEG_DIR}/include/libavformat + $ENV{FFMPEG_DIR}/include/ffmpeg + /usr/local/include/ffmpeg + /usr/include/ffmpeg + /usr/include/libavformat + /usr/include/ffmpeg/libavformat + /usr/local/include/libavformat +) + +find_path(FFMPEG_INCLUDE_DIR2 avutil.h + $ENV{FFMPEG_DIR} + $ENV{FFMPEG_DIR}/ffmpeg + $ENV{FFMPEG_DIR}/libavutil + $ENV{FFMPEG_DIR}/include/libavutil + $ENV{FFMPEG_DIR}/include/ffmpeg + /usr/local/include/ffmpeg + /usr/include/ffmpeg + /usr/include/libavutil + /usr/include/ffmpeg/libavutil + /usr/local/include/libavutil +) + +find_path(FFMPEG_INCLUDE_DIR3 avcodec.h + $ENV{FFMPEG_DIR} + $ENV{FFMPEG_DIR}/ffmpeg + $ENV{FFMPEG_DIR}/libavcodec + $ENV{FFMPEG_DIR}/include/libavcodec + $ENV{FFMPEG_DIR}/include/ffmpeg + /usr/local/include/ffmpeg + /usr/include/ffmpeg + /usr/include/libavcodec + /usr/include/ffmpeg/libavcodec + /usr/local/include/libavcodec +) + +find_path(FFMPEG_INCLUDE_DIR4 swscale.h + $ENV{FFMPEG_DIR} + $ENV{FFMPEG_DIR}/ffmpeg + $ENV{FFMPEG_DIR}/libswscale + $ENV{FFMPEG_DIR}/include/libswscale + $ENV{FFMPEG_DIR}/include/ffmpeg + /usr/local/include/ffmpeg + /usr/include/ffmpeg + /usr/include/libswscale + /usr/include/ffmpeg/libswscale + /usr/local/include/libswscale +) + +find_path(FFMPEG_INCLUDE_DIR5 avdevice.h + $ENV{FFMPEG_DIR} + $ENV{FFMPEG_DIR}/ffmpeg + $ENV{FFMPEG_DIR}/libavdevice + $ENV{FFMPEG_DIR}/include/libavdevice + $ENV{FFMPEG_DIR}/include/ffmpeg + /usr/local/include/ffmpeg + /usr/include/ffmpeg + /usr/include/libavdevice + /usr/include/ffmpeg/libavdevice + /usr/local/include/libavdevice +) + +if(FFMPEG_INCLUDE_DIR1) + if(FFMPEG_INCLUDE_DIR2) + if(FFMPEG_INCLUDE_DIR3) + set(FFMPEG_INCLUDE_DIR ${FFMPEG_INCLUDE_DIR1} + ${FFMPEG_INCLUDE_DIR2} + ${FFMPEG_INCLUDE_DIR3}) + endif() + endif() +endif() + +if(FFMPEG_INCLUDE_DIR4) + set(FFMPEG_INCLUDE_DIR ${FFMPEG_INCLUDE_DIR} + ${FFMPEG_INCLUDE_DIR4}) +endif() + +if(FFMPEG_INCLUDE_DIR5) + set(FFMPEG_INCLUDE_DIR ${FFMPEG_INCLUDE_DIR} + ${FFMPEG_INCLUDE_DIR5} + ${FFMPEG_INCLUDE_DIR5}/..) +endif() + +find_library(FFMPEG_avformat_LIBRARY avformat + $ENV{FFMPEG_DIR} + $ENV{FFMPEG_DIR}/lib + $ENV{FFMPEG_DIR}/libavformat + /usr/local/lib + /usr/lib +) + +find_library(FFMPEG_avcodec_LIBRARY avcodec + $ENV{FFMPEG_DIR} + $ENV{FFMPEG_DIR}/lib + $ENV{FFMPEG_DIR}/libavcodec + /usr/local/lib + /usr/lib +) + +find_library(FFMPEG_avutil_LIBRARY avutil + $ENV{FFMPEG_DIR} + $ENV{FFMPEG_DIR}/lib + $ENV{FFMPEG_DIR}/libavutil + /usr/local/lib + /usr/lib +) + +if(NOT DISABLE_SWSCALE) + find_library(FFMPEG_swscale_LIBRARY swscale + $ENV{FFMPEG_DIR} + $ENV{FFMPEG_DIR}/lib + $ENV{FFMPEG_DIR}/libswscale + /usr/local/lib + /usr/lib + ) +endif(NOT DISABLE_SWSCALE) + +find_library(FFMPEG_avdevice_LIBRARY avdevice + $ENV{FFMPEG_DIR} + $ENV{FFMPEG_DIR}/lib + $ENV{FFMPEG_DIR}/libavdevice + /usr/local/lib + /usr/lib +) + +find_library(_FFMPEG_z_LIBRARY_ z + $ENV{FFMPEG_DIR} + $ENV{FFMPEG_DIR}/lib + /usr/local/lib + /usr/lib +) + + + +if(FFMPEG_INCLUDE_DIR) + if(FFMPEG_avformat_LIBRARY) + if(FFMPEG_avcodec_LIBRARY) + if(FFMPEG_avutil_LIBRARY) + set(FFMPEG_FOUND "YES") + set(FFMPEG_LIBRARIES ${FFMPEG_avformat_LIBRARY} + ${FFMPEG_avcodec_LIBRARY} + ${FFMPEG_avutil_LIBRARY} + ) + if(FFMPEG_swscale_LIBRARY) + set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} + ${FFMPEG_swscale_LIBRARY} + ) + endif() + if(FFMPEG_avdevice_LIBRARY) + set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} + ${FFMPEG_avdevice_LIBRARY} + ) + endif() + if(_FFMPEG_z_LIBRARY_) + set( FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} + ${_FFMPEG_z_LIBRARY_} + ) + endif() + endif() + endif() + endif() +endif() + +mark_as_advanced( + FFMPEG_INCLUDE_DIR + FFMPEG_INCLUDE_DIR1 + FFMPEG_INCLUDE_DIR2 + FFMPEG_INCLUDE_DIR3 + FFMPEG_INCLUDE_DIR4 + FFMPEG_INCLUDE_DIR5 + FFMPEG_avformat_LIBRARY + FFMPEG_avcodec_LIBRARY + FFMPEG_avutil_LIBRARY + FFMPEG_swscale_LIBRARY + FFMPEG_avdevice_LIBRARY + _FFMPEG_z_LIBRARY_ + ) + +# Set package properties if FeatureSummary was included +if(COMMAND set_package_properties) + set_package_properties(FFMPEG PROPERTIES DESCRIPTION "A complete, cross-platform solution to record, convert and stream audio and video") + set_package_properties(FFMPEG PROPERTIES URL "http://ffmpeg.org/") +endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index e6db967839..f80852bb13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,8 @@ if(WIN32) else() if(LINUX) option(WITH_FFMPEG "Build with FFMPEG." ON) + # Builder beware: later versions of ffmpeg may break! + option(WITH_SYSTEM_FFMPEG "Build with the system's FFMPEG." OFF) option(WITH_TTY "Build with Linux TTY Input Support." OFF) option(WITH_PROFILING "Build with Profiling Support." OFF) option(WITH_GLES2 "Build with OpenGL ES 2.0 Support." ON) @@ -287,36 +289,47 @@ elseif(LINUX) endif() if(WITH_FFMPEG) - list(APPEND FFMPEG_CONFIGURE - "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg/configure" - "--disable-programs" - "--disable-doc" - "--disable-avdevice" - "--disable-swresample" - "--disable-postproc" - "--disable-avfilter" - "--disable-shared" - "--enable-static" - ) - if(WITH_GPL_LIBS) + if (WITH_SYSTEM_FFMPEG) + find_package("FFMPEG") + if(NOT FFMPEG_FOUND) + message(FATAL_ERROR "System ffmpeg not found! Either install the libraries or remove the argument, then try again.") + else() + + message(STATUS "-- Warning! Your version of ffmpeg may be too high! If you want to use the system ffmpeg, clear your cmake cache and do not include the system ffmpeg argument.") + set(HAS_FFMPEG TRUE) + endif() + else() list(APPEND FFMPEG_CONFIGURE - "--enable-gpl" + "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg/configure" + "--disable-programs" + "--disable-doc" + "--disable-avdevice" + "--disable-swresample" + "--disable-postproc" + "--disable-avfilter" + "--disable-shared" + "--enable-static" ) + if(WITH_GPL_LIBS) + list(APPEND FFMPEG_CONFIGURE + "--enable-gpl" + ) + endif() + # NEVER use the system ffmpeg. Not worth the hassle. + # --shlibdir=$our_installdir/stepmania-$VERSION + externalproject_add("ffmpeg" + DOWNLOAD_DIR "${SM_EXTERN_DIR}/ffmpeg-linux" + PREFIX "${SM_EXTERN_DIR}/ffmpeg-linux" + GIT_REPOSITORY "git://source.ffmpeg.org/ffmpeg.git" + GIT_TAG "n2.1.3" + CONFIGURE_COMMAND ${FFMPEG_CONFIGURE} + BUILD_COMMAND "make" + UPDATE_COMMAND "" + INSTALL_COMMAND "" + TEST_COMMAND "" + ) + set(HAS_FFMPEG TRUE) endif() - # NEVER use the system ffmpeg. Not worth the hassle. - # --shlibdir=$our_installdir/stepmania-$VERSION - externalproject_add("ffmpeg" - DOWNLOAD_DIR "${SM_EXTERN_DIR}/ffmpeg-linux" - PREFIX "${SM_EXTERN_DIR}/ffmpeg-linux" - GIT_REPOSITORY "git://source.ffmpeg.org/ffmpeg.git" - GIT_TAG "n2.1.3" - CONFIGURE_COMMAND ${FFMPEG_CONFIGURE} - BUILD_COMMAND "make" - UPDATE_COMMAND "" - INSTALL_COMMAND "" - TEST_COMMAND "" - ) - set(HAS_FFMPEG TRUE) else() set(HAS_FFMPEG FALSE) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8aeb6a95e2..c9afa1ab61 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -383,11 +383,25 @@ elseif(APPLE) ) else() # Unix / Linux # TODO: Remember to find and locate the zip archive files. + if (HAS_FFMPEG) + if(WITH_SYSTEM_FFMPEG) + list(APPEND SMDATA_LINK_LIB + "${FFMPEG_avformat_LIBRARY}" + "${FFMPEG_avcodec_LIBRARY}" + "${FFMPEG_swscale_LIBRARY}" + "${FFMPEG_avutil_LIBRARY}" + ) + else() + list(APPEND SMDATA_LINK_LIB + "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg-build/libavformat/libavformat.a" + "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg-build/libavcodec/libavcodec.a" + "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg-build/libswscale/libswscale.a" + "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg-build/libavutil/libavutil.a" + ) + endif() + endif() + list(APPEND SMDATA_LINK_LIB - "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg-build/libavformat/libavformat.a" - "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg-build/libavcodec/libavcodec.a" - "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg-build/libswscale/libswscale.a" - "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg-build/libavutil/libavutil.a" "${DL_LIBRARY}" ) @@ -476,11 +490,15 @@ if(NOT APPLE) ) else() if (HAS_FFMPEG) - add_dependencies("${SM_EXE_NAME}" "ffmpeg") - list(APPEND SM_INCLUDE_DIRS - "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg" - "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg-build" - ) + if (WITH_SYSTEM_FFMPEG) + list(APPEND SM_INCLUDE_DIRS "${FFMPEG_INCLUDE_DIR}") + else() + add_dependencies("${SM_EXE_NAME}" "ffmpeg") + list(APPEND SM_INCLUDE_DIRS + "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg" + "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg-build" + ) + endif() endif() if (HAS_GTK2) list(APPEND SM_INCLUDE_DIRS "${GTK2_INCLUDE_DIRS}")