Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake polishing #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ project(googerteller VERSION 1.0
DESCRIPTION "Audible feedback on Google communications"
LANGUAGES CXX C)

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard to use")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
message("-- Looking for Portable C Audio Library")
find_library(PCAUDIO_LIB NAMES pcaudio libpcaudio)
if (NOT PCAUDIO_LIB)
message(FATAL_ERROR "Could not find PCAUDIO_LIB using the following names: pcaudio, libpcaudio")
endif()
message("-- Looking for Portable C Audio Library - found")

#add_library(support STATIC ext/powerblog/h2o-pp.cc
# ext/powerblog/ext/simplesocket/swrappers.cc
Expand All @@ -21,10 +26,10 @@ set(CMAKE_CXX_EXTENSIONS ON)
#target_link_libraries(support PUBLIC -lh2o-evloop -lssl -lcrypto Threads::Threads)

add_executable(teller teller.cc ext/lpm.c)
target_link_libraries(teller -lpcaudio -lpthread)
target_link_libraries(teller PRIVATE ${PCAUDIO_LIB} Threads::Threads)

add_executable(testrunner testrunner.cc ext/lpm.c )
target_link_libraries(testrunner -lpcaudio)
target_link_libraries(testrunner PRIVATE ${PCAUDIO_LIB})

enable_testing()
add_test(testname testrunner)
Expand Down