aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2011-07-20 17:56:49 +0200
committerNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2011-07-20 17:56:49 +0200
commit69937c342cc420d352f6f7f5c6c90383312b76d4 (patch)
treeefff8e50e488073fa25af864191b33d78c1d5bac /src/CMakeLists.txt
parent9bc701d194ea9e2bc56c1c9c473d6602e6070d60 (diff)
parent489a7ef3247f1db1f44efa2c7fbafb70c00f7812 (diff)
downloadminetest-69937c342cc420d352f6f7f5c6c90383312b76d4.tar.gz
minetest-69937c342cc420d352f6f7f5c6c90383312b76d4.tar.bz2
minetest-69937c342cc420d352f6f7f5c6c90383312b76d4.zip
Merge branch 'master' of github.com:erlehmann/minetest-delta
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)