aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2011-07-20 08:56:35 -0700
committerNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2011-07-20 08:56:35 -0700
commit489a7ef3247f1db1f44efa2c7fbafb70c00f7812 (patch)
tree0fdfa167644040940348abeac58709110a971a0c /src/CMakeLists.txt
parent2095b1581615f7b8c4f008886837fbbeaf75faec (diff)
parente787e16a833a988e9658dbfe556cc2cc1d7d0714 (diff)
downloadminetest-489a7ef3247f1db1f44efa2c7fbafb70c00f7812.tar.gz
minetest-489a7ef3247f1db1f44efa2c7fbafb70c00f7812.tar.bz2
minetest-489a7ef3247f1db1f44efa2c7fbafb70c00f7812.zip
Merge pull request #22 from SpeedProg/master
added gettext support
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index dfe5b5753..fd1591423 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -27,6 +27,14 @@ if(WIN32)
CACHE FILEPATH "Path to zlibwapi.lib")
set(ZLIB_DLL "${PROJECT_SOURCE_DIR}/../../zlib125dll/dll32/zlibwapi.dll"
CACHE FILEPATH "Path to zlibwapi.dll (for installation)")
+ set(GETTEXT_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/../../gettext/include"
+ CACHE PATH "gettext include directory")
+ set(GETTEXT_BIN_DIR "${PROJECT_SOURCE_DIR}/../../gettext/bin"
+ CACHE PATH "gettext bin directory")
+ set(GETTEXT_LIBRARIES "${PROJECT_SOURCE_DIR}/../../gettext/lib/intl.lib"
+ CACHE FILEPATH "gettext intl.lib")
+ set(IRRLICHT_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../irrlicht-1.7.2"
+ CACHE PATH "irrlicht dir")
else()
# Unix probably
if(BUILD_CLIENT)
@@ -134,6 +142,7 @@ include_directories(
${ZLIB_INCLUDE_DIR}
${CMAKE_BUILD_TYPE}
${PNG_INCLUDE_DIR}
+ ${GETTEXT_INCLUDE_DIR}
"${PROJECT_SOURCE_DIR}/jthread"
"${PROJECT_SOURCE_DIR}/sqlite"
)
@@ -151,6 +160,7 @@ if(BUILD_CLIENT)
${BZIP2_LIBRARIES}
${PNG_LIBRARIES}
${X11_LIBRARIES}
+ ${GETTEXT_LIBRARIES}
${PLATFORM_LIBS}
${CLIENT_PLATFORM_LIBS}
jthread
@@ -208,6 +218,10 @@ else()
set(ARCH i386)
endif()
+ if(WIN32)
+ set(CMAKE_EXE_LINKER_FLAGS "-lintl -L ${GETTEXT_BIN_DIR}")
+ endif()
+
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${WARNING_FLAGS} -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O1 -Wall ${WARNING_FLAGS}")
@@ -239,6 +253,8 @@ if(BUILD_CLIENT)
install(FILES ${images} DESTINATION ${DATADIR})
+ install(FILES ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo DESTINATION locale/de/LC_MESSAGES)
+
if(WIN32)
if(DEFINED IRRLICHT_DLL)
install(FILES ${IRRLICHT_DLL} DESTINATION ${BINDIR})
@@ -246,6 +262,10 @@ if(BUILD_CLIENT)
if(DEFINED ZLIB_DLL)
install(FILES ${ZLIB_DLL} DESTINATION ${BINDIR})
endif()
+ if(DEFINED GETTEXT_BIN_DIR)
+ install(FILES ${GETTEXT_BIN_DIR}/libintl3.dll DESTINATION ${BINDIR})
+ install(FILES ${GETTEXT_BIN_DIR}/libiconv2.dll DESTINATION ${BINDIR})
+ endif()
endif()
endif(BUILD_CLIENT)
@@ -253,6 +273,27 @@ if(BUILD_SERVER)
install(TARGETS minetestserver DESTINATION ${BINDIR})
endif(BUILD_SERVER)
+if(WIN32)
+ set(GETTEXT_MSGFMT "${GETTEXT_BIN_DIR}/msgfmt" CACHE FILEPATH "path to msgfmt")
+elseif(APPLE)
+ set(GETTEXT_MSGFMT "${GETTEXT_BIN_DIR}/msgfmt" CACHE FILEPATH "path to msgfmt")
+else()
+ set(GETTEXT_MSGFMT "msgfmt")
+endif()
+
+add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMENT "mo-update [de]: Creating locale directory.")
+
+add_custom_command(
+ OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo
+ COMMAND ${GETTEXT_MSGFMT} -o ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po
+ DEPENDS
+ ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES
+ ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/po/de
+ COMMENT "mo-update [de]: Creating mo file."
+ )
+add_custom_target(translation_de ALL COMMENT "mo update [de]" DEPENDS ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo)
+
# Subdirectories
add_subdirectory(jthread)