summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 387400b3196cc3d51b98993575e113a8e75b3b23 (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
cmake_minimum_required(VERSION 3.8)

project(reVC C CXX)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")

if(WIN32)
    set(REVC_AUDIOS "NULL" "OAL" "MSS")
else()
    set(REVC_AUDIOS "NULL" "OAL")
endif()

set(REVC_AUDIO "OAL" CACHE STRING "Audio")

set_property(CACHE REVC_AUDIO PROPERTY STRINGS ${REVC_AUDIOS})
message(STATUS "REVC_AUDIO = ${REVC_AUDIO} (choices=${REVC_AUDIOS})")
set("REVC_AUDIO_${REVC_AUDIO}" ON)
if(NOT REVC_AUDIO IN_LIST REVC_AUDIOS)
    message(FATAL_ERROR "Illegal REVC_AUDIO=${REVC_AUDIO}")
endif()

if(REVC_INSTALL)
    include(GNUInstallDirs)
    set(REVC_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/reVC")
endif()

add_subdirectory("vendor/librw")
add_subdirectory(src)

if(REVC_INSTALL)
    include(CMakePackageConfigHelpers)
    configure_package_config_file(reVC-config.cmake.in reVC-config.cmake
        INSTALL_DESTINATION "${CMAKE_INSTALL_PREFIX}"
        )
    install(
        FILES "${CMAKE_CURRENT_BINARY_DIR}/reVC-config.cmake"
        DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
        )
    install(
        EXPORT reVC-targets
        DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
        )

    include(CMakeCPack.cmake)
endif()