Browse Source

Merge branch 'master' into compatibility

Conflicts:
	src/Magnum/AbstractShaderProgram.cpp
	src/Magnum/CubeMapTextureArray.h
	src/Magnum/Shader.cpp
Vladimír Vondruš 12 years ago
parent
commit
317304bf87
  1. 2
      package/archlinux/PKGBUILD-android-arm
  2. 2
      package/archlinux/PKGBUILD-android-x86
  3. 2
      package/archlinux/PKGBUILD-mingw32
  4. 4
      package/archlinux/PKGBUILD-nacl-glibc
  5. 10
      package/archlinux/PKGBUILD-nacl-newlib
  6. 18
      src/Magnum/AbstractShaderProgram.cpp
  7. 33
      src/Magnum/CubeMapTextureArray.h
  8. 41
      src/Magnum/RectangleTexture.h
  9. 14
      src/Magnum/Shader.cpp
  10. 6
      src/Magnum/Texture.h
  11. 2
      src/Magnum/TextureArray.h
  12. 6
      src/MagnumPlugins/MagnumFont/CMakeLists.txt
  13. 2
      src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt
  14. 8
      src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt
  15. 4
      src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt
  16. 6
      src/MagnumPlugins/ObjImporter/CMakeLists.txt
  17. 2
      src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt
  18. 6
      src/MagnumPlugins/TgaImageConverter/CMakeLists.txt
  19. 2
      src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt
  20. 6
      src/MagnumPlugins/TgaImporter/CMakeLists.txt
  21. 2
      src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt
  22. 6
      src/MagnumPlugins/WavAudioImporter/CMakeLists.txt
  23. 2
      src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt

2
package/archlinux/PKGBUILD-android-arm

