1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 18:03:13 +02:00

Fixed some cmake warnings

This commit is contained in:
Adam
2011-08-27 20:47:30 -04:00
parent 670c928a9f
commit 28e8190e6b
3 changed files with 27 additions and 10 deletions
+13 -6
View File
@@ -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.
+8 -2
View File
@@ -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})
+6 -2
View File
@@ -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)