diff options
| author | Adam <Adam@anope.org> | 2010-09-26 03:21:00 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-09-26 03:21:00 -0400 |
| commit | 7d5893a1c8af78b0f56431664f48c73134735c64 (patch) | |
| tree | 9d19cfd3784d8ac2e69305611de31fae0d6cd25c | |
| parent | d646d455e2655be59f6d5bcc56710ac70548ca37 (diff) | |
Properly detect gettext and dont build langfiles on systems without it
| -rw-r--r-- | CMakeLists.txt | 1 | ||||
| -rw-r--r-- | lang/CMakeLists.txt | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ada20aa14..a92086489 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -331,7 +331,6 @@ check_function_exists(strlcpy HAVE_STRLCPY) check_function_exists(umask HAVE_UMASK) check_function_exists(backtrace HAVE_BACKTRACE) check_function_exists(eventfd HAVE_EVENTFD) -check_function_exists(gettext HAVE_GETTEXT) # Check for the existance of the following types check_type_size(uint8_t UINT8_T) diff --git a/lang/CMakeLists.txt b/lang/CMakeLists.txt index bb05cf921..622888900 100644 --- a/lang/CMakeLists.txt +++ b/lang/CMakeLists.txt @@ -1,5 +1,8 @@ +# Find gettext +INCLUDE(FindGettext) + # Only do this if gettext is installed -if(HAVE_GETTEXT) +if(GETTEXT_FOUND) # Get all of the .po files file(GLOB LANG_SRCS_PO RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.*.po") sort_list(LANG_SRCS_PO) @@ -19,7 +22,7 @@ if(HAVE_GETTEXT) # Add the .mo file to a list for use later with add_custom_target append_to_list(LANG_SRCS_MO ${CMAKE_CURRENT_BINARY_DIR}/${LANG_MO}) # Run msgfmt on the language file, depends on the .po file - add_custom_command(OUTPUT ${LANG_MO} COMMAND msgfmt -c ${CMAKE_CURRENT_SOURCE_DIR}/${LANG_PO} -o ${CMAKE_CURRENT_BINARY_DIR}/${LANG_MO} MAIN_DEPENDENCY ${LANG_PO}) + add_custom_command(OUTPUT ${LANG_MO} COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -c ${CMAKE_CURRENT_SOURCE_DIR}/${LANG_PO} -o ${CMAKE_CURRENT_BINARY_DIR}/${LANG_MO} MAIN_DEPENDENCY ${LANG_PO}) # Add to cpack ignored files if not on Windows. file(RELATIVE_PATH LANG_RELATIVE ${Anope_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/${LANG_LANG}) if(NOT WIN32) @@ -33,4 +36,4 @@ if(HAVE_GETTEXT) # Generate languages, depends on the mo files add_custom_target(language DEPENDS ${LANG_SRCS_MO}) -endif(HAVE_GETTEXT) +endif(GETTEXT_FOUND) |
