diff --git a/doc/changelog.dox b/doc/changelog.dox index 889b7ce99..0c4477d5f 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -138,6 +138,9 @@ See also: [mosra/magnum#297](https://github.com/mosra/magnum/pull/297)) - Imroved initial Emscripten setup on Windows to be more frictionless (see [mosra/toolchains#4](https://github.com/mosra/toolchains/pull/4)) +- @ref DebugTools no longer unconditionally requires the @ref Trade library + in case @ref Corrade::TestSuite is found. The @ref DebugTools::CompareImage + documentation was updated to mention the optionality. @subsection changelog-latest-bugfixes Bug fixes diff --git a/src/Magnum/DebugTools/CMakeLists.txt b/src/Magnum/DebugTools/CMakeLists.txt index 81f9dbfcd..bba931e32 100644 --- a/src/Magnum/DebugTools/CMakeLists.txt +++ b/src/Magnum/DebugTools/CMakeLists.txt @@ -110,7 +110,7 @@ endif() # Build the TestSuite-related functionality only if it is present find_package(Corrade COMPONENTS TestSuite) -if(Corrade_TestSuite_FOUND) +if(Corrade_TestSuite_FOUND AND WITH_TRADE) list(APPEND MagnumDebugTools_GracefulAssert_SRCS CompareImage.cpp) @@ -148,7 +148,7 @@ elseif(BUILD_STATIC_PIC) set_target_properties(MagnumDebugTools PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() target_link_libraries(MagnumDebugTools PUBLIC Magnum) -if(Corrade_TestSuite_FOUND) +if(Corrade_TestSuite_FOUND AND WITH_TRADE) target_link_libraries(MagnumDebugTools PUBLIC Corrade::TestSuite MagnumTrade) @@ -189,7 +189,7 @@ if(BUILD_TESTS) set_target_properties(MagnumDebugToolsTestLib PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() target_link_libraries(MagnumDebugToolsTestLib PUBLIC Magnum) - if(Corrade_TestSuite_FOUND) + if(Corrade_TestSuite_FOUND AND WITH_TRADE) target_link_libraries(MagnumDebugToolsTestLib PUBLIC Corrade::TestSuite MagnumTrade) diff --git a/src/Magnum/DebugTools/CompareImage.h b/src/Magnum/DebugTools/CompareImage.h index 74b1af956..215f79095 100644 --- a/src/Magnum/DebugTools/CompareImage.h +++ b/src/Magnum/DebugTools/CompareImage.h @@ -142,7 +142,12 @@ namespace Magnum { namespace DebugTools { /** @brief Image comparator -To be used with @ref Corrade::TestSuite. Basic use is really simple: +To be used with @ref Corrade::TestSuite. + +@note This class is available only if Magnum is compiled with `WITH_TRADE` + enabled (done by default). See @ref building-features for more information. + +Basic use is really simple: @snippet debugtools-compareimage.cpp 0 diff --git a/src/Magnum/DebugTools/Test/CMakeLists.txt b/src/Magnum/DebugTools/Test/CMakeLists.txt index 73ce4b5ce..3e8a07032 100644 --- a/src/Magnum/DebugTools/Test/CMakeLists.txt +++ b/src/Magnum/DebugTools/Test/CMakeLists.txt @@ -23,7 +23,7 @@ # DEALINGS IN THE SOFTWARE. # -if(Corrade_TestSuite_FOUND) +if(WITH_TRADE) # Otherwise CMake complains that Corrade::PluginManager is not found, wtf find_package(Corrade REQUIRED PluginManager)