@ -38,5 +38,5 @@ build() {
package() { package() {
cd "$startdir/build-android-arm" cd "$startdir/build-android-arm"
DESTDIR="$pkgdir/" ninja install DESTDIR="$pkgdir/" ninja install/strip
} }

2
package/archlinux/PKGBUILD-android-x86

@ -38,5 +38,5 @@ build() {
package() { package() {
cd "$startdir/build-android-x86" cd "$startdir/build-android-x86"
DESTDIR="$pkgdir/" ninja install DESTDIR="$pkgdir/" ninja install/strip
} }

2
package/archlinux/PKGBUILD-mingw32

@ -34,5 +34,5 @@ build() {
package() { package() {
cd "$startdir/build-win" cd "$startdir/build-win"
DESTDIR="$pkgdir/" ninja install DESTDIR="$pkgdir/" ninja install/strip
} }

4
package/archlinux/PKGBUILD-nacl-glibc

@ -56,10 +56,10 @@ build() {
package() { package() {
# Install 32bit # Install 32bit
cd "$startdir/build-nacl-glibc-x86-32" cd "$startdir/build-nacl-glibc-x86-32"
DESTDIR="$pkgdir/" ninja install DESTDIR="$pkgdir/" ninja install/strip
# Install 64bit (the headers will be overwritten, but they are (and should # Install 64bit (the headers will be overwritten, but they are (and should
# be) the same for both versions # be) the same for both versions
cd "$startdir/build-nacl-glibc-x86-64" cd "$startdir/build-nacl-glibc-x86-64"
DESTDIR="$pkgdir/" ninja install DESTDIR="$pkgdir/" ninja install/strip
} }

10
package/archlinux/PKGBUILD-nacl-newlib

@ -58,16 +58,10 @@ build() {
package() { package() {
# Install 32bit # Install 32bit
cd "$startdir/build-nacl-newlib-x86-32" cd "$startdir/build-nacl-newlib-x86-32"
DESTDIR="$pkgdir/" ninja install DESTDIR="$pkgdir/" ninja install/strip
# Strip 32bit binaries
/usr/nacl/toolchain/linux_x86_newlib/bin/i686-nacl-strip ${pkgdir}/usr/nacl/bin/*x86-32.nexe
# Install 64bit (the headers will be overwritten, but they are (and should # Install 64bit (the headers will be overwritten, but they are (and should
# be) the same for both versions # be) the same for both versions
cd "$startdir/build-nacl-newlib-x86-64" cd "$startdir/build-nacl-newlib-x86-64"
DESTDIR="$pkgdir/" ninja install DESTDIR="$pkgdir/" ninja install/strip
# Strip 64bit binaries
/usr/nacl/toolchain/linux_x86_newlib/bin/x86_64-nacl-strip ${pkgdir}/usr/nacl/bin/*x86-64.nexe
} }

18
src/Magnum/AbstractShaderProgram.cpp

@ -36,6 +36,10 @@
#include "Implementation/ShaderProgramState.h" #include "Implementation/ShaderProgramState.h"
#include "Implementation/State.h" #include "Implementation/State.h"
#if defined(CORRADE_TARGET_NACL_NEWLIB) || defined(CORRADE_TARGET_ANDROID) || defined(__MINGW32__)
#include <sstream>
#endif
namespace Magnum { namespace Magnum {
Int AbstractShaderProgram::maxVertexAttributes() { Int AbstractShaderProgram::maxVertexAttributes() {
@ -293,6 +297,12 @@ bool AbstractShaderProgram::link(std::initializer_list<std::reference_wrapper<Ab
glGetProgramInfoLog(shader._id, message.size(), nullptr, &message[0]); glGetProgramInfoLog(shader._id, message.size(), nullptr, &message[0]);
message.resize(std::max(logLength, 1)-1); message.resize(std::max(logLength, 1)-1);
/** @todo Remove when this is fixed everywhere (also the include above) */
#if defined(CORRADE_TARGET_NACL_NEWLIB) || defined(CORRADE_TARGET_ANDROID) || defined(__MINGW32__)
std::ostringstream converter;
converter << i;
#endif
/* Show error log */ /* Show error log */
if(!success) { if(!success) {
Error out; Error out;
@ -300,11 +310,15 @@ bool AbstractShaderProgram::link(std::initializer_list<std::reference_wrapper<Ab
out.setFlag(Debug::SpaceAfterEachValue, false); out.setFlag(Debug::SpaceAfterEachValue, false);
out << "AbstractShaderProgram::link(): linking"; out << "AbstractShaderProgram::link(): linking";
if(shaders.size() != 1) { if(shaders.size() != 1) {
#if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID) && !defined(__MINGW32__)
#ifndef CORRADE_GCC44_COMPATIBILITY #ifndef CORRADE_GCC44_COMPATIBILITY
out << " of shader " << std::to_string(i); out << " of shader " << std::to_string(i);
#else #else
out << " of shader " << std::to_string(static_cast<long long int>(i)); out << " of shader " << std::to_string(static_cast<long long int>(i));
#endif #endif
#else
out << " of shader " << converter.str();
#endif
} }
out << " failed with the following message:\n" out << " failed with the following message:\n"
<< message; << message;
@ -316,11 +330,15 @@ bool AbstractShaderProgram::link(std::initializer_list<std::reference_wrapper<Ab
out.setFlag(Debug::SpaceAfterEachValue, false); out.setFlag(Debug::SpaceAfterEachValue, false);
out << "AbstractShaderProgram::link(): linking"; out << "AbstractShaderProgram::link(): linking";
if(shaders.size() != 1) { if(shaders.size() != 1) {
#if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID) && !defined(__MINGW32__)
#ifndef CORRADE_GCC44_COMPATIBILITY #ifndef CORRADE_GCC44_COMPATIBILITY
out << " of shader " << std::to_string(i); out << " of shader " << std::to_string(i);
#else #else
out << " of shader " << std::to_string(static_cast<long long int>(i)); out << " of shader " << std::to_string(static_cast<long long int>(i));
#endif #endif
#else
out << " of shader " << converter.str();
#endif
} }
out << " succeeded with the following message:\n" out << " succeeded with the following message:\n"
<< message; << message;

33
src/Magnum/CubeMapTextureArray.h

@ -99,13 +99,36 @@ class CubeMapTextureArray: public AbstractTexture {
} }
#endif #endif
/** @copydoc Texture::setBaseLevel() */ /**
* @brief Set base mip level
* @return Reference to self (for method chaining)
*
* Taken into account when generating mipmap using @ref generateMipmap()
* and when considering texture completeness when using mipmap
* filtering. Initial value is `0`.
* @see @ref setMaxLevel(), @ref setMinificationFilter(),
* @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter}
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access}
* with @def_gl{TEXTURE_BASE_LEVEL}
*/
CubeMapTextureArray& setBaseLevel(Int level) { CubeMapTextureArray& setBaseLevel(Int level) {
AbstractTexture::setBaseLevel(level); AbstractTexture::setBaseLevel(level);
return *this; return *this;
} }
/** @copydoc Texture::setMaxLevel() */ /**
* @brief Set max mip level
* @return Reference to self (for method chaining)
*
* Taken into account when generating mipmap using @ref generateMipmap()
* and when considering texture completeness when using mipmap
* filtering. Initial value is `1000`, which is clamped to count of
* levels specified when using @ref setStorage().
* @see @ref setBaseLevel(), @ref setMinificationFilter(),
* @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter}
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access}
* with @def_gl{TEXTURE_MAX_LEVEL}
*/
CubeMapTextureArray& setMaxLevel(Int level) { CubeMapTextureArray& setMaxLevel(Int level) {
AbstractTexture::setMaxLevel(level); AbstractTexture::setMaxLevel(level);
return *this; return *this;
@ -129,19 +152,19 @@ class CubeMapTextureArray: public AbstractTexture {
return *this; return *this;
} }
/** @copydoc Texture::setBorderColor() */ /** @copydoc RectangleTexture::setBorderColor(const Color4&) */
CubeMapTextureArray& setBorderColor(const Color4& color) { CubeMapTextureArray& setBorderColor(const Color4& color) {
AbstractTexture::setBorderColor(color); AbstractTexture::setBorderColor(color);
return *this; return *this;
} }
/** @copydoc Texture::setBorderColor(const Vector4ui&) */ /** @copydoc RectangleTexture::setBorderColor(const Vector4ui&) */
CubeMapTextureArray& setBorderColor(const Vector4ui& color) { CubeMapTextureArray& setBorderColor(const Vector4ui& color) {
AbstractTexture::setBorderColor(color); AbstractTexture::setBorderColor(color);
return *this; return *this;
} }
/** @copydoc Texture::setBorderColor(const Vector4i&) */ /** @copydoc RectangleTexture::setBorderColor(const Vector4i&) */
CubeMapTextureArray& setBorderColor(const Vector4i& color) { CubeMapTextureArray& setBorderColor(const Vector4i& color) {
AbstractTexture::setBorderColor(color); AbstractTexture::setBorderColor(color);
return *this; return *this;

41
src/Magnum/RectangleTexture.h

@ -137,25 +137,48 @@ class RectangleTexture: public AbstractTexture {
return *this; return *this;
} }
/** @copydoc Texture::setBorderColor() */ /**
* @brief Set border color
* @return Reference to self (for method chaining)
*
* Border color when wrapping is set to @ref Sampler::Wrapping::ClampToBorder.
* If @extension{EXT,direct_state_access} is not available, the texture
* is bound to some texture unit before the operation. Initial value is
* `{0.0f, 0.0f, 0.0f, 0.0f}`.
* @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter}
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access}
* with @def_gl{TEXTURE_BORDER_COLOR}
*/
RectangleTexture& setBorderColor(const Color4& color) { RectangleTexture& setBorderColor(const Color4& color) {
AbstractTexture::setBorderColor(color); AbstractTexture::setBorderColor(color);
return *this; return *this;
} }
#ifndef MAGNUM_TARGET_GLES /**
/** @copydoc Texture::setBorderColor(const Vector4ui&) */ * @brief Set border color for integer texture
* @return Reference to self (for method chaining)
*
* Border color for integer textures when wrapping is set to
* @ref Sampler::Wrapping::ClampToBorder. If @extension{EXT,direct_state_access}
* is not available, the texture is bound to some texture unit before
* the operation. Initial value is `{0, 0, 0, 0}`.
* @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter}
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access}
* with @def_gl{TEXTURE_BORDER_COLOR}
* @requires_gl30 %Extension @extension{EXT,texture_integer}
*/
RectangleTexture& setBorderColor(const Vector4ui& color) { RectangleTexture& setBorderColor(const Vector4ui& color) {
AbstractTexture::setBorderColor(color); AbstractTexture::setBorderColor(color);
return *this; return *this;
} }
/** @copydoc Texture::setBorderColor(const Vector4i&) */ /** @overload
* @requires_gl30 %Extension @extension{EXT,texture_integer}
*/
RectangleTexture& setBorderColor(const Vector4i& color) { RectangleTexture& setBorderColor(const Vector4i& color) {
AbstractTexture::setBorderColor(color); AbstractTexture::setBorderColor(color);
return *this; return *this;
} }
#endif
/** @copydoc Texture::setMaxAnisotropy() */ /** @copydoc Texture::setMaxAnisotropy() */
RectangleTexture& setMaxAnisotropy(Float anisotropy) { RectangleTexture& setMaxAnisotropy(Float anisotropy) {
@ -190,7 +213,6 @@ class RectangleTexture: public AbstractTexture {
return *this; return *this;
} }
#ifndef MAGNUM_TARGET_GLES
/** /**
* @brief Read texture to image * @brief Read texture to image
* @param image %Image where to put the data * @param image %Image where to put the data
@ -206,7 +228,6 @@ class RectangleTexture: public AbstractTexture {
* and @extension{ARB,robustness} are available, the DSA version is * and @extension{ARB,robustness} are available, the DSA version is
* used, because it is better for performance and there isn't any * used, because it is better for performance and there isn't any
* function combining both features. * function combining both features.
* @requires_gl %Texture image queries are not available in OpenGL ES.
* @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and * @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{GetTexLevelParameter} or @fn_gl_extension{GetTextureLevelParameter,EXT,direct_state_access} * @fn_gl{GetTexLevelParameter} or @fn_gl_extension{GetTextureLevelParameter,EXT,direct_state_access}
* with @def_gl{TEXTURE_WIDTH} and @def_gl{TEXTURE_HEIGHT}, then * with @def_gl{TEXTURE_WIDTH} and @def_gl{TEXTURE_HEIGHT}, then
@ -223,12 +244,10 @@ class RectangleTexture: public AbstractTexture {
* @param usage %Buffer usage * @param usage %Buffer usage
* *
* See @ref image(Image2D&) for more information. * See @ref image(Image2D&) for more information.
* @requires_gl %Texture image queries are not available in OpenGL ES.
*/ */
void image(BufferImage2D& image, BufferUsage usage) { void image(BufferImage2D& image, BufferUsage usage) {
AbstractTexture::image<2>(_target, 0, image, usage); AbstractTexture::image<2>(_target, 0, image, usage);
} }
#endif
/** /**
* @brief Set image data * @brief Set image data
@ -250,7 +269,6 @@ class RectangleTexture: public AbstractTexture {
return *this; return *this;
} }
#ifndef MAGNUM_TARGET_GLES2
/** @overload */ /** @overload */
RectangleTexture& setImage(TextureFormat internalFormat, BufferImage2D& image) { RectangleTexture& setImage(TextureFormat internalFormat, BufferImage2D& image) {
DataHelper<2>::setImage(*this, _target, 0, internalFormat, image); DataHelper<2>::setImage(*this, _target, 0, internalFormat, image);
@ -261,7 +279,6 @@ class RectangleTexture: public AbstractTexture {
RectangleTexture& setImage(TextureFormat internalFormat, BufferImage2D&& image) { RectangleTexture& setImage(TextureFormat internalFormat, BufferImage2D&& image) {
return setImage(internalFormat, image); return setImage(internalFormat, image);
} }
#endif
/** /**
* @brief Set image subdata * @brief Set image subdata
@ -281,7 +298,6 @@ class RectangleTexture: public AbstractTexture {
return *this; return *this;
} }
#ifndef MAGNUM_TARGET_GLES2
/** @overload */ /** @overload */
RectangleTexture& setSubImage(const Vector2i& offset, BufferImage2D& image) { RectangleTexture& setSubImage(const Vector2i& offset, BufferImage2D& image) {
DataHelper<2>::setSubImage(*this, _target, 0, offset, image); DataHelper<2>::setSubImage(*this, _target, 0, offset, image);
@ -292,7 +308,6 @@ class RectangleTexture: public AbstractTexture {
RectangleTexture& setSubImage(const Vector2i& offset, BufferImage2D&& image) { RectangleTexture& setSubImage(const Vector2i& offset, BufferImage2D&& image) {
return setSubImage(offset, image); return setSubImage(offset, image);
} }
#endif
/** /**
* @brief Invalidate texture image * @brief Invalidate texture image

14
src/Magnum/Shader.cpp

@ -672,6 +672,12 @@ bool Shader::compile(std::initializer_list<std::reference_wrapper<Shader>> shade
glGetShaderInfoLog(shader._id, message.size(), nullptr, &message[0]); glGetShaderInfoLog(shader._id, message.size(), nullptr, &message[0]);
message.resize(std::max(logLength, 1)-1); message.resize(std::max(logLength, 1)-1);
/** @todo Remove when this is fixed everywhere (also the include above) */
#if defined(CORRADE_TARGET_NACL_NEWLIB) || defined(CORRADE_TARGET_ANDROID) || defined(__MINGW32__)
std::ostringstream converter;
converter << i;
#endif
/* Show error log */ /* Show error log */
if(!success) { if(!success) {
Error out; Error out;
@ -680,11 +686,15 @@ bool Shader::compile(std::initializer_list<std::reference_wrapper<Shader>> shade
out << "Shader::compile(): compilation of " << shaderName(shader._type) out << "Shader::compile(): compilation of " << shaderName(shader._type)
<< " shader"; << " shader";
if(shaders.size() != 1) { if(shaders.size() != 1) {
#if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID) && !defined(__MINGW32__)
#ifndef CORRADE_GCC44_COMPATIBILITY #ifndef CORRADE_GCC44_COMPATIBILITY
out << ' ' << std::to_string(i); out << ' ' << std::to_string(i);
#else #else
out << ' ' << std::to_string(static_cast<long long int>(i)); out << ' ' << std::to_string(static_cast<long long int>(i));
#endif #endif
#else
out << ' ' << converter.str();
#endif
} }
out << " failed with the following message:\n" out << " failed with the following message:\n"
<< message; << message;
@ -697,11 +707,15 @@ bool Shader::compile(std::initializer_list<std::reference_wrapper<Shader>> shade
out << "Shader::compile(): compilation of " << shaderName(shader._type) out << "Shader::compile(): compilation of " << shaderName(shader._type)
<< " shader"; << " shader";
if(shaders.size() != 1) { if(shaders.size() != 1) {
#if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID) && !defined(__MINGW32__)
#ifndef CORRADE_GCC44_COMPATIBILITY #ifndef CORRADE_GCC44_COMPATIBILITY
out << ' ' << std::to_string(i); out << ' ' << std::to_string(i);
#else #else
out << ' ' << std::to_string(static_cast<long long int>(i)); out << ' ' << std::to_string(static_cast<long long int>(i));
#endif #endif
#else
out << ' ' << converter.str();
#endif
} }
out << " succeeded with the following message:\n" out << " succeeded with the following message:\n"
<< message; << message;

6
src/Magnum/Texture.h

@ -337,7 +337,11 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
return *this; return *this;
} }
/** @overload */ /** @overload
* @requires_gl30 %Extension @extension{EXT,texture_integer}
* @requires_gl Border is available only for float textures in OpenGL
* ES.
*/
Texture<dimensions>& setBorderColor(const Vector4i& color) { Texture<dimensions>& setBorderColor(const Vector4i& color) {
AbstractTexture::setBorderColor(color); AbstractTexture::setBorderColor(color);
return *this; return *this;

2
src/Magnum/TextureArray.h

@ -137,7 +137,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
return *this; return *this;
} }
/** @copydoc Texture::setBorderColor() */ /** @copydoc Texture::setBorderColor(const Color4&) */
TextureArray<dimensions>& setBorderColor(const Color4& color) { TextureArray<dimensions>& setBorderColor(const Color4& color) {
AbstractTexture::setBorderColor(color); AbstractTexture::setBorderColor(color);
return *this; return *this;

6
src/MagnumPlugins/MagnumFont/CMakeLists.txt

@ -45,13 +45,13 @@ endif()
install(FILES ${MagnumFont_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/MagnumFont) install(FILES ${MagnumFont_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/MagnumFont)
if(BUILD_GL_TESTS) if(BUILD_GL_TESTS)
add_library(MagnumFontTestLib STATIC $<TARGET_OBJECTS:MagnumFontObjects>) add_library(MagnumMagnumFontTestLib STATIC $<TARGET_OBJECTS:MagnumFontObjects>)
target_link_libraries(MagnumFontTestLib Magnum MagnumText TgaImporterTestLib) target_link_libraries(MagnumMagnumFontTestLib Magnum MagnumText MagnumTgaImporterTestLib)
# On Windows we need to install first and then run the tests to avoid "DLL # 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 # not found" hell, thus we need to install this too
if(WIN32 AND NOT CMAKE_CROSSCOMPILING) if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS MagnumFontTestLib install(TARGETS MagnumMagnumFontTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}
ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})

2
src/MagnumPlugins/MagnumFont/Test/CMakeLists.txt

@ -28,4 +28,4 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
corrade_add_test(MagnumFontGLTest MagnumFontGLTest.cpp LIBRARIES MagnumFontTestLib ${GL_TEST_LIBRARIES}) corrade_add_test(MagnumFontGLTest MagnumFontGLTest.cpp LIBRARIES MagnumMagnumFontTestLib ${GL_TEST_LIBRARIES})

8
src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt

@ -39,19 +39,19 @@ add_plugin(MagnumFontConverter ${MAGNUM_PLUGINS_FONTCONVERTER_DEBUG_INSTALL_DIR}
target_link_libraries(MagnumFontConverter Magnum MagnumText) target_link_libraries(MagnumFontConverter Magnum MagnumText)
if(WIN32) if(WIN32)
target_link_libraries(MagnumFontConverter TgaImageConverter) target_link_libraries(MagnumFontConverter MagnumTgaImageConverter)
endif() endif()
install(FILES ${MagnumFontConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/MagnumFontConverter) install(FILES ${MagnumFontConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/MagnumFontConverter)
if(BUILD_GL_TESTS) if(BUILD_GL_TESTS)
add_library(MagnumFontConverterTestLib STATIC $<TARGET_OBJECTS:MagnumFontConverterObjects>) add_library(MagnumMagnumFontConverterTestLib STATIC $<TARGET_OBJECTS:MagnumFontConverterObjects>)
target_link_libraries(MagnumFontConverterTestLib Magnum MagnumText TgaImageConverterTestLib) target_link_libraries(MagnumMagnumFontConverterTestLib Magnum MagnumText MagnumTgaImageConverterTestLib)
# On Windows we need to install first and then run the tests to avoid "DLL # 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 # not found" hell, thus we need to install this too
if(WIN32 AND NOT CMAKE_CROSSCOMPILING) if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS MagnumFontConverterTestLib install(TARGETS MagnumMagnumFontConverterTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}
ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})

4
src/MagnumPlugins/MagnumFontConverter/Test/CMakeLists.txt

@ -29,6 +29,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
corrade_add_test(MagnumFontConverterGLTest MagnumFontConverterGLTest.cpp LIBRARIES corrade_add_test(MagnumFontConverterGLTest MagnumFontConverterGLTest.cpp LIBRARIES
MagnumFontConverterTestLib MagnumMagnumFontConverterTestLib
TgaImporterTestLib MagnumTgaImporterTestLib
${GL_TEST_LIBRARIES}) ${GL_TEST_LIBRARIES})

6
src/MagnumPlugins/ObjImporter/CMakeLists.txt

@ -37,13 +37,13 @@ target_link_libraries(ObjImporter Magnum MagnumMeshTools)
install(FILES ObjImporter.h DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/ObjImporter) install(FILES ObjImporter.h DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/ObjImporter)
if(BUILD_TESTS) if(BUILD_TESTS)
add_library(ObjImporterTestLib STATIC $<TARGET_OBJECTS:ObjImporterObjects>) add_library(MagnumObjImporterTestLib STATIC $<TARGET_OBJECTS:ObjImporterObjects>)
target_link_libraries(ObjImporterTestLib Magnum MagnumMeshTools) target_link_libraries(MagnumObjImporterTestLib Magnum MagnumMeshTools)
# On Windows we need to install first and then run the tests to avoid "DLL # 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 # not found" hell, thus we need to install this too
if(WIN32 AND NOT CMAKE_CROSSCOMPILING) if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS ObjImporterTestLib install(TARGETS MagnumObjImporterTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}
ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})

2
src/MagnumPlugins/ObjImporter/Test/CMakeLists.txt

@ -28,4 +28,4 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
corrade_add_test(ObjImporterTest Test.cpp LIBRARIES ObjImporterTestLib) corrade_add_test(ObjImporterTest Test.cpp LIBRARIES MagnumObjImporterTestLib)

6
src/MagnumPlugins/TgaImageConverter/CMakeLists.txt

@ -41,13 +41,13 @@ target_link_libraries(TgaImageConverter Magnum)
install(FILES ${TgaImageConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImageConverter) install(FILES ${TgaImageConverter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImageConverter)
if(BUILD_TESTS) if(BUILD_TESTS)
add_library(TgaImageConverterTestLib ${SHARED_OR_STATIC} $<TARGET_OBJECTS:TgaImageConverterObjects>) add_library(MagnumTgaImageConverterTestLib ${SHARED_OR_STATIC} $<TARGET_OBJECTS:TgaImageConverterObjects>)
target_link_libraries(TgaImageConverterTestLib Magnum) target_link_libraries(MagnumTgaImageConverterTestLib Magnum)
# On Windows we need to install first and then run the tests to avoid "DLL # 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 # not found" hell, thus we need to install this too
if(WIN32 AND NOT CMAKE_CROSSCOMPILING) if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS TgaImageConverterTestLib install(TARGETS MagnumTgaImageConverterTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}
ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})

2
src/MagnumPlugins/TgaImageConverter/Test/CMakeLists.txt

@ -28,4 +28,4 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
corrade_add_test(TgaImageConverterTest TgaImageConverterTest.cpp LIBRARIES TgaImageConverterTestLib TgaImporterTestLib) corrade_add_test(TgaImageConverterTest TgaImageConverterTest.cpp LIBRARIES MagnumTgaImageConverterTestLib MagnumTgaImporterTestLib)

6
src/MagnumPlugins/TgaImporter/CMakeLists.txt

@ -42,13 +42,13 @@ target_link_libraries(TgaImporter Magnum)
install(FILES ${TgaImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImporter) install(FILES ${TgaImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/TgaImporter)
if(BUILD_TESTS) if(BUILD_TESTS)
add_library(TgaImporterTestLib ${SHARED_OR_STATIC} $<TARGET_OBJECTS:TgaImporterObjects>) add_library(MagnumTgaImporterTestLib ${SHARED_OR_STATIC} $<TARGET_OBJECTS:TgaImporterObjects>)
target_link_libraries(TgaImporterTestLib Magnum) target_link_libraries(MagnumTgaImporterTestLib Magnum)
# On Windows we need to install first and then run the tests to avoid "DLL # 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 # not found" hell, thus we need to install this too
if(WIN32 AND NOT CMAKE_CROSSCOMPILING) if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS TgaImporterTestLib install(TARGETS MagnumTgaImporterTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}
ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})

2
src/MagnumPlugins/TgaImporter/Test/CMakeLists.txt

@ -28,4 +28,4 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
corrade_add_test(TgaImporterTest TgaImporterTest.cpp LIBRARIES TgaImporterTestLib) corrade_add_test(TgaImporterTest TgaImporterTest.cpp LIBRARIES MagnumTgaImporterTestLib)

6
src/MagnumPlugins/WavAudioImporter/CMakeLists.txt

@ -48,13 +48,13 @@ target_link_libraries(WavAudioImporter Magnum MagnumAudio)
install(FILES ${WavAudioImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/WavAudioImporter) install(FILES ${WavAudioImporter_HEADERS} DESTINATION ${MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR}/WavAudioImporter)
if(BUILD_TESTS) if(BUILD_TESTS)
add_library(WavAudioImporterTestLib STATIC $<TARGET_OBJECTS:WavAudioImporterObjects>) add_library(MagnumWavAudioImporterTestLib STATIC $<TARGET_OBJECTS:WavAudioImporterObjects>)
target_link_libraries(WavAudioImporterTestLib Magnum MagnumAudio) target_link_libraries(MagnumWavAudioImporterTestLib Magnum MagnumAudio)
# On Windows we need to install first and then run the tests to avoid "DLL # 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 # not found" hell, thus we need to install this too
if(WIN32 AND NOT CMAKE_CROSSCOMPILING) if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS WavAudioImporterTestLib install(TARGETS MagnumWavAudioImporterTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}
ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})

2
src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt

@ -28,4 +28,4 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
corrade_add_test(WavAudioImporterTest WavImporterTest.cpp LIBRARIES WavAudioImporterTestLib) corrade_add_test(WavAudioImporterTest WavImporterTest.cpp LIBRARIES MagnumWavAudioImporterTestLib)

Loading…
Cancel
Save