Browse Source

Be consistent and use our own platform definitions.

pull/55/merge
Vladimír Vondruš 12 years ago
parent
commit
c7b23a884f
  1. 10
      CMakeLists.txt
  2. 2
      modules/FindMagnum.cmake
  3. 2
      src/Magnum/Audio/Audio.cpp
  4. 2
      src/Magnum/CMakeLists.txt
  5. 2
      src/Magnum/MeshTools/CMakeLists.txt
  6. 8
      src/Magnum/Platform/CMakeLists.txt
  7. 4
      src/Magnum/Platform/Sdl2Application.cpp
  8. 10
      src/Magnum/Platform/magnum-info.cpp
  9. 2
      src/Magnum/SceneGraph/CMakeLists.txt
  10. 6
      src/Magnum/Text/CMakeLists.txt
  11. 2
      src/Magnum/Text/fontconverter.cpp
  12. 6
      src/Magnum/TextureTools/CMakeLists.txt
  13. 2
      src/Magnum/TextureTools/distancefieldconverter.cpp
  14. 4
      src/MagnumPlugins/MagnumFont/CMakeLists.txt
  15. 4
      src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt
  16. 2
      src/MagnumPlugins/ObjImporter/CMakeLists.txt
  17. 2
      src/MagnumPlugins/TgaImageConverter/CMakeLists.txt
  18. 2
      src/MagnumPlugins/TgaImporter/CMakeLists.txt
  19. 2
      src/MagnumPlugins/WavAudioImporter/CMakeLists.txt

10
CMakeLists.txt

@ -58,8 +58,12 @@ if(CORRADE_TARGET_NACL)
elseif(CORRADE_TARGET_ANDROID)
option(WITH_ANDROIDAPPLICATION "Build AndroidApplication library" OFF)
# OS X-specific application libraries
elseif(CORRADE_TARGET_APPLE)
cmake_dependent_option(WITH_WINDOWLESSCGLAPPLICATION "Build WindowlessCglApplication library" OFF "NOT WITH_MAGNUMINFO;NOT WITH_FONTCONVERTER;NOT WITH_DISTANCEFIELDCONVERTER" ON)
# X11, GLX and EGL-specific application libraries
elseif(CORRADE_TARGET_UNIX AND NOT APPLE)
elseif(CORRADE_TARGET_UNIX)
option(WITH_GLXAPPLICATION "Build GlxApplication library" OFF)
cmake_dependent_option(WITH_WINDOWLESSGLXAPPLICATION "Build WindowlessGlxApplication library" OFF "NOT WITH_MAGNUMINFO;NOT WITH_FONTCONVERTER;NOT WITH_DISTANCEFIELDCONVERTER" ON)
cmake_dependent_option(WITH_XEGLAPPLICATION "Build XEglApplication library" OFF "TARGET_GLES" OFF)
@ -67,10 +71,6 @@ elseif(CORRADE_TARGET_UNIX AND NOT APPLE)
# Windows-specific application libraries
elseif(CORRADE_TARGET_WINDOWS)
cmake_dependent_option(WITH_WINDOWLESSWGLAPPLICATION "Build WindowlessWglApplication library" OFF "NOT WITH_MAGNUMINFO;NOT WITH_FONTCONVERTER;NOT WITH_DISTANCEFIELDCONVERTER" ON)
# OS X-specific application libraries
elseif(APPLE)
cmake_dependent_option(WITH_WINDOWLESSCGLAPPLICATION "Build WindowlessCglApplication library" OFF "NOT WITH_MAGNUMINFO;NOT WITH_FONTCONVERTER;NOT WITH_DISTANCEFIELDCONVERTER" ON)
endif()
# Platform-independent (almost) application libraries

2
modules/FindMagnum.cmake

@ -230,7 +230,7 @@ endif()
# ${MAGNUM_LIBRARIES} listed in dependencies also after all other library names
# to avoid linker errors. Applicaiton libraries are often last thus it is
# +- sufficient to add it there only.
if(WIN32 OR MAGNUM_BUILD_STATIC)
if(CORRADE_TARGET_WINDOWS OR MAGNUM_BUILD_STATIC)
set(_WINDOWCONTEXT_MAGNUM_LIBRARIES_DEPENDENCY ${MAGNUM_LIBRARIES})
endif()

2
src/Magnum/Audio/Audio.cpp

