Skip to content

Commit 92cbe2d

Browse files
committed
build: clean up NO_GETTEXT cmake support
Make NO_GETTEXT a build option aliased to ENV{NO_GETTEXT} to pass to vcpkg_install.bat to skip building gettext, which is a long build. Also do not build translations if NO_GETTEXT is set. Signed-off-by: Rafael Kitover <[email protected]>
1 parent 619e5fc commit 92cbe2d

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

contrib/buildsystems/CMakeLists.txt

+10-17
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ if(NOT WIN32)
7272
set(USE_VCPKG OFF CACHE BOOL FORCE)
7373
endif()
7474

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+
7582
if(NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)
7683
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
7784
message("settting CMAKE_EXPORT_COMPILE_COMMANDS: ${CMAKE_EXPORT_COMPILE_COMMANDS}")
@@ -195,8 +202,7 @@ find_package(CURL)
195202
find_package(EXPAT)
196203
find_package(Iconv)
197204

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)
200206
find_package(Intl)
201207
endif()
202208

@@ -229,18 +235,10 @@ if(WIN32 AND NOT MSVC)#not required for visual studio builds
229235
endif()
230236
endif()
231237

232-
if(NO_GETTEXT)
233-
message(STATUS "msgfmt not used under NO_GETTEXT")
234-
else()
238+
if(NOT NO_GETTEXT)
235239
find_program(MSGFMT_EXE msgfmt)
236240
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.")
244242
endif()
245243
endif()
246244

@@ -1056,7 +1054,6 @@ set(NO_PYTHON )
10561054
set(PAGER_ENV "LESS=FRX LV=-c")
10571055
set(DC_SHA1 YesPlease)
10581056
set(RUNTIME_PREFIX true)
1059-
set(NO_GETTEXT )
10601057

10611058
if(NOT CURL_FOUND)
10621059
set(NO_CURL 1)
@@ -1066,10 +1063,6 @@ if(NOT EXPAT_FOUND)
10661063
set(NO_EXPAT 1)
10671064
endif()
10681065

1069-
if(NOT Intl_FOUND)
1070-
set(NO_GETTEXT 1)
1071-
endif()
1072-
10731066
if(NOT PERL_TESTS)
10741067
set(NO_PERL 1)
10751068
endif()

0 commit comments

Comments
 (0)