Stop PulseAudio callback busy-waiting when stream is stopped.
[rtaudio-cdist.git] / CMakeLists.txt
index 136ab8d89102071f1d9a27818d642f13e9bdd257..812d4d307666e7fa9ab37ccc6de609f19d36e6d5 100644 (file)
@@ -44,7 +44,8 @@ elseif (UNIX AND NOT APPLE)
     if (AUDIO_LINUX_PULSE)
         find_library(PULSE_LIB pulse)
         find_library(PULSESIMPLE_LIB pulse-simple)
-        list(APPEND LINKLIBS ${PULSE_LIB} ${PULSESIMPLE_LIB})
+        find_package(Threads REQUIRED CMAKE_THREAD_PREFER_PTHREAD)
+        list(APPEND LINKLIBS ${PULSE_LIB} ${PULSESIMPLE_LIB} ${CMAKE_THREAD_LIBS_INIT})
         add_definitions(-D__LINUX_PULSE__)
         message(STATUS "Using Linux PulseAudio")
     endif (AUDIO_LINUX_PULSE)
@@ -54,7 +55,7 @@ elseif (UNIX AND NOT APPLE)
         if (NOT ALSA_FOUND)
             message(FATAL_ERROR "ALSA API requested but no ALSA dev libraries found")
         endif()
-        add_defines(${ALSA_INCLUDE_DIR})
+        include_directories(${ALSA_INCLUDE_DIR})
         list(APPEND LINKLIBS ${ALSA_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
         add_definitions(-D__LINUX_ALSA__)
         message(STATUS "Using Linux ALSA")
@@ -91,15 +92,17 @@ if (WIN32)
     endif()
 
     include_directories(include)
-    list(APPEND LINKLIBS dsound winmm ole32)
+    list(APPEND LINKLIBS winmm ole32)
 
     if (AUDIO_WINDOWS_DS)
         add_definitions(-D__WINDOWS_DS__)
         message(STATUS "Using Windows DirectSound")
+        list(APPEND LINKLIBS dsound)
     endif (AUDIO_WINDOWS_DS)
     if (AUDIO_WINDOWS_WASAPI)
         add_definitions(-D__WINDOWS_WASAPI__)
         message(STATUS "Using Windows WASAPI")
+        list(APPEND LINKLIBS uuid ksuser)
     endif (AUDIO_WINDOWS_WASAPI)
     if (AUDIO_WINDOWS_ASIO)
         list(APPEND rtaudio_SOURCES
@@ -112,6 +115,7 @@ if (WIN32)
     endif (AUDIO_WINDOWS_ASIO)
 endif (WIN32)
 
+cmake_policy(SET CMP0042 OLD)
 add_library(rtaudio SHARED ${rtaudio_SOURCES})
 add_library(rtaudio_static STATIC ${rtaudio_SOURCES})
 
@@ -121,3 +125,15 @@ if (BUILD_TESTING)
     add_subdirectory(tests)
 endif (BUILD_TESTING)
 
+install(TARGETS rtaudio
+      LIBRARY DESTINATION lib
+      ARCHIVE DESTINATION lib
+      RUNTIME DESTINATION bin)
+
+install(
+    FILES RtAudio.h
+    DESTINATION include)
+
+install(
+    FILES rtaudio.pc
+    DESTINATION lib/pkgconfig)