-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
31 lines (25 loc) · 1.3 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FILE(GLOB SOURCE_VIDEO_PLAYBACK_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
FILE(GLOB HEADER_VIDEO_PLAYBACK_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
IF(PKG_CONFIG_FOUND)
MESSAGE(STATUS "Found pkg-config: ${PKG_CONFIG_EXECUTABLE} -- version ${PKG_CONFIG_VERSION_STRING}.")
PKG_CHECK_MODULES(AVFORMAT QUIET libavformat)
PKG_CHECK_MODULES(AVCODEC QUIET libavcodec)
PKG_CHECK_MODULES(AVUTIL QUIET libavutil)
PKG_CHECK_MODULES(SWSCALE QUIET libswscale)
PKG_CHECK_MODULES(SWRESAMPLE QUIET libswresample)
ELSE()
MESSAGE(ERROR "Could not find AV Libraries.")
# TODO add logic for handling if pkg-config not available.
ENDIF()
FIND_PACKAGE(OpenAL QUIET)
IF(OPENAL_FOUND)
MESSAGE(STATUS "OpenAL found: ${OPENAL_LIBRARY}.")
ELSE()
SET(OPENAL_INCLUDE_DIR "")
ENDIF()
ADD_EXECUTABLE(VideoPlayback ${SOURCE_VIDEO_PLAYBACK_FILES} ${HEADER_VIDEO_PLAYBACK_FILES})
TARGET_LINK_LIBRARIES(VideoPlayback glCommon fragcore-aal fragcore-audio-interface ${AVUTIL_LIBRARIES} ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${SWSCALE_LIBRARIES} ${SWRESAMPLE_LIBRARIES} ${OPENAL_LIBRARY} ${ALUT_LIBRARY})
# OpenGL dependies headers.
TARGET_INCLUDE_DIRECTORIES(VideoPlayback PRIVATE ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIRS} ${ALUT_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR})
ADD_DEPENDENCIES(VideoPlayback glCommon)
INSTALL(TARGETS VideoPlayback DESTINATION bin)