Skip to content

Commit

Permalink
Merge pull request #15 from csdms/mdpiper/improve-packaging
Browse files Browse the repository at this point in the history
Improve project packaging
  • Loading branch information
mdpiper committed Nov 2, 2023
2 parents 6fa6822 + 686e921 commit fc585ae
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
12 changes: 10 additions & 2 deletions heat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/${model_name}.pc.cmake
${CMAKE_BINARY_DIR}/heat/${model_name}.pc
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/${bmi_name}.pc.cmake
${CMAKE_BINARY_DIR}/heat/${bmi_name}.pc
)

if(WIN32)
add_library(${model_name} heat.cxx)
add_library(${bmi_name} bmi_heat.cxx heat.cxx)
else()
add_library(${model_name} SHARED heat.cxx)
add_library(${bmi_name} SHARED bmi_heat.cxx heat.cxx)
endif()

Expand All @@ -18,7 +24,7 @@ install(
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
TARGETS ${bmi_name}
TARGETS ${model_name} ${bmi_name}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
Expand All @@ -28,6 +34,8 @@ install(
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${model_name}.pc
FILES
${CMAKE_CURRENT_BINARY_DIR}/${model_name}.pc
${CMAKE_CURRENT_BINARY_DIR}/${bmi_name}.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
5 changes: 5 additions & 0 deletions heat/bmiheatcxx.pc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Name: BmiHeatCXX
Description: BMI for HeatCXX model
Version: ${CMAKE_PROJECT_VERSION}
Cflags: -I${CMAKE_INSTALL_FULL_INCLUDEDIR}
Libs: -L${CMAKE_INSTALL_FULL_LIBDIR} -l${bmi_name}
1 change: 0 additions & 1 deletion heat/heatcxx.pc.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Name: HeatCXX
Description: 2D Heat Equation
Version: ${CMAKE_PROJECT_VERSION}
Libs: -L${CMAKE_INSTALL_FULL_LIBDIR} -l${bmi_name}
Cflags: -I${CMAKE_INSTALL_FULL_INCLUDEDIR}

0 comments on commit fc585ae

Please sign in to comment.