@@ -72,6 +72,13 @@ if(NOT WIN32)
72
72
set (USE_VCPKG OFF CACHE BOOL FORCE )
73
73
endif ()
74
74
75
+ build_option (
76
+ NO_GETTEXT
77
+ BOOL "Set to TRUE/ON to disable internationalization support using gettext and building translations using msgfmt from gettext-tools."
78
+ FALSE
79
+ ALIASES ENV{NO_GETTEXT}
80
+ )
81
+
75
82
if (NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS )
76
83
set (CMAKE_EXPORT_COMPILE_COMMANDS TRUE )
77
84
message ("settting CMAKE_EXPORT_COMPILE_COMMANDS: ${CMAKE_EXPORT_COMPILE_COMMANDS} " )
@@ -195,8 +202,7 @@ find_package(CURL)
195
202
find_package (EXPAT )
196
203
find_package (Iconv )
197
204
198
- #Don't use libintl on Windows Visual Studio and Clang builds
199
- if (NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "MSVC" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" )))
205
+ if (NOT NO_GETTEXT )
200
206
find_package (Intl )
201
207
endif ()
202
208
@@ -229,18 +235,10 @@ if(WIN32 AND NOT MSVC)#not required for visual studio builds
229
235
endif ()
230
236
endif ()
231
237
232
- if (NO_GETTEXT )
233
- message (STATUS "msgfmt not used under NO_GETTEXT" )
234
- else ()
238
+ if (NOT NO_GETTEXT )
235
239
find_program (MSGFMT_EXE msgfmt )
236
240
if (NOT MSGFMT_EXE )
237
- if (USE_VCPKG )
238
- set (MSGFMT_EXE ${CMAKE_SOURCE_DIR} /compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe )
239
- endif ()
240
- if (NOT EXISTS ${MSGFMT_EXE} )
241
- message (WARNING "Text Translations won't be built" )
242
- unset (MSGFMT_EXE )
243
- endif ()
241
+ message (WARNING "msgfmt not available and/or could not be installed, text translations won't be built." )
244
242
endif ()
245
243
endif ()
246
244
@@ -1056,7 +1054,6 @@ set(NO_PYTHON )
1056
1054
set (PAGER_ENV "LESS=FRX LV=-c" )
1057
1055
set (DC_SHA1 YesPlease )
1058
1056
set (RUNTIME_PREFIX true )
1059
- set (NO_GETTEXT )
1060
1057
1061
1058
if (NOT CURL_FOUND )
1062
1059
set (NO_CURL 1 )
@@ -1066,10 +1063,6 @@ if(NOT EXPAT_FOUND)
1066
1063
set (NO_EXPAT 1 )
1067
1064
endif ()
1068
1065
1069
- if (NOT Intl_FOUND )
1070
- set (NO_GETTEXT 1 )
1071
- endif ()
1072
-
1073
1066
if (NOT PERL_TESTS )
1074
1067
set (NO_PERL 1 )
1075
1068
endif ()
0 commit comments