Skip to content

Commit edda89b

Browse files
authored
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.
1 parent 7c71dd3 commit edda89b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,8 @@ target_compile_features(pybind11_headers INTERFACE cxx_inheriting_constructors c
178178

179179
if(PYBIND11_INSTALL)
180180
install(DIRECTORY ${PYBIND11_INCLUDE_DIR}/pybind11 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
181-
# GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share".
182181
set(PYBIND11_CMAKECONFIG_INSTALL_DIR
183-
"share/cmake/${PROJECT_NAME}"
182+
"${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME}"
184183
CACHE STRING "install path for pybind11Config.cmake")
185184

186185
configure_package_config_file(

0 commit comments

Comments
 (0)