CMake: Improve NLS error messages

This commit is contained in:
Lasse Collin 2024-07-02 20:23:35 +03:00
parent 628d8d2c4f
commit 2d13d10357
1 changed files with 7 additions and 4 deletions

View File

@ -328,23 +328,26 @@ option(XZ_NLS "Native Language Support (translated messages and man pages)"
if(XZ_NLS) if(XZ_NLS)
if(CMAKE_VERSION VERSION_LESS "3.20") if(CMAKE_VERSION VERSION_LESS "3.20")
message(FATAL_ERROR "XZ_NLS=ON requires CMake >= 3.20. " message(FATAL_ERROR "Native language support (NLS) requires "
"CMake >= 3.20. "
"Upgrade to a newer CMake or set XZ_NLS=OFF.") "Upgrade to a newer CMake or set XZ_NLS=OFF.")
endif() endif()
if(NOT Intl_FOUND) if(NOT Intl_FOUND)
message(FATAL_ERROR "XZ_NLS=ON but find_package(Intl) failed. " message(FATAL_ERROR "Native language support (NLS) was enabled but "
"find_package(Intl) failed. "
"Install libintl or set XZ_NLS=OFF.") "Install libintl or set XZ_NLS=OFF.")
endif() endif()
if(NOT GETTEXT_FOUND) if(NOT GETTEXT_FOUND)
message(FATAL_ERROR "XZ_NLS=ON but find_package(Gettext) failed. " message(FATAL_ERROR "Native language support (NLS) was enabled but "
"find_package(Gettext) failed. "
"Install gettext tools or set XZ_NLS=OFF.") "Install gettext tools or set XZ_NLS=OFF.")
endif() endif()
# Warn if translated man pages are missing. # Warn if translated man pages are missing.
if(UNIX AND NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/po4a/man") if(UNIX AND NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/po4a/man")
message(WARNING "Native language support (NLS) has been enabled " message(WARNING "Native language support (NLS) was enabled "
"but pre-generated translated man pages " "but pre-generated translated man pages "
"were not found and thus they won't be installed. " "were not found and thus they won't be installed. "
"Run 'po4a/update-po' to generate them.") "Run 'po4a/update-po' to generate them.")