summaryrefslogtreecommitdiff
path: root/contrib/buildsystems
diff options
context:
space:
mode:
authorLibravatar Matthew Rogers <mattr94@gmail.com>2021-06-06 12:02:54 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-06-11 15:23:24 +0900
commitce24797d388ab0fc13605d25239ae08bcb9c6738 (patch)
treee3601b3fd8c7073000fe76be7d68b93ae148f58e /contrib/buildsystems
parentcmake: create compile_commands.json by default (diff)
downloadtgif-ce24797d388ab0fc13605d25239ae08bcb9c6738.tar.xz
cmake: add warning for ignored MSGFMT_EXE
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> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/buildsystems')
-rw-r--r--contrib/buildsystems/CMakeLists.txt20
1 files changed, 12 insertions, 8 deletions
diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index 67b722ffd4..675e2ae6fb 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -185,14 +185,18 @@ if(WIN32 AND NOT MSVC)#not required for visual studio builds
endif()
endif()
-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)
+if(NO_GETTEXT)
+ message(STATUS "msgfmt not used under NO_GETTEXT")
+else()
+ 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()
endif()
endif()