simplify CMakeList with cmake scripts

This commit is contained in:
qPCR4vir
2018-09-10 14:27:56 +02:00
parent 8057bf95e1
commit 8c6b0d4653
7 changed files with 149 additions and 147 deletions

View File

@@ -0,0 +1,15 @@
option(NANA_CMAKE_ENABLE_AUDIO "Enable class audio::play for PCM playback." OFF)
# todo: decide - PUBLIC vs PRIVATE
if(NANA_CMAKE_ENABLE_AUDIO)
target_compile_definitions(nana PUBLIC NANA_ENABLE_AUDIO)
if(UNIX)
find_package(ASOUND)
if(ASOUND_FOUND)
target_include_directories(nana PUBLIC ${ASOUND_INCLUDE_DIRS})
target_compile_options(nana PUBLIC -lasound)
else()
message(FATAL_ERROR "libasound is not found")
endif()
endif()
endif()