@ -33,7 +33,7 @@ namespace Magnum { namespace Audio {
/* Verify types */
static_assert(std::is_same<ALubyte, UnsignedByte>::value, "ALubyte is not the same as UnsignedByte");
/** @todo Why `ALbyte` is defined as `char` and not `signed char` on OSX? */
#ifndef __APPLE__
#ifndef CORRADE_TARGET_APPLE
static_assert(std::is_same<ALbyte, Byte>::value, "ALbyte is not the same as Byte");
#else
static_assert(std::is_signed<ALbyte>::value && sizeof(ALbyte) == 1, "ALbyte does not have the same characteristics as Byte");

2
src/Magnum/CMakeLists.txt

@ -242,7 +242,7 @@ if(BUILD_TESTS)
# 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)
if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS MagnumMathTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}

2
src/Magnum/MeshTools/CMakeLists.txt

@ -91,7 +91,7 @@ if(BUILD_TESTS)
# 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)
if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS MagnumMeshToolsTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}

8
src/Magnum/Platform/CMakeLists.txt

@ -232,14 +232,14 @@ endif()
# Magnum Info
if(WITH_MAGNUMINFO)
add_executable(magnum-info magnum-info.cpp)
if(UNIX AND NOT CORRADE_TARGET_NACL AND NOT APPLE)
target_link_libraries(magnum-info MagnumWindowlessGlxApplication ${X11_LIBRARIES})
if(CORRADE_TARGET_APPLE)
target_link_libraries(magnum-info MagnumWindowlessCglApplication)
elseif(CORRADE_TARGET_NACL)
target_link_libraries(magnum-info MagnumWindowlessNaClApplication ppapi_cpp ppapi)
elseif(CORRADE_TARGET_UNIX)
target_link_libraries(magnum-info MagnumWindowlessGlxApplication ${X11_LIBRARIES})
elseif(CORRADE_TARGET_WINDOWS)
target_link_libraries(magnum-info MagnumWindowlessWglApplication)
elseif(APPLE)
target_link_libraries(magnum-info MagnumWindowlessCglApplication)
else()
message(FATAL_ERROR "magnum-info is not available on this platform. Set WITH_MAGNUMINFO to OFF to skip building it.")
endif()

4
src/Magnum/Platform/Sdl2Application.cpp

