summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2024-11-19 21:58:13 +0000
committerDavid Kalnischkies <david@kalnischkies.de>2024-11-22 12:11:13 +0000
commit7578b7031921231400be78fa8c2893bbd5ea18df (patch)
tree9b58c936265a36cad021bc716d2c61a88eed577f
parent0fb71e375363f2b45b033bb2b324e80214325c61 (diff)
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.
-rw-r--r--CMake/Documentation.cmake4
-rw-r--r--doc/CMakeLists.txt7
-rw-r--r--doc/examples/CMakeLists.txt2
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)