git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
MGMatthew Rogers via GitGitGadget <gitgitgadget@gmail.com>
Date
Jun 6, 2021, 12:02 UTC
Message-ID
<2110c8ffa423e90224089d048291f4392aa50eab.1622980974.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.970.v2.git.1622980974.gitgitgadget@gmail.com>
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(-)
diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index 399a3cd6c071..3dc7ffcd98bb 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -189,14 +189,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()
 
-- 
gitgitgadget
Previous: Matthew Rogers via GitGitGadgetNext: Junio C Hamano
Message 25 of 31 in “Make CMake work out of the box”
  1. 0/3 Make CMake work out of the boxMatthew Rogers via GitGitGadget, Jun 4, 2021
  2. 1/3 cmake: add knob to disable vcpkgMatthew Rogers via GitGitGadget, Jun 4, 2021
  3. Eric SunshineJun 4, 2021
  4. Matt RogersJun 4, 2021
  5. Sibi SiddharthanJun 4, 2021
  6. Matt RogersJun 5, 2021
  7. Sibi SiddharthanJun 6, 2021
  8. 3/3 cmake: add warning for ignored MSGFMT_EXEMatthew Rogers via GitGitGadget, Jun 4, 2021
  9. Eric SunshineJun 4, 2021
  10. 2/3 cmake: create compile_commands.json by defaultMatthew Rogers via GitGitGadget, Jun 4, 2021
  11. Eric SunshineJun 4, 2021
  12. Sibi SiddharthanJun 4, 2021
  13. Matt RogersJun 5, 2021
  14. Sibi SiddharthanJun 6, 2021
  15. Bagas SanjayaJun 5, 2021
  16. Matt RogersJun 5, 2021
  17. Johannes SchindelinJun 10, 2021
  18. Philip OakleyJun 18, 2021
  19. Johannes SchindelinJun 18, 2021
  20. Philip OakleyJun 18, 2021
  21. Johannes SchindelinJun 22, 2021
  22. 0/3 Make CMake work out of the boxMatthew Rogers via GitGitGadget, Jun 6, 2021
  23. 1/3 cmake: add knob to disable vcpkgMatthew Rogers via GitGitGadget, Jun 6, 2021
  24. 2/3 cmake: create compile_commands.json by defaultMatthew Rogers via GitGitGadget, Jun 6, 2021
  25. 3/3 cmake: add warning for ignored MSGFMT_EXEMatthew Rogers via GitGitGadget, Jun 6, 2021
  26. Junio C HamanoJun 7, 2021
  27. Johannes SchindelinJun 10, 2021
  28. Philip OakleyJun 18, 2021
  29. Philip OakleyJun 18, 2021
  30. Johannes SchindelinJun 10, 2021
  31. Junio C HamanoJun 11, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.