CMake: Use target_link_directories

This commit is contained in:
Jonas Kvinge
2024-08-27 19:39:53 +02:00
parent 9883dc6925
commit 837e5388ea
9 changed files with 67 additions and 147 deletions

View File

@@ -1,16 +1,7 @@
cmake_minimum_required(VERSION 3.7)
cmake_minimum_required(VERSION 3.13)
set(SOURCES gstfastspectrum.cpp gstmoodbarplugin.cpp)
link_directories(
${GLIB_LIBRARY_DIRS}
${GOBJECT_LIBRARY_DIRS}
${GSTREAMER_LIBRARY_DIRS}
${GSTREAMER_BASE_LIBRARY_DIRS}
${GSTREAMER_AUDIO_LIBRARY_DIRS}
${FFTW3_LIBRARY_DIRS}
)
add_library(gstmoodbar STATIC ${SOURCES})
target_include_directories(gstmoodbar SYSTEM PRIVATE
@@ -24,6 +15,15 @@ target_include_directories(gstmoodbar SYSTEM PRIVATE
target_include_directories(gstmoodbar PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_directories(gstmoodbar PRIVATE
${GLIB_LIBRARY_DIRS}
${GOBJECT_LIBRARY_DIRS}
${GSTREAMER_LIBRARY_DIRS}
${GSTREAMER_BASE_LIBRARY_DIRS}
${GSTREAMER_AUDIO_LIBRARY_DIRS}
${FFTW3_LIBRARY_DIRS}
)
target_link_libraries(gstmoodbar PRIVATE
${GLIB_LIBRARIES}
${GOBJECT_LIBRARIES}