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 #15

Merged
merged 3 commits into from
Nov 2, 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
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}