@@ -54,6 +54,10 @@ to the path or pass the path as `-DVCPKG_DIR=/your/clone/of/vcpkg`.
54
54
To set the vcpkg arch (target triplet) pass `VCPKG_ARCH` or
55
55
`VCPKG_TARGET_TRIPLET` e.g.: `-DVCPKG_ARCH=x64-windows`.
56
56
57
+ By default for vcpkg, gettext is not built and translations do not
58
+ work because gettext is a very long compile. To enable translations
59
+ pass `-DNO_GETTEXT=FALSE`.
60
+
57
61
The Visual Studio default generator changed in v16.6 from its Visual Studio
58
62
implemenation to `Ninja` This required changes to many CMake scripts.
59
63
@@ -72,6 +76,21 @@ if(NOT WIN32)
72
76
set (USE_VCPKG OFF CACHE BOOL FORCE)
73
77
endif ()
74
78
79
+ set (gettext_default TRUE )
80
+
81
+ # Turn off gettext by default when using vcpkg because it's a very
82
+ # long compile.
83
+ if (NOT USE_VCPKG)
84
+ set (gettext_default FALSE )
85
+ endif ()
86
+
87
+ build_option(
88
+ NO_GETTEXT
89
+ BOOL "Set to TRUE/ON to disable internationalization support using gettext and building translations using msgfmt from gettext-tools."
90
+ ${gettext_default}
91
+ ALIASES ENV{NO_GETTEXT}
92
+ )
93
+
75
94
if (NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)
76
95
set (CMAKE_EXPORT_COMPILE_COMMANDS TRUE )
77
96
message ("settting CMAKE_EXPORT_COMPILE_COMMANDS: ${CMAKE_EXPORT_COMPILE_COMMANDS} " )
@@ -195,8 +214,7 @@ find_package(CURL)
195
214
find_package (EXPAT)
196
215
find_package (Iconv)
197
216
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" )))
217
+ if (NOT NO_GETTEXT)
200
218
find_package (Intl)
201
219
endif ()
202
220
@@ -229,18 +247,10 @@ if(WIN32 AND NOT MSVC)#not required for visual studio builds
229
247
endif ()
230
248
endif ()
231
249
232
- if (NO_GETTEXT)
233
- message (STATUS "msgfmt not used under NO_GETTEXT" )
234
- else ()
250
+ if (NOT NO_GETTEXT)
235
251
find_program (MSGFMT_EXE msgfmt)
236
252
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 ()
253
+ message (WARNING "msgfmt not available and/or could not be installed, text translations won't be built." )
244
254
endif ()
245
255
endif ()
246
256
@@ -1056,7 +1066,6 @@ set(NO_PYTHON )
1056
1066
set (PAGER_ENV "LESS=FRX LV=-c" )
1057
1067
set (DC_SHA1 YesPlease)
1058
1068
set (RUNTIME_PREFIX true )
1059
- set (NO_GETTEXT )
1060
1069
1061
1070
if (NOT CURL_FOUND)
1062
1071
set (NO_CURL 1)
@@ -1066,10 +1075,6 @@ if(NOT EXPAT_FOUND)
1066
1075
set (NO_EXPAT 1)
1067
1076
endif ()
1068
1077
1069
- if (NOT Intl_FOUND)
1070
- set (NO_GETTEXT 1)
1071
- endif ()
1072
-
1073
1078
if (NOT PERL_TESTS)
1074
1079
set (NO_PERL 1)
1075
1080
endif ()
0 commit comments