Create and install openblas.pc in cmake builds
@@ -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()
