Skip to content

Commit

Permalink
build: use NuGet Gettext.Tools for msgfmt on WIN32
Browse files Browse the repository at this point in the history
Use the nuget_install() function introduced in 3b05adf (build: add
nuget_install() in cmake/NuGet.cmake, 2022-02-10) to download the
Gettext.Tools package for the msgfmt utility on Windows if it's not
available.

Signed-off-by: Rafael Kitover <[email protected]>
  • Loading branch information
rkitover committed Feb 15, 2022
1 parent 62ae805 commit 4aeb5bb
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions contrib/buildsystems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,18 +229,21 @@ if(WIN32 AND NOT MSVC)#not required for visual studio builds
endif()
endif()

if(NO_GETTEXT)
message(STATUS "msgfmt not used under NO_GETTEXT")
else()
find_program(MSGFMT_EXE msgfmt)

if(NOT MSGFMT_EXE)
if(WIN32)
include(NuGet)
nuget_install(Gettext.Tools)
endif()

unset(MSGFMT_EXE)
unset(MSGFMT_EXE CACHE)

find_program(MSGFMT_EXE msgfmt)

if(NOT MSGFMT_EXE)
if(USE_VCPKG)
set(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)
endif()
if(NOT EXISTS ${MSGFMT_EXE})
message(WARNING "Text Translations won't be built")
unset(MSGFMT_EXE)
endif()
message(WARNING "msgfmt not available and/or could not be installed, text translations won't be built.")
endif()
endif()

Expand Down

0 comments on commit 4aeb5bb

Please sign in to comment.