diff mbox series

[3/3] cmake: add warning for ignored MSGFMT_EXE

Message ID 07763a9de723af8674b707ba762845fd414bd0a6.1622828605.git.gitgitgadget@gmail.com (mailing list archive)
State Superseded
Headers show
Series Make CMake work out of the box | expand

Commit Message

Matt Rogers June 4, 2021, 5:43 p.m. UTC
From: Matthew Rogers <mattr94@gmail.com>

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>
---
 contrib/buildsystems/CMakeLists.txt | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

Comments

Eric Sunshine June 4, 2021, 6:10 p.m. UTC | #1
On Fri, Jun 4, 2021 at 1:44 PM Matthew Rogers via GitGitGadget
<gitgitgadget@gmail.com> wrote:
> 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.

This would be easier to digest if "as such" is the start of a new
sentence: "As such...". Or "Therefore, add a check...".

> suggested-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> Signed-off-by: Matthew Rogers <mattr94@gmail.com>

s/suggested-by/Suggested-by:/

Tiny little nits, both. Don't know if it's worth a re-roll, but if you
happen to re-roll for some other reason, perhaps these could be
tweaked.
diff mbox series

Patch

diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index 99150c8f5853..ea43a4f9cc9f 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -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()