From cd8f80634fc6b4713489ae8ba965dd6e90a9de8f Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sun, 12 Feb 2017 14:37:33 +0100 Subject: [PATCH] Create and install openblas.pc in cmake builds --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a98e20c52..c6e930991 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -227,3 +227,12 @@ install (FILES ${INCLUDE_FILES} DESTINATION include) if(NOT MSVC) install (TARGETS ${OpenBLAS_LIBNAME}_static DESTINATION lib) endif() + +include(FindPkgConfig QUIET) +if(PKG_CONFIG_FOUND) + set(prefix ${CMAKE_INSTALL_PREFIX}) + set(libdir ${CMAKE_INSTALL_PREFIX}/lib) + set(includedir ${CMAKE_INSTALL_PREFIX}/include) + configure_file(${PROJECT_SOURCE_DIR}/cmake/openblas.pc.in ${PROJECT_BINARY_DIR}/openblas.pc @ONLY) + install (FILES ${PROJECT_BINARY_DIR}/openblas.pc DESTINATION lib/pkgconfig/) +endif()