Browse Source

Enabled other utilities on Windows.

pull/54/head
Vladimír Vondruš 12 years ago
parent
commit
df26073620
  1. 4
      CMakeLists.txt
  2. 2
      doc/building.dox
  3. 14
      src/Magnum/Text/CMakeLists.txt
  4. 9
      src/Magnum/Text/fontconverter.cpp
  5. 14
      src/Magnum/TextureTools/CMakeLists.txt
  6. 9
      src/Magnum/TextureTools/distancefieldconverter.cpp

4
CMakeLists.txt

@ -80,8 +80,8 @@ if((CORRADE_TARGET_UNIX AND NOT APPLE) OR CORRADE_TARGET_NACL OR CORRADE_TARGET_
option(WITH_MAGNUMINFO "Build magnum-info utility" OFF)
endif()
# Utilities (currently depending on WindowlessGlxApplication)
if(CORRADE_TARGET_UNIX AND NOT APPLE)
# Utilities (currently only using GLX or WGL)
if((CORRADE_TARGET_UNIX AND NOT APPLE) OR CORRADE_TARGET_WINDOWS)
cmake_dependent_option(WITH_FONTCONVERTER "Build magnum-fontconverter utility" OFF "NOT TARGET_GLES" OFF)
cmake_dependent_option(WITH_DISTANCEFIELDCONVERTER "Build magnum-distancefieldconverter utility" OFF "NOT TARGET_GLES" OFF)
endif()

2
doc/building.dox

@ -204,7 +204,7 @@ platform best:
- `WITH_WINDOWLESSWGLAPPLICATION` - @ref Platform::WindowlessWglApplication "WindowlessWglApplication"
There are also a few command-line utilities. They are currently available only
on Linux and are disabled by default:
on Linux and Windows, also disabled by default:
- `WITH_MAGNUMINFO` - `magnum-info` executable, provides information about
the engine and OpenGL capabilities.

14
src/Magnum/Text/CMakeLists.txt

@ -60,17 +60,21 @@ install(TARGETS MagnumText
install(FILES ${MagnumText_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Text)
if(WITH_FONTCONVERTER)
if(NOT UNIX OR TARGET_GLES)
message(FATAL_ERROR "magnum-fontconverter is not available on this platform. Set WITH_FONTCONVERTER to OFF to suppress this warning.")
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/configure.h)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
add_executable(magnum-fontconverter fontconverter.cpp)
target_link_libraries(magnum-fontconverter MagnumText Magnum MagnumWindowlessGlxApplication ${X11_LIBRARIES})
if(UNIX AND NOT TARGET_GLES)
target_link_libraries(magnum-fontconverter MagnumText Magnum MagnumWindowlessGlxApplication ${X11_LIBRARIES})
elseif(WIN32)
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.")
endif()
install(TARGETS magnum-fontconverter DESTINATION ${MAGNUM_BINARY_INSTALL_DIR})
endif()

9
src/Magnum/Text/fontconverter.cpp

@ -27,12 +27,19 @@
#include <Corrade/Utility/Arguments.h>
#include <Corrade/Utility/Directory.h>
#include "Magnum/Platform/WindowlessGlxApplication.h"
#include "Magnum/Text/AbstractFont.h"
#include "Magnum/Text/AbstractFontConverter.h"
#include "Magnum/Text/DistanceFieldGlyphCache.h"
#include "Magnum/Trade/AbstractImageConverter.h"
#ifdef CORRADE_TARGET_UNIX
#include "Magnum/Platform/WindowlessGlxApplication.h"
#elif defined(CORRADE_TARGET_WINDOWS)
#include "Magnum/Platform/WindowlessWglApplication.h"
#else
#error No windowless application available on this platform
#endif
#include "configure.h"
namespace Magnum { namespace Text {

14
src/Magnum/TextureTools/CMakeLists.txt

@ -49,17 +49,21 @@ endif()
target_link_libraries(MagnumTextureTools Magnum)
if(WITH_DISTANCEFIELDCONVERTER)
if(NOT UNIX OR TARGET_GLES)
message(FATAL_ERROR "magnum-distancefieldconverter is not available on this platform. Set WITH_DISTANCEFIELDCONVERTER to OFF to suppress this warning.")
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/distancefieldconverterConfigure.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/distancefieldconverterConfigure.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable(magnum-distancefieldconverter distancefieldconverter.cpp)
target_link_libraries(magnum-distancefieldconverter MagnumTextureTools Magnum MagnumWindowlessGlxApplication ${X11_LIBRARIES})
if(UNIX AND NOT TARGET_GLES)
target_link_libraries(magnum-distancefieldconverter MagnumTextureTools Magnum MagnumWindowlessGlxApplication ${X11_LIBRARIES})
elseif(WIN32)
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.")
endif()
install(TARGETS magnum-distancefieldconverter DESTINATION ${MAGNUM_BINARY_INSTALL_DIR})
endif()

9
src/Magnum/TextureTools/distancefieldconverter.cpp

@ -32,12 +32,19 @@
#include "Magnum/Renderer.h"
#include "Magnum/Texture.h"
#include "Magnum/TextureFormat.h"
#include "Magnum/Platform/WindowlessGlxApplication.h"
#include "Magnum/TextureTools/DistanceField.h"
#include "Magnum/Trade/AbstractImporter.h"
#include "Magnum/Trade/AbstractImageConverter.h"
#include "Magnum/Trade/ImageData.h"
#ifdef CORRADE_TARGET_UNIX
#include "Magnum/Platform/WindowlessGlxApplication.h"
#elif defined(CORRADE_TARGET_WINDOWS)
#include "Magnum/Platform/WindowlessWglApplication.h"
#else
#error No windowless application available on this platform
#endif
#include "distancefieldconverterConfigure.h"
namespace Magnum { namespace TextureTools {

Loading…
Cancel
Save