aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-01-01 12:36:41 -0800
committerChris Robinson <[email protected]>2012-01-01 12:36:41 -0800
commit466cac328f15f3538c895208bfe7ea14f3923ffc (patch)
tree4111b4502b76146cad46bdf2634b0f11e6ee68a8 /CMakeLists.txt
parent06caac261976e42f08faeebe4ec921de3200b85f (diff)
Add an example program that streams audio using ffmpeg
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 25fd546d..8e0f9dae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,7 @@ INCLUDE(CheckSymbolExists)
INCLUDE(CheckCCompilerFlag)
INCLUDE(CheckCSourceCompiles)
INCLUDE(CheckTypeSize)
+INCLUDE(FindPkgConfig)
PROJECT(OpenAL C)
@@ -56,6 +57,8 @@ OPTION(WERROR "Treat compile warnings as errors" OFF)
OPTION(UTILS "Build and install utility programs" ON)
+OPTION(EXAMPLES "Build and install example programs" ON)
+
OPTION(ALSOFT_CONFIG "Install alsoft.conf configuration file" OFF)
@@ -730,3 +733,20 @@ IF(UTILS)
MESSAGE(STATUS "Building utility programs")
MESSAGE(STATUS "")
ENDIF()
+
+IF(EXAMPLES)
+ PKG_CHECK_MODULES(FFMPEG libavcodec libavformat)
+ IF(FFMPEG_FOUND)
+ ADD_EXECUTABLE(alstream examples/alhelpers.c examples/alffmpeg.c examples/alstream.c)
+ TARGET_LINK_LIBRARIES(alstream ${FFMPEG_LIBRARIES} ${LIBNAME})
+ SET_TARGET_PROPERTIES(alstream PROPERTIES COMPILE_FLAGS "${FFMPEG_CFLAGS}")
+ INSTALL(TARGETS alstream
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION "lib${LIB_SUFFIX}"
+ ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
+ )
+
+ MESSAGE(STATUS "Building ffmpeg example programs")
+ MESSAGE(STATUS "")
+ ENDIF()
+ENDIF()