CMake: build all tests

This commit is contained in:
Be 2021-01-22 17:14:20 -06:00 • committed by Phil Burk
commit ee2c707495
2 changed files with 61 additions and 9 deletions

View file

@ -477,6 +477,16 @@ ENDIF()
# Prepared for inclusion of test files
OPTION(PA_BUILD_TESTS "Include test projects" OFF)
IF(PA_BUILD_TESTS)
MACRO(ADD_TEST appl_name)
ADD_EXECUTABLE(${appl_name} "${appl_name}.c")
TARGET_LINK_LIBRARIES(${appl_name} portaudio_static)
TARGET_INCLUDE_DIRECTORIES(${appl_name} PRIVATE "${CMAKE_SOURCE_DIR}/src/common")
SET_TARGET_PROPERTIES(${appl_name}
PROPERTIES
FOLDER "Test"
)
ENDMACRO(ADD_TEST)
SUBDIRS(test)
ENDIF()