Skip to content

Commit

Permalink
Use GnuInstallDirs variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpiper committed Oct 16, 2023
1 parent 7e3d441 commit 4f58520
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ project(bmi-example-fortran
LANGUAGES Fortran
)

include(GNUInstallDirs)

set(model_name heatf)
set(bmi_name bmi${model_name})

Expand Down
10 changes: 5 additions & 5 deletions bmi_heat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ target_link_libraries(run_${bmi_name} ${bmi_name})

install(
TARGETS run_${bmi_name}
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
TARGETS ${bmi_name}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
FILES ${CMAKE_Fortran_MODULE_DIRECTORY}/${bmi_name}.mod
DESTINATION include
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
10 changes: 5 additions & 5 deletions heat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ target_link_libraries(run_${model_name} ${model_name})

install(
TARGETS run_${model_name}
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
TARGETS ${model_name}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
FILES ${CMAKE_Fortran_MODULE_DIRECTORY}/${model_name}.mod
DESTINATION include
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

0 comments on commit 4f58520

Please sign in to comment.