mirror of
https://github.com/anope/anope.git
synced 2026-06-27 03:56:37 +02:00
Update FindGettext.cmake for new Windows stuff and fix language.cpp
compile
This commit is contained in:
+6
-14
@@ -2,33 +2,25 @@
|
||||
if(NOT WIN32)
|
||||
find_path(GETTEXT_INCLUDE libintl.h /usr/include /usr/local/include ${EXTRA_INCLUDE})
|
||||
find_library(GETTEXT_LIBRARY intl PATHS /usr/lib /usr/lib64 ${EXTRA_LIBS})
|
||||
find_library(ICONV_LIBRARY iconv PATHS /usr/lib /usr/lib64 ${EXTRA_LIBS})
|
||||
find_program(GETTEXT_MSGFMT msgfmt PATHS /usr/bin/ /usr/local/bin ${EXTRA_INCLUDE})
|
||||
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
|
||||
set(GETTEXT_FOUND TRUE)
|
||||
if(GETTEXT_LIBRARY)
|
||||
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY})
|
||||
endif(GETTEXT_LIBRARY)
|
||||
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
|
||||
else(NOT WIN32)
|
||||
find_path(GETTEXT_INCLUDE libintl.h ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include gettext/include ${EXTRA_INCLUDE})
|
||||
find_library(GETTEXT_LIBRARY libintl PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
|
||||
find_library(ICONV_LIBRARY libiconv PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
|
||||
find_library(MINGWEX_LIBRARY libmingwex PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
|
||||
find_library(GCC_LIBRARY libgcc PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
|
||||
find_program(GETTEXT_MSGFMT msgfmt PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/bin $ENV{VCINSTALLDIR}/bin gettext/bin ${EXTRA_INCLUDE})
|
||||
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT AND ICONV_LIBRARY AND MINGWEX_LIBRARY AND GCC_LIBRARY)
|
||||
if(GETTEXT_INCLUDE AND GETTEXT_LIBRARY AND GETTEXT_MSGFMT)
|
||||
set(GETTEXT_FOUND TRUE)
|
||||
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT AND ICONV_LIBRARY AND MINGWEX_LIBRARY AND GCC_LIBRARY)
|
||||
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY})
|
||||
endif(GETTEXT_INCLUDE AND GETTEXT_LIBRARY AND GETTEXT_MSGFMT)
|
||||
endif(NOT WIN32)
|
||||
|
||||
# If we found everything we need set variables correctly for lang/CMakeLists.txt to use
|
||||
if(GETTEXT_FOUND)
|
||||
include_directories("${GETTEXT_INCLUDE}")
|
||||
set(GETTEXT_MSGFMT_EXECUTABLE ${GETTEXT_MSGFMT})
|
||||
|
||||
if(WIN32)
|
||||
set(GETTEXT_LIBRARIES libiconv libintl libmingwex libgcc)
|
||||
else(WIN32)
|
||||
if(GETTEXT_LIBRARY)
|
||||
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY} ${ICONV_LIBRARY})
|
||||
endif(GETTEXT_LIBRARY)
|
||||
endif(WIN32)
|
||||
endif(GETTEXT_FOUND)
|
||||
|
||||
+1
-5
@@ -86,11 +86,7 @@ if(WIN32)
|
||||
target_link_libraries(${PROGRAM_NAME} wsock32 Ws2_32 ${LINK_LIBS} ${GETTEXT_LIBRARIES} ${WIN32_MEMORY})
|
||||
set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}")
|
||||
else(WIN32)
|
||||
if(GETTEXT_LIBRARIES)
|
||||
target_link_libraries(${PROGRAM_NAME} ${LINK_LIBS} ${GETTEXT_LIBRARIES})
|
||||
else(GETTEXT_LIBRARIES)
|
||||
target_link_libraries(${PROGRAM_NAME} ${LINK_LIBS})
|
||||
endif(GETTEXT_LIBRARIES)
|
||||
target_link_libraries(${PROGRAM_NAME} ${LINK_LIBS} ${GETTEXT_LIBRARIES})
|
||||
endif(WIN32)
|
||||
# Building the Anope executable requires the version.h header to be generated
|
||||
add_dependencies(${PROGRAM_NAME} headers)
|
||||
|
||||
@@ -76,8 +76,6 @@ const char *Language::Translate(const NickCore *nc, const char *string)
|
||||
|
||||
#if GETTEXT_FOUND
|
||||
|
||||
extern "C" int _nl_msg_cat_cntr;
|
||||
|
||||
const char *Language::Translate(const char *lang, const char *string)
|
||||
{
|
||||
if (!string || !*string)
|
||||
@@ -86,7 +84,6 @@ const char *Language::Translate(const char *lang, const char *string)
|
||||
if (!lang || !*lang)
|
||||
lang = Config->DefLanguage.c_str();
|
||||
|
||||
++_nl_msg_cat_cntr;
|
||||
#ifdef _WIN32
|
||||
SetThreadLocale(MAKELCID(MAKELANGID(WindowsGetLanguage(lang), SUBLANG_DEFAULT), SORT_DEFAULT));
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user