From 2f3dcce640d9783de4b3d610a7c1914cb1527114 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Sun, 28 Aug 2022 11:32:23 +0200 Subject: [PATCH] Avoid using upper case project name in doc install dir (#3299) Closes #3296 Co-authored-by: Mike Taves --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 775cd011d5..be05dd53c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -291,7 +291,20 @@ link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) # Installation ################################################################################ include(ProjInstallPath) + +# By default GNUInstallDirs will use the upper case project name +# for CMAKE_INSTALL_DOCDIR, resulting in something like share/doc/PROJ +# instead of share/doc/proj which historically have been the path used +# by the project. +# Here force the use of a lower case project name and reset after +# GNUInstallDirs has done its thing +set(PROJECT_NAME_ORIGINAL "${PROJECT_NAME}") +string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME) + include(GNUInstallDirs) + +set(PROJECT_NAME "${PROJECT_NAME_ORIGINAL}") + set(PROJ_DATA_PATH "${CMAKE_INSTALL_FULL_DATADIR}/proj") ################################################################################