From 3a243a04b2217147740d01984c7dd796584c7f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 8 Oct 2019 16:20:58 +0200 Subject: [PATCH] CMake: put all binaries into a dedicated location in the build dir. This makes it possible to: - finally use Magnum as a CMake subproject on Windows and have your executables not fail to run with a "DLL missing" error (and the setting is put to cache so superprojects just implicitly make use of that) - run tests on Windows without having to install first - use dynamic plugins from a CMake subproject on any platform without having to install first or load them by filename --- and the plugin directory is now easily discovered as relative to libraryLocation() of the library implementing given plugin interface --- CMakeLists.txt | 31 ++++++++++++ doc/building.dox | 12 +++-- doc/cmake.dox | 49 +++++++++++++++++++ package/archlinux/PKGBUILD-coverage | 4 +- package/ci/appveyor-desktop-gles.bat | 4 +- package/ci/appveyor-desktop-mingw.bat | 4 +- package/ci/appveyor-desktop-vulkan.bat | 4 +- package/ci/appveyor-desktop.bat | 4 +- package/ci/appveyor-rt.bat | 3 ++ package/ci/travis-android-arm.sh | 4 ++ package/ci/travis-desktop-gles.sh | 8 ++- package/ci/travis-desktop-vulkan.sh | 3 ++ package/ci/travis-desktop.sh | 4 +- package/ci/travis-emscripten.sh | 3 ++ package/ci/travis-ios-simulator.sh | 3 ++ src/Magnum/Audio/AbstractImporter.cpp | 16 ++---- src/Magnum/Audio/CMakeLists.txt | 9 ---- src/Magnum/CMakeLists.txt | 9 ---- src/Magnum/DebugTools/CMakeLists.txt | 9 ---- src/Magnum/GL/CMakeLists.txt | 9 ---- src/Magnum/MeshTools/CMakeLists.txt | 9 ---- src/Magnum/SceneGraph/CMakeLists.txt | 9 ---- src/Magnum/Shaders/CMakeLists.txt | 9 ---- src/Magnum/Text/AbstractFont.cpp | 24 ++++----- src/Magnum/Text/AbstractFontConverter.cpp | 16 ++---- src/Magnum/Text/CMakeLists.txt | 9 ---- src/Magnum/Trade/AbstractImageConverter.cpp | 24 ++++----- src/Magnum/Trade/AbstractImporter.cpp | 24 ++++----- src/Magnum/Trade/CMakeLists.txt | 9 ---- src/Magnum/Vk/CMakeLists.txt | 9 ---- .../AnyAudioImporter/CMakeLists.txt | 4 ++ .../AnyImageConverter/CMakeLists.txt | 4 ++ .../AnyImageImporter/CMakeLists.txt | 4 ++ .../AnySceneImporter/CMakeLists.txt | 4 ++ src/MagnumPlugins/MagnumFont/CMakeLists.txt | 4 ++ .../MagnumFontConverter/CMakeLists.txt | 4 ++ src/MagnumPlugins/ObjImporter/CMakeLists.txt | 4 ++ .../TgaImageConverter/CMakeLists.txt | 4 ++ src/MagnumPlugins/TgaImporter/CMakeLists.txt | 4 ++ .../WavAudioImporter/CMakeLists.txt | 4 ++ 40 files changed, 211 insertions(+), 163 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 996a5400f..1050edc6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -408,6 +408,37 @@ set(MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_DIR ${MAGNUM_PLUGINS_RELEASE_DIR}/audio set(MAGNUM_LIBRARY_VERSION 2.2) set(MAGNUM_LIBRARY_SOVERSION 2) +# A single output location. After a decade of saying NO THIS IS A NON-SOLUTION +# TO A NON-PROBLEM I reconsidered my views and enabled this, because: +# +# - On Windows (which don't have RPATH), this makes test execution finally +# possible without having to install all the stuff first (including the +# test-only libs, which is ugh). +# - With CMake subprojects, this makes it finally possible to use dynamic +# plugins directly from the build dir (again without installing anything) --- +# all plugins are put into the same place, so PluginManager has a single +# place to look into; and thanks to the dynamic libraries being there as +# well, this location can be automagically detected as relative to +# Directory::libraryLocation(). +# - Thanks to the $ being part of the output path, you are always sure +# you never accidentally mix up debug/release libraries when switching +# CMAKE_BUILD_TYPE in an existing build dir. +# +# The runtime location is set to CMAKE_BINARY_DIR and not PROJECT_BINARY_DIR +# because have one runtime location per CMake subproject would not solve much +# either. If the user already provides CMAKE_RUNTIME_OUTPUT_DIRECTORY (even +# empty), it's respected and nothing is being done. +# +# Explicitly using a generator expression to ensure plugins are added to e.g. +# /lib/magnum/importers/ instead of lib/magnum/importers/. Also +# adding this to cache, making superprojects pick that up implicitly as well, +# without forcing them to explicitly mirror this setting. +if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$/bin CACHE PATH "" FORCE) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$/lib CACHE PATH "" FORCE) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$/lib CACHE PATH "" FORCE) +endif() + add_subdirectory(modules) add_subdirectory(src) diff --git a/doc/building.dox b/doc/building.dox index a5313f821..b2de463cf 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -53,6 +53,11 @@ information. Additional functionality is provided separately in @ref building-extras "Magnum Extras" and @ref building-examples "Magnum Examples". +@section building-cmake-subproject Using Magnum as a CMake subproject + +Magnum can be bundled into your project with the @cb{.cmake} add_subdirectory() @ce +CMake command. See @ref cmake-subproject for more information. + @section building-packages Prepared packages The easiest way to install Magnum is to use one of the ready-made packages for @@ -707,9 +712,8 @@ using ctest --output-on-failure @endcode -in the build directory. On Windows the tests require the library to be -installed with DLLs accessible through @cb{.bat} %PATH% @ce. See the above -@ref building-windows "Windows documentation" for more information. +in the build directory. It's not needed to install anything anywhere to run the +tests. The @ref Audio library has tests which require OpenAL to be able to create a context. That is the case on most platforms, so they are enabled by default. @@ -1044,7 +1048,7 @@ through `PATH`. If you set `CMAKE_INSTALL_PREFIX` to `/usr` subdirectory of the particular Android platform sysroot, the package will get found automatically when -compiling subprojects. Gradle and other Android buildsystems expect +compiling depending projects. Gradle and other Android buildsystems expect platform-independent includes and other files to be stored in a central location, you can set `MAGNUM_INCLUDE_INSTALL_PREFIX` to `/usr` subdirectory of the global NDK sysroot. Another option is to explicitly set `CMAKE_PREFIX_PATH` diff --git a/doc/cmake.dox b/doc/cmake.dox index 9c04f1103..44a7c9968 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -36,6 +36,8 @@ Magnum uses CMake as a primary build system for both building and integration into your projects. The following guide explains how to use it. If you wish to use a different buildsystem, see @ref custom-buildsystems instead. +@section cmake-installed Using Magnum that was externally built and installed + The main logic is in the [FindMagnum.cmake](https://github.com/mosra/magnum/blob/master/modules/FindMagnum.cmake) module distributed with the engine in the `modules/` directory, you are encouraged to copy it along with [FindCorrade.cmake](https://github.com/mosra/corrade/blob/master/modules/FindCorrade.cmake) @@ -44,6 +46,8 @@ into your project and add path to the files to `CMAKE_MODULE_PATH`: @code{.cmake} # Path where FindCorrade.cmake & FindMagnum.cmake can be found, adapt as needed set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/modules/" ${CMAKE_MODULE_PATH}) + +find_package(Magnum REQUIRED ...) # see below @endcode Otherwise, if CMake won't be able to find this file in predefined locations, it @@ -59,6 +63,51 @@ If you installed the library or its dependencies to non-standard location directory to help CMake find it. You can enter more different dirs if you separate them with semicolons. +@section cmake-subproject Using Magnum as a CMake subproject + +A self-contained alternative to the above is adding Corrade and Magnum +repositories into your project (as a Git submodule, bundling a downloaded +archive etc.) and use @cb{.cmake} add_subdirectory() @ce. With that approach +you don't need to care about `FindCorrade.cmake` / `FindMagnum.cmake`, however +the usual tradeoffs when bundling code apply --- slower full rebuilds, IDEs +having more to parse etc. + +@code{.cmake} +add_subdirectory(corrade EXCLUDE_FROM_ALL) # so only things you use are built +add_subdirectory(magnum EXCLUDE_FROM_ALL) + +find_package(Magnum REQUIRED ...) # see below +@endcode + +Note that the @cb{.cmake} find_package() @ce call is needed in both the +installed and the subproject case for a properly configured environment. + +To simplify your project setup, the subproject globally configures +@m_class{m-doc-external} [CMAKE_RUNTIME_OUTPUT_DIRECTORY](https://cmake.org/cmake/help/latest/variable/CMAKE_RUNTIME_OUTPUT_DIRECTORY.html) +and friends to `/bin` / `/lib` directories inside your build +directory. This makes the subproject workflow easier when dynamically-loaded +plugins are involved; and on Windows it makes it possible to run built +executables without having to do a @cb{.sh} $PATH @ce setup for dependency +DLLs. If your project already configures `CMAKE_{RUNTIME,LIBRARY,ARCHIVE}_OUTPUT_DIRECTORY`, +those will get used instead (and you can also set your own output directories +* *after* the @cb{.cmake} add_subdirectory() @ce call, which will make Magnum +keep the above). If you want to disable this behavior altogether and keep +all executables and libraries in their implicit locations, set those variables +to an empty string (as opposed to nothing at all, which is the same as if the +variable is not set) --- Magnum will detect and respect that: + +@code{.cmake} +# I'm happy with having binaries scattered around the build dir +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "") + +add_subdirectory(corrade EXCLUDE_FROM_ALL) +add_subdirectory(magnum EXCLUDE_FROM_ALL) +@endcode + +@section cmake-find-module Finding the package and its component + Basic usage is: @code{.cmake} diff --git a/package/archlinux/PKGBUILD-coverage b/package/archlinux/PKGBUILD-coverage index 503fce031..63cf7e35f 100644 --- a/package/archlinux/PKGBUILD-coverage +++ b/package/archlinux/PKGBUILD-coverage @@ -65,8 +65,8 @@ check() { MAGNUM_DISABLE_EXTENSIONS="GL_ARB_get_texture_sub_image" CORRADE_TEST_SKIP_BENCHMARKS=ON CORRADE_TEST_COLOR=ON ctest --output-on-failure -j5 -R GLTest || true MAGNUM_DISABLE_EXTENSIONS="GL_ARB_vertex_array_object" CORRADE_TEST_SKIP_BENCHMARKS=ON CORRADE_TEST_COLOR=ON ctest --output-on-failure -j5 -R GLTest || true MAGNUM_DISABLE_EXTENSIONS="GL_KHR_debug" CORRADE_TEST_SKIP_BENCHMARKS=ON CORRADE_TEST_COLOR=ON ctest --output-on-failure -j5 -R GLTest || true - ./src/Magnum/Platform/magnum-gl-info --limits > /dev/null - ./src/Magnum/Audio/magnum-al-info > /dev/null + ./Debug/bin/magnum-al-info > /dev/null + ./Debug/bin/magnum-gl-info --limits > /dev/null rm -rf coverage mkdir coverage diff --git a/package/ci/appveyor-desktop-gles.bat b/package/ci/appveyor-desktop-gles.bat index ec2e0c19a..4a48947f7 100644 --- a/package/ci/appveyor-desktop-gles.bat +++ b/package/ci/appveyor-desktop-gles.bat @@ -49,8 +49,10 @@ cmake .. ^ -DBUILD_GL_TESTS=ON ^ -G Ninja || exit /b cmake --build . || exit /b -cmake --build . --target install || exit /b rem Test set CORRADE_TEST_COLOR=ON ctest -V -E GLTest || exit /b + +rem Test install, after running the tests as for them it shouldn't be needed +cmake --build . --target install || exit /b diff --git a/package/ci/appveyor-desktop-mingw.bat b/package/ci/appveyor-desktop-mingw.bat index 0736ebbe0..2063be195 100644 --- a/package/ci/appveyor-desktop-mingw.bat +++ b/package/ci/appveyor-desktop-mingw.bat @@ -48,12 +48,14 @@ cmake .. ^ -DBUILD_GL_TESTS=ON ^ -G Ninja || exit /b cmake --build . || exit /b -cmake --build . --target install || exit /b rem Test set CORRADE_TEST_COLOR=ON ctest -V -E GLTest || exit /b +rem Test install, after running the tests as for them it shouldn't be needed +cmake --build . --target install || exit /b + rem Coverage upload set PATH=C:\msys64\usr\bin;%PATH% bash %APPVEYOR_BUILD_FOLDER%\package\ci\appveyor-lcov.sh || exit /b diff --git a/package/ci/appveyor-desktop-vulkan.bat b/package/ci/appveyor-desktop-vulkan.bat index 83b615517..8d40d85dd 100644 --- a/package/ci/appveyor-desktop-vulkan.bat +++ b/package/ci/appveyor-desktop-vulkan.bat @@ -60,8 +60,10 @@ cmake .. ^ -DBUILD_GL_TESTS=OFF ^ -G Ninja || exit /b cmake --build . || exit /b -cmake --build . --target install || exit /b rem Test set CORRADE_TEST_COLOR=ON ctest -V -E GLTest || exit /b + +rem Test install, after running the tests as for them it shouldn't be needed +cmake --build . --target install || exit /b diff --git a/package/ci/appveyor-desktop.bat b/package/ci/appveyor-desktop.bat index 2be8baee6..266ad6939 100644 --- a/package/ci/appveyor-desktop.bat +++ b/package/ci/appveyor-desktop.bat @@ -50,8 +50,10 @@ cmake .. ^ -DBUILD_STATIC=%BUILD_STATIC% ^ -G Ninja || exit /b cmake --build . || exit /b -cmake --build . --target install || exit /b rem Test set CORRADE_TEST_COLOR=ON ctest -V -E GLTest || exit /b + +rem Test install, after running the tests as for them it shouldn't be needed +cmake --build . --target install || exit /b diff --git a/package/ci/appveyor-rt.bat b/package/ci/appveyor-rt.bat index 2619bade5..8f3d4c900 100644 --- a/package/ci/appveyor-rt.bat +++ b/package/ci/appveyor-rt.bat @@ -83,3 +83,6 @@ cmake .. ^ -DBUILD_STATIC=ON ^ -G "%GENERATOR%" -A x64 || exit /b cmake --build . --config Release -- /m /v:m || exit /b + +rem Test install, after running the tests as for them it shouldn't be needed +cmake --build . --config Release --target install || exit /b diff --git a/package/ci/travis-android-arm.sh b/package/ci/travis-android-arm.sh index 984bdbdc6..090882740 100755 --- a/package/ci/travis-android-arm.sh +++ b/package/ci/travis-android-arm.sh @@ -51,6 +51,7 @@ cmake .. \ -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang \ -DCMAKE_ANDROID_STL_TYPE=c++_static \ -DCORRADE_RC_EXECUTABLE=$HOME/deps-native/bin/corrade-rc \ + -DCMAKE_INSTALL_PREFIX=$HOME/deps \ -DCMAKE_PREFIX_PATH=$HOME/deps \ -DCMAKE_FIND_ROOT_PATH=$HOME/deps \ -DCMAKE_BUILD_TYPE=Release \ @@ -81,3 +82,6 @@ echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a emulator -avd test -no-audio -no-window & android-wait-for-emulator CORRADE_TEST_COLOR=ON ctest -V -E GLTest + +# Test install, after running the tests as for them it shouldn't be needed +ninja install diff --git a/package/ci/travis-desktop-gles.sh b/package/ci/travis-desktop-gles.sh index b2934cf29..048da8da2 100755 --- a/package/ci/travis-desktop-gles.sh +++ b/package/ci/travis-desktop-gles.sh @@ -20,6 +20,7 @@ cmake .. \ -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \ -DCMAKE_PREFIX_PATH="$HOME/deps" \ -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_INSTALL_PREFIX=$HOME/deps \ -DEGL_LIBRARY=$HOME/swiftshader/libEGL.so \ -DOPENGLES2_LIBRARY=$HOME/swiftshader/libGLESv2.so \ -DOPENGLES3_LIBRARY=$HOME/swiftshader/libGLESv2.so \ @@ -55,5 +56,8 @@ cmake .. \ ninja -j4 CORRADE_TEST_COLOR=ON ctest -V if [ "$TARGET_GLES2" == "ON" ]; then CORRADE_TEST_COLOR=ON MAGNUM_DISABLE_EXTENSIONS="OES_vertex_array_object" ctest -V -R GLTest; fi -src/Magnum/Audio/magnum-al-info > /dev/null -src/Magnum/Platform/magnum-gl-info --limits > /dev/null +Debug/bin/magnum-al-info > /dev/null +Debug/bin/magnum-gl-info --limits > /dev/null + +# Test install, after running the tests as for them it shouldn't be needed +ninja install diff --git a/package/ci/travis-desktop-vulkan.sh b/package/ci/travis-desktop-vulkan.sh index 05101f01e..c3f537332 100755 --- a/package/ci/travis-desktop-vulkan.sh +++ b/package/ci/travis-desktop-vulkan.sh @@ -65,3 +65,6 @@ cmake .. \ # Otherwise the job gets killed (probably because using too much memory) ninja -j4 ASAN_OPTIONS="color=always" LSAN_OPTIONS="color=always suppressions=$TRAVIS_BUILD_DIR/package/ci/leaksanitizer.conf" CORRADE_TEST_COLOR=ON ctest -V -E GLTest + +# Test install, after running the tests as for them it shouldn't be needed +ninja install diff --git a/package/ci/travis-desktop.sh b/package/ci/travis-desktop.sh index 55e7dade9..d35811628 100755 --- a/package/ci/travis-desktop.sh +++ b/package/ci/travis-desktop.sh @@ -54,8 +54,10 @@ cmake .. \ ninja -j4 ASAN_OPTIONS="color=always" LSAN_OPTIONS="color=always suppressions=$TRAVIS_BUILD_DIR/package/ci/leaksanitizer.conf" CORRADE_TEST_COLOR=ON ctest -V -E GLTest -# Verify also compilation of the documentation image generators +# Test install, after running the tests as for them it shouldn't be needed ninja install + +# Verify also compilation of the documentation image generators cd .. mkdir build-doc-generated && cd build-doc-generated cmake ../doc/generated \ diff --git a/package/ci/travis-emscripten.sh b/package/ci/travis-emscripten.sh index 8d91fd987..f09413a2a 100755 --- a/package/ci/travis-emscripten.sh +++ b/package/ci/travis-emscripten.sh @@ -75,3 +75,6 @@ ninja -j4 # Test CORRADE_TEST_COLOR=ON ctest -V -E "(GL|AL)Test" + +# Test install, after running the tests as for them it shouldn't be needed +ninja install diff --git a/package/ci/travis-ios-simulator.sh b/package/ci/travis-ios-simulator.sh index 196d49cb5..48b87cc02 100755 --- a/package/ci/travis-ios-simulator.sh +++ b/package/ci/travis-ios-simulator.sh @@ -69,3 +69,6 @@ set -o pipefail && cmake --build . --config Release | xcpretty # Library not loaded: /System/Library/Frameworks/OpenGLES.framework/OpenGLES # error DYLD_FALLBACK_LIBRARY_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/OpenGLES.framework/ DYLD_FALLBACK_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks CORRADE_TEST_COLOR=ON ctest -V -C Release -E GLTest + +# Test install, after running the tests as for them it shouldn't be needed +set -o pipefail && cmake --build . --config Release --target install | xcpretty diff --git a/src/Magnum/Audio/AbstractImporter.cpp b/src/Magnum/Audio/AbstractImporter.cpp index 8c75f29a7..2c7b32902 100644 --- a/src/Magnum/Audio/AbstractImporter.cpp +++ b/src/Magnum/Audio/AbstractImporter.cpp @@ -45,23 +45,15 @@ std::string AbstractImporter::pluginInterface() { std::vector AbstractImporter::pluginSearchPaths() { return { #ifdef CORRADE_IS_DEBUG_BUILD - #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_BUILD_STATIC) - Utility::Directory::join(Utility::Directory::path(Utility::Directory::dllLocation( - #ifdef __MINGW32__ - "lib" - #endif - "MagnumAudio-d")), "magnum-d/audioimporters"), + #ifndef MAGNUM_BUILD_STATIC + Utility::Directory::join(Utility::Directory::path(Utility::Directory::libraryLocation(&pluginInterface)), "magnum-d/audioimporters"), #else "magnum-d/audioimporters", #endif Utility::Directory::join(MAGNUM_PLUGINS_DEBUG_DIR, "audioimporters") #else - #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_BUILD_STATIC) - Utility::Directory::join(Utility::Directory::path(Utility::Directory::dllLocation( - #ifdef __MINGW32__ - "lib" - #endif - "MagnumAudio")), "magnum/audioimporters"), + #ifndef MAGNUM_BUILD_STATIC + Utility::Directory::join(Utility::Directory::path(Utility::Directory::libraryLocation(&pluginInterface)), "magnum/audioimporters"), #else "magnum/audioimporters", #endif diff --git a/src/Magnum/Audio/CMakeLists.txt b/src/Magnum/Audio/CMakeLists.txt index c6665d232..2c77c6c47 100644 --- a/src/Magnum/Audio/CMakeLists.txt +++ b/src/Magnum/Audio/CMakeLists.txt @@ -162,14 +162,5 @@ if(BUILD_TESTS) target_link_libraries(MagnumAudioTestLib MagnumSceneGraph) endif() - # On Windows we need to install first and then run the tests to avoid "DLL - # not found" hell, thus we need to install this too - if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING AND NOT BUILD_STATIC) - install(TARGETS MagnumAudioTestLib - RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} - LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} - ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - endif() - add_subdirectory(Test) endif() diff --git a/src/Magnum/CMakeLists.txt b/src/Magnum/CMakeLists.txt index d39b0cf53..71ab8a4c5 100644 --- a/src/Magnum/CMakeLists.txt +++ b/src/Magnum/CMakeLists.txt @@ -212,15 +212,6 @@ if(BUILD_TESTS) endif() target_link_libraries(MagnumTestLib PUBLIC Corrade::Utility) - # On Windows we need to install first and then run the tests to avoid "DLL - # not found" hell, thus we need to install this too - if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING AND NOT BUILD_STATIC) - install(TARGETS MagnumMathTestLib MagnumTestLib - RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} - LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} - ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - endif() - add_subdirectory(Test) endif() diff --git a/src/Magnum/DebugTools/CMakeLists.txt b/src/Magnum/DebugTools/CMakeLists.txt index 820673114..36b164546 100644 --- a/src/Magnum/DebugTools/CMakeLists.txt +++ b/src/Magnum/DebugTools/CMakeLists.txt @@ -167,15 +167,6 @@ if(BUILD_TESTS) endif() endif() - # On Windows we need to install first and then run the tests to avoid "DLL - # not found" hell, thus we need to install this too - if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING AND NOT BUILD_STATIC) - install(TARGETS MagnumDebugToolsTestLib - RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} - LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} - ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - endif() - add_subdirectory(Test) endif() diff --git a/src/Magnum/GL/CMakeLists.txt b/src/Magnum/GL/CMakeLists.txt index ce5391e64..fe276ae6f 100644 --- a/src/Magnum/GL/CMakeLists.txt +++ b/src/Magnum/GL/CMakeLists.txt @@ -317,15 +317,6 @@ if(BUILD_TESTS) target_link_libraries(MagnumGLTestLib PUBLIC OpenGLES3::OpenGLES3) endif() - # On Windows we need to install first and then run the tests to avoid "DLL - # not found" hell, thus we need to install this too - if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING AND NOT BUILD_STATIC) - install(TARGETS MagnumGLTestLib - RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} - LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} - ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - endif() - if(BUILD_GL_TESTS) add_library(MagnumOpenGLTesterTestLib STATIC $ diff --git a/src/Magnum/MeshTools/CMakeLists.txt b/src/Magnum/MeshTools/CMakeLists.txt index d23487fdb..a6d6b4d28 100644 --- a/src/Magnum/MeshTools/CMakeLists.txt +++ b/src/Magnum/MeshTools/CMakeLists.txt @@ -121,15 +121,6 @@ if(BUILD_TESTS) target_link_libraries(MagnumMeshToolsTestLib PUBLIC MagnumGL MagnumTrade) endif() - # On Windows we need to install first and then run the tests to avoid "DLL - # not found" hell, thus we need to install this too - if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING AND NOT BUILD_STATIC) - install(TARGETS MagnumMeshToolsTestLib - RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} - LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} - ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - endif() - add_subdirectory(Test) endif() diff --git a/src/Magnum/SceneGraph/CMakeLists.txt b/src/Magnum/SceneGraph/CMakeLists.txt index e3c092902..5647415b6 100644 --- a/src/Magnum/SceneGraph/CMakeLists.txt +++ b/src/Magnum/SceneGraph/CMakeLists.txt @@ -112,15 +112,6 @@ if(BUILD_TESTS) "CORRADE_GRACEFUL_ASSERT" "MagnumSceneGraph_EXPORTS") target_link_libraries(MagnumSceneGraphTestLib MagnumMathTestLib) - # On Windows we need to install first and then run the tests to avoid "DLL - # not found" hell, thus we need to install this too - if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING AND NOT BUILD_STATIC) - install(TARGETS MagnumSceneGraphTestLib - RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} - LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} - ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - endif() - add_subdirectory(Test) endif() diff --git a/src/Magnum/Shaders/CMakeLists.txt b/src/Magnum/Shaders/CMakeLists.txt index eb98f515a..8096bcf64 100644 --- a/src/Magnum/Shaders/CMakeLists.txt +++ b/src/Magnum/Shaders/CMakeLists.txt @@ -113,15 +113,6 @@ if(BUILD_TESTS) Magnum MagnumGL) - # On Windows we need to install first and then run the tests to avoid "DLL - # not found" hell, thus we need to install this too - if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING AND NOT BUILD_STATIC) - install(TARGETS MagnumShadersTestLib - RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} - LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} - ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - endif() - add_subdirectory(Test) endif() diff --git a/src/Magnum/Text/AbstractFont.cpp b/src/Magnum/Text/AbstractFont.cpp index 7f309dfd0..17db62cda 100644 --- a/src/Magnum/Text/AbstractFont.cpp +++ b/src/Magnum/Text/AbstractFont.cpp @@ -50,24 +50,24 @@ std::string AbstractFont::pluginInterface() { std::vector AbstractFont::pluginSearchPaths() { return { #ifdef CORRADE_IS_DEBUG_BUILD - #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_BUILD_STATIC) - Utility::Directory::join(Utility::Directory::path(Utility::Directory::dllLocation( - #ifdef __MINGW32__ - "lib" - #endif - "MagnumText-d")), "magnum-d/fonts"), + #ifndef MAGNUM_BUILD_STATIC + Utility::Directory::join(Utility::Directory::path(Utility::Directory::libraryLocation(&pluginInterface)), "magnum-d/fonts"), #else + #ifndef MAGNUM_TARGET_WINDOWS + /* On Windows, the plugin DLLs are next to the executable, so the one + below works. Elsewhere the plugins are in the lib dir instead */ + "../lib/magnum-d/fonts", + #endif "magnum-d/fonts", #endif Utility::Directory::join(MAGNUM_PLUGINS_DEBUG_DIR, "fonts") #else - #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_BUILD_STATIC) - Utility::Directory::join(Utility::Directory::path(Utility::Directory::dllLocation( - #ifdef __MINGW32__ - "lib" - #endif - "MagnumText")), "magnum/fonts"), + #ifndef MAGNUM_BUILD_STATIC + Utility::Directory::join(Utility::Directory::path(Utility::Directory::libraryLocation(&pluginInterface)), "magnum/fonts"), #else + #ifndef MAGNUM_TARGET_WINDOWS + "../lib/magnum/fonts", + #endif "magnum/fonts", #endif Utility::Directory::join(MAGNUM_PLUGINS_DIR, "fonts") diff --git a/src/Magnum/Text/AbstractFontConverter.cpp b/src/Magnum/Text/AbstractFontConverter.cpp index 1fe569a24..a37acda9f 100644 --- a/src/Magnum/Text/AbstractFontConverter.cpp +++ b/src/Magnum/Text/AbstractFontConverter.cpp @@ -64,23 +64,15 @@ std::string AbstractFontConverter::pluginInterface() { std::vector AbstractFontConverter::pluginSearchPaths() { return { #ifdef CORRADE_IS_DEBUG_BUILD - #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_BUILD_STATIC) - Utility::Directory::join(Utility::Directory::path(Utility::Directory::dllLocation( - #ifdef __MINGW32__ - "lib" - #endif - "MagnumText-d")), "magnum-d/fontconverters"), + #ifndef MAGNUM_BUILD_STATIC + Utility::Directory::join(Utility::Directory::path(Utility::Directory::libraryLocation(&pluginInterface)), "magnum-d/fontconverters"), #else "magnum-d/fontconverters", #endif Utility::Directory::join(MAGNUM_PLUGINS_DEBUG_DIR, "fontconverters") #else - #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_BUILD_STATIC) - Utility::Directory::join(Utility::Directory::path(Utility::Directory::dllLocation( - #ifdef __MINGW32__ - "lib" - #endif - "MagnumText")), "magnum/fontconverters"), + #ifndef MAGNUM_BUILD_STATIC + Utility::Directory::join(Utility::Directory::path(Utility::Directory::libraryLocation(&pluginInterface)), "magnum/fontconverters"), #else "magnum/fontconverters", #endif diff --git a/src/Magnum/Text/CMakeLists.txt b/src/Magnum/Text/CMakeLists.txt index 72eca933e..302b6195f 100644 --- a/src/Magnum/Text/CMakeLists.txt +++ b/src/Magnum/Text/CMakeLists.txt @@ -163,15 +163,6 @@ if(BUILD_TESTS) target_link_libraries(MagnumText PUBLIC MagnumGL) endif() - # On Windows we need to install first and then run the tests to avoid "DLL - # not found" hell, thus we need to install this too - if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING AND NOT BUILD_STATIC) - install(TARGETS MagnumTextTestLib - RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} - LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} - ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - endif() - add_subdirectory(Test) endif() diff --git a/src/Magnum/Trade/AbstractImageConverter.cpp b/src/Magnum/Trade/AbstractImageConverter.cpp index 2cbd77c20..e14d04166 100644 --- a/src/Magnum/Trade/AbstractImageConverter.cpp +++ b/src/Magnum/Trade/AbstractImageConverter.cpp @@ -50,24 +50,24 @@ std::string AbstractImageConverter::pluginInterface() { std::vector AbstractImageConverter::pluginSearchPaths() { return { #ifdef CORRADE_IS_DEBUG_BUILD - #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_BUILD_STATIC) - Utility::Directory::join(Utility::Directory::path(Utility::Directory::dllLocation( - #ifdef __MINGW32__ - "lib" - #endif - "MagnumTrade-d")), "magnum-d/imageconverters"), + #ifndef MAGNUM_BUILD_STATIC + Utility::Directory::join(Utility::Directory::path(Utility::Directory::libraryLocation(&pluginInterface)), "magnum-d/imageconverters"), #else + #ifndef MAGNUM_TARGET_WINDOWS + /* On Windows, the plugin DLLs are next to the executable, so the one + below works. Elsewhere the plugins are in the lib dir instead */ + "../lib/magnum-d/imageconverters", + #endif "magnum-d/imageconverters", #endif Utility::Directory::join(MAGNUM_PLUGINS_DEBUG_DIR, "imageconverters") #else - #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_BUILD_STATIC) - Utility::Directory::join(Utility::Directory::path(Utility::Directory::dllLocation( - #ifdef __MINGW32__ - "lib" - #endif - "MagnumTrade")), "magnum/imageconverters"), + #ifndef MAGNUM_BUILD_STATIC + Utility::Directory::join(Utility::Directory::path(Utility::Directory::libraryLocation(&pluginInterface)), "magnum/imageconverters"), #else + #ifndef MAGNUM_TARGET_WINDOWS + "../lib/magnum/imageconverters", + #endif "magnum/imageconverters", #endif Utility::Directory::join(MAGNUM_PLUGINS_DIR, "imageconverters") diff --git a/src/Magnum/Trade/AbstractImporter.cpp b/src/Magnum/Trade/AbstractImporter.cpp index b021580f2..337b8578e 100644 --- a/src/Magnum/Trade/AbstractImporter.cpp +++ b/src/Magnum/Trade/AbstractImporter.cpp @@ -59,26 +59,26 @@ std::string AbstractImporter::pluginInterface() { std::vector AbstractImporter::pluginSearchPaths() { return { #ifdef CORRADE_IS_DEBUG_BUILD - #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_BUILD_STATIC) - Utility::Directory::join(Utility::Directory::path(Utility::Directory::dllLocation( - #ifdef __MINGW32__ - "lib" - #endif - "MagnumTrade-d")), "magnum-d/importers"), + #ifndef MAGNUM_BUILD_STATIC + Utility::Directory::join(Utility::Directory::path(Utility::Directory::libraryLocation(&pluginInterface)), "magnum-d/importers"), #else + #ifndef MAGNUM_TARGET_WINDOWS + /* On Windows, the plugin DLLs are next to the executable, so the one + below works. Elsewhere the plugins are in the lib dir instead */ + "../lib/magnum-d/importers", + #endif "magnum-d/importers", #endif Utility::Directory::join(MAGNUM_PLUGINS_DEBUG_DIR, "importers") #ifdef CORRADE_TARGET_WINDOWS #endif #else - #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_BUILD_STATIC) - Utility::Directory::join(Utility::Directory::path(Utility::Directory::dllLocation( - #ifdef __MINGW32__ - "lib" - #endif - "MagnumTrade")), "magnum/importers"), + #ifndef MAGNUM_BUILD_STATIC + Utility::Directory::join(Utility::Directory::path(Utility::Directory::libraryLocation(&pluginInterface)), "magnum/importers"), #else + #ifndef MAGNUM_TARGET_WINDOWS + "../lib/magnum/importers", + #endif "magnum/importers", #endif Utility::Directory::join(MAGNUM_PLUGINS_DIR, "importers") diff --git a/src/Magnum/Trade/CMakeLists.txt b/src/Magnum/Trade/CMakeLists.txt index a4447702f..00ad7e666 100644 --- a/src/Magnum/Trade/CMakeLists.txt +++ b/src/Magnum/Trade/CMakeLists.txt @@ -138,15 +138,6 @@ if(BUILD_TESTS) Magnum Corrade::PluginManager) - # On Windows we need to install first and then run the tests to avoid "DLL - # not found" hell, thus we need to install this too - if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING AND NOT BUILD_STATIC) - install(TARGETS MagnumTradeTestLib - RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} - LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} - ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - endif() - add_subdirectory(Test) endif() diff --git a/src/Magnum/Vk/CMakeLists.txt b/src/Magnum/Vk/CMakeLists.txt index aec2fe8e8..a2dcf4490 100644 --- a/src/Magnum/Vk/CMakeLists.txt +++ b/src/Magnum/Vk/CMakeLists.txt @@ -104,15 +104,6 @@ if(BUILD_TESTS) Magnum Vulkan::Vulkan) - # On Windows we need to install first and then run the tests to avoid "DLL - # not found" hell, thus we need to install this too - if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING AND NOT BUILD_STATIC) - install(TARGETS MagnumVkTestLib - RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} - LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} - ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - endif() - add_subdirectory(Test) endif() diff --git a/src/MagnumPlugins/AnyAudioImporter/CMakeLists.txt b/src/MagnumPlugins/AnyAudioImporter/CMakeLists.txt index 077502c36..411615631 100644 --- a/src/MagnumPlugins/AnyAudioImporter/CMakeLists.txt +++ b/src/MagnumPlugins/AnyAudioImporter/CMakeLists.txt @@ -43,6 +43,10 @@ if(BUILD_PLUGINS_STATIC AND BUILD_STATIC_PIC) set_target_properties(AnyAudioImporter PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() target_link_libraries(AnyAudioImporter PUBLIC Magnum MagnumAudio) +set_target_properties(AnyAudioImporter PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/magnum$<$:-d>/audioimporters + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/magnum$<$:-d>/audioimporters + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/magnum$<$:-d>/audioimporters) install(FILES AnyImporter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/AnyAudioImporter) diff --git a/src/MagnumPlugins/AnyImageConverter/CMakeLists.txt b/src/MagnumPlugins/AnyImageConverter/CMakeLists.txt index 4c4ebfdcc..2df7c2756 100644 --- a/src/MagnumPlugins/AnyImageConverter/CMakeLists.txt +++ b/src/MagnumPlugins/AnyImageConverter/CMakeLists.txt @@ -43,6 +43,10 @@ if(BUILD_PLUGINS_STATIC AND BUILD_STATIC_PIC) set_target_properties(AnyImageConverter PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() target_link_libraries(AnyImageConverter PUBLIC MagnumTrade) +set_target_properties(AnyImageConverter PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/magnum$<$:-d>/imageconverters + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/magnum$<$:-d>/imageconverters + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/magnum$<$:-d>/imageconverters) install(FILES AnyImageConverter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/AnyImageConverter) diff --git a/src/MagnumPlugins/AnyImageImporter/CMakeLists.txt b/src/MagnumPlugins/AnyImageImporter/CMakeLists.txt index 16069238e..b8b540018 100644 --- a/src/MagnumPlugins/AnyImageImporter/CMakeLists.txt +++ b/src/MagnumPlugins/AnyImageImporter/CMakeLists.txt @@ -43,6 +43,10 @@ if(BUILD_PLUGINS_STATIC AND BUILD_STATIC_PIC) set_target_properties(AnyImageImporter PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() target_link_libraries(AnyImageImporter PUBLIC MagnumTrade) +set_target_properties(AnyImageImporter PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/magnum$<$:-d>/importers + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/magnum$<$:-d>/importers + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/magnum$<$:-d>/importers) install(FILES AnyImageImporter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/AnyImageImporter) diff --git a/src/MagnumPlugins/AnySceneImporter/CMakeLists.txt b/src/MagnumPlugins/AnySceneImporter/CMakeLists.txt index b68cff3b6..1d7884333 100644 --- a/src/MagnumPlugins/AnySceneImporter/CMakeLists.txt +++ b/src/MagnumPlugins/AnySceneImporter/CMakeLists.txt @@ -43,6 +43,10 @@ if(BUILD_PLUGINS_STATIC AND BUILD_STATIC_PIC) set_target_properties(AnySceneImporter PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() target_link_libraries(AnySceneImporter PUBLIC MagnumTrade) +set_target_properties(AnySceneImporter PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/magnum$<$:-d>/importers + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/magnum$<$:-d>/importers + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/magnum$<$:-d>/importers) install(FILES AnySceneImporter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/AnySceneImporter) diff --git a/src/MagnumPlugins/MagnumFont/CMakeLists.txt b/src/MagnumPlugins/MagnumFont/CMakeLists.txt index e6f27638d..0bdcdd673 100644 --- a/src/MagnumPlugins/MagnumFont/CMakeLists.txt +++ b/src/MagnumPlugins/MagnumFont/CMakeLists.txt @@ -52,6 +52,10 @@ target_link_libraries(MagnumFont PUBLIC Magnum MagnumText MagnumTrade) if(CORRADE_TARGET_WINDOWS) target_link_libraries(MagnumFont PUBLIC TgaImporter) endif() +set_target_properties(MagnumFont PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/magnum$<$:-d>/fonts + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/magnum$<$:-d>/fonts + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/magnum$<$:-d>/fonts) install(FILES MagnumFont.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/MagnumFont) diff --git a/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt b/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt index 7a7fee489..dc812426e 100644 --- a/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt +++ b/src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt @@ -46,6 +46,10 @@ target_link_libraries(MagnumFontConverter PUBLIC Magnum MagnumText MagnumTrade) if(CORRADE_TARGET_WINDOWS) target_link_libraries(MagnumFontConverter PUBLIC TgaImageConverter) endif() +set_target_properties(MagnumFontConverter PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/magnum$<$:-d>/fontconverters + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/magnum$<$:-d>/fontconverters + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/magnum$<$:-d>/fontconverters) install(FILES MagnumFontConverter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/MagnumFontConverter) diff --git a/src/MagnumPlugins/ObjImporter/CMakeLists.txt b/src/MagnumPlugins/ObjImporter/CMakeLists.txt index 29613b7dd..2eeb85e2c 100644 --- a/src/MagnumPlugins/ObjImporter/CMakeLists.txt +++ b/src/MagnumPlugins/ObjImporter/CMakeLists.txt @@ -43,6 +43,10 @@ if(BUILD_PLUGINS_STATIC AND BUILD_STATIC_PIC) set_target_properties(ObjImporter PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() target_link_libraries(ObjImporter PUBLIC MagnumTrade MagnumMeshTools) +set_target_properties(ObjImporter PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/magnum$<$:-d>/importers + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/magnum$<$:-d>/importers + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/magnum$<$:-d>/importers) install(FILES ObjImporter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/ObjImporter) diff --git a/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt b/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt index d5a901c73..4b95f7b65 100644 --- a/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt +++ b/src/MagnumPlugins/TgaImageConverter/CMakeLists.txt @@ -43,6 +43,10 @@ if(BUILD_PLUGINS_STATIC AND BUILD_STATIC_PIC) set_target_properties(TgaImageConverter PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() target_link_libraries(TgaImageConverter PUBLIC MagnumTrade) +set_target_properties(TgaImageConverter PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/magnum$<$:-d>/imageconverters + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/magnum$<$:-d>/imageconverters + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/magnum$<$:-d>/imageconverters) install(FILES TgaImageConverter.h DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImageConverter) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/configure.h DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImageConverter) diff --git a/src/MagnumPlugins/TgaImporter/CMakeLists.txt b/src/MagnumPlugins/TgaImporter/CMakeLists.txt index 7ae54c746..a7c2c07b6 100644 --- a/src/MagnumPlugins/TgaImporter/CMakeLists.txt +++ b/src/MagnumPlugins/TgaImporter/CMakeLists.txt @@ -44,6 +44,10 @@ if(BUILD_PLUGINS_STATIC AND BUILD_STATIC_PIC) set_target_properties(TgaImporter PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() target_link_libraries(TgaImporter PUBLIC MagnumTrade) +set_target_properties(TgaImporter PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/magnum$<$:-d>/importers + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/magnum$<$:-d>/importers + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/magnum$<$:-d>/importers) install(FILES TgaImporter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImporter) diff --git a/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt b/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt index 0ea786a25..e529c811c 100644 --- a/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt +++ b/src/MagnumPlugins/WavAudioImporter/CMakeLists.txt @@ -59,6 +59,10 @@ if(BUILD_PLUGINS_STATIC AND BUILD_STATIC_PIC) set_target_properties(WavAudioImporter PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() target_link_libraries(WavAudioImporter PUBLIC Magnum MagnumAudio) +set_target_properties(WavAudioImporter PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/magnum$<$:-d>/audioimporters + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/magnum$<$:-d>/audioimporters + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/magnum$<$:-d>/audioimporters) install(FILES WavImporter.h ${CMAKE_CURRENT_BINARY_DIR}/configure.h DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/WavAudioImporter)