Skip to content

Commit

Permalink
Build extension implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpiper committed Feb 1, 2024
1 parent 3aeadf4 commit 9775ad6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bmi_heat/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# bmi-heat

set(extension_name bmiheatgeof)

# Create shared library, except on Windows.
if(WIN32)
add_library(${bmi_name} bmi_heat.f90)
add_library(${extension_name} bmi_heat_geo.f90)
else()
add_library(${bmi_name} SHARED bmi_heat.f90)
add_library(${extension_name} SHARED bmi_heat_geo.f90)
endif()
target_link_libraries(${bmi_name} ${model_name} ${bmif_lib})
target_link_libraries(${extension_name} ${bmi_name})

add_executable(run_${bmi_name} bmi_main.f90)
target_link_libraries(run_${bmi_name} ${bmi_name})
Expand All @@ -16,12 +21,14 @@ install(
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
TARGETS ${bmi_name}
TARGETS ${bmi_name} ${extension_name}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
FILES ${CMAKE_Fortran_MODULE_DIRECTORY}/${bmi_name}.mod
FILES
${CMAKE_Fortran_MODULE_DIRECTORY}/${bmi_name}.mod
${CMAKE_Fortran_MODULE_DIRECTORY}/${extension_name}.mod
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

0 comments on commit 9775ad6

Please sign in to comment.