Install .cmake files in CMAKE_INSTALL_LIBDIR

This avoid problems when build and install 64 and 32 bits libs at same time,
because both overwrite the .cmake files if install it in an non-architecture depend path
like is `share/cmake/foo` is.

cmake now pick the correct .cmake files when try to add to another project as depencies
This commit is contained in:
sL1pKn07 2023-06-17 15:17:45 +02:00
parent c94cfef30a
commit c677978789
1 changed files with 3 additions and 4 deletions

View File

@ -549,9 +549,8 @@ configure_file(${PROJECT_SOURCE_DIR}/cmake/openblas.pc.in ${PROJECT_BINARY_DIR}/
install (FILES ${PROJECT_BINARY_DIR}/openblas${SUFFIX64}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/)
# GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share".
set(PN OpenBLAS)
set(CMAKECONFIG_INSTALL_DIR "share/cmake/${PN}${SUFFIX64}")
set(CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PN}${SUFFIX64}")
configure_package_config_file(cmake/${PN}Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PN}${SUFFIX64}Config.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR})