From 7578b7031921231400be78fa8c2893bbd5ea18df Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 19 Nov 2024 21:58:13 +0000 Subject: Avoid unnormalized paths for CMake install destinations CMake 3.31 is very noisy about our manpage (and to a lesser extend documentation in general) building as we used "//" and "/../" there. `cmake --help-policy CMP0177` documents the warning, so we could just decide on a value and deal with it, but given our usage is not really needed and rather trivial to change lets not pick a value and instead use a normalized path so we don't use different code paths in CMake depending on which CMake version we happen to be build with. --- CMake/Documentation.cmake | 4 +++- doc/CMakeLists.txt | 7 ++++--- doc/examples/CMakeLists.txt | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMake/Documentation.cmake b/CMake/Documentation.cmake index f3eb4c5e1..d7f136020 100644 --- a/CMake/Documentation.cmake +++ b/CMake/Documentation.cmake @@ -154,14 +154,16 @@ function(xsltproc_one) if (DOC_MANPAGE) if (language) set(manpage_output "${CMAKE_CURRENT_BINARY_DIR}/${language}/${document}.${section}") + set(manpage_l10npath "/${language}") else() + set(manpage_l10npath "") set(manpage_output "${CMAKE_CURRENT_BINARY_DIR}/${document}.${section}") endif() set(manpage_stylesheet "${CMAKE_CURRENT_BINARY_DIR}/manpage-style.xsl") set(manpage_params) install(FILES ${manpage_output} - DESTINATION ${CMAKE_INSTALL_MANDIR}/${language}/man${section} + DESTINATION ${CMAKE_INSTALL_MANDIR}${manpage_l10npath}/man${section} OPTIONAL) endif() if (DOC_HTML) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 72a1fed88..493c36c08 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -22,13 +22,14 @@ set(ENTITIES apt-verbatim.ent ../vendor/${CURRENT_VENDOR}/apt-vendor.ent ) +set(USR_SHARE_DOC "${CMAKE_INSTALL_DATAROOTDIR}/doc") if(WITH_DOC OR WITH_DOC_GUIDES) add_docbook(apt-doc HTML TEXT ALL DOCUMENTS guide.dbk offline.dbk - INSTALL ${CMAKE_INSTALL_DOCDIR}/../apt-doc + INSTALL ${USR_SHARE_DOC}/apt-doc LINGUAS ${LINGUAS} TRANSLATED_ENTITIES ${TRANSLATED_ENTITIES} DEPENDS ${ENTITIES} @@ -40,7 +41,7 @@ add_docbook(libapt-pkg-doc HTML TEXT ALL dpkg-tech.dbk files.dbk method.dbk - INSTALL ${CMAKE_INSTALL_DOCDIR}/../libapt-pkg-doc + INSTALL ${USR_SHARE_DOC}/libapt-pkg-doc LINGUAS ${LINGUAS} TRANSLATED_ENTITIES ${TRANSLATED_ENTITIES} DEPENDS ${ENTITIES} @@ -65,7 +66,7 @@ add_custom_target(apt-doxygen ALL ) install(DIRECTORY ${PROJECT_BINARY_DIR}/doc/doxygen/html - DESTINATION ${CMAKE_INSTALL_DOCDIR}/../libapt-pkg-doc + DESTINATION ${USR_SHARE_DOC}/libapt-pkg-doc PATTERN "*.map" EXCLUDE PATTERN "*.md5" EXCLUDE ) diff --git a/doc/examples/CMakeLists.txt b/doc/examples/CMakeLists.txt index 8d9ea068f..be638d081 100644 --- a/doc/examples/CMakeLists.txt +++ b/doc/examples/CMakeLists.txt @@ -1,4 +1,4 @@ install(FILES apt.conf configure-index preferences DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples) install(FILES apt-ftparchive.conf ftp-archive.conf - DESTINATION ${CMAKE_INSTALL_DOCDIR}/../apt-utils/examples) + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/apt-utils/examples) -- cgit v1.2.3-70-g09d2