diff --git a/src/Math/Vector.h b/src/Math/Vector.h index e0f2d8a92..ccde04b55 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -550,7 +550,7 @@ template class Vector { private: /* Implementation for Vector::Vector(const Vector&) */ - template constexpr explicit Vector(Implementation::Sequence, const Vector& vector): + template constexpr explicit Vector(Implementation::Sequence, const Vector& vector): #ifndef CORRADE_MSVC2013_COMPATIBILITY _data{T(vector._data[sequence])...} {} #else diff --git a/src/Plugins/MagnumFont/CMakeLists.txt b/src/Plugins/MagnumFont/CMakeLists.txt index 9ea4bb7a8..8c6a47117 100644 --- a/src/Plugins/MagnumFont/CMakeLists.txt +++ b/src/Plugins/MagnumFont/CMakeLists.txt @@ -46,5 +46,15 @@ install(FILES ${MagnumFont_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL if(BUILD_GL_TESTS) add_library(MagnumFontTestLib STATIC $) target_link_libraries(MagnumFontTestLib Magnum MagnumText TgaImporterTestLib) + + # 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(WIN32 AND NOT CMAKE_CROSSCOMPILING) + install(TARGETS MagnumFontTestLib + 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/Plugins/MagnumFontConverter/CMakeLists.txt b/src/Plugins/MagnumFontConverter/CMakeLists.txt index f73442afb..5f590b7e8 100644 --- a/src/Plugins/MagnumFontConverter/CMakeLists.txt +++ b/src/Plugins/MagnumFontConverter/CMakeLists.txt @@ -46,5 +46,15 @@ install(FILES ${MagnumFontConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUD if(BUILD_GL_TESTS) add_library(MagnumFontConverterTestLib STATIC $) target_link_libraries(MagnumFontConverterTestLib Magnum MagnumText TgaImageConverterTestLib) + + # 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(WIN32 AND NOT CMAKE_CROSSCOMPILING) + install(TARGETS MagnumFontConverterTestLib + 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/Plugins/TgaImageConverter/CMakeLists.txt b/src/Plugins/TgaImageConverter/CMakeLists.txt index ddbb4149a..1efdd806e 100644 --- a/src/Plugins/TgaImageConverter/CMakeLists.txt +++ b/src/Plugins/TgaImageConverter/CMakeLists.txt @@ -42,5 +42,15 @@ install(FILES ${TgaImageConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_ if(BUILD_TESTS) add_library(TgaImageConverterTestLib ${SHARED_OR_STATIC} $) target_link_libraries(TgaImageConverterTestLib Magnum) + + # 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(WIN32 AND NOT CMAKE_CROSSCOMPILING) + install(TARGETS TgaImageConverterTestLib + 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/Plugins/TgaImporter/CMakeLists.txt b/src/Plugins/TgaImporter/CMakeLists.txt index 5f87fab56..2f893e5f0 100644 --- a/src/Plugins/TgaImporter/CMakeLists.txt +++ b/src/Plugins/TgaImporter/CMakeLists.txt @@ -43,5 +43,15 @@ install(FILES ${TgaImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTAL if(BUILD_TESTS) add_library(TgaImporterTestLib ${SHARED_OR_STATIC} $) target_link_libraries(TgaImporterTestLib Magnum) + + # 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(WIN32 AND NOT CMAKE_CROSSCOMPILING) + install(TARGETS TgaImporterTestLib + 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/Plugins/WavAudioImporter/CMakeLists.txt b/src/Plugins/WavAudioImporter/CMakeLists.txt index 477f04e53..a1a406d74 100644 --- a/src/Plugins/WavAudioImporter/CMakeLists.txt +++ b/src/Plugins/WavAudioImporter/CMakeLists.txt @@ -47,5 +47,15 @@ install(FILES ${WavAudioImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_I if(BUILD_TESTS) add_library(WavAudioImporterTestLib STATIC $) target_link_libraries(WavAudioImporterTestLib Magnum MagnumAudio) + + # 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(WIN32 AND NOT CMAKE_CROSSCOMPILING) + install(TARGETS WavAudioImporterTestLib + 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/SceneGraph/AbstractCamera.h b/src/SceneGraph/AbstractCamera.h index 304bf95b8..986769565 100644 --- a/src/SceneGraph/AbstractCamera.h +++ b/src/SceneGraph/AbstractCamera.h @@ -73,7 +73,7 @@ and @ref Camera3D-explicit-specializations "Camera3D" class documentation or @see @ref scenegraph, @ref AbstractBasicCamera2D, @ref AbstractBasicCamera3D, @ref Drawable, @ref DrawableGroup */ -template class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera: public AbstractFeature { +template class AbstractCamera: public AbstractFeature { public: /** @brief Aspect ratio policy */ AspectRatioPolicy aspectRatioPolicy() const { return _aspectRatioPolicy; } @@ -215,6 +215,11 @@ typedef AbstractBasicCamera3D AbstractCamera3D; typedef AbstractCamera<3, Float> AbstractCamera3D; #endif +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera<2, Float>; +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera<3, Float>; +#endif + }} #endif diff --git a/src/SceneGraph/AbstractFeature.h b/src/SceneGraph/AbstractFeature.h index f4c7895e7..1488c056f 100644 --- a/src/SceneGraph/AbstractFeature.h +++ b/src/SceneGraph/AbstractFeature.h @@ -160,7 +160,7 @@ also @ref compilation-speedup-hpp for more information. @see @ref AbstractBasicFeature2D, @ref AbstractBasicFeature3D, @ref AbstractFeature2D, @ref AbstractFeature3D */ -template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature +template class AbstractFeature #ifndef DOXYGEN_GENERATING_OUTPUT : private Containers::LinkedListItem, AbstractObject> #endif @@ -349,6 +349,11 @@ typedef AbstractBasicFeature3D AbstractFeature3D; typedef AbstractFeature<3, Float> AbstractFeature3D; #endif +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<2, Float>; +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<3, Float>; +#endif + }} #endif diff --git a/src/SceneGraph/AbstractObject.h b/src/SceneGraph/AbstractObject.h index b3bfefa78..d804f678e 100644 --- a/src/SceneGraph/AbstractObject.h +++ b/src/SceneGraph/AbstractObject.h @@ -69,7 +69,7 @@ class documentation or @ref compilation-speedup-hpp for more information. @see @ref AbstractBasicObject2D, @ref AbstractBasicObject3D, @ref AbstractObject2D, @ref AbstractObject3D */ -template class MAGNUM_SCENEGRAPH_EXPORT AbstractObject +template class AbstractObject #ifndef DOXYGEN_GENERATING_OUTPUT : private Containers::LinkedList> #endif @@ -285,6 +285,11 @@ typedef AbstractBasicObject3D AbstractObject3D; typedef AbstractObject<3, Float> AbstractObject3D; #endif +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractObject<2, Float>; +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractObject<3, Float>; +#endif + }} #endif diff --git a/src/SceneGraph/AbstractTransformation.h b/src/SceneGraph/AbstractTransformation.h index e5ffb822a..49a02d052 100644 --- a/src/SceneGraph/AbstractTransformation.h +++ b/src/SceneGraph/AbstractTransformation.h @@ -52,7 +52,7 @@ use @ref Object.hpp implementation file to avoid linker errors. See @ref AbstractBasicTransformation3D, @ref AbstractTransformation2D, @ref AbstractTransformation3D */ -template class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation { +template class AbstractTransformation { public: /** @brief Underlying floating-point type */ typedef T Type; @@ -150,6 +150,11 @@ typedef AbstractBasicTransformation3D AbstractTransformation3D; typedef AbstractTransformation<3, Float> AbstractTransformation3D; #endif +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation<2, Float>; +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation<3, Float>; +#endif + }} #endif diff --git a/src/SceneGraph/AbstractTranslation.h b/src/SceneGraph/AbstractTranslation.h index 88e6be3b5..d1422438a 100644 --- a/src/SceneGraph/AbstractTranslation.h +++ b/src/SceneGraph/AbstractTranslation.h @@ -62,7 +62,7 @@ class AbstractTranslation: public AbstractTransformation { * @see @ref Vector2::xAxis(), @ref Vector2::yAxis(), @ref Vector3::xAxis(), * @ref Vector3::yAxis(), @ref Vector3::zAxis() */ - AbstractTranslation& translate(const typename DimensionTraits::VectorType& vector, TransformationType type = TransformationType::Global) { + AbstractTranslation& translate(const typename DimensionTraits::VectorType& vector, TransformationType type = TransformationType::Global) { doTranslate(vector, type); return *this; } diff --git a/src/SceneGraph/Animable.cpp b/src/SceneGraph/Animable.cpp index 1087f8371..d4b41833f 100644 --- a/src/SceneGraph/Animable.cpp +++ b/src/SceneGraph/Animable.cpp @@ -22,17 +22,10 @@ DEALINGS IN THE SOFTWARE. */ -#include "Animable.hpp" +#include "Animable.h" namespace Magnum { namespace SceneGraph { -#ifndef DOXYGEN_GENERATING_OUTPUT -template class MAGNUM_SCENEGRAPH_EXPORT Animable<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT Animable<3, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<3, Float>; -#endif - Debug operator<<(Debug debug, AnimationState value) { switch(value) { #define _c(value) case AnimationState::value: return debug << "SceneGraph::AnimationState::" #value; diff --git a/src/SceneGraph/Animable.h b/src/SceneGraph/Animable.h index 5031edaa9..9917c115a 100644 --- a/src/SceneGraph/Animable.h +++ b/src/SceneGraph/Animable.h @@ -140,7 +140,7 @@ use @ref Animable.hpp implementation file to avoid linker errors. See also @see @ref scenegraph, @ref BasicAnimable2D, @ref BasicAnimable3D, @ref Animable2D, @ref Animable3D, @ref AnimableGroup */ -template class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractGroupedFeature, T> { +template class Animable: public AbstractGroupedFeature, T> { friend class AnimableGroup; public: @@ -388,6 +388,11 @@ typedef BasicAnimable3D Animable3D; typedef Animable<3, Float> Animable3D; #endif +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Animable<2, Float>; +extern template class MAGNUM_SCENEGRAPH_EXPORT Animable<3, Float>; +#endif + }} #endif diff --git a/src/SceneGraph/AnimableGroup.h b/src/SceneGraph/AnimableGroup.h index 8d62cdda7..4b7ae52eb 100644 --- a/src/SceneGraph/AnimableGroup.h +++ b/src/SceneGraph/AnimableGroup.h @@ -41,7 +41,7 @@ See Animable for more information. @see @ref scenegraph, @ref BasicAnimableGroup2D, @ref BasicAnimableGroup3D, @ref AnimableGroup2D, @ref AnimableGroup3D */ -template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup: public FeatureGroup, T> { +template class AnimableGroup: public FeatureGroup, T> { friend class Animable; public: @@ -126,6 +126,11 @@ typedef BasicAnimableGroup3D AnimableGroup3D; typedef AnimableGroup<3, Float> AnimableGroup3D; #endif +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<2, Float>; +extern template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<3, Float>; +#endif + }} #endif diff --git a/src/SceneGraph/Camera2D.h b/src/SceneGraph/Camera2D.h index 7d0b982b6..09183c9ef 100644 --- a/src/SceneGraph/Camera2D.h +++ b/src/SceneGraph/Camera2D.h @@ -57,7 +57,7 @@ class documentation or @ref compilation-speedup-hpp for more information. @see @ref scenegraph, @ref Camera2D, @ref BasicCamera3D, @ref Drawable, @ref DrawableGroup */ -template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera2D: public AbstractCamera<2, T> { +template class BasicCamera2D: public AbstractCamera<2, T> { public: /** * @brief Constructor @@ -105,6 +105,10 @@ template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera2D: public AbstractC */ typedef BasicCamera2D Camera2D; +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera2D; +#endif + }} #endif diff --git a/src/SceneGraph/Camera3D.h b/src/SceneGraph/Camera3D.h index c33c843c0..8b126458b 100644 --- a/src/SceneGraph/Camera3D.h +++ b/src/SceneGraph/Camera3D.h @@ -62,7 +62,7 @@ class documentation or @ref compilation-speedup-hpp for more information. @see @ref scenegraph, @ref Camera3D, @ref BasicCamera2D, @ref Drawable, @ref DrawableGroup */ -template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera3D: public AbstractCamera<3, T> { +template class BasicCamera3D: public AbstractCamera<3, T> { public: /** * @brief Constructor @@ -141,6 +141,10 @@ template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera3D: public AbstractC */ typedef BasicCamera3D Camera3D; +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera3D; +#endif + }} #endif diff --git a/src/SceneGraph/DualComplexTransformation.h b/src/SceneGraph/DualComplexTransformation.h index a95d94365..be97fe9be 100644 --- a/src/SceneGraph/DualComplexTransformation.h +++ b/src/SceneGraph/DualComplexTransformation.h @@ -117,17 +117,6 @@ template class BasicDualComplexTransformation: public AbstractBasicTran return transformInternal(Math::DualComplex::rotation(angle), type); } - /** - * @brief Move object in stacking order - * @param under Sibling object under which to move or `nullptr`, - * if you want to move it above all. - * @return Reference to self (for method chaining) - */ - Object>& move(Object>* under) { - static_cast*>(this)->Containers::template LinkedList>>::move(this, under); - return static_cast>&>(*this); - } - protected: /* Allow construction only from Object */ explicit BasicDualComplexTransformation(); @@ -196,6 +185,10 @@ template struct Transformation> { } +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +#endif + }} #endif diff --git a/src/SceneGraph/DualQuaternionTransformation.h b/src/SceneGraph/DualQuaternionTransformation.h index 718be0c70..8109c40eb 100644 --- a/src/SceneGraph/DualQuaternionTransformation.h +++ b/src/SceneGraph/DualQuaternionTransformation.h @@ -202,6 +202,10 @@ template struct Transformation> { } +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +#endif + }} #endif diff --git a/src/SceneGraph/FeatureGroup.h b/src/SceneGraph/FeatureGroup.h index 0cd2168a0..d3d6f2f07 100644 --- a/src/SceneGraph/FeatureGroup.h +++ b/src/SceneGraph/FeatureGroup.h @@ -41,7 +41,7 @@ namespace Magnum { namespace SceneGraph { See @ref FeatureGroup. */ -template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeatureGroup { +template class AbstractFeatureGroup { template friend class FeatureGroup; explicit AbstractFeatureGroup(); @@ -193,6 +193,11 @@ template FeatureGroup; +extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeatureGroup<3, Float>; +#endif + }} #endif diff --git a/src/SceneGraph/MatrixTransformation2D.h b/src/SceneGraph/MatrixTransformation2D.h index 3bc5f24db..6ae7a5254 100644 --- a/src/SceneGraph/MatrixTransformation2D.h +++ b/src/SceneGraph/MatrixTransformation2D.h @@ -117,17 +117,6 @@ template class BasicMatrixTransformation2D: public AbstractBasicTransla return transform(Math::Matrix3::reflection(normal), type); } - /** - * @brief Move object in stacking order - * @param under Sibling object under which to move or `nullptr`, - * if you want to move it above all. - * @return Reference to self (for method chaining) - */ - Object>& move(Object>* under) { - static_cast*>(this)->Containers::template LinkedList>>::move(this, under); - return static_cast>&>(*this); - } - protected: /* Allow construction only from Object */ explicit BasicMatrixTransformation2D(); @@ -181,6 +170,10 @@ template struct Transformation> { } +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +#endif + }} #endif diff --git a/src/SceneGraph/MatrixTransformation3D.h b/src/SceneGraph/MatrixTransformation3D.h index 742fe3d27..032a38122 100644 --- a/src/SceneGraph/MatrixTransformation3D.h +++ b/src/SceneGraph/MatrixTransformation3D.h @@ -218,6 +218,10 @@ template struct Transformation> { } +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +#endif + }} #endif diff --git a/src/SceneGraph/Object.h b/src/SceneGraph/Object.h index 6adfc8973..b8e6d7db8 100644 --- a/src/SceneGraph/Object.h +++ b/src/SceneGraph/Object.h @@ -90,14 +90,11 @@ class documentation or @ref compilation-speedup-hpp for more information. - @ref RigidMatrixTransformation3D "Object" - @ref TranslationTransformation2D "Object" - @ref TranslationTransformation3D "Object" -- @ref BasicTranslationTransformation2D "Object>" -- @ref BasicTranslationTransformation3D "Object>" @see @ref Scene, @ref AbstractFeature, @ref AbstractTransformation, @ref DebugTools::ObjectRenderer -@todo Test (and fix) that hpp works also on Windows */ -template class MAGNUM_SCENEGRAPH_EXPORT Object: public AbstractObject, public Transformation +template class Object: public AbstractObject, public Transformation #ifndef DOXYGEN_GENERATING_OUTPUT , private Containers::LinkedList>, private Containers::LinkedListItem, Object> #endif diff --git a/src/SceneGraph/RigidMatrixTransformation2D.h b/src/SceneGraph/RigidMatrixTransformation2D.h index ed169b0ea..53c5a7537 100644 --- a/src/SceneGraph/RigidMatrixTransformation2D.h +++ b/src/SceneGraph/RigidMatrixTransformation2D.h @@ -134,17 +134,6 @@ template class BasicRigidMatrixTransformation2D: public AbstractBasicTr return transformInternal(Math::Matrix3::reflection(normal), type); } - /** - * @brief Move object in stacking order - * @param under Sibling object under which to move or `nullptr`, - * if you want to move it above all. - * @return Reference to self (for method chaining) - */ - Object>& move(Object>* under) { - static_cast*>(this)->Containers::template LinkedList>>::move(this, under); - return static_cast>&>(*this); - } - protected: /* Allow construction only from Object */ explicit BasicRigidMatrixTransformation2D(); @@ -215,6 +204,10 @@ template struct Transformation> { } +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +#endif + }} #endif diff --git a/src/SceneGraph/RigidMatrixTransformation3D.h b/src/SceneGraph/RigidMatrixTransformation3D.h index 2fdd6d1cf..11b2ff1c2 100644 --- a/src/SceneGraph/RigidMatrixTransformation3D.h +++ b/src/SceneGraph/RigidMatrixTransformation3D.h @@ -257,6 +257,10 @@ template struct Transformation> { } +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +#endif + }} #endif diff --git a/src/SceneGraph/Test/CMakeLists.txt b/src/SceneGraph/Test/CMakeLists.txt index 0ba37c03a..fd6ee3519 100644 --- a/src/SceneGraph/Test/CMakeLists.txt +++ b/src/SceneGraph/Test/CMakeLists.txt @@ -24,13 +24,13 @@ corrade_add_test(SceneGraphAnimableTest AnimableTest.cpp LIBRARIES MagnumSceneGraph) corrade_add_test(SceneGraphCameraTest CameraTest.cpp LIBRARIES MagnumSceneGraph) -corrade_add_test(SceneGraphDualComplexTransfo___Test DualComplexTransformationTest.cpp LIBRARIES MagnumSceneGraph) -corrade_add_test(SceneGraphDualQuaternionTran___Test DualQuaternionTransformationTest.cpp LIBRARIES MagnumSceneGraph) +corrade_add_test(SceneGraphDualComplexTransfo___Test DualComplexTransformationTest.cpp LIBRARIES MagnumSceneGraphTestLib) +corrade_add_test(SceneGraphDualQuaternionTran___Test DualQuaternionTransformationTest.cpp LIBRARIES MagnumSceneGraphTestLib) corrade_add_test(SceneGraphMatrixTransforma___2DTest MatrixTransformation2DTest.cpp LIBRARIES MagnumSceneGraph) corrade_add_test(SceneGraphMatrixTransforma___3DTest MatrixTransformation3DTest.cpp LIBRARIES MagnumSceneGraph) corrade_add_test(SceneGraphObjectTest ObjectTest.cpp LIBRARIES MagnumSceneGraphTestLib) -corrade_add_test(SceneGraphRigidMatrixTrans___2DTest RigidMatrixTransformation2DTest.cpp LIBRARIES MagnumSceneGraph) -corrade_add_test(SceneGraphRigidMatrixTrans___3DTest RigidMatrixTransformation3DTest.cpp LIBRARIES MagnumSceneGraph) +corrade_add_test(SceneGraphRigidMatrixTrans___2DTest RigidMatrixTransformation2DTest.cpp LIBRARIES MagnumSceneGraphTestLib) +corrade_add_test(SceneGraphRigidMatrixTrans___3DTest RigidMatrixTransformation3DTest.cpp LIBRARIES MagnumSceneGraphTestLib) corrade_add_test(SceneGraphSceneTest SceneTest.cpp LIBRARIES MagnumSceneGraph) corrade_add_test(SceneGraphTranslationTransfo___Test TranslationTransformationTest.cpp LIBRARIES MagnumSceneGraph) diff --git a/src/SceneGraph/Test/TranslationTransformationTest.cpp b/src/SceneGraph/Test/TranslationTransformationTest.cpp index b3d69bdaa..1fe7dd5e4 100644 --- a/src/SceneGraph/Test/TranslationTransformationTest.cpp +++ b/src/SceneGraph/Test/TranslationTransformationTest.cpp @@ -25,6 +25,7 @@ #include #include +#include "SceneGraph/Object.hpp" #include "SceneGraph/TranslationTransformation.h" #include "SceneGraph/Scene.h" @@ -131,11 +132,11 @@ void TranslationTransformationTest::translate() { } void TranslationTransformationTest::integral() { - typedef Object> Object2Di; + typedef Object> Object2Di; Object2Di o; o.translate({3, -7}); - CORRADE_COMPARE(o.transformationMatrix(), Matrix3::translation({3, -7})); + CORRADE_COMPARE(o.transformationMatrix(), Matrix3::translation({3.0f, -7.0f})); } }}} diff --git a/src/SceneGraph/TranslationTransformation.h b/src/SceneGraph/TranslationTransformation.h index 104a0c0d6..bbb20e1c9 100644 --- a/src/SceneGraph/TranslationTransformation.h +++ b/src/SceneGraph/TranslationTransformation.h @@ -212,6 +212,11 @@ template struct Transfor } +#ifdef _WIN32 +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +extern template class MAGNUM_SCENEGRAPH_EXPORT Object>; +#endif + }} #endif diff --git a/src/SceneGraph/instantiation.cpp b/src/SceneGraph/instantiation.cpp index f326f2c02..b04fd0964 100644 --- a/src/SceneGraph/instantiation.cpp +++ b/src/SceneGraph/instantiation.cpp @@ -23,6 +23,7 @@ */ #include "SceneGraph/AbstractFeature.hpp" +#include "SceneGraph/Animable.hpp" #include "SceneGraph/Camera2D.hpp" #include "SceneGraph/Camera3D.hpp" #include "SceneGraph/DualComplexTransformation.h" @@ -37,32 +38,42 @@ namespace Magnum { namespace SceneGraph { +/* On Windows the instantiations are already marked with extern template */ +#ifndef _WIN32 +#define MAGNUM_SCENEGRAPH_EXPORT_HPP MAGNUM_SCENEGRAPH_EXPORT +#else +#define MAGNUM_SCENEGRAPH_EXPORT_HPP +#endif + #ifndef DOXYGEN_GENERATING_OUTPUT -template class MAGNUM_SCENEGRAPH_EXPORT AbstractObject<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractObject<3, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractObject<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractObject<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractTransformation<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractTransformation<3, Float>; + +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractFeature<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractFeature<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractFeatureGroup<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractFeatureGroup<3, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<3, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeatureGroup<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeatureGroup<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Animable<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Animable<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AnimableGroup<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AnimableGroup<3, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera<2, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera<3, Float>; -template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera2D; -template class MAGNUM_SCENEGRAPH_EXPORT BasicCamera3D; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractCamera<2, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP AbstractCamera<3, Float>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP BasicCamera2D; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP BasicCamera3D; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; -template class MAGNUM_SCENEGRAPH_EXPORT Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; +template class MAGNUM_SCENEGRAPH_EXPORT_HPP Object>; #endif }} diff --git a/src/Test/MeshTest.cpp b/src/Test/MeshTest.cpp index 839e6610b..3c58f4510 100644 --- a/src/Test/MeshTest.cpp +++ b/src/Test/MeshTest.cpp @@ -63,7 +63,7 @@ void MeshTest::configurationPrimitive() { Utility::Configuration c; c.setValue("primitive", Mesh::Primitive::LineStrip); - CORRADE_COMPARE(c.value("primitive"), "LineStrip"); + CORRADE_COMPARE(c.value("primitive"), "LineStrip"); CORRADE_COMPARE(c.value("primitive"), Mesh::Primitive::LineStrip); } @@ -71,7 +71,7 @@ void MeshTest::configurationIndexType() { Utility::Configuration c; c.setValue("type", Mesh::IndexType::UnsignedByte); - CORRADE_COMPARE(c.value("type"), "UnsignedByte"); + CORRADE_COMPARE(c.value("type"), "UnsignedByte"); CORRADE_COMPARE(c.value("type"), Mesh::IndexType::UnsignedByte); }