diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d6afc8..edf9c73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,8 @@ project(bmi-example-fortran LANGUAGES Fortran ) +include(GNUInstallDirs) + set(model_name heatf) set(bmi_name bmi${model_name}) diff --git a/bmi_heat/CMakeLists.txt b/bmi_heat/CMakeLists.txt index 8820a56..8f86d3b 100644 --- a/bmi_heat/CMakeLists.txt +++ b/bmi_heat/CMakeLists.txt @@ -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} ) diff --git a/heat/CMakeLists.txt b/heat/CMakeLists.txt index 78fe34d..98f0781 100644 --- a/heat/CMakeLists.txt +++ b/heat/CMakeLists.txt @@ -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} )