From edda89ba6851ba9c04052079f43f514aec37f9f2 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 13 Oct 2020 13:08:54 -0400 Subject: [PATCH] fix: install to DATAROOTDIR instead of hardcoding share (#2584) Closes #2571; this is defined to share, and unlike DATADIR, is not sometimes overwritten incorrectly for storing CMake files. --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 123abf77..99cdd220 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,9 +178,8 @@ target_compile_features(pybind11_headers INTERFACE cxx_inheriting_constructors c if(PYBIND11_INSTALL) install(DIRECTORY ${PYBIND11_INCLUDE_DIR}/pybind11 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - # GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share". set(PYBIND11_CMAKECONFIG_INSTALL_DIR - "share/cmake/${PROJECT_NAME}" + "${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME}" CACHE STRING "install path for pybind11Config.cmake") configure_package_config_file(