diff --git a/ChemistryLib/CMakeLists.txt b/ChemistryLib/CMakeLists.txt index 00b1349a2095b592ad7ffd16d2321697770bd7f2..e7960b2755b34d20a509623687447fc6e6d267ff 100644 --- a/ChemistryLib/CMakeLists.txt +++ b/ChemistryLib/CMakeLists.txt @@ -1,4 +1,4 @@ -#Source files grouped by a directory +# Source files grouped by a directory get_source_files(SOURCES) append_source_files(SOURCES PhreeqcIOData) @@ -11,10 +11,7 @@ endif() include(GenerateExportHeader) generate_export_header(ChemistryLib) -target_link_libraries(ChemistryLib - PUBLIC iphreeqc - PRIVATE NumLib -) +target_link_libraries(ChemistryLib PUBLIC iphreeqc PRIVATE NumLib) if(OGS_USE_PCH) cotire(ChemistryLib) diff --git a/GeoLib/CMakeLists.txt b/GeoLib/CMakeLists.txt index 7c9fbf1599543793a1ca00db1111bb50db2b1712..c2dc61b9c27c046afd117f38c8227d11f9b9ebb5 100644 --- a/GeoLib/CMakeLists.txt +++ b/GeoLib/CMakeLists.txt @@ -1,13 +1,13 @@ # Source files -GET_SOURCE_FILES(SOURCES) +get_source_files(SOURCES) -APPEND_SOURCE_FILES(SOURCES IO) +append_source_files(SOURCES IO) -APPEND_SOURCE_FILES(SOURCES IO/XmlIO/Rapid) -APPEND_SOURCE_FILES(SOURCES IO/XmlIO/Boost) +append_source_files(SOURCES IO/XmlIO/Rapid) +append_source_files(SOURCES IO/XmlIO/Boost) if(OGS_BUILD_GUI) - APPEND_SOURCE_FILES(SOURCES IO/XmlIO/Qt) + append_source_files(SOURCES IO/XmlIO/Qt) endif() # Create the library @@ -26,6 +26,10 @@ if(OGS_USE_PCH) cotire(GeoLib) endif() -configure_file(IO/XmlIO/OpenGeoSysGLI.xsd ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/OpenGeoSysGLI.xsd COPYONLY) -configure_file(IO/XmlIO/OpenGeoSysSTN.xsd ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/OpenGeoSysSTN.xsd COPYONLY) -install(FILES IO/XmlIO/OpenGeoSysGLI.xsd IO/XmlIO/OpenGeoSysSTN.xsd DESTINATION bin COMPONENT ogs_cli) +configure_file(IO/XmlIO/OpenGeoSysGLI.xsd + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/OpenGeoSysGLI.xsd COPYONLY) +configure_file(IO/XmlIO/OpenGeoSysSTN.xsd + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/OpenGeoSysSTN.xsd COPYONLY) +install(FILES IO/XmlIO/OpenGeoSysGLI.xsd IO/XmlIO/OpenGeoSysSTN.xsd + DESTINATION bin + COMPONENT ogs_cli) diff --git a/MaterialLib/CMakeLists.txt b/MaterialLib/CMakeLists.txt index 6af23f988eb9a916ddd63dc5d84d751fdb973d82..a173181bb77446b500c900e61f153852a5b56106 100644 --- a/MaterialLib/CMakeLists.txt +++ b/MaterialLib/CMakeLists.txt @@ -24,7 +24,8 @@ append_source_files(SOURCES PorousMedium/Porosity) append_source_files(SOURCES PorousMedium/Storage) append_source_files(SOURCES PorousMedium/Permeability) append_source_files(SOURCES PorousMedium/UnsaturatedProperty/CapillaryPressure) -append_source_files(SOURCES PorousMedium/UnsaturatedProperty/RelativePermeability) +append_source_files(SOURCES + PorousMedium/UnsaturatedProperty/RelativePermeability) append_source_files(SOURCES TwoPhaseModels) add_subdirectory(SolidModels/MFront) @@ -36,14 +37,11 @@ endif() include(GenerateExportHeader) generate_export_header(MaterialLib) -target_include_directories(MaterialLib - PUBLIC ${CMAKE_CURRENT_BINARY_DIR} -) +target_include_directories(MaterialLib PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(MaterialLib - PUBLIC MaterialLib_SolidModels_MFront - PRIVATE MathLib MeshLib ParameterLib -) + PUBLIC MaterialLib_SolidModels_MFront + PRIVATE MathLib MeshLib ParameterLib) if(OGS_USE_PCH) cotire(MaterialLib) diff --git a/MaterialLib/SolidModels/MFront/CMakeLists.txt b/MaterialLib/SolidModels/MFront/CMakeLists.txt index a693ff0a812ea8497556dc6d7bfaa015787489e9..05b2a276d8e8d58fe98966a0899431742a2d5554 100644 --- a/MaterialLib/SolidModels/MFront/CMakeLists.txt +++ b/MaterialLib/SolidModels/MFront/CMakeLists.txt @@ -7,20 +7,18 @@ endif() add_library(MaterialLib_SolidModels_MFront ${SOURCES}) if(BUILD_SHARED_LIBS) - install(TARGETS MaterialLib_SolidModels_MFront LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(TARGETS MaterialLib_SolidModels_MFront + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() target_link_libraries(MaterialLib_SolidModels_MFront - PUBLIC BaseLib NumLib logog - PRIVATE MathLib MeshLib -) + PUBLIC BaseLib NumLib logog + PRIVATE MathLib MeshLib) -if (OGS_USE_MFRONT) +if(OGS_USE_MFRONT) target_include_directories(MaterialLib_SolidModels_MFront - PUBLIC ${MGIS_INCLUDE_DIR} - ) - target_link_libraries(MaterialLib_SolidModels_MFront - PUBLIC ${MGIS_LIBRARY} - ) - target_compile_definitions(MaterialLib_SolidModels_MFront PRIVATE OGS_USE_MFRONT) + PUBLIC ${MGIS_INCLUDE_DIR}) + target_link_libraries(MaterialLib_SolidModels_MFront PUBLIC ${MGIS_LIBRARY}) + target_compile_definitions(MaterialLib_SolidModels_MFront PRIVATE + OGS_USE_MFRONT) endif() diff --git a/MathLib/CMakeLists.txt b/MathLib/CMakeLists.txt index bbde7cd43d11c118b561ae712a5ee38cbfb60249..4b1030bcd5ee7097f830e2ee7a54e17a771756a6 100644 --- a/MathLib/CMakeLists.txt +++ b/MathLib/CMakeLists.txt @@ -1,27 +1,27 @@ -#Source files grouped by a directory -GET_SOURCE_FILES(SOURCES) +# Source files grouped by a directory +get_source_files(SOURCES) -APPEND_SOURCE_FILES(SOURCES Curve) -APPEND_SOURCE_FILES(SOURCES InterpolationAlgorithms) -APPEND_SOURCE_FILES(SOURCES Integration) -APPEND_SOURCE_FILES(SOURCES LinAlg) -APPEND_SOURCE_FILES(SOURCES LinAlg/Dense) +append_source_files(SOURCES Curve) +append_source_files(SOURCES InterpolationAlgorithms) +append_source_files(SOURCES Integration) +append_source_files(SOURCES LinAlg) +append_source_files(SOURCES LinAlg/Dense) if(CVODE_FOUND) - APPEND_SOURCE_FILES(SOURCES ODE) + append_source_files(SOURCES ODE) endif() -APPEND_SOURCE_FILES(SOURCES Nonlinear) +append_source_files(SOURCES Nonlinear) if(OGS_USE_EIGEN) - APPEND_SOURCE_FILES(SOURCES LinAlg/Eigen) + append_source_files(SOURCES LinAlg/Eigen) endif() if(OGS_USE_LIS) - APPEND_SOURCE_FILES(SOURCES LinAlg/Lis) - APPEND_SOURCE_FILES(SOURCES LinAlg/EigenLis) + append_source_files(SOURCES LinAlg/Lis) + append_source_files(SOURCES LinAlg/EigenLis) endif() if(OGS_USE_PETSC) - APPEND_SOURCE_FILES(SOURCES LinAlg/PETSc) + append_source_files(SOURCES LinAlg/PETSc) endif() # Create the library @@ -38,7 +38,7 @@ set_target_properties(MathLib PROPERTIES LINKER_LANGUAGE CXX) target_link_libraries(MathLib PUBLIC BaseLib logog ${OpenMP_CXX_LIBRARIES}) -if (CVODE_FOUND) +if(CVODE_FOUND) target_include_directories(MathLib PRIVATE ${CVODE_INCLUDE_DIRS}) target_link_libraries(MathLib PUBLIC ${CVODE_LIBRARIES}) endif() @@ -47,15 +47,15 @@ if(LAPACK_FOUND) target_link_libraries(MathLib PUBLIC ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}) endif() -if (OGS_USE_LIS) +if(OGS_USE_LIS) target_link_libraries(MathLib PUBLIC ${LIS_LIBRARIES}) endif() -if (OGS_USE_MKL) +if(OGS_USE_MKL) target_link_libraries(MathLib PUBLIC ${MKL_LIBRARIES}) endif() -if (OGS_USE_PETSC) +if(OGS_USE_PETSC) target_include_directories(MathLib PUBLIC ${PETSC_INCLUDE_DIRS}) target_link_libraries(MathLib PUBLIC ${PETSC_LIBRARIES}) endif() diff --git a/MeshGeoToolsLib/CMakeLists.txt b/MeshGeoToolsLib/CMakeLists.txt index 983138fab6b6b443077c84392997c4d620e418b8..8a6ea49d716e8d158887d488f3d19923ecf23137 100644 --- a/MeshGeoToolsLib/CMakeLists.txt +++ b/MeshGeoToolsLib/CMakeLists.txt @@ -1,5 +1,5 @@ # Source files -GET_SOURCE_FILES(SOURCES) +get_source_files(SOURCES) # Create the library add_library(MeshGeoToolsLib ${SOURCES}) @@ -8,9 +8,8 @@ if(BUILD_SHARED_LIBS) endif() target_link_libraries(MeshGeoToolsLib - PUBLIC GeoLib MathLib - PRIVATE BaseLib MeshLib logog -) + PUBLIC GeoLib MathLib + PRIVATE BaseLib MeshLib logog) if(OGS_USE_PCH) cotire(MeshGeoToolsLib) diff --git a/MeshLib/CMakeLists.txt b/MeshLib/CMakeLists.txt index 4f6299ed85aa72ff6836248601381dac27a3cc18..e92236424e017d68d213fadb0685e309f15ccc1a 100644 --- a/MeshLib/CMakeLists.txt +++ b/MeshLib/CMakeLists.txt @@ -1,23 +1,23 @@ -GET_SOURCE_FILES(SOURCES) +get_source_files(SOURCES) # It should be removed too for other MPI based DDC approach in future. if(NOT OGS_USE_PETSC) list(REMOVE_ITEM SOURCES NodePartitionedMesh.h) endif() -APPEND_SOURCE_FILES(SOURCES MeshEditing) -APPEND_SOURCE_FILES(SOURCES MeshGenerators) -APPEND_SOURCE_FILES(SOURCES MeshSearch) -APPEND_SOURCE_FILES(SOURCES Elements) -APPEND_SOURCE_FILES(SOURCES IO) -APPEND_SOURCE_FILES(SOURCES IO/Legacy) -APPEND_SOURCE_FILES(SOURCES IO/VtkIO) -APPEND_SOURCE_FILES(SOURCES MeshQuality) -APPEND_SOURCE_FILES(SOURCES Vtk) +append_source_files(SOURCES MeshEditing) +append_source_files(SOURCES MeshGenerators) +append_source_files(SOURCES MeshSearch) +append_source_files(SOURCES Elements) +append_source_files(SOURCES IO) +append_source_files(SOURCES IO/Legacy) +append_source_files(SOURCES IO/VtkIO) +append_source_files(SOURCES MeshQuality) +append_source_files(SOURCES Vtk) # It could be used for other MPI based DDC approach in future. if(OGS_USE_PETSC) - APPEND_SOURCE_FILES(SOURCES IO/MPI_IO) + append_source_files(SOURCES IO/MPI_IO) endif() # Create the library @@ -30,5 +30,8 @@ if(OGS_USE_PCH) endif() target_link_libraries(MeshLib - PUBLIC BaseLib GeoLib MathLib logog ${VTK_LIBRARIES} -) + PUBLIC BaseLib + GeoLib + MathLib + logog + ${VTK_LIBRARIES}) diff --git a/NumLib/CMakeLists.txt b/NumLib/CMakeLists.txt index c1fae72c19152c09009bd6286f485e697b8c4109..7c744d1536b16a19e91e42de824cb7b34969bf68 100644 --- a/NumLib/CMakeLists.txt +++ b/NumLib/CMakeLists.txt @@ -1,17 +1,17 @@ -GET_SOURCE_FILES(SOURCES) +get_source_files(SOURCES) -APPEND_SOURCE_FILES(SOURCES Assembler) -APPEND_SOURCE_FILES(SOURCES DOF) -APPEND_SOURCE_FILES(SOURCES Fem) -APPEND_SOURCE_FILES(SOURCES Fem/CoordinatesMapping) -APPEND_SOURCE_FILES(SOURCES Fem/FiniteElement) -APPEND_SOURCE_FILES(SOURCES Fem/Integration) -APPEND_SOURCE_FILES(SOURCES Fem/ShapeFunction) -APPEND_SOURCE_FILES(SOURCES TimeStepping) -APPEND_SOURCE_FILES(SOURCES TimeStepping/Algorithms) -APPEND_SOURCE_FILES(SOURCES Function) -APPEND_SOURCE_FILES(SOURCES ODESolver) -APPEND_SOURCE_FILES(SOURCES Extrapolation) +append_source_files(SOURCES Assembler) +append_source_files(SOURCES DOF) +append_source_files(SOURCES Fem) +append_source_files(SOURCES Fem/CoordinatesMapping) +append_source_files(SOURCES Fem/FiniteElement) +append_source_files(SOURCES Fem/Integration) +append_source_files(SOURCES Fem/ShapeFunction) +append_source_files(SOURCES TimeStepping) +append_source_files(SOURCES TimeStepping/Algorithms) +append_source_files(SOURCES Function) +append_source_files(SOURCES ODESolver) +append_source_files(SOURCES Extrapolation) # Create the library add_library(NumLib ${SOURCES}) @@ -25,9 +25,12 @@ target_include_directories(NumLib PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) set_target_properties(NumLib PROPERTIES LINKER_LANGUAGE CXX) target_link_libraries(NumLib - PUBLIC BaseLib GeoLib MathLib MeshLib logog - PRIVATE MeshGeoToolsLib -) + PUBLIC BaseLib + GeoLib + MathLib + MeshLib + logog + PRIVATE MeshGeoToolsLib) if(OGS_USE_PCH) cotire(NumLib) diff --git a/ParameterLib/CMakeLists.txt b/ParameterLib/CMakeLists.txt index 857be4c14f894b64dcde14ebb56845a4d783b822..59bd7e35266ad4eecc2c2c84e339254f1f60739d 100644 --- a/ParameterLib/CMakeLists.txt +++ b/ParameterLib/CMakeLists.txt @@ -8,9 +8,7 @@ endif() include(GenerateExportHeader) generate_export_header(ParameterLib) -target_include_directories(ParameterLib - PUBLIC ${CMAKE_CURRENT_BINARY_DIR} -) +target_include_directories(ParameterLib PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(ParameterLib PRIVATE BaseLib MeshLib)