Skip to content

Commit

Permalink
cmake: add warning for ignored MSGFMT_EXE
Browse files Browse the repository at this point in the history
It does not make sense to attempt to set MSGFMT_EXE when NO_GETTEXT is
configured, as such add a check for NO_GETTEXT before attempting to set
it.

suggested-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Matthew Rogers <mattr94@gmail.com>
  • Loading branch information
ROGERSM94 committed Jun 4, 2021
1 parent c3bf266 commit 07763a9
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions contrib/buildsystems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,18 @@ if(WIN32 AND NOT MSVC)#not required for visual studio builds
endif()
endif()

find_program(MSGFMT_EXE msgfmt)
if(NOT MSGFMT_EXE)
if (USING_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)
if(NO_GETTEXT)
message(STATUS "msgfmt not used under NO_GETTEXT")
else()
find_program(MSGFMT_EXE msgfmt)
if(NOT MSGFMT_EXE)
if (USING_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()
endif()
endif()

Expand Down

0 comments on commit 07763a9

Please sign in to comment.