From 21aca082a9c73496ee8d28c3f14ac15fc6f0936a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20L=C3=B3pez-Cabanillas?= Date: Sat, 4 Sep 2021 20:38:17 +0200 Subject: [PATCH] less property dance --- cmake_admin/FluidUnitTest.cmake | 8 ++++---- src/CMakeLists.txt | 9 +++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cmake_admin/FluidUnitTest.cmake b/cmake_admin/FluidUnitTest.cmake index a5bb7785..10120116 100644 --- a/cmake_admin/FluidUnitTest.cmake +++ b/cmake_admin/FluidUnitTest.cmake @@ -1,5 +1,5 @@ macro ( ADD_FLUID_TEST _test ) - ADD_EXECUTABLE(${_test} ${_test}.c $ ) + add_executable( ${_test} ${_test}.c ) # only build this unit test when explicitly requested by "make check" set_target_properties(${_test} PROPERTIES EXCLUDE_FROM_ALL TRUE) @@ -8,7 +8,7 @@ macro ( ADD_FLUID_TEST _test ) if ( FLUID_CPPFLAGS ) set_target_properties ( ${_test} PROPERTIES COMPILE_FLAGS ${FLUID_CPPFLAGS} ) endif ( FLUID_CPPFLAGS ) - TARGET_LINK_LIBRARIES(${_test} $) + target_link_libraries( ${_test} libfluidsynth-OBJ ) # use the local include path to look for fluidsynth.h, as we cannot be sure fluidsynth is already installed target_include_directories(${_test} @@ -28,7 +28,7 @@ macro ( ADD_FLUID_TEST _test ) endmacro ( ADD_FLUID_TEST ) macro ( ADD_FLUID_TEST_UTIL _util ) - ADD_EXECUTABLE(${_util} ${_util}.c $ ) + add_executable( ${_util} ${_util}.c ) # only build this unit test when explicitly requested by "make check" set_target_properties(${_util} PROPERTIES EXCLUDE_FROM_ALL TRUE) @@ -40,7 +40,7 @@ macro ( ADD_FLUID_TEST_UTIL _util ) if ( FLUID_CPPFLAGS ) set_target_properties ( ${_util} PROPERTIES COMPILE_FLAGS ${FLUID_CPPFLAGS} ) endif ( FLUID_CPPFLAGS ) - TARGET_LINK_LIBRARIES(${_util} $) + target_link_libraries( ${_util} libfluidsynth-OBJ ) # use the local include path to look for fluidsynth.h, as we cannot be sure fluidsynth is already installed target_include_directories(${_util} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 69b00215..0e6d86ef 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -375,9 +375,14 @@ target_link_libraries ( libfluidsynth-OBJ INTERFACE ${LIBINSTPATCH_LIBRARIES} ) +# This doesn't install any object file at all +# it is only a trick for exporting targets +install( TARGETS libfluidsynth-OBJ + EXPORT FluidSynthTargets + OBJECTS ) + # Here are applied/linked the OBJECT library dependencies -get_target_property ( LIBS_PRIVATE libfluidsynth-OBJ INTERFACE_LINK_LIBRARIES) -target_link_libraries ( libfluidsynth PRIVATE ${LIBS_PRIVATE} ) +target_link_libraries ( libfluidsynth PRIVATE libfluidsynth-OBJ ) # ************ CLI program ************