diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-11-07 15:47:41 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-11-07 23:07:55 +0100 |
commit | 7165a8eb0227f03a5126496de4a2f3407a72c3a4 (patch) | |
tree | 8e923fbab693d7069b2f5e683c6fd28a40416cae /CMakeLists.txt | |
parent | 87b57bb24c829e23576af9a5c9acdd52313fda55 (diff) | |
download | nncmpp-7165a8eb0227f03a5126496de4a2f3407a72c3a4.tar.gz nncmpp-7165a8eb0227f03a5126496de4a2f3407a72c3a4.tar.xz nncmpp-7165a8eb0227f03a5126496de4a2f3407a72c3a4.zip |
Add ability to control PulseAudio volume
I know, son, it might be hard to accept,
but you're imported. Your true parents are wmstatus
and paswitch, from the desktop-tools family.
Also, fix unnecessary linking of optional dependencies.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d425bb2..17c70ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,12 +46,23 @@ if (WITH_FFTW) if (NOT fftw_FOUND) message (FATAL_ERROR "FFTW not found") endif () + list (APPEND extra_libraries ${fftw_LIBRARIES}) +endif () + +pkg_check_modules (libpulse libpulse) +option (WITH_PULSE "Enable control of PulseAudio sink volume" ${libpulse_FOUND}) +if (WITH_PULSE) + if (NOT libpulse_FOUND) + message (FATAL_ERROR "libpulse not found") + endif () + list (APPEND extra_libraries ${libpulse_LIBRARIES}) endif () include_directories (${Unistring_INCLUDE_DIRS} ${Ncursesw_INCLUDE_DIRS} ${Termo_INCLUDE_DIRS} ${curl_INCLUDE_DIRS} - ${fftw_INCLUDE_DIRS}) -link_directories (${curl_LIBRARY_DIRS} ${fftw_LIBRARY_DIRS}) + ${fftw_INCLUDE_DIRS} ${libpulse_INCLUDE_DIRS}) +link_directories (${curl_LIBRARY_DIRS} + ${fftw_LIBRARY_DIRS} ${libpulse_LIBRARY_DIRS}) # Configuration if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD") @@ -82,8 +93,7 @@ include_directories (${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}) # Build the main executable and link it add_executable (${PROJECT_NAME} ${PROJECT_NAME}.c) target_link_libraries (${PROJECT_NAME} ${Unistring_LIBRARIES} - ${Ncursesw_LIBRARIES} termo-static ${curl_LIBRARIES} - ${fftw_LIBRARIES} ${extra_libraries}) + ${Ncursesw_LIBRARIES} termo-static ${curl_LIBRARIES} ${extra_libraries}) add_threads (${PROJECT_NAME}) # Installation |