Skip to content

Commit d7901d9

Browse files
committed
Use NuGet pkg Gettext.Tools for msgfmt on WIN32.
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]>
1 parent 319740f commit d7901d9

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

contrib/buildsystems/CMakeLists.txt

+14-10
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,22 @@ if(WIN32 AND NOT MSVC)#not required for visual studio builds
222222
endif()
223223
endif()
224224

225-
if(NO_GETTEXT)
226-
message(STATUS "msgfmt not used under NO_GETTEXT")
227-
else()
225+
226+
find_program(MSGFMT_EXE msgfmt)
227+
228+
if(NOT MSGFMT_EXE)
229+
if(WIN32)
230+
include(NuGet)
231+
nuget_install(Gettext.Tools)
232+
endif()
233+
234+
unset(MSGFMT_EXE)
235+
unset(MSGFMT_EXE CACHE)
236+
228237
find_program(MSGFMT_EXE msgfmt)
238+
229239
if(NOT MSGFMT_EXE)
230-
if(USE_VCPKG)
231-
set(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)
232-
endif()
233-
if(NOT EXISTS ${MSGFMT_EXE})
234-
message(WARNING "Text Translations won't be built")
235-
unset(MSGFMT_EXE)
236-
endif()
240+
message(WARNING "msgfmt not available and/or could not be installed, text translations won't be built.")
237241
endif()
238242
endif()
239243

0 commit comments

Comments
 (0)