summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-08-27 20:47:30 -0400
committerAdam <Adam@anope.org>2011-08-27 20:47:30 -0400
commit28e8190e6bc96f2f3f4c53d611fc349d50092c3f (patch)
tree10960a97f4fa292624739779f0244d226533837c
parent670c928a9f10c37aca748fe6bd0ddda741f7d7d9 (diff)
Fixed some cmake warnings
-rw-r--r--docs/LANGUAGE19
-rw-r--r--modules/CMakeLists.txt10
-rw-r--r--src/CMakeLists.txt8
3 files changed, 27 insertions, 10 deletions
diff --git a/docs/LANGUAGE b/docs/LANGUAGE
index ca3838639..c4e3ebba8 100644
--- a/docs/LANGUAGE
+++ b/docs/LANGUAGE
@@ -7,7 +7,7 @@ Anope Mutli Language Support
1) Building Anope with gettext support
- To build Anope with gettext support gettext and its devlopmental libraries must be installed on the system.
+ To build Anope with gettext support, gettext and its development libraries must be installed on the system.
Anope does not require locales to be installed or enabled on the system, but does require the locales-all
package on Debian and Debian based systems.
@@ -32,8 +32,15 @@ Anope Mutli Language Support
3) Using langages with modules
Module authors can easially add the ability to have their modules translated by adding _() around the strings they
- need translated (messages to the user, etc). See a few of the modules in /modules/extras (cs_appendtopic, hs_request)
- for examples of this. If you want to translate a module someone has made, first generate a .pot file if there is none.
- Run `xgettext -s -d modulename -o modulename.pot --from-code=utf-8 modulename.cpp`. Then, run msginit on the .pot file
- with `msginit -l language -o modulename.language.po -i modulename.pot`. Translate the new .po file, then place it in
- the lang folder and rerun ./Config; make && make install.
+ want translated (messages to the user, etc).
+
+ If you want to translate a module someone has made, first generate a .pot file if there isn't one already using
+ xgettext -s -d modulename -o modulename.pot --from-code=utf-8 modulename.cpp`
+ The .pot file is a template of all of the language strings extracted from the source file.
+
+ Next, run msginit on the .pot file with
+ `msginit -l language -o modulename.language.po -i modulename.pot`.
+ Translate the new .po file and rerun ./Config; make && make install.
+
+ All .po and .pot files should be placed in modules/language/third. Additionally an update script is provided there
+ that will create .pot files and merge any changes to it with existing .po files.
diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt
index d4bd3f7a1..6fa017fd6 100644
--- a/modules/CMakeLists.txt
+++ b/modules/CMakeLists.txt
@@ -77,7 +77,10 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
set(WIN32_NO_LIBS)
endif(WIN32)
set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${TEMP_LDFLAGS} ${WIN32_NO_LIBS}")
- add_dependencies(${SO} ${PROGRAM_NAME} module_language)
+ add_dependencies(${SO} ${PROGRAM_NAME})
+ if(GETTEXT_FOUND)
+ add_dependencies(${SO} module_language)
+ endif(GETTEXT_FOUND)
# For Windows only, have the module link to the export library of Anope as well as wsock32 and Ws2_32 libraries (most of the modules probably don't need this, but this is to be on the safe side), also set it's version
if(WIN32)
target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 Ws2_32 ${WIN32_MEMORY} ${TEMP_DEPENDENCIES})
@@ -174,7 +177,10 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
# Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand
add_library(${SO} MODULE ${MODULES_SUBDIR_SRCS})
set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${SUBDIR_LDFLAGS}")
- add_dependencies(${SO} ${PROGRAM_NAME} module_language)
+ add_dependencies(${SO} ${PROGRAM_NAME})
+ if(GETTEXT_FOUND)
+ add_dependencies(${SO} module_language)
+ endif(GETTEXT_FOUND)
# For Windows only, have the module link to the export library of Anope as well as wsock32 and Ws2_32 libraries (most of the modules probably don't need this, but this is to be on the safe side), also set it's version
if(WIN32)
target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 Ws2_32 ${WIN32_MEMORY} ${SUBDIR_EXTRA_DEPENDS})
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a01b608a4..d564a8965 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -96,8 +96,12 @@ else(WIN32)
target_link_libraries(${PROGRAM_NAME} ${GETTEXT_LIBRARIES})
endif(GETTEXT_LIBRARIES)
endif(WIN32)
-# Building the Anope executable requires the language files to be compiled first as well as the version.h header to be generated
-add_dependencies(${PROGRAM_NAME} language headers)
+# Building the Anope executable requires the version.h header to be generated
+add_dependencies(${PROGRAM_NAME} headers)
+# Also require the language files if we have gettext
+if(GETTEXT_FOUND)
+ add_dependencies(${PROGRAM_NAME} language)
+endif(GETTEXT_FOUND)
# Get the filename of the Anope executable as it is in on this system
get_target_property(SERVICES_BINARY ${PROGRAM_NAME} LOCATION)