Browse Source

DebugTools: fix a build system corner case.

simd
Vladimír Vondruš 7 years ago
parent
commit
6bd44bffd6
  1. 3
      doc/changelog.dox
  2. 6
      src/Magnum/DebugTools/CMakeLists.txt
  3. 7
      src/Magnum/DebugTools/CompareImage.h
  4. 2
      src/Magnum/DebugTools/Test/CMakeLists.txt

3
doc/changelog.dox

@ -138,6 +138,9 @@ See also:
[mosra/magnum#297](https://github.com/mosra/magnum/pull/297)) [mosra/magnum#297](https://github.com/mosra/magnum/pull/297))
- Imroved initial Emscripten setup on Windows to be more frictionless (see - Imroved initial Emscripten setup on Windows to be more frictionless (see
[mosra/toolchains#4](https://github.com/mosra/toolchains/pull/4)) [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 @subsection changelog-latest-bugfixes Bug fixes

6
src/Magnum/DebugTools/CMakeLists.txt

@ -110,7 +110,7 @@ endif()
# Build the TestSuite-related functionality only if it is present # Build the TestSuite-related functionality only if it is present
find_package(Corrade COMPONENTS TestSuite) find_package(Corrade COMPONENTS TestSuite)
if(Corrade_TestSuite_FOUND) if(Corrade_TestSuite_FOUND AND WITH_TRADE)
list(APPEND MagnumDebugTools_GracefulAssert_SRCS list(APPEND MagnumDebugTools_GracefulAssert_SRCS
CompareImage.cpp) CompareImage.cpp)
@ -148,7 +148,7 @@ elseif(BUILD_STATIC_PIC)
set_target_properties(MagnumDebugTools PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties(MagnumDebugTools PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif() endif()
target_link_libraries(MagnumDebugTools PUBLIC Magnum) target_link_libraries(MagnumDebugTools PUBLIC Magnum)
if(Corrade_TestSuite_FOUND) if(Corrade_TestSuite_FOUND AND WITH_TRADE)
target_link_libraries(MagnumDebugTools PUBLIC target_link_libraries(MagnumDebugTools PUBLIC
Corrade::TestSuite Corrade::TestSuite
MagnumTrade) MagnumTrade)
@ -189,7 +189,7 @@ if(BUILD_TESTS)
set_target_properties(MagnumDebugToolsTestLib PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties(MagnumDebugToolsTestLib PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif() endif()
target_link_libraries(MagnumDebugToolsTestLib PUBLIC Magnum) target_link_libraries(MagnumDebugToolsTestLib PUBLIC Magnum)
if(Corrade_TestSuite_FOUND) if(Corrade_TestSuite_FOUND AND WITH_TRADE)
target_link_libraries(MagnumDebugToolsTestLib PUBLIC target_link_libraries(MagnumDebugToolsTestLib PUBLIC
Corrade::TestSuite Corrade::TestSuite
MagnumTrade) MagnumTrade)

7
src/Magnum/DebugTools/CompareImage.h

@ -142,7 +142,12 @@ namespace Magnum { namespace DebugTools {
/** /**
@brief Image comparator @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 @snippet debugtools-compareimage.cpp 0

2
src/Magnum/DebugTools/Test/CMakeLists.txt

@ -23,7 +23,7 @@
# DEALINGS IN THE SOFTWARE. # DEALINGS IN THE SOFTWARE.
# #
if(Corrade_TestSuite_FOUND) if(WITH_TRADE)
# Otherwise CMake complains that Corrade::PluginManager is not found, wtf # Otherwise CMake complains that Corrade::PluginManager is not found, wtf
find_package(Corrade REQUIRED PluginManager) find_package(Corrade REQUIRED PluginManager)

Loading…
Cancel
Save