aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-02-11 12:56:13 -0800
committerChris Robinson <[email protected]>2017-02-11 12:56:13 -0800
commit6b030999cbde7cbd59752031ed696b7f9dd51969 (patch)
treee267019e4b8f11abfccf0dd2ad33d3a5e00cdb68 /CMakeLists.txt
parente92229f8395979591a14a980543d92aa4e7489c0 (diff)
Don't require SDL_sound for alffplay
Also explicitly link with libz for alffplay, since static ffmpeg libs need it.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt107
1 files changed, 58 insertions, 49 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 690ec37a..5de93610 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1438,54 +1438,62 @@ IF(ALSOFT_TESTS)
ENDIF()
IF(ALSOFT_EXAMPLES)
- IF(SDL2_FOUND AND SDL_SOUND_FOUND)
- ADD_LIBRARY(ex-common STATIC examples/common/alhelpers.c
- examples/common/sdl_sound.c)
- SET_PROPERTY(TARGET ex-common APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
- SET_PROPERTY(TARGET ex-common APPEND PROPERTY INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR}
- ${SDL_SOUND_INCLUDE_DIR})
-
- ADD_EXECUTABLE(alstream examples/alstream.c)
- TARGET_LINK_LIBRARIES(alstream ex-common ${SDL_SOUND_LIBRARIES} ${SDL2_LIBRARY}
- common ${LIBNAME})
- SET_PROPERTY(TARGET alstream APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
- SET_PROPERTY(TARGET alstream APPEND PROPERTY INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR}
- ${SDL_SOUND_INCLUDE_DIR})
-
- ADD_EXECUTABLE(alreverb examples/alreverb.c)
- TARGET_LINK_LIBRARIES(alreverb ex-common ${SDL_SOUND_LIBRARIES} ${SDL2_LIBRARY}
- common ${LIBNAME})
- SET_PROPERTY(TARGET alreverb APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
- SET_PROPERTY(TARGET alreverb APPEND PROPERTY INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR}
- ${SDL_SOUND_INCLUDE_DIR})
-
- ADD_EXECUTABLE(allatency examples/allatency.c)
- TARGET_LINK_LIBRARIES(allatency ex-common ${SDL_SOUND_LIBRARIES} ${SDL2_LIBRARY}
- common ${LIBNAME})
- SET_PROPERTY(TARGET allatency APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
- SET_PROPERTY(TARGET allatency APPEND PROPERTY INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR}
- ${SDL_SOUND_INCLUDE_DIR})
-
- ADD_EXECUTABLE(alloopback examples/alloopback.c)
- TARGET_LINK_LIBRARIES(alloopback ex-common ${SDL_SOUND_LIBRARIES} ${SDL2_LIBRARY}
+ IF(SDL2_FOUND)
+ IF(SDL_SOUND_FOUND)
+ ADD_LIBRARY(ex-common STATIC examples/common/alhelpers.c
+ examples/common/sdl_sound.c)
+ SET_PROPERTY(TARGET ex-common APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
+ SET_PROPERTY(TARGET ex-common APPEND PROPERTY
+ INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR}
+ )
+
+ ADD_EXECUTABLE(alstream examples/alstream.c)
+ TARGET_LINK_LIBRARIES(alstream ex-common ${SDL_SOUND_LIBRARIES} ${SDL2_LIBRARY}
+ common ${LIBNAME})
+ SET_PROPERTY(TARGET alstream APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
+ SET_PROPERTY(TARGET alstream APPEND PROPERTY
+ INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR}
+ )
+
+ ADD_EXECUTABLE(alreverb examples/alreverb.c)
+ TARGET_LINK_LIBRARIES(alreverb ex-common ${SDL_SOUND_LIBRARIES} ${SDL2_LIBRARY}
+ common ${LIBNAME})
+ SET_PROPERTY(TARGET alreverb APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
+ SET_PROPERTY(TARGET alreverb APPEND PROPERTY
+ INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR}
+ )
+
+ ADD_EXECUTABLE(allatency examples/allatency.c)
+ TARGET_LINK_LIBRARIES(allatency ex-common ${SDL_SOUND_LIBRARIES} ${SDL2_LIBRARY}
+ common ${LIBNAME})
+ SET_PROPERTY(TARGET allatency APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
+ SET_PROPERTY(TARGET allatency APPEND PROPERTY
+ INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR}
+ )
+
+ ADD_EXECUTABLE(alloopback examples/alloopback.c)
+ TARGET_LINK_LIBRARIES(alloopback ex-common ${SDL_SOUND_LIBRARIES} ${SDL2_LIBRARY}
+ common ${LIBNAME})
+ SET_PROPERTY(TARGET alloopback APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
+ SET_PROPERTY(TARGET alloopback APPEND PROPERTY
+ INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR}
+ )
+
+ ADD_EXECUTABLE(alhrtf examples/alhrtf.c)
+ TARGET_LINK_LIBRARIES(alhrtf ex-common ${SDL_SOUND_LIBRARIES} ${SDL2_LIBRARY}
common ${LIBNAME})
- SET_PROPERTY(TARGET alloopback APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
- SET_PROPERTY(TARGET alloopback APPEND PROPERTY INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR}
- ${SDL_SOUND_INCLUDE_DIR})
-
- ADD_EXECUTABLE(alhrtf examples/alhrtf.c)
- TARGET_LINK_LIBRARIES(alhrtf ex-common ${SDL_SOUND_LIBRARIES} ${SDL2_LIBRARY}
- common ${LIBNAME})
- SET_PROPERTY(TARGET alhrtf APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
- SET_PROPERTY(TARGET alhrtf APPEND PROPERTY INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR}
- ${SDL_SOUND_INCLUDE_DIR})
-
- IF(ALSOFT_INSTALL)
- INSTALL(TARGETS alstream alreverb allatency alloopback alhrtf
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ SET_PROPERTY(TARGET alhrtf APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
+ SET_PROPERTY(TARGET alhrtf APPEND PROPERTY
+ INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR}
)
+
+ IF(ALSOFT_INSTALL)
+ INSTALL(TARGETS alstream alreverb allatency alloopback alhrtf
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ )
+ ENDIF()
ENDIF()
SET(FFVER_OK FALSE)
@@ -1514,10 +1522,11 @@ IF(ALSOFT_EXAMPLES)
ENDIF()
IF(FFVER_OK AND NOT MSVC)
ADD_EXECUTABLE(alffplay examples/alffplay.c)
- TARGET_LINK_LIBRARIES(alffplay common ex-common ${SDL2_LIBRARY} ${LIBNAME} ${FFMPEG_LIBRARIES})
+ TARGET_LINK_LIBRARIES(alffplay common ${SDL2_LIBRARY} ${LIBNAME} ${FFMPEG_LIBRARIES})
SET_PROPERTY(TARGET alffplay APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS})
- SET_PROPERTY(TARGET alffplay APPEND PROPERTY INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR}
- ${FFMPEG_INCLUDE_DIRS})
+ SET_PROPERTY(TARGET alffplay APPEND PROPERTY
+ INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR} ${FFMPEG_INCLUDE_DIRS}
+ )
IF(ALSOFT_INSTALL)
INSTALL(TARGETS alffplay