From 8f039b7f855911d406a403b77be38b79d76c3b89 Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Sat, 15 Jun 2024 20:44:36 +0100 Subject: [PATCH] Flag appropriate include directories as SYSTEM --- CMakeLists.txt | 4 ++-- cmake/modules/StaticDependencies.cmake | 4 ++-- plugins/CarlaBase/CMakeLists.txt | 4 ++-- plugins/CarlaPatchbay/CMakeLists.txt | 3 ++- plugins/CarlaRack/CMakeLists.txt | 3 ++- plugins/Eq/CMakeLists.txt | 2 +- plugins/GigPlayer/CMakeLists.txt | 2 +- plugins/Lv2Effect/CMakeLists.txt | 6 ++--- plugins/Lv2Instrument/CMakeLists.txt | 6 ++--- plugins/SlicerT/CMakeLists.txt | 22 ++++++++++++------- plugins/SpectrumAnalyzer/CMakeLists.txt | 2 +- .../VstBase/RemoteVstPlugin/CMakeLists.txt | 2 +- plugins/ZynAddSubFx/CMakeLists.txt | 8 ++++--- src/CMakeLists.txt | 12 +++++----- 14 files changed, 45 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d2b50d42db4..6aa53d98211 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,7 +172,7 @@ LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}") FIND_PACKAGE(Qt5 5.9.0 COMPONENTS Core Gui Widgets Xml REQUIRED) FIND_PACKAGE(Qt5 COMPONENTS LinguistTools QUIET) -INCLUDE_DIRECTORIES( +include_directories(SYSTEM ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} @@ -410,7 +410,7 @@ IF(WANT_SOUNDIO) IF(SOUNDIO_FOUND) SET(LMMS_HAVE_SOUNDIO TRUE) SET(STATUS_SOUNDIO "OK") - INCLUDE_DIRECTORIES("${SOUNDIO_INCLUDE_DIR}") + include_directories(SYSTEM "${SOUNDIO_INCLUDE_DIR}") ELSE(SOUNDIO_FOUND) SET(SOUNDIO_INCLUDE_DIR "") SET(STATUS_SOUNDIO "not found, please install libsoundio if you require libsoundio support") diff --git a/cmake/modules/StaticDependencies.cmake b/cmake/modules/StaticDependencies.cmake index fa4f7092d14..d12c47d12c8 100644 --- a/cmake/modules/StaticDependencies.cmake +++ b/cmake/modules/StaticDependencies.cmake @@ -1,5 +1,5 @@ -# StaticLinking.cmake - adds features similar to interface properties that are -# only transitive over static dependencies. +# StaticDependencies.cmake - adds features similar to interface properties that +# are only transitive over static dependencies. # # Copyright (c) 2024 Dominic Clark # diff --git a/plugins/CarlaBase/CMakeLists.txt b/plugins/CarlaBase/CMakeLists.txt index 9728f44c2e5..6533055a4c3 100644 --- a/plugins/CarlaBase/CMakeLists.txt +++ b/plugins/CarlaBase/CMakeLists.txt @@ -15,7 +15,7 @@ if(LMMS_HAVE_WEAKCARLA) SET(CARLA_NATIVE_LIB carla_native-plugin) ADD_LIBRARY(${CARLA_NATIVE_LIB} SHARED DummyCarla.cpp) - TARGET_INCLUDE_DIRECTORIES(${CARLA_NATIVE_LIB} SYSTEM PUBLIC ${CARLA_INCLUDE_DIRS}) + target_include_directories(${CARLA_NATIVE_LIB} SYSTEM PUBLIC ${CARLA_INCLUDE_DIRS}) INSTALL(TARGETS ${CARLA_NATIVE_LIB} LIBRARY DESTINATION "${PLUGIN_DIR}/optional" RUNTIME DESTINATION "${PLUGIN_DIR}/optional" @@ -31,7 +31,7 @@ if(LMMS_HAVE_CARLA OR LMMS_HAVE_WEAKCARLA) SET(CARLA_INCLUDE_DIRS ${CARLA_INCLUDE_DIRS} PARENT_SCOPE) INCLUDE(BuildPlugin) - INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS}) + include_directories(SYSTEM ${CARLA_INCLUDE_DIRS}) LINK_DIRECTORIES(${CARLA_LIBRARY_DIRS}) LINK_LIBRARIES(${CARLA_LIBRARIES}) BUILD_PLUGIN(carlabase Carla.cpp Carla.h diff --git a/plugins/CarlaPatchbay/CMakeLists.txt b/plugins/CarlaPatchbay/CMakeLists.txt index 457e61e6a83..8f6efd5ea2c 100644 --- a/plugins/CarlaPatchbay/CMakeLists.txt +++ b/plugins/CarlaPatchbay/CMakeLists.txt @@ -1,7 +1,8 @@ if(LMMS_HAVE_CARLA OR LMMS_HAVE_WEAKCARLA) ADD_DEFINITIONS(-DCARLA_PLUGIN_PATCHBAY -DCARLA_PLUGIN_SYNTH) INCLUDE(BuildPlugin) - INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/../CarlaBase") + include_directories(SYSTEM ${CARLA_INCLUDE_DIRS}) + include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../CarlaBase") LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/../CarlaBase" ${CARLA_LIBRARY_DIRS}) LINK_LIBRARIES(carlabase) diff --git a/plugins/CarlaRack/CMakeLists.txt b/plugins/CarlaRack/CMakeLists.txt index 8373688c1ba..d5328562405 100644 --- a/plugins/CarlaRack/CMakeLists.txt +++ b/plugins/CarlaRack/CMakeLists.txt @@ -1,7 +1,8 @@ if(LMMS_HAVE_CARLA OR LMMS_HAVE_WEAKCARLA) ADD_DEFINITIONS(-DCARLA_PLUGIN_RACK -DCARLA_PLUGIN_SYNTH) INCLUDE(BuildPlugin) - INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/../CarlaBase") + include_directories(SYSTEM ${CARLA_INCLUDE_DIRS}) + include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../CarlaBase") LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/../CarlaBase" ${CARLA_LIBRARY_DIRS}) LINK_LIBRARIES(carlabase) diff --git a/plugins/Eq/CMakeLists.txt b/plugins/Eq/CMakeLists.txt index 899dde5ec6d..68edb034b5c 100644 --- a/plugins/Eq/CMakeLists.txt +++ b/plugins/Eq/CMakeLists.txt @@ -1,5 +1,5 @@ INCLUDE(BuildPlugin) -INCLUDE_DIRECTORIES(${FFTW3F_INCLUDE_DIRS}) +include_directories(SYSTEM ${FFTW3F_INCLUDE_DIRS}) LINK_LIBRARIES(${FFTW3F_LIBRARIES}) BUILD_PLUGIN(eq EqEffect.cpp EqCurve.cpp EqCurve.h EqControls.cpp EqControlsDialog.cpp EqFilter.h EqParameterWidget.cpp EqFader.h EqSpectrumView.h EqSpectrumView.cpp MOCFILES EqControls.h EqControlsDialog.h EqCurve.h EqParameterWidget.h EqFader.h EqSpectrumView.h EMBEDDED_RESOURCES *.png) diff --git a/plugins/GigPlayer/CMakeLists.txt b/plugins/GigPlayer/CMakeLists.txt index 92c80fedceb..69ac1b80cdf 100644 --- a/plugins/GigPlayer/CMakeLists.txt +++ b/plugins/GigPlayer/CMakeLists.txt @@ -1,6 +1,6 @@ if(LMMS_HAVE_GIG) INCLUDE(BuildPlugin) - INCLUDE_DIRECTORIES(${GIG_INCLUDE_DIRS}) + include_directories(SYSTEM ${GIG_INCLUDE_DIRS}) SET(CMAKE_AUTOUIC ON) # Required for not crashing loading files with libgig diff --git a/plugins/Lv2Effect/CMakeLists.txt b/plugins/Lv2Effect/CMakeLists.txt index 915751797d1..e0427eaa30a 100644 --- a/plugins/Lv2Effect/CMakeLists.txt +++ b/plugins/Lv2Effect/CMakeLists.txt @@ -1,7 +1,7 @@ IF(LMMS_HAVE_LV2) - INCLUDE_DIRECTORIES(${LV2_INCLUDE_DIRS}) - INCLUDE_DIRECTORIES(${LILV_INCLUDE_DIRS}) - INCLUDE_DIRECTORIES(${SUIL_INCLUDE_DIRS}) + include_directories(SYSTEM ${LV2_INCLUDE_DIRS}) + include_directories(SYSTEM ${LILV_INCLUDE_DIRS}) + include_directories(SYSTEM ${SUIL_INCLUDE_DIRS}) INCLUDE(BuildPlugin) BUILD_PLUGIN(lv2effect Lv2Effect.cpp Lv2FxControls.cpp Lv2FxControlDialog.cpp Lv2Effect.h Lv2FxControls.h Lv2FxControlDialog.h MOCFILES Lv2Effect.h Lv2FxControls.h Lv2FxControlDialog.h diff --git a/plugins/Lv2Instrument/CMakeLists.txt b/plugins/Lv2Instrument/CMakeLists.txt index 290bd84e82e..e10eff69215 100644 --- a/plugins/Lv2Instrument/CMakeLists.txt +++ b/plugins/Lv2Instrument/CMakeLists.txt @@ -1,7 +1,7 @@ IF(LMMS_HAVE_LV2) - INCLUDE_DIRECTORIES(${LV2_INCLUDE_DIRS}) - INCLUDE_DIRECTORIES(${LILV_INCLUDE_DIRS}) - INCLUDE_DIRECTORIES(${SUIL_INCLUDE_DIRS}) + include_directories(SYSTEM ${LV2_INCLUDE_DIRS}) + include_directories(SYSTEM ${LILV_INCLUDE_DIRS}) + include_directories(SYSTEM ${SUIL_INCLUDE_DIRS}) INCLUDE(BuildPlugin) BUILD_PLUGIN(lv2instrument Lv2Instrument.cpp Lv2Instrument.h MOCFILES Lv2Instrument.h EMBEDDED_RESOURCES logo.png) ENDIF(LMMS_HAVE_LV2) diff --git a/plugins/SlicerT/CMakeLists.txt b/plugins/SlicerT/CMakeLists.txt index 49a80ca03aa..fa7ce3c11a1 100644 --- a/plugins/SlicerT/CMakeLists.txt +++ b/plugins/SlicerT/CMakeLists.txt @@ -1,10 +1,16 @@ -INCLUDE(BuildPlugin) +include(BuildPlugin) -INCLUDE_DIRECTORIES(${FFTW3F_INCLUDE_DIRS}) -LINK_LIBRARIES(${FFTW3F_LIBRARIES}) +include_directories(SYSTEM ${FFTW3F_INCLUDE_DIRS}) +link_libraries(${FFTW3F_LIBRARIES}) -INCLUDE_DIRECTORIES(${SAMPLERATE_INCLUDE_DIRS}) -LINK_DIRECTORIES(${SAMPLERATE_LIBRARY_DIRS}) -LINK_LIBRARIES(${SAMPLERATE_LIBRARIES}) - -BUILD_PLUGIN(slicert SlicerT.cpp SlicerT.h SlicerTView.cpp SlicerTView.h SlicerTWaveform.cpp SlicerTWaveform.h MOCFILES SlicerT.h SlicerTView.h SlicerTWaveform.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png") \ No newline at end of file +build_plugin(slicert + SlicerT.cpp + SlicerT.h + SlicerTView.cpp + SlicerTView.h + SlicerTWaveform.cpp + SlicerTWaveform.h + MOCFILES SlicerT.h SlicerTView.h SlicerTWaveform.h + EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png" +) +target_link_libraries(slicert SampleRate::samplerate) diff --git a/plugins/SpectrumAnalyzer/CMakeLists.txt b/plugins/SpectrumAnalyzer/CMakeLists.txt index 488495a9e3d..4b3d2ed69bd 100644 --- a/plugins/SpectrumAnalyzer/CMakeLists.txt +++ b/plugins/SpectrumAnalyzer/CMakeLists.txt @@ -1,5 +1,5 @@ INCLUDE(BuildPlugin) -INCLUDE_DIRECTORIES(${FFTW3F_INCLUDE_DIRS}) +include_directories(SYSTEM ${FFTW3F_INCLUDE_DIRS}) LINK_LIBRARIES(${FFTW3F_LIBRARIES}) diff --git a/plugins/VstBase/RemoteVstPlugin/CMakeLists.txt b/plugins/VstBase/RemoteVstPlugin/CMakeLists.txt index 5bcf9f065da..a3cd517ff06 100644 --- a/plugins/VstBase/RemoteVstPlugin/CMakeLists.txt +++ b/plugins/VstBase/RemoteVstPlugin/CMakeLists.txt @@ -76,7 +76,7 @@ if(IS_MINGW) " HAS_STD_MUTEX) if(NOT HAS_STD_MUTEX) - target_include_directories(${EXE_NAME} PRIVATE + target_include_directories(${EXE_NAME} SYSTEM PRIVATE "${LMMS_SOURCE_DIR}/src/3rdparty/mingw-std-threads") target_compile_definitions(${EXE_NAME} PRIVATE -DUSE_MINGW_THREADS_REPLACEMENT) diff --git a/plugins/ZynAddSubFx/CMakeLists.txt b/plugins/ZynAddSubFx/CMakeLists.txt index b3c31018780..a0eb6f36ae6 100644 --- a/plugins/ZynAddSubFx/CMakeLists.txt +++ b/plugins/ZynAddSubFx/CMakeLists.txt @@ -12,7 +12,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) # definitions for ZynAddSubFX IF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD OR LMMS_BUILD_FREEBSD) FIND_PACKAGE(X11) - INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR}) + include_directories(SYSTEM ${X11_INCLUDE_DIR}) ADD_DEFINITIONS(-DOS_LINUX) ELSE() ADD_DEFINITIONS(-DOS_WINDOWS) @@ -44,10 +44,12 @@ IF(NOT EXISTS ${FLTK_FLUID_EXECUTABLE}) ENDIF() ENDIF() -include_directories( +include_directories(SYSTEM "${FLTK_INCLUDE_DIR}" - "${CMAKE_CURRENT_SOURCE_DIR}" ${FFTW3F_INCLUDE_DIRS} +) +include_directories( + "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f0a459f6cb6..940d485f966 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -54,30 +54,30 @@ ADD_GEN_QRC(LMMS_RCC_OUT lmms.qrc FILE(RELATIVE_PATH LIB_DIR_RELATIVE "/${BIN_DIR}" "/${LIB_DIR}") FILE(RELATIVE_PATH PLUGIN_DIR_RELATIVE "/${BIN_DIR}" "/${PLUGIN_DIR}") ADD_DEFINITIONS(-DLIB_DIR="${LIB_DIR_RELATIVE}" -DPLUGIN_DIR="${PLUGIN_DIR_RELATIVE}" ${PULSEAUDIO_DEFINITIONS}) -INCLUDE_DIRECTORIES( +include_directories(SYSTEM ${JACK_INCLUDE_DIRS} ${SNDIO_INCLUDE_DIRS} ${FFTW3F_INCLUDE_DIRS} ) IF(NOT LMMS_HAVE_SDL2 AND NOT ("${SDL_INCLUDE_DIR}" STREQUAL "")) - INCLUDE_DIRECTORIES("${SDL_INCLUDE_DIR}") + include_directories(SYSTEM "${SDL_INCLUDE_DIR}") ENDIF() IF(NOT ("${PULSEAUDIO_INCLUDE_DIR}" STREQUAL "")) - INCLUDE_DIRECTORIES("${PULSEAUDIO_INCLUDE_DIR}") + include_directories(SYSTEM "${PULSEAUDIO_INCLUDE_DIR}") ENDIF() IF(NOT ("${LV2_INCLUDE_DIRS}" STREQUAL "")) - INCLUDE_DIRECTORIES(${LV2_INCLUDE_DIRS}) + include_directories(SYSTEM ${LV2_INCLUDE_DIRS}) ENDIF() IF(NOT ("${LILV_INCLUDE_DIRS}" STREQUAL "")) - INCLUDE_DIRECTORIES(${LILV_INCLUDE_DIRS}) + include_directories(SYSTEM ${LILV_INCLUDE_DIRS}) ENDIF() IF(NOT ("${SUIL_INCLUDE_DIRS}" STREQUAL "")) - INCLUDE_DIRECTORIES(${SUIL_INCLUDE_DIRS}) + include_directories(SYSTEM ${SUIL_INCLUDE_DIRS}) ENDIF() # Use libraries in non-standard directories (e.g., another version of Qt)