@ -143,7 +143,7 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) {
in Apple's GL drivers, thus we would be forever stuck on 2.1 without the
new features. In practice SDL fails to create 2.1 context on recent OS X
versions. */
#elif defined(__APPLE__)
#elif defined(CORRADE_TARGET_APPLE)
else {
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
@ -161,7 +161,7 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) {
}
/* Fall back to GL 2.1, if 3.2 context creation fails on OS X */
#ifdef __APPLE__
#ifdef CORRADE_TARGET_APPLE
if(!(context = SDL_GL_CreateContext(window))){
Warning() << "Platform::Sdl2Application::tryCreateContext(): cannot create core context:" << SDL_GetError() << "(falling back to compatibility context)";
SDL_DestroyWindow(window);

10
src/Magnum/Platform/magnum-info.cpp

@ -52,7 +52,7 @@
#ifdef CORRADE_TARGET_NACL
#include "Magnum/Platform/WindowlessNaClApplication.h"
#elif defined(__APPLE__)
#elif defined(CORRADE_TARGET_APPLE)
#include "Magnum/Platform/WindowlessCglApplication.h"
#elif defined(CORRADE_TARGET_UNIX)
#include "Magnum/Platform/WindowlessGlxApplication.h"
@ -102,10 +102,14 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
#ifdef CORRADE_TARGET_NACL
Debug() << "Used application: Platform::WindowlessNaClApplication";
#elif defined(__APPLE__)
#elif defined(CORRADE_TARGET_APPLE)
Debug() << "Used application: Platform::WindowlessCglApplication";
#else
#elif defined(CORRADE_TARGET_UNIX)
Debug() << "Used application: Platform::WindowlessGlxApplication";
#elif defined(CORRADE_TARGET_WINDOWS)
Debug() << "Used application: Platform::WindowlessWglApplication";
#else
#error No windowless application available on this platform
#endif
Debug() << "Compilation flags:";
#ifdef CORRADE_GCC47_COMPATIBILITY

2
src/Magnum/SceneGraph/CMakeLists.txt

@ -104,7 +104,7 @@ if(BUILD_TESTS)
# 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)
if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS MagnumSceneGraphTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}

6
src/Magnum/Text/CMakeLists.txt

@ -67,11 +67,11 @@ if(WITH_FONTCONVERTER)
add_executable(magnum-fontconverter fontconverter.cpp)
if(APPLE)
if(CORRADE_TARGET_APPLE)
target_link_libraries(magnum-fontconverter MagnumText Magnum MagnumWindowlessCglApplication)
elseif(UNIX AND NOT TARGET_GLES)
elseif(CORRADE_TARGET_UNIX AND NOT TARGET_GLES)
target_link_libraries(magnum-fontconverter MagnumText Magnum MagnumWindowlessGlxApplication ${X11_LIBRARIES})
elseif(WIN32)
elseif(CORRADE_TARGET_WINDOWS)
target_link_libraries(magnum-fontconverter MagnumText Magnum MagnumWindowlessWglApplication)
else()
message(FATAL_ERROR "magnum-fontconverter is not available on this platform. Set WITH_FONTCONVERTER to OFF to suppress this warning.")

2
src/Magnum/Text/fontconverter.cpp

@ -32,7 +32,7 @@
#include "Magnum/Text/DistanceFieldGlyphCache.h"
#include "Magnum/Trade/AbstractImageConverter.h"
#ifdef __APPLE__
#ifdef CORRADE_TARGET_APPLE
#include "Magnum/Platform/WindowlessCglApplication.h"
#elif defined(CORRADE_TARGET_UNIX)
#include "Magnum/Platform/WindowlessGlxApplication.h"

6
src/Magnum/TextureTools/CMakeLists.txt

@ -56,11 +56,11 @@ if(WITH_DISTANCEFIELDCONVERTER)
add_executable(magnum-distancefieldconverter distancefieldconverter.cpp)
if(APPLE)
if(CORRADE_TARGET_APPLE)
target_link_libraries(magnum-distancefieldconverter MagnumTextureTools MagnumWindowlessCglApplication Magnum)
elseif(UNIX AND NOT TARGET_GLES)
elseif(CORRADE_TARGET_UNIX AND NOT TARGET_GLES)
target_link_libraries(magnum-distancefieldconverter MagnumTextureTools Magnum MagnumWindowlessGlxApplication ${X11_LIBRARIES})
elseif(WIN32)
elseif(CORRADE_TARGET_WINDOWS)
target_link_libraries(magnum-distancefieldconverter MagnumTextureTools MagnumWindowlessWglApplication Magnum)
else()
message(FATAL_ERROR "magnum-distancefieldconverter is not available on this platform. Set WITH_DISTANCEFIELDCONVERTER to OFF to suppress this warning.")

2
src/Magnum/TextureTools/distancefieldconverter.cpp

@ -37,7 +37,7 @@
#include "Magnum/Trade/AbstractImageConverter.h"
#include "Magnum/Trade/ImageData.h"
#ifdef __APPLE__
#ifdef CORRADE_TARGET_APPLE
#include "Magnum/Platform/WindowlessCglApplication.h"
#elif defined(CORRADE_TARGET_UNIX)
#include "Magnum/Platform/WindowlessGlxApplication.h"

4
src/MagnumPlugins/MagnumFont/CMakeLists.txt

@ -38,7 +38,7 @@ add_plugin(MagnumFont ${MAGNUM_PLUGINS_FONT_DEBUG_INSTALL_DIR} ${MAGNUM_PLUGINS_
pluginRegistration.cpp)
target_link_libraries(MagnumFont Magnum MagnumText)
if(WIN32)
if(CORRADE_TARGET_WINDOWS)
target_link_libraries(MagnumFont TgaImporter)
endif()
@ -51,7 +51,7 @@ if(BUILD_GL_TESTS)
# 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)
if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS MagnumMagnumFontTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}

4
src/MagnumPlugins/MagnumFontConverter/CMakeLists.txt

@ -38,7 +38,7 @@ add_plugin(MagnumFontConverter ${MAGNUM_PLUGINS_FONTCONVERTER_DEBUG_INSTALL_DIR}
pluginRegistration.cpp)
target_link_libraries(MagnumFontConverter Magnum MagnumText)
if(WIN32)
if(CORRADE_TARGET_WINDOWS)
target_link_libraries(MagnumFontConverter TgaImageConverter)
endif()
@ -51,7 +51,7 @@ if(BUILD_GL_TESTS)
# 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)
if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS MagnumMagnumFontConverterTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}

2
src/MagnumPlugins/ObjImporter/CMakeLists.txt

@ -43,7 +43,7 @@ if(BUILD_TESTS)
# 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)
if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS MagnumObjImporterTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}

2
src/MagnumPlugins/TgaImageConverter/CMakeLists.txt

@ -47,7 +47,7 @@ if(BUILD_TESTS)
# 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)
if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS MagnumTgaImageConverterTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}

2
src/MagnumPlugins/TgaImporter/CMakeLists.txt

@ -48,7 +48,7 @@ if(BUILD_TESTS)
# 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)
if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS MagnumTgaImporterTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}

2
src/MagnumPlugins/WavAudioImporter/CMakeLists.txt

@ -54,7 +54,7 @@ if(BUILD_TESTS)
# 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)
if(CORRADE_TARGET_WINDOWS AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS MagnumWavAudioImporterTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}

Loading…
Cancel
Save