Browse Source

gettext cmake changes

master
darkrose 4 years ago
parent
commit
a13ab57f86
2 changed files with 5 additions and 14 deletions
  1. 2
    2
      cmake/Modules/FindGettextLib.cmake
  2. 3
    12
      src/CMakeLists.txt

+ 2
- 2
cmake/Modules/FindGettextLib.cmake View File

@@ -14,8 +14,8 @@ FIND_PROGRAM(GETTEXT_MSGFMT
IF(GETTEXT_MSGFMT)
SET(GETTEXT_FOUND TRUE)
SET(GETTEXT_PO_PATH ${CMAKE_SOURCE_DIR}/po)
SET(GETTEXT_MO_BUILD_PATH ${CMAKE_BINARY_DIR}/locale/<locale>/LC_MESSAGES)
SET(GETTEXT_MO_DEST_PATH ${SHAREDIR}/../locale/<locale>/LC_MESSAGES)
SET(GETTEXT_MO_BUILD_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../data/locale/<locale>)
SET(GETTEXT_MO_DEST_PATH ${SHAREDIR}/locale/<locale>)
FILE(GLOB GETTEXT_AVAILABLE_LOCALES RELATIVE ${GETTEXT_PO_PATH} "${GETTEXT_PO_PATH}/*")
LIST(REMOVE_ITEM GETTEXT_AVAILABLE_LOCALES voxelands.pot)
MACRO(SET_MO_PATHS _buildvar _destvar _locale)

+ 3
- 12
src/CMakeLists.txt View File

@@ -5,23 +5,14 @@ if(RUN_IN_PLACE)
add_definitions ( -DRUN_IN_PLACE )
endif(RUN_IN_PLACE)

# user-visible option to enable/disable gettext usage
OPTION(ENABLE_GETTEXT "Use GetText for internationalization" ON)

# this is only set to 1 if gettext is enabled _and_ available
set(USE_GETTEXT 0)
set(USE_GETTEXT 1)

find_package(GettextLib)

if(GETTEXT_FOUND AND ENABLE_GETTEXT)
if(GETTEXT_FOUND)
message(STATUS "gettext msgfmt path: ${GETTEXT_MSGFMT}")
set(USE_GETTEXT 1)
message(STATUS "GetText enabled; locales found: ${GETTEXT_AVAILABLE_LOCALES}")
elseif(GETTEXT_FOUND AND NOT ENABLE_GETTEXT)
MESSAGE(STATUS "GetText found but disabled;")
else(GETTEXT_FOUND AND ENABLE_GETTEXT)
message(STATUS "GetText disabled")
endif(GETTEXT_FOUND AND ENABLE_GETTEXT)
endif(GETTEXT_FOUND)

# user visible option to enable/disable audio
OPTION(ENABLE_AUDIO "Enable audio" ON)

Loading…
Cancel
Save