Skip to content

Commit

Permalink
Add a pkgconfig file to the install
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpiper committed Mar 11, 2024
1 parent 239f11f commit 8f08c44
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ include(GNUInstallDirs)
set(mod_name "${CMAKE_PROJECT_NAME}_\
${CMAKE_PROJECT_VERSION_MAJOR}_${CMAKE_PROJECT_VERSION_MINOR}")

configure_file(
${CMAKE_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.pc.cmake
${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.pc
@ONLY
)

# Create static and shared libraries.
set(static_lib ${CMAKE_PROJECT_NAME}_static)
set(shared_lib ${CMAKE_PROJECT_NAME}_shared)
Expand Down Expand Up @@ -49,3 +55,7 @@ install(
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
FILES ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
11 changes: 11 additions & 0 deletions bmif.pc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: bmi-fortran
Description: The Basic Model Interface for Fortran
URL: https://bmi.readthedocs.io
Version: @CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@
Libs: -L${libdir} -l@CMAKE_PROJECT_NAME@
Cflags: -I${includedir}

0 comments on commit 8f08c44

Please sign in to comment.