Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve project packaging #19

Merged
merged 4 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions heat/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# heatc
# heat

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.c)
add_library(${bmi_name} bmi_heat.c heat.c)
else()
add_library(${model_name} SHARED heat.c)
add_library(${bmi_name} SHARED bmi_heat.c heat.c)
endif()

Expand All @@ -19,7 +25,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 @@ -29,6 +35,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/bmiheatc.pc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Name: BmiHeatC
Description: BMI for HeatC 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/heatc.pc.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Name: HeatC
Description: 2D Heat Equation
Version: ${CMAKE_PROJECT_VERSION}
Libs: -L${CMAKE_INSTALL_FULL_LIBDIR} -l${bmi_name}
Cflags: -I${CMAKE_INSTALL_FULL_INCLUDEDIR}
2 changes: 1 addition & 1 deletion testing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# test (heatc)
# test (heat)

include(CTest)

Expand Down