Skip to content

Commit

Permalink
Use NuGet pkg Gettext.Tools for msgfmt on WIN32.
Browse files Browse the repository at this point in the history
Use the nuget_install() function introduced in 5c2d0afc7c 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 10, 2022
1 parent 319740f commit d7901d9
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions contrib/buildsystems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,18 +222,22 @@ 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 d7901d9

Please sign in to comment.