@@ -72,6 +72,21 @@ if(NOT WIN32)
72
72
set (USE_VCPKG OFF CACHE BOOL FORCE)
73
73
endif ()
74
74
75
+ set (gettext_default TRUE )
76
+
77
+ # Turn off gettext by default when using vcpkg because it's a very
78
+ # long compile.
79
+ if (NOT USE_VCPKG)
80
+ set (gettext_default FALSE )
81
+ endif ()
82
+
83
+ build_option(
84
+ NO_GETTEXT
85
+ BOOL "Set to TRUE/ON to disable internationalization support using gettext and building translations using msgfmt from gettext-tools."
86
+ ${gettext_default}
87
+ ALIASES ENV{NO_GETTEXT}
88
+ )
89
+
75
90
if (NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)
76
91
set (CMAKE_EXPORT_COMPILE_COMMANDS TRUE )
77
92
message ("settting CMAKE_EXPORT_COMPILE_COMMANDS: ${CMAKE_EXPORT_COMPILE_COMMANDS} " )
@@ -195,8 +210,7 @@ find_package(CURL)
195
210
find_package (EXPAT)
196
211
find_package (Iconv)
197
212
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" )))
213
+ if (NOT NO_GETTEXT)
200
214
find_package (Intl)
201
215
endif ()
202
216
@@ -229,18 +243,10 @@ if(WIN32 AND NOT MSVC)#not required for visual studio builds
229
243
endif ()
230
244
endif ()
231
245
232
- if (NO_GETTEXT)
233
- message (STATUS "msgfmt not used under NO_GETTEXT" )
234
- else ()
246
+ if (NOT NO_GETTEXT)
235
247
find_program (MSGFMT_EXE msgfmt)
236
248
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 ()
249
+ message (WARNING "msgfmt not available and/or could not be installed, text translations won't be built." )
244
250
endif ()
245
251
endif ()
246
252
@@ -1056,7 +1062,6 @@ set(NO_PYTHON )
1056
1062
set (PAGER_ENV "LESS=FRX LV=-c" )
1057
1063
set (DC_SHA1 YesPlease)
1058
1064
set (RUNTIME_PREFIX true )
1059
- set (NO_GETTEXT )
1060
1065
1061
1066
if (NOT CURL_FOUND)
1062
1067
set (NO_CURL 1)
@@ -1066,10 +1071,6 @@ if(NOT EXPAT_FOUND)
1066
1071
set (NO_EXPAT 1)
1067
1072
endif ()
1068
1073
1069
- if (NOT Intl_FOUND)
1070
- set (NO_GETTEXT 1)
1071
- endif ()
1072
-
1073
1074
if (NOT PERL_TESTS)
1074
1075
set (NO_PERL 1)
1075
1076
endif ()
0 commit comments