|
From: Lasse Kärkkäi. <tr...@us...> - 2009-12-11 04:40:37
|
Module: performous
Branch: master
Commit: ad36da993792323b24029b65629a6e9657479bcc
Author: Lasse Karkkainen <tro...@tr...>
Date: Fri Dec 11 06:40:18 2009 +0200
Make i18n optional
---
game/CMakeLists.txt | 19 ++++++++++++++++---
game/i18n.hh | 5 +++++
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index c823ded..e7e8ef0 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -20,19 +20,32 @@ else()
endif()
# Find all the libs that don't require extra parameters
-foreach(lib ${OUR_LIBS} SDL PangoCairo LibRSVG LibXML++ Magick++ GLEW AVFormat SWScale OpenGL Gettext Z Jpeg Tiff Png)
+foreach(lib ${OUR_LIBS} SDL PangoCairo LibRSVG LibXML++ Magick++ GLEW AVFormat SWScale OpenGL Z Jpeg Tiff Png)
find_package(${lib} REQUIRED)
include_directories(${${lib}_INCLUDE_DIRS})
list(APPEND LIBS ${${lib}_LIBRARIES})
add_definitions(${${lib}_DEFINITIONS})
endforeach(lib)
+find_package(Gettext)
+if(Gettext_FOUND)
+ include_directories(${Gettext_INCLUDE_DIRS})
+ list(APPEND LIBS ${Gettext_LIBRARIES})
+ add_definitions("-DHAVE_GETTEXT")
+ message(STATUS "Internationalization: Enabled")
+else()
+ message(STATUS "Internationalization: Disabled (libintl not found)")
+endif()
+
find_package(PortMidi)
if(PortMidi_FOUND)
- include_directories(PortMidi_INCLUDE_DIRS)
+ include_directories(${PortMidi_INCLUDE_DIRS})
list(APPEND LIBS ${PortMidi_LIBRARIES})
add_definitions("-DHAVE_PORTMIDI")
-endif(PortMidi_FOUND)
+ message(STATUS "MIDI I/O: Enabled")
+else()
+ message(STATUS "MIDI I/O: Disabled (libportmidi not found)")
+endif()
# Set default compile flags for GCC
if(CMAKE_COMPILER_IS_GNUCXX)
diff --git a/game/i18n.hh b/game/i18n.hh
index ed353e1..83c74f1 100644
--- a/game/i18n.hh
+++ b/game/i18n.hh
@@ -1,6 +1,11 @@
#pragma once
+#ifdef HAVE_GETTEXT
/* Internationalization Dependances */
#include <libintl.h>
#include <locale.h>
#define _(x) gettext(x)
+#else
+#define _(x) (x)
+#endif
+
|