From ef725cdbcfdb9ac1ed8ff03e75600d7c683193ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 7 Oct 2019 19:50:26 +0200 Subject: [PATCH] Adapt to changes to executable symbol defaults in CMake 3.4. --- src/Magnum/DebugTools/Test/CMakeLists.txt | 9 +++++++++ .../AnyAudioImporter/Test/CMakeLists.txt | 7 +++++++ .../AnyImageConverter/Test/CMakeLists.txt | 7 +++++++ .../AnyImageImporter/Test/CMakeLists.txt | 7 +++++++ .../AnySceneImporter/Test/CMakeLists.txt | 7 +++++++ src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt | 15 +++++++++++++++ .../MagnumFontConverter/Test/CMakeLists.txt | 7 +++++++ src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt | 7 +++++++ .../TgaImageConverter/Test/CMakeLists.txt | 7 +++++++ src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt | 7 +++++++ .../WavAudioImporter/Test/CMakeLists.txt | 9 +++++++-- 11 files changed, 87 insertions(+), 2 deletions(-) diff --git a/src/Magnum/DebugTools/Test/CMakeLists.txt b/src/Magnum/DebugTools/Test/CMakeLists.txt index cd6e1d3de..fab9805af 100644 --- a/src/Magnum/DebugTools/Test/CMakeLists.txt +++ b/src/Magnum/DebugTools/Test/CMakeLists.txt @@ -123,6 +123,15 @@ if(TARGET_GL) target_link_libraries(DebugToolsScreenshotGLTest PRIVATE TgaImporter) endif() endif() + + if(CORRADE_BUILD_STATIC AND NOT BUILD_PLUGINS_STATIC) + # CMake < 3.4 does this implicitly, but 3.4+ not anymore (see + # CMP0065). That's generally okay, *except if* the build is + # static, the executable uses a plugin manager and needs to + # share globals with the plugins (such as output redirection + # and so on). + set_target_properties(DebugToolsScreenshotGLTest PROPERTIES ENABLE_EXPORTS ON) + endif() endif() if(WITH_SCENEGRAPH AND WITH_TRADE) diff --git a/src/MagnumPlugins/AnyAudioImporter/Test/CMakeLists.txt b/src/MagnumPlugins/AnyAudioImporter/Test/CMakeLists.txt index 3ece4582b..e720a8479 100644 --- a/src/MagnumPlugins/AnyAudioImporter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/AnyAudioImporter/Test/CMakeLists.txt @@ -58,3 +58,10 @@ if(BUILD_PLUGINS_STATIC) endif() endif() set_target_properties(AnyAudioImporterTest PROPERTIES FOLDER "MagnumPlugins/AnyAudioImporter/Test") +if(CORRADE_BUILD_STATIC AND NOT BUILD_PLUGINS_STATIC) + # CMake < 3.4 does this implicitly, but 3.4+ not anymore (see CMP0065). + # That's generally okay, *except if* the build is static, the executable + # uses a plugin manager and needs to share globals with the plugins (such + # as output redirection and so on). + set_target_properties(AnyAudioImporterTest PROPERTIES ENABLE_EXPORTS ON) +endif() diff --git a/src/MagnumPlugins/AnyImageConverter/Test/CMakeLists.txt b/src/MagnumPlugins/AnyImageConverter/Test/CMakeLists.txt index 78a470b72..193083ffb 100644 --- a/src/MagnumPlugins/AnyImageConverter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/AnyImageConverter/Test/CMakeLists.txt @@ -56,3 +56,10 @@ if(BUILD_PLUGINS_STATIC) endif() endif() set_target_properties(AnyImageConverterTest PROPERTIES FOLDER "MagnumPlugins/AnyImageConverter/Test") +if(CORRADE_BUILD_STATIC AND NOT BUILD_PLUGINS_STATIC) + # CMake < 3.4 does this implicitly, but 3.4+ not anymore (see CMP0065). + # That's generally okay, *except if* the build is static, the executable + # uses a plugin manager and needs to share globals with the plugins (such + # as output redirection and so on). + set_target_properties(AnyImageConverterTest PROPERTIES ENABLE_EXPORTS ON) +endif() diff --git a/src/MagnumPlugins/AnyImageImporter/Test/CMakeLists.txt b/src/MagnumPlugins/AnyImageImporter/Test/CMakeLists.txt index aa7fefe00..d5da7b8c9 100644 --- a/src/MagnumPlugins/AnyImageImporter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/AnyImageImporter/Test/CMakeLists.txt @@ -66,3 +66,10 @@ if(BUILD_PLUGINS_STATIC) endif() endif() set_target_properties(AnyImageImporterTest PROPERTIES FOLDER "MagnumPlugins/AnyImageImporter/Test") +if(CORRADE_BUILD_STATIC AND NOT BUILD_PLUGINS_STATIC) + # CMake < 3.4 does this implicitly, but 3.4+ not anymore (see CMP0065). + # That's generally okay, *except if* the build is static, the executable + # uses a plugin manager and needs to share globals with the plugins (such + # as output redirection and so on). + set_target_properties(AnyImageImporterTest PROPERTIES ENABLE_EXPORTS ON) +endif() diff --git a/src/MagnumPlugins/AnySceneImporter/Test/CMakeLists.txt b/src/MagnumPlugins/AnySceneImporter/Test/CMakeLists.txt index 5462c7219..901206b53 100644 --- a/src/MagnumPlugins/AnySceneImporter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/AnySceneImporter/Test/CMakeLists.txt @@ -58,3 +58,10 @@ if(BUILD_PLUGINS_STATIC) endif() endif() set_target_properties(AnySceneImporterTest PROPERTIES FOLDER "MagnumPlugins/AnySceneImporter/Test") +if(CORRADE_BUILD_STATIC AND NOT BUILD_PLUGINS_STATIC) + # CMake < 3.4 does this implicitly, but 3.4+ not anymore (see CMP0065). + # That's generally okay, *except if* the build is static, the executable + # uses a plugin manager and needs to share globals with the plugins (such + # as output redirection and so on). + set_target_properties(AnySceneImporterTest PROPERTIES ENABLE_EXPORTS ON) +endif() diff --git a/src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt b/src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt index 0a88aa35a..dbe9a9eb3 100644 --- a/src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt +++ b/src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt @@ -54,6 +54,13 @@ if(BUILD_PLUGINS_STATIC) target_link_libraries(MagnumFontTest PRIVATE MagnumFont TgaImporter) endif() set_target_properties(MagnumFontTest PROPERTIES FOLDER "MagnumPlugins/MagnumFont/Test") +if(CORRADE_BUILD_STATIC AND NOT BUILD_PLUGINS_STATIC) + # CMake < 3.4 does this implicitly, but 3.4+ not anymore (see CMP0065). + # That's generally okay, *except if* the build is static, the executable + # uses a plugin manager and needs to share globals with the plugins (such + # as output redirection and so on). + set_target_properties(MagnumFontTest PROPERTIES ENABLE_EXPORTS ON) +endif() if(BUILD_GL_TESTS) corrade_add_test(MagnumFontGLTest MagnumFontGLTest.cpp @@ -66,4 +73,12 @@ if(BUILD_GL_TESTS) target_link_libraries(MagnumFontGLTest PRIVATE MagnumFont TgaImporter) endif() set_target_properties(MagnumFontGLTest PROPERTIES FOLDER "MagnumPlugins/MagnumFont/Test") + if((CORRADE_BUILD_STATIC OR MAGNUM_BUILD_STATIC) AND NOT BUILD_PLUGINS_STATIC) + # CMake < 3.4 does this implicitly, but 3.4+ not anymore (see CMP0065). + # That's generally okay, *except if* the build is static, the + # executable uses a plugin manager and needs to share globals with the + # plugins (such as output redirection, GL::Context::current() and so + # on). + set_target_properties(MagnumFontGLTest PROPERTIES ENABLE_EXPORTS ON) + endif() endif() diff --git a/src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt b/src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt index 5ccdea3cc..b49a3ad08 100644 --- a/src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt @@ -52,3 +52,10 @@ if(BUILD_PLUGINS_STATIC) endif() endif() set_target_properties(MagnumFontConverterTest PROPERTIES FOLDER "MagnumPlugins/MagnumFontConverter/Test") +if(CORRADE_BUILD_STATIC AND NOT BUILD_PLUGINS_STATIC) + # CMake < 3.4 does this implicitly, but 3.4+ not anymore (see CMP0065). + # That's generally okay, *except if* the build is static, the executable + # uses a plugin manager and needs to share globals with the plugins (such + # as output redirection and so on). + set_target_properties(MagnumFontConverterTest PROPERTIES ENABLE_EXPORTS ON) +endif() diff --git a/src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt b/src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt index ada5fb3de..e0c577aaf 100644 --- a/src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt @@ -68,3 +68,10 @@ if(BUILD_PLUGINS_STATIC) target_link_libraries(ObjImporterTest PRIVATE ObjImporter) endif() set_target_properties(ObjImporterTest PROPERTIES FOLDER "MagnumPlugins/ObjImporter/Test") +if(CORRADE_BUILD_STATIC AND NOT BUILD_PLUGINS_STATIC) + # CMake < 3.4 does this implicitly, but 3.4+ not anymore (see CMP0065). + # That's generally okay, *except if* the build is static, the executable + # uses a plugin manager and needs to share globals with the plugins (such + # as output redirection and so on). + set_target_properties(ObjImporterTest PROPERTIES ENABLE_EXPORTS ON) +endif() diff --git a/src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt b/src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt index a6126f8d1..468937156 100644 --- a/src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt @@ -50,3 +50,10 @@ if(BUILD_PLUGINS_STATIC) endif() endif() set_target_properties(TgaImageConverterTest PROPERTIES FOLDER "MagnumPlugins/TgaImageConverter/Test") +if(CORRADE_BUILD_STATIC AND NOT BUILD_PLUGINS_STATIC) + # CMake < 3.4 does this implicitly, but 3.4+ not anymore (see CMP0065). + # That's generally okay, *except if* the build is static, the executable + # uses a plugin manager and needs to share globals with the plugins (such + # as output redirection and so on). + set_target_properties(TgaImageConverterTest PROPERTIES ENABLE_EXPORTS ON) +endif() diff --git a/src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt b/src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt index e7bf23cea..65f9d9910 100644 --- a/src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt @@ -51,3 +51,10 @@ if(BUILD_PLUGINS_STATIC) target_link_libraries(TgaImporterTest PRIVATE TgaImporter) endif() set_target_properties(TgaImporterTest PROPERTIES FOLDER "MagnumPlugins/TgaImporter/Test") +if(CORRADE_BUILD_STATIC AND NOT BUILD_PLUGINS_STATIC) + # CMake < 3.4 does this implicitly, but 3.4+ not anymore (see CMP0065). + # That's generally okay, *except if* the build is static, the executable + # uses a plugin manager and needs to share globals with the plugins (such + # as output redirection and so on). + set_target_properties(TgaImporterTest PROPERTIES ENABLE_EXPORTS ON) +endif() diff --git a/src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt b/src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt index a3684768d..fe74383ed 100644 --- a/src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt @@ -84,13 +84,18 @@ target_include_directories(WavAudioImporterTest PRIVATE ${CMAKE_CURRENT_BINARY_D if(BUILD_PLUGINS_STATIC) target_link_libraries(WavAudioImporterTest PRIVATE WavAudioImporter) endif() - corrade_add_test(WavAudioImporterWavHeaderTest WavHeaderTest.cpp $ LIBRARIES MagnumAudio) - set_target_properties( WavAudioImporterTest WavAudioImporterWavHeaderTest PROPERTIES FOLDER "MagnumPlugins/WavAudioImporter/Test") +if(CORRADE_BUILD_STATIC AND NOT BUILD_PLUGINS_STATIC) + # CMake < 3.4 does this implicitly, but 3.4+ not anymore (see CMP0065). + # That's generally okay, *except if* the build is static, the executable + # uses a plugin manager and needs to share globals with the plugins (such + # as output redirection and so on). + set_target_properties(WavAudioImporterTest PROPERTIES ENABLE_EXPORTS ON) +endif()