fluidsynth/cmake_admin/FluidUnitTest.cmake
2018-04-07 19:09:49 +02:00

15 lines
746 B
CMake

macro ( ADD_FLUID_TEST _test )
ADD_EXECUTABLE(${_test} ${_test}.c)
TARGET_LINK_LIBRARIES(${_test} libfluidsynth)
# use the local include path to look for fluidsynth.h, as we cannot be sure fluidsynth is already installed
target_include_directories(${_test}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include> # include auto generated headers
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> # include "normal" public (sub-)headers
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src> # include private headers
$<TARGET_PROPERTY:libfluidsynth,INCLUDE_DIRECTORIES> # include all other header search paths needed by libfluidsynth (esp. glib)
)
ADD_TEST(NAME ${_test} COMMAND ${_test})
endmacro ( ADD_FLUID_TEST )