From 64a7787e90a74c9719ceec7645fad152dc68b583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20L=C3=B3pez-Cabanillas?= Date: Sat, 31 Jul 2021 23:03:16 +0200 Subject: [PATCH] fixes and simplifications * FluidSynthConfigVersion.cmake is created with ${VERSION} instead of ${LIB_VERSION_INFO} * FluidSynthConfig.cmake.in simplified: it doesn't need to include the version file. * Simplified BUILD_INTERFACE generator expression as suggested --- CMakeLists.txt | 4 ++-- FluidSynthConfig.cmake.in | 3 +-- src/CMakeLists.txt | 8 +++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b04cd32b..51b5c1dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -869,8 +869,8 @@ export(EXPORT FluidSynthTargets include(CMakePackageConfigHelpers) write_basic_package_version_file( FluidSynthConfigVersion.cmake - VERSION ${LIB_VERSION_INFO} - COMPATIBILITY SameMajorVersion + VERSION ${VERSION} + COMPATIBILITY SameMinorVersion ) configure_file(FluidSynthConfig.cmake.in FluidSynthConfig.cmake @ONLY) diff --git a/FluidSynthConfig.cmake.in b/FluidSynthConfig.cmake.in index 9f85511a..1ffdf598 100644 --- a/FluidSynthConfig.cmake.in +++ b/FluidSynthConfig.cmake.in @@ -6,6 +6,5 @@ # define variables for configuration options: # set(network-enabled @enable-network@) -# finally, include the targets/version files +# finally, include the targets file include("${CMAKE_CURRENT_LIST_DIR}/FluidSynthTargets.cmake") -include("${CMAKE_CURRENT_LIST_DIR}/FluidSynthConfigVersion.cmake") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5cc98fbf..38a4e983 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -348,7 +348,7 @@ else ( MACOSX_FRAMEWORK ) ) endif ( MACOSX_FRAMEWORK ) -target_link_libraries ( libfluidsynth +target_link_libraries ( libfluidsynth PRIVATE ${GLIB_LIBRARIES} ${GMODULE_LIBRARIES} ${LASH_LIBRARIES} @@ -391,10 +391,12 @@ if ( FLUID_CPPFLAGS ) PROPERTIES COMPILE_FLAGS ${FLUID_CPPFLAGS} ) endif ( FLUID_CPPFLAGS ) -target_link_libraries ( fluidsynth +target_link_libraries ( fluidsynth PRIVATE libfluidsynth ${SYSTEMD_LIBRARIES} ${FLUID_LIBS} + ${GLIB_LIBRARIES} # because g_file_test() + ${SDL2_LIBRARIES} # because SDL_Init() etc. ) if ( MACOSX_FRAMEWORK ) @@ -420,7 +422,7 @@ endif ( MACOSX_FRAMEWORK ) # build_interface: for the libfluidsynth target when imported from the build directory. # install_interface: for the target when imported from the installed directory. target_include_directories(libfluidsynth PUBLIC - "$" + "$" "$" )