Browse Source

Merge pull request #1096 from martin-frbg/pkg-config

Build only openblas.pc for pkg-config and install it from cmake as well
tags/v0.2.20^2
Martin Kroeker GitHub 8 years ago
parent
commit
e2489c9a92
4 changed files with 26 additions and 16 deletions
  1. +9
    -0
      CMakeLists.txt
  2. +7
    -16
      Makefile.install
  3. +10
    -0
      cmake/openblas.pc.in
  4. +0
    -0
      openblas.pc.in

+ 9
- 0
CMakeLists.txt View File

@@ -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()

+ 7
- 16
Makefile.install View File

@@ -98,23 +98,14 @@ endif
endif


#Generating blas.pc
@echo Generating blas.pc in $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)
@echo 'libdir='$(OPENBLAS_LIBRARY_DIR) >> $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/blas.pc
@echo 'includedir='$(OPENBLAS_INCLUDE_DIR) >> $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/blas.pc
@echo 'version='$(VERSION) >> $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/blas.pc
@echo 'extralib='$(EXTRALIB) >> $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/blas.pc
@cat blas.pc.in >> $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/blas.pc
#Generating openblas.pc
@echo Generating openblas.pc in $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)
@echo 'libdir='$(OPENBLAS_LIBRARY_DIR) >> $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc
@echo 'includedir='$(OPENBLAS_INCLUDE_DIR) >> $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc
@echo 'version='$(VERSION) >> $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc
@echo 'extralib='$(EXTRALIB) >> $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc
@cat openblas.pc.in >> $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc

ifndef NO_CBLAS
@echo Generating cblas.pc in $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)
@cp $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/blas.pc $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/cblas.pc
endif

ifndef NO_LAPACKE
@echo Generating lapack.pc in $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)
@cp $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/blas.pc $(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/lapack.pc
endif

#Generating OpenBLASConfig.cmake
@echo Generating $(OPENBLAS_CMAKE_CONFIG) in $(DESTDIR)$(OPENBLAS_CMAKE_DIR)


+ 10
- 0
cmake/openblas.pc.in View File

@@ -0,0 +1,10 @@
prefix=@prefix@
libdir=@libdir@
includedir=@includedir@

Name: OpenBLAS
Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version
Version: @OPENBLAS_VERSION@
URL: https://github.com/xianyi/OpenBLAS
Libs: -L${libdir} -lopenblas
Cflags: -I${includedir}

blas.pc.in → openblas.pc.in View File


Loading…
Cancel
Save