From 200ed0b18a77cfedaae8033a80de66c6b592ddc4 Mon Sep 17 00:00:00 2001 From: Horimoto Yasuhiro Date: Thu, 2 Nov 2023 13:33:38 +0900 Subject: [PATCH] cmake: fix destination path (#34) `share/${GROONGA_NORMALIZER_MYSQL_PROJECT_NAME}` is shown `share/groonga-normalizer-mysql`. Thus, `README.md` and `doc/text/lgpl-2.0.txt`are installed in `share/groonga-normalizer-mysql/`. However, these files are installed `share/doc/groonga-normalizer-mysql/` for RPM packages. See: https://github.com/groonga/groonga-normalizer-mysql/blob/main/packages/yum/groonga-normalizer-mysql.spec.in#L59C1-L59C42 I change destination path `share/groonga-normalizer-mysql` to `share/doc/groonga-normalizer-mysql`. --- https://github.com/groonga/groonga-normalizer-mysql/blob/main/CMakeLists.txt#L97 is defined `DESTINATION "${CMAKE_LIBDIR}/pkgconfig/"`. However, `CMAKE_LIBDIR` is not definition. (Probably, `CMAKE_LIBDIR` is null.) Thus, `groonga-normalizer-mysql.pc` is installed to `pkgconfig/`. This install path is not expected. I change destination path `pkgconfig/` to `usr/lib64(or lib)/pkgconfig`. --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a537c4..3af7669 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,9 +21,11 @@ cmake_minimum_required(VERSION 3.16) set(GROONGA_NORMALIZER_MYSQL_PROJECT_NAME "groonga-normalizer-mysql") project("${GROONGA_NORMALIZER_MYSQL_PROJECT_NAME}") -if(NOT DEFINED GROONGA_NORMALIZER_MYSQL_DATA_DIR) - set(GROONGA_NORMALIZER_MYSQL_DATA_DIR - "share/${GROONGA_NORMALIZER_MYSQL_PROJECT_NAME}") +include(GNUInstallDirs) + +if(NOT DEFINED GROONGA_NORMALIZER_MYSQL_DOC_DIR) + set(GROONGA_NORMALIZER_MYSQL_DOC_DIR + "${CMAKE_INSTALL_DOCDIR}/${GROONGA_NORMALIZER_MYSQL_PROJECT_NAME}") endif() if(DEFINED GROONGA_NORMALIZER_MYSQL_EMBED) @@ -94,10 +96,10 @@ if(NOT GROONGA_NORMALIZER_MYSQL_EMBED) @ONLY) install( FILES "${CMAKE_CURRENT_BINARY_DIR}/groonga-normalizer-mysql.pc" - DESTINATION "${CMAKE_LIBDIR}/pkgconfig/") + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/") endif() install(FILES "README.md" "doc/text/lgpl-2.0.txt" - DESTINATION "${GROONGA_NORMALIZER_MYSQL_DATA_DIR}") + DESTINATION "${GROONGA_NORMALIZER_MYSQL_DOC_DIR}")