Skip to content

Commit

Permalink
Add pkg-config files for heatf model and its BMI
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpiper committed Mar 11, 2024
1 parent e45f5cc commit 113fcc9
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bmi_heat/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# bmi-heat

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/${bmi_name}.pc.cmake
${CMAKE_BINARY_DIR}/bmi_heat/${bmi_name}.pc
@ONLY
)

# Create shared library, except on Windows.
if(WIN32)
add_library(${bmi_name} bmi_heat.f90)
Expand All @@ -25,3 +31,7 @@ install(
FILES ${CMAKE_Fortran_MODULE_DIRECTORY}/${bmi_name}.mod
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${bmi_name}.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
11 changes: 11 additions & 0 deletions bmi_heat/bmiheatf.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_name@
Description: BMI for the heatf model
Version: @CMAKE_PROJECT_VERSION@
Requires: @model_name@
Libs: -L${libdir} -l@bmi_name@
Cflags: -I${includedir}
10 changes: 10 additions & 0 deletions heat/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# heat

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/${model_name}.pc.cmake
${CMAKE_BINARY_DIR}/heat/${model_name}.pc
@ONLY
)

# Create shared library, except on Windows.
if(WIN32)
add_library(${model_name} heat.f90)
Expand All @@ -24,3 +30,7 @@ install(
FILES ${CMAKE_Fortran_MODULE_DIRECTORY}/${model_name}.mod
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${model_name}.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
10 changes: 10 additions & 0 deletions heat/heatf.pc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: @model_name@
Description: The two-dimensional heat equation in Fortran
Version: @CMAKE_PROJECT_VERSION@
Libs: -L${libdir} -l@model_name@
Cflags: -I${includedir}

0 comments on commit 113fcc9

Please sign in to comment.