From 9019f15017e1e2cd0dd01bdce5367310555b9038 Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Tue, 27 Aug 2024 12:37:44 -1000 Subject: [PATCH] add cmake install commands for component libraries (#3307) --- src/coreComponents/codingUtilities/CMakeLists.txt | 2 ++ src/coreComponents/common/CMakeLists.txt | 2 ++ src/coreComponents/constitutive/CMakeLists.txt | 2 ++ src/coreComponents/constitutiveDrivers/CMakeLists.txt | 1 + src/coreComponents/dataRepository/CMakeLists.txt | 1 + src/coreComponents/denseLinearAlgebra/CMakeLists.txt | 2 ++ src/coreComponents/discretizationMethods/CMakeLists.txt | 1 + src/coreComponents/events/CMakeLists.txt | 1 + src/coreComponents/fieldSpecification/CMakeLists.txt | 1 + src/coreComponents/fileIO/CMakeLists.txt | 1 + src/coreComponents/finiteElement/CMakeLists.txt | 1 + src/coreComponents/finiteVolume/CMakeLists.txt | 1 + src/coreComponents/functions/CMakeLists.txt | 2 ++ src/coreComponents/linearAlgebra/CMakeLists.txt | 1 + src/coreComponents/mainInterface/CMakeLists.txt | 1 + src/coreComponents/math/CMakeLists.txt | 1 + src/coreComponents/mesh/CMakeLists.txt | 2 ++ src/coreComponents/physicsSolvers/CMakeLists.txt | 3 +++ src/coreComponents/schema/CMakeLists.txt | 1 + 19 files changed, 27 insertions(+) diff --git a/src/coreComponents/codingUtilities/CMakeLists.txt b/src/coreComponents/codingUtilities/CMakeLists.txt index f936fc4135e..fdccb254f5e 100644 --- a/src/coreComponents/codingUtilities/CMakeLists.txt +++ b/src/coreComponents/codingUtilities/CMakeLists.txt @@ -36,6 +36,8 @@ set_source_files_properties( Parsing.cpp PROPERTIES LANGUAGE CXX ) target_include_directories( codingUtilities PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) +install( TARGETS codingUtilities LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) + if( GEOS_ENABLE_TESTS ) add_subdirectory(tests) diff --git a/src/coreComponents/common/CMakeLists.txt b/src/coreComponents/common/CMakeLists.txt index 3733bafb7f7..e384c1d0e5c 100644 --- a/src/coreComponents/common/CMakeLists.txt +++ b/src/coreComponents/common/CMakeLists.txt @@ -113,6 +113,8 @@ blt_add_library( NAME common target_include_directories( common PUBLIC ${CMAKE_BINARY_DIR}/include ) target_include_directories( common PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) +install( TARGETS common LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) + if( GEOS_ENABLE_TESTS ) add_subdirectory( unitTests ) add_subdirectory( format/table/unitTests ) diff --git a/src/coreComponents/constitutive/CMakeLists.txt b/src/coreComponents/constitutive/CMakeLists.txt index c4defea6888..7a4fd542b9b 100644 --- a/src/coreComponents/constitutive/CMakeLists.txt +++ b/src/coreComponents/constitutive/CMakeLists.txt @@ -315,6 +315,8 @@ blt_add_library( NAME constitutive target_include_directories( constitutive PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) +install( TARGETS constitutive LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) + if( GEOS_ENABLE_TESTS ) add_subdirectory( unitTests ) endif( ) diff --git a/src/coreComponents/constitutiveDrivers/CMakeLists.txt b/src/coreComponents/constitutiveDrivers/CMakeLists.txt index 24570963e67..41e4a946d28 100644 --- a/src/coreComponents/constitutiveDrivers/CMakeLists.txt +++ b/src/coreComponents/constitutiveDrivers/CMakeLists.txt @@ -54,3 +54,4 @@ blt_add_library( NAME constitutiveDrivers ) target_include_directories( constitutiveDrivers PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) +install( TARGETS constitutiveDrivers LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) diff --git a/src/coreComponents/dataRepository/CMakeLists.txt b/src/coreComponents/dataRepository/CMakeLists.txt index 1d97ce8d11e..70c8a9bf97e 100644 --- a/src/coreComponents/dataRepository/CMakeLists.txt +++ b/src/coreComponents/dataRepository/CMakeLists.txt @@ -62,6 +62,7 @@ blt_add_library( NAME dataRepository ) target_include_directories( dataRepository PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) +install( TARGETS dataRepository LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) if( GEOS_ENABLE_TESTS ) diff --git a/src/coreComponents/denseLinearAlgebra/CMakeLists.txt b/src/coreComponents/denseLinearAlgebra/CMakeLists.txt index 5af9fc56f52..1d15320355c 100644 --- a/src/coreComponents/denseLinearAlgebra/CMakeLists.txt +++ b/src/coreComponents/denseLinearAlgebra/CMakeLists.txt @@ -24,6 +24,8 @@ blt_add_library( NAME denseLinearAlgebra target_include_directories( denseLinearAlgebra PUBLIC ${CMAKE_CURRENT_LIST_DIR} ) +install( TARGETS denseLinearAlgebra LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) + if( GEOS_ENABLE_TESTS ) add_subdirectory( unitTests ) endif( ) diff --git a/src/coreComponents/discretizationMethods/CMakeLists.txt b/src/coreComponents/discretizationMethods/CMakeLists.txt index 191f8dd12c9..06d03ca8fa9 100644 --- a/src/coreComponents/discretizationMethods/CMakeLists.txt +++ b/src/coreComponents/discretizationMethods/CMakeLists.txt @@ -26,3 +26,4 @@ blt_add_library( NAME discretizationMethods target_include_directories( discretizationMethods PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) +install( TARGETS discretizationMethods LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) diff --git a/src/coreComponents/events/CMakeLists.txt b/src/coreComponents/events/CMakeLists.txt index 184dea2f0c1..3a7fe6a7a92 100644 --- a/src/coreComponents/events/CMakeLists.txt +++ b/src/coreComponents/events/CMakeLists.txt @@ -39,3 +39,4 @@ blt_add_library( NAME events target_include_directories( events PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) +install( TARGETS events LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) diff --git a/src/coreComponents/fieldSpecification/CMakeLists.txt b/src/coreComponents/fieldSpecification/CMakeLists.txt index f7b68eaaa1e..5e67ea51812 100644 --- a/src/coreComponents/fieldSpecification/CMakeLists.txt +++ b/src/coreComponents/fieldSpecification/CMakeLists.txt @@ -41,3 +41,4 @@ blt_add_library( NAME fieldSpecification target_include_directories( fieldSpecification PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) +install( TARGETS fieldSpecification LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) diff --git a/src/coreComponents/fileIO/CMakeLists.txt b/src/coreComponents/fileIO/CMakeLists.txt index 714ea11808c..3b70d456190 100644 --- a/src/coreComponents/fileIO/CMakeLists.txt +++ b/src/coreComponents/fileIO/CMakeLists.txt @@ -93,6 +93,7 @@ blt_add_library( NAME fileIO target_include_directories( fileIO PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) +install( TARGETS fileIO LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) diff --git a/src/coreComponents/finiteElement/CMakeLists.txt b/src/coreComponents/finiteElement/CMakeLists.txt index aa3740ddd04..3343eb53258 100644 --- a/src/coreComponents/finiteElement/CMakeLists.txt +++ b/src/coreComponents/finiteElement/CMakeLists.txt @@ -55,6 +55,7 @@ blt_add_library( NAME finiteElement target_include_directories( finiteElement PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) +install( TARGETS finiteElement LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) if( GEOS_ENABLE_TESTS ) add_subdirectory( unitTests ) diff --git a/src/coreComponents/finiteVolume/CMakeLists.txt b/src/coreComponents/finiteVolume/CMakeLists.txt index 9f855fc79db..39dd4450445 100644 --- a/src/coreComponents/finiteVolume/CMakeLists.txt +++ b/src/coreComponents/finiteVolume/CMakeLists.txt @@ -55,3 +55,4 @@ blt_add_library( NAME finiteVolume target_include_directories( finiteVolume PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) +install( TARGETS finiteVolume LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) diff --git a/src/coreComponents/functions/CMakeLists.txt b/src/coreComponents/functions/CMakeLists.txt index ec6542660da..8e73070438c 100644 --- a/src/coreComponents/functions/CMakeLists.txt +++ b/src/coreComponents/functions/CMakeLists.txt @@ -46,6 +46,8 @@ blt_add_library( NAME functions target_include_directories( functions PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) +install( TARGETS functions LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) + if( GEOS_ENABLE_TESTS ) add_subdirectory( unitTests ) endif() diff --git a/src/coreComponents/linearAlgebra/CMakeLists.txt b/src/coreComponents/linearAlgebra/CMakeLists.txt index abbfcdf8bb2..d19283bb37f 100644 --- a/src/coreComponents/linearAlgebra/CMakeLists.txt +++ b/src/coreComponents/linearAlgebra/CMakeLists.txt @@ -163,6 +163,7 @@ blt_add_library( NAME linearAlgebra target_include_directories( linearAlgebra PUBLIC ${CMAKE_CURRENT_LIST_DIR} ) +install( TARGETS linearAlgebra LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) if( GEOS_ENABLE_TESTS ) add_subdirectory( unitTests ) diff --git a/src/coreComponents/mainInterface/CMakeLists.txt b/src/coreComponents/mainInterface/CMakeLists.txt index fb96f9ed6c5..af6b85e76cf 100644 --- a/src/coreComponents/mainInterface/CMakeLists.txt +++ b/src/coreComponents/mainInterface/CMakeLists.txt @@ -35,3 +35,4 @@ add_dependencies( mainInterface generate_version ) target_include_directories( mainInterface PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) +install( TARGETS mainInterface LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) diff --git a/src/coreComponents/math/CMakeLists.txt b/src/coreComponents/math/CMakeLists.txt index 290f23808db..53c52e1abdb 100644 --- a/src/coreComponents/math/CMakeLists.txt +++ b/src/coreComponents/math/CMakeLists.txt @@ -14,3 +14,4 @@ blt_add_library( NAME math target_include_directories( math INTERFACE ${CMAKE_SOURCE_DIR}/coreComponents ) +install( TARGETS math LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) diff --git a/src/coreComponents/mesh/CMakeLists.txt b/src/coreComponents/mesh/CMakeLists.txt index 5eeb7f1a900..481ef6f243e 100644 --- a/src/coreComponents/mesh/CMakeLists.txt +++ b/src/coreComponents/mesh/CMakeLists.txt @@ -193,6 +193,8 @@ blt_add_library( NAME mesh target_include_directories( mesh PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) +install( TARGETS mesh LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) + if( ENABLE_VTK ) # Avoid compiling with nvcc which sometimes segfaults in debug set_source_files_properties( generators/VTKMeshGeneratorTools.cpp PROPERTIES LANGUAGE CXX ) diff --git a/src/coreComponents/physicsSolvers/CMakeLists.txt b/src/coreComponents/physicsSolvers/CMakeLists.txt index c8a6f1a002e..b9bc68e85e3 100644 --- a/src/coreComponents/physicsSolvers/CMakeLists.txt +++ b/src/coreComponents/physicsSolvers/CMakeLists.txt @@ -74,6 +74,9 @@ blt_add_library( NAME physicsSolvers ) target_include_directories( physicsSolvers PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) + +install( TARGETS physicsSolvers LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) + if( externalComponentDeps ) target_include_directories( physicsSolvers PUBLIC ${CMAKE_SOURCE_DIR}/externalComponents ) endif() diff --git a/src/coreComponents/schema/CMakeLists.txt b/src/coreComponents/schema/CMakeLists.txt index a6e7369b14b..c62fba76b07 100644 --- a/src/coreComponents/schema/CMakeLists.txt +++ b/src/coreComponents/schema/CMakeLists.txt @@ -28,3 +28,4 @@ blt_add_library( NAME schema target_include_directories( schema PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents) +install( TARGETS schema LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )