From 3c852e2891c4d7637ced6ac2e62e321cdfc8cbe4 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Tue, 6 Mar 2012 23:01:00 +0000 Subject: [PATCH] Allow fonttool to be compiled on linux. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10943 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- CMakeLists.txt | 28 +++------------------------- tools/font_tool/CFontTool.cpp | 2 +- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 58fb7fe02..d866dfbaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,6 @@ endif() option(USE_WIIUSE "Support for wiimote input devices" OFF) option(USE_FRIBIDI "Support for right-to-left languages" ON) -option(FONT_TOOL "Compile font tool" OFF) set(STK_SOURCE_DIR "src") set(STK_DATA_DIR "${PROJECT_SOURCE_DIR}/data") @@ -84,30 +83,6 @@ else() add_definitions(-DNDEBUG) endif() -find_package(Freetype) - -if(FONT_TOOL) - if(FREETYPE_FOUND) - message(STATUS "Freetype found") - find_package(X11) - include_directories(${FREETYPE_INCLUDE_DIRS}) - add_executable(font_tool - tools/font_tool/CFontTool.cpp - tools/font_tool/CFontTool.h - tools/font_tool/CVectorFontTool.h - tools/font_tool/main.cpp - ) - target_link_libraries(font_tool ${FREETYPE_LIBRARIES}) - target_link_libraries(font_tool ${X11_Xft_LIB}) - target_link_libraries(font_tool ${OPENGL_LIBRARIES}) - target_link_libraries(font_tool ${IRRLICHT_LIBRARIES}) - else() - message(STATUS "Freetype was not found, the font tool won't be built (only useful for developers)") - endif() -else() - message(STATUS "Font tool deactivated, the font tool won't be built (only useful for developers)") -endif() - # Provides list of source files in STK_SOURCES include(sources.cmake) @@ -172,6 +147,9 @@ if(USE_WIIUSE) add_definitions(-DENABLE_WIIUSE) endif() +# Optional tools +add_subdirectory(tools/font_tool) + # ==== Make dist target ==== add_custom_target(dist diff --git a/tools/font_tool/CFontTool.cpp b/tools/font_tool/CFontTool.cpp index 2774931d1..587827d84 100644 --- a/tools/font_tool/CFontTool.cpp +++ b/tools/font_tool/CFontTool.cpp @@ -456,7 +456,7 @@ bool LoadPoFiles(const char* sListFileName){ /* Get a list of the font foundries, storing them in a set to sort */ std::set foundries; Display* display = (Display*)Device->getVideoDriver()->getExposedVideoData().OpenGLLinux.X11Display; - XftFontSet* fonts = XftListFonts(display, DefaultScreen(display), 0, XFT_FOUNDRY, 0); + XftFontSet* fonts = XftListFonts(display, DefaultScreen(display), 0, XFT_FOUNDRY, NULL); for (int i = 0; i < fonts->nfont; i++) { char *foundry;