diff --git a/Applications/CLI/CMakeLists.txt b/Applications/CLI/CMakeLists.txt index a8eb184cc7d70cafbc864d97d0046ac78aaf55c8..b1031501bf240ba5c0f317c79ef574f88165af99 100644 --- a/Applications/CLI/CMakeLists.txt +++ b/Applications/CLI/CMakeLists.txt @@ -73,7 +73,7 @@ add_test(NAME ogs_no_args COMMAND ogs) set_tests_properties(ogs_no_args PROPERTIES WILL_FAIL TRUE) # ---- Installation ---- -install(TARGETS ogs RUNTIME DESTINATION bin COMPONENT ogs_cli) +install(TARGETS ogs RUNTIME DESTINATION bin) set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} "ogs" "OGS Simulator") diff --git a/Applications/DataExplorer/DataExplorer.cmake b/Applications/DataExplorer/DataExplorer.cmake index 92d8544331c27148cb8c5ed7e70d38d337d8ac90..be297d6e5b3853b3e29af98b19b45cf7365295b6 100644 --- a/Applications/DataExplorer/DataExplorer.cmake +++ b/Applications/DataExplorer/DataExplorer.cmake @@ -76,7 +76,7 @@ endif() set_property(TARGET DataExplorer PROPERTY FOLDER "DataExplorer") # ---- Installation ---- -install(TARGETS DataExplorer RUNTIME DESTINATION bin COMPONENT ogs_gui) +install(TARGETS DataExplorer RUNTIME DESTINATION bin) cpack_add_component(ogs_gui DISPLAY_NAME "OGS Data Explorer" diff --git a/Applications/FileIO/CMakeLists.txt b/Applications/FileIO/CMakeLists.txt index c5befdde247e52954875dc794092ba9c721aaf55..4372417514158dab7ba8419e650384254d2669db 100644 --- a/Applications/FileIO/CMakeLists.txt +++ b/Applications/FileIO/CMakeLists.txt @@ -2,7 +2,7 @@ get_source_files(SOURCES) append_source_files(SOURCES Gmsh) append_source_files(SOURCES Legacy) -if(NOT Shapelib_FOUND) +if(NOT OGS_BUILD_GUI) list(REMOVE_ITEM SOURCES SHPInterface.h SHPInterface.cpp) endif() @@ -29,7 +29,7 @@ target_link_libraries(ApplicationsFileIO MathLib # Needed for the XmlPrjInterface, which links the DE/Base/OGSError.h. $<$<BOOL:${OGS_BUILD_GUI}>:QtBase> - $<$<BOOL:${Shapelib_FOUND}>:${Shapelib_LIBRARIES}> + $<$<TARGET_EXISTS:shp>:shp> $<$<TARGET_EXISTS:SwmmInterface>:SwmmInterface> PRIVATE MeshLib GitInfoLib std::filesystem spdlog::spdlog ) @@ -42,5 +42,4 @@ configure_file(XmlIO/OpenGeoSysProject.xsd ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/OpenGeoSysProject.xsd COPYONLY) install(FILES XmlIO/OpenGeoSysCND.xsd XmlIO/OpenGeoSysNum.xsd XmlIO/OpenGeoSysProject.xsd - DESTINATION bin - COMPONENT ogs_cli) + DESTINATION bin) diff --git a/Applications/Utils/CMakeLists.txt b/Applications/Utils/CMakeLists.txt index 5fb663ed1cce554ffa1bc265ae1f4a873206e196..7138ca6f6f6c82f8845c6684a176f1adb41c50c1 100644 --- a/Applications/Utils/CMakeLists.txt +++ b/Applications/Utils/CMakeLists.txt @@ -14,6 +14,6 @@ if(OGS_BUILD_SWMM) add_subdirectory(SWMMConverter) endif() -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/Applications/Utils/FileConverter/CMakeLists.txt b/Applications/Utils/FileConverter/CMakeLists.txt index 9962ff02f5a386f0af3f370c96ee5cce6c1c3ad4..ee4df28cbc5714ea245116849fb0d9a4199dc3fb 100644 --- a/Applications/Utils/FileConverter/CMakeLists.txt +++ b/Applications/Utils/FileConverter/CMakeLists.txt @@ -16,14 +16,7 @@ if(OGS_USE_NETCDF) endif() if(OGS_BUILD_GUI) - if(Shapelib_FOUND) - list(APPEND TOOLS ConvertSHPToGLI) - endif() - list(APPEND TOOLS FEFLOW2OGS) -endif() - -if(Shapelib_FOUND) - list(APPEND TOOLS Mesh2Shape) + list(APPEND TOOLS ConvertSHPToGLI FEFLOW2OGS Mesh2Shape) endif() foreach(TOOL ${TOOLS}) @@ -32,14 +25,10 @@ foreach(TOOL ${TOOLS}) MeshGeoToolsLib tclap) endforeach() set_target_properties(${TOOLS} PROPERTIES FOLDER Utilities) -install(TARGETS ${TOOLS} RUNTIME DESTINATION bin COMPONENT Utilities) +install(TARGETS ${TOOLS} RUNTIME DESTINATION bin) if(TARGET ConvertSHPToGLI) - target_link_libraries(ConvertSHPToGLI GeoLib Qt5::Xml ${Shapelib_LIBRARIES}) -endif() - -if(TARGET Mesh2Shape) - target_link_libraries(Mesh2Shape ${Shapelib_LIBRARIES}) + target_link_libraries(ConvertSHPToGLI GeoLib Qt5::Xml) endif() if(TARGET NetCdfConverter) diff --git a/Applications/Utils/GeoTools/CMakeLists.txt b/Applications/Utils/GeoTools/CMakeLists.txt index efa9100d7efa7678817f98269a2a34d773a32763..a6e624fb15743d107f8a3659a37eca85d82a6c37 100644 --- a/Applications/Utils/GeoTools/CMakeLists.txt +++ b/Applications/Utils/GeoTools/CMakeLists.txt @@ -13,4 +13,4 @@ foreach(TOOL ${TOOLS}) Qt5::Core) endforeach() set_target_properties(${TOOLS} PROPERTIES FOLDER Utilities) -install(TARGETS ${TOOLS} RUNTIME DESTINATION bin COMPONENT Utilities) +install(TARGETS ${TOOLS} RUNTIME DESTINATION bin) diff --git a/Applications/Utils/MeshEdit/CMakeLists.txt b/Applications/Utils/MeshEdit/CMakeLists.txt index 45322b4a65c66e49d9c60a8b407586bb615d66ab..8155924cf64ef97f786dc283ea9148c8b5d328b8 100644 --- a/Applications/Utils/MeshEdit/CMakeLists.txt +++ b/Applications/Utils/MeshEdit/CMakeLists.txt @@ -32,7 +32,7 @@ if(OGS_BUILD_GUI) PRIVATE ${PROJECT_SOURCE_DIR}/ThirdParty/paraview) target_link_libraries(RemoveGhostData GitInfoLib MeshLib tclap) set_target_properties(RemoveGhostData PROPERTIES FOLDER Utilities) - install(TARGETS RemoveGhostData RUNTIME DESTINATION bin COMPONENT Utilities) + install(TARGETS RemoveGhostData RUNTIME DESTINATION bin) endif() foreach(TOOL ${TOOLS}) @@ -40,7 +40,7 @@ foreach(TOOL ${TOOLS}) target_link_libraries(${TOOL} GitInfoLib MeshLib tclap) endforeach() set_target_properties(${TOOLS} PROPERTIES FOLDER Utilities) -install(TARGETS ${TOOLS} RUNTIME DESTINATION bin COMPONENT Utilities) +install(TARGETS ${TOOLS} RUNTIME DESTINATION bin) target_link_libraries(appendLinesAlongPolyline MeshGeoToolsLib ApplicationsFileIO) diff --git a/Applications/Utils/MeshGeoTools/CMakeLists.txt b/Applications/Utils/MeshGeoTools/CMakeLists.txt index 324e80d8fdb4d63cb0306a3b98e976f5f4c55607..6f2c2850fa019143a893348ea0b9bcafdab526cd 100644 --- a/Applications/Utils/MeshGeoTools/CMakeLists.txt +++ b/Applications/Utils/MeshGeoTools/CMakeLists.txt @@ -30,4 +30,4 @@ if(TARGET VerticalSliceFromLayers) endif() set_target_properties(${TOOLS} PROPERTIES FOLDER Utilities) -install(TARGETS ${TOOLS} RUNTIME DESTINATION bin COMPONENT Utilities) +install(TARGETS ${TOOLS} RUNTIME DESTINATION bin) diff --git a/Applications/Utils/ModelPreparation/CMakeLists.txt b/Applications/Utils/ModelPreparation/CMakeLists.txt index dea0a6c8b16c5f9a60dc625c0dade39a633fc740..e541621a4e15d081ede3740f7105c974edf056b8 100644 --- a/Applications/Utils/ModelPreparation/CMakeLists.txt +++ b/Applications/Utils/ModelPreparation/CMakeLists.txt @@ -5,6 +5,6 @@ foreach(TOOL ${TOOLS}) target_link_libraries(${TOOL} GitInfoLib MeshLib tclap) endforeach() set_target_properties(${TOOLS} PROPERTIES FOLDER Utilities) -install(TARGETS ${TOOLS} RUNTIME DESTINATION bin COMPONENT Utilities) +install(TARGETS ${TOOLS} RUNTIME DESTINATION bin) add_subdirectory(PartitionMesh) diff --git a/Applications/Utils/ModelPreparation/PartitionMesh/CMakeLists.txt b/Applications/Utils/ModelPreparation/PartitionMesh/CMakeLists.txt index 71d080d9f284e707900b3eedc596617cc69f9dd1..67e28221339469c252ba17253925f459cfb69ab0 100644 --- a/Applications/Utils/ModelPreparation/PartitionMesh/CMakeLists.txt +++ b/Applications/Utils/ModelPreparation/PartitionMesh/CMakeLists.txt @@ -10,4 +10,4 @@ add_executable(partmesh PartitionMesh.cpp Metis.cpp NodeWiseMeshPartitioner.cpp) set_target_properties(partmesh PROPERTIES FOLDER Utilities) target_link_libraries(partmesh GitInfoLib MeshLib tclap) add_dependencies(partmesh mpmetis) -install(TARGETS partmesh RUNTIME DESTINATION bin COMPONENT ogs_partmesh) +install(TARGETS partmesh RUNTIME DESTINATION bin) diff --git a/Applications/Utils/OGSFileConverter/CMakeLists.txt b/Applications/Utils/OGSFileConverter/CMakeLists.txt index df1df12b7dd3819d5d3024e4a812804b294d3507..20eac9d48b046344ab0c3146a2da6d935a6adf4e 100644 --- a/Applications/Utils/OGSFileConverter/CMakeLists.txt +++ b/Applications/Utils/OGSFileConverter/CMakeLists.txt @@ -16,4 +16,4 @@ add_autogen_include(OGSFileConverterLib) set_target_properties(OGSFileConverter OGSFileConverterLib PROPERTIES FOLDER "Utilities") -install(TARGETS OGSFileConverter RUNTIME DESTINATION bin COMPONENT Utilities) +install(TARGETS OGSFileConverter RUNTIME DESTINATION bin) diff --git a/Applications/Utils/PostProcessing/CMakeLists.txt b/Applications/Utils/PostProcessing/CMakeLists.txt index 56d7df38bd1cc33c07067741f9965e7375adf2e8..c3bd2f990e0789585ca9577940db24f24a6a7b0c 100644 --- a/Applications/Utils/PostProcessing/CMakeLists.txt +++ b/Applications/Utils/PostProcessing/CMakeLists.txt @@ -2,12 +2,12 @@ if(OGS_BUILD_PROCESS_LIE) add_executable(postLIE postLIE.cpp) target_link_libraries(postLIE GitInfoLib LIECommon tclap) set_target_properties(postLIE PROPERTIES FOLDER Utilities) - install(TARGETS postLIE RUNTIME DESTINATION bin COMPONENT Utilities) + install(TARGETS postLIE RUNTIME DESTINATION bin) endif() if(OGS_BUILD_GUI) add_executable(Raster2PointCloud Raster2PointCloud.cpp) target_link_libraries(Raster2PointCloud GitInfoLib ApplicationsFileIO BaseLib GeoLib VtkVis QtDataView tclap) set_target_properties(Raster2PointCloud PROPERTIES FOLDER Utilities) - install(TARGETS Raster2PointCloud RUNTIME DESTINATION bin COMPONENT Utilities) + install(TARGETS Raster2PointCloud RUNTIME DESTINATION bin) endif() diff --git a/Applications/Utils/SWMMConverter/CMakeLists.txt b/Applications/Utils/SWMMConverter/CMakeLists.txt index ba04ef30831b3cb82da6bc83a85ab76e32e166b1..1d03b716ace2c5cc10b99412a7d79d64b03191c7 100644 --- a/Applications/Utils/SWMMConverter/CMakeLists.txt +++ b/Applications/Utils/SWMMConverter/CMakeLists.txt @@ -9,4 +9,4 @@ target_link_libraries(SWMMConverter ) include_directories(${PROJECT_SOURCE_DIR}/Applications/FileIO) set_target_properties(SWMMConverter PROPERTIES FOLDER Utilities) -install(TARGETS SWMMConverter RUNTIME DESTINATION bin COMPONENT Utilities) +install(TARGETS SWMMConverter RUNTIME DESTINATION bin) diff --git a/Applications/Utils/SimpleMeshCreation/CMakeLists.txt b/Applications/Utils/SimpleMeshCreation/CMakeLists.txt index b75f2d0e41d6b53616ab87a2f299f366a9e577d9..32a4f2a324f75e4eb4a77cc5a99c9c4b88e31fa8 100644 --- a/Applications/Utils/SimpleMeshCreation/CMakeLists.txt +++ b/Applications/Utils/SimpleMeshCreation/CMakeLists.txt @@ -8,4 +8,4 @@ foreach(TOOL ${TOOLS}) target_link_libraries(${TOOL} ApplicationsFileIO GitInfoLib MeshLib tclap) endforeach() set_target_properties(${TOOLS} PROPERTIES FOLDER Utilities) -install(TARGETS ${TOOLS} RUNTIME DESTINATION bin COMPONENT Utilities) +install(TARGETS ${TOOLS} RUNTIME DESTINATION bin) diff --git a/CMakeLists.txt b/CMakeLists.txt index be9b0275d0add71a52775ffb72189c44e30bc510..6172d66c6ac31d065651ae38c65b927724ec0baf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,14 +51,8 @@ endif() # Third-party libraries, names come from Conan package names set(OGS_LIBS vtk - boost - eigen qt - shapelib - libgeotiff petsc - lis - cvode tfel CACHE INTERNAL "") foreach(LIB ${OGS_LIBS}) @@ -73,6 +67,7 @@ if(OGS_USE_PETSC) endif() option(OGS_USE_CVODE "Use the Sundials CVODE module?" OFF) option(OGS_BUILD_UTILS "Should the utilities programs be built?" ON) +option(OGS_BUILD_TESTING "Should the tests be built?" ON) # ---- CMake includes ---- include(GitSetup) @@ -220,7 +215,7 @@ include(scripts/cmake/packaging/Pack.cmake) # ---- Subdirectories ---- # xdmfdiff -if(OGS_USE_XDMF AND BUILD_TESTING) +if(OGS_USE_XDMF AND OGS_BUILD_TESTING) add_subdirectory(Tests/xdmfdiff) endif() @@ -240,12 +235,12 @@ if(OGS_BUILD_PROCESS_ComponentTransport add_subdirectory(ChemistryLib) endif() -if(OGS_BUILD_CLI OR OGS_BUILD_UTILS OR BUILD_TESTING) +if(OGS_BUILD_CLI OR OGS_BUILD_UTILS OR OGS_BUILD_TESTING) add_subdirectory(ParameterLib) add_subdirectory(MaterialLib) add_subdirectory(ProcessLib) endif() -if(BUILD_TESTING AND NOT IS_SUBPROJECT) +if(OGS_BUILD_TESTING AND NOT IS_SUBPROJECT) add_subdirectory(Tests) endif() diff --git a/GeoLib/CMakeLists.txt b/GeoLib/CMakeLists.txt index 8b06b0419494a59279a73abf617620c8edd38fc2..7aff86e825b8a82f427391b8e2e1e6310d18362a 100644 --- a/GeoLib/CMakeLists.txt +++ b/GeoLib/CMakeLists.txt @@ -29,5 +29,4 @@ configure_file(IO/XmlIO/OpenGeoSysGLI.xsd 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) + DESTINATION bin) diff --git a/MathLib/CMakeLists.txt b/MathLib/CMakeLists.txt index 46588c75ecdab1d6170ba7049ea3c16498b04bde..2882065524b34c6325ec0fb1150f7426e38d3f5e 100644 --- a/MathLib/CMakeLists.txt +++ b/MathLib/CMakeLists.txt @@ -5,7 +5,7 @@ append_source_files(SOURCES Curve) append_source_files(SOURCES InterpolationAlgorithms) append_source_files(SOURCES Integration) append_source_files(SOURCES LinAlg) -if(CVODE_FOUND) +if(OGS_USE_CVODE) append_source_files(SOURCES ODE) endif() append_source_files(SOURCES Nonlinear) @@ -26,8 +26,6 @@ target_include_directories(MathLib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} $<$<BOOL:${OGS_USE_PETSC}>:${PETSC_INCLUDE_DIRS}> - PRIVATE - $<$<BOOL:${OGS_USE_CVODE}>:${CVODE_INCLUDE_DIRS}> ) set_target_properties(MathLib PROPERTIES LINKER_LANGUAGE CXX) @@ -38,6 +36,7 @@ target_link_libraries(MathLib ${OpenMP_CXX_LIBRARIES} $<$<TARGET_EXISTS:LAPACK::LAPACK>:LAPACK::LAPACK> $<$<BOOL:${OGS_USE_LIS}>:${LIS_LIBRARIES}> + $<$<BOOL:${OGS_USE_CVODE}>:CVODE::CVODE> Eigen3::Eigen PRIVATE spdlog::spdlog @@ -46,9 +45,6 @@ target_link_libraries(MathLib if(OGS_USE_PETSC) target_link_libraries(MathLib PUBLIC ${PETSC_LIBRARIES}) endif() -if(OGS_USE_CVODE) - target_link_libraries(MathLib PUBLIC ${CVODE_LIBRARIES}) -endif() if(OGS_USE_MKL) target_link_libraries(MathLib PUBLIC ${MKL_LIBRARIES}) endif() @@ -57,7 +53,7 @@ target_compile_definitions(MathLib PUBLIC $<$<BOOL:${USE_LIS}>:USE_LIS> $<$<BOOL:${OGS_USE_PETSC}>:USE_PETSC> - $<$<BOOL:${CVODE_FOUND}>:CVODE_FOUND> + $<$<BOOL:${OGS_USE_CVODE}>:CVODE_FOUND> PRIVATE $<$<BOOL:${OGS_USE_MKL}>:USE_MKL> ) diff --git a/ProcessLib/ComponentTransport/CMakeLists.txt b/ProcessLib/ComponentTransport/CMakeLists.txt index c7e0c319ca0054df6d319e38712af0ea8cd69e10..20f45f1a2f7d34e908d9617a358eab7bbab588ea 100644 --- a/ProcessLib/ComponentTransport/CMakeLists.txt +++ b/ProcessLib/ComponentTransport/CMakeLists.txt @@ -4,6 +4,6 @@ ogs_add_library(ComponentTransport ${SOURCES}) target_link_libraries(ComponentTransport PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/HT/CMakeLists.txt b/ProcessLib/HT/CMakeLists.txt index 336db9e775ccc2b538723bcf77f9e05ae9b74743..17f027f19dab2860e14ae70156cb092dbbaef19d 100644 --- a/ProcessLib/HT/CMakeLists.txt +++ b/ProcessLib/HT/CMakeLists.txt @@ -3,6 +3,6 @@ get_source_files(SOURCES) ogs_add_library(HT ${SOURCES}) target_link_libraries(HT PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/HT/Tests.cmake b/ProcessLib/HT/Tests.cmake index 5a21ae3e7bc5b5dfd5e3e43a9ff487fbcc645f98..a1d14b54c0bd34699672065bc685ec72df349e1c 100644 --- a/ProcessLib/HT/Tests.cmake +++ b/ProcessLib/HT/Tests.cmake @@ -449,7 +449,7 @@ AddTest( VIS ThermalConvection_ts_1_t_0.000000.vtu ) -if(NOT OGS_USE_MPI AND BUILD_TESTING AND Python3_FOUND) +if(NOT OGS_USE_MPI AND OGS_BUILD_TESTING AND Python3_FOUND) add_custom_target(generate_invalid_project_files_ht ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/ThirdParty/ogs6py/generateInvalidMediaForHT.py diff --git a/ProcessLib/HeatConduction/CMakeLists.txt b/ProcessLib/HeatConduction/CMakeLists.txt index eeaa0e16318dc8f3a50d837424c67ac034f2a520..e5353ad4f3c35cccc36fc5dccc47389fc570442f 100644 --- a/ProcessLib/HeatConduction/CMakeLists.txt +++ b/ProcessLib/HeatConduction/CMakeLists.txt @@ -3,6 +3,6 @@ get_source_files(SOURCES) ogs_add_library(HeatConduction ${SOURCES}) target_link_libraries(HeatConduction PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/HeatTransportBHE/CMakeLists.txt b/ProcessLib/HeatTransportBHE/CMakeLists.txt index 493279c2246e893c33ce41a417be9c38052aab97..746f01dcec3a2daae66ef55df2f620d7fb81b209 100644 --- a/ProcessLib/HeatTransportBHE/CMakeLists.txt +++ b/ProcessLib/HeatTransportBHE/CMakeLists.txt @@ -13,6 +13,6 @@ target_link_libraries(HeatTransportBHE $<$<TARGET_EXISTS:pybind11::pybind11>:pybind11::pybind11> ) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/HydroMechanics/CMakeLists.txt b/ProcessLib/HydroMechanics/CMakeLists.txt index 9b40804c791e7484244822543b0ed16e5f38b3d5..31004690cbf4b72349fb91e2ac49e2ece8d38b99 100644 --- a/ProcessLib/HydroMechanics/CMakeLists.txt +++ b/ProcessLib/HydroMechanics/CMakeLists.txt @@ -3,6 +3,6 @@ get_source_files(SOURCES) ogs_add_library(HydroMechanics ${SOURCES}) target_link_libraries(HydroMechanics PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/LIE/CMakeLists.txt b/ProcessLib/LIE/CMakeLists.txt index e30ed86926d7f55e100c75a4cb80718e07ad5256..208129bcce77b6c079475daccfaf358e5c944809 100644 --- a/ProcessLib/LIE/CMakeLists.txt +++ b/ProcessLib/LIE/CMakeLists.txt @@ -7,7 +7,7 @@ append_source_files(SOURCES SmallDeformation/LocalAssembler) ogs_add_library(LIE ${SOURCES}) target_link_libraries(LIE PUBLIC ProcessLib LIECommon PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(HydroMechanics/Tests.cmake) include(SmallDeformation/Tests.cmake) endif() diff --git a/ProcessLib/LiquidFlow/CMakeLists.txt b/ProcessLib/LiquidFlow/CMakeLists.txt index 7a451eb2e3ff853a4362aca50bcd29d2b380de25..b7cd839b28bb5efe94466727bf24c2d11073f4d4 100644 --- a/ProcessLib/LiquidFlow/CMakeLists.txt +++ b/ProcessLib/LiquidFlow/CMakeLists.txt @@ -3,6 +3,6 @@ get_source_files(SOURCES) ogs_add_library(LiquidFlow ${SOURCES}) target_link_libraries(LiquidFlow PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/PhaseField/CMakeLists.txt b/ProcessLib/PhaseField/CMakeLists.txt index 761ce0cfac040059d8ade7f281f63a6ede5150ba..34e13ba4029127928098f57805028090b4048601 100644 --- a/ProcessLib/PhaseField/CMakeLists.txt +++ b/ProcessLib/PhaseField/CMakeLists.txt @@ -3,6 +3,6 @@ get_source_files(SOURCES) ogs_add_library(PhaseField ${SOURCES}) target_link_libraries(PhaseField PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/RichardsComponentTransport/CMakeLists.txt b/ProcessLib/RichardsComponentTransport/CMakeLists.txt index 18b0d9b405f364fbcd1ea44a2c9c4c645e7e0b1a..39a464cd941d1b8057a0f332270ddd292916e009 100644 --- a/ProcessLib/RichardsComponentTransport/CMakeLists.txt +++ b/ProcessLib/RichardsComponentTransport/CMakeLists.txt @@ -5,6 +5,6 @@ target_link_libraries(RichardsComponentTransport PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/RichardsFlow/CMakeLists.txt b/ProcessLib/RichardsFlow/CMakeLists.txt index 2e8665ebf02a491616620dc2c0ec624b65ac7f75..40fd6bfe7685bf5d23593da493a0b91214fb7b53 100644 --- a/ProcessLib/RichardsFlow/CMakeLists.txt +++ b/ProcessLib/RichardsFlow/CMakeLists.txt @@ -3,6 +3,6 @@ get_source_files(SOURCES) ogs_add_library(RichardsFlow ${SOURCES}) target_link_libraries(RichardsFlow PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/RichardsMechanics/CMakeLists.txt b/ProcessLib/RichardsMechanics/CMakeLists.txt index a7f5cedb2c2f24cffe4256a9f81170094a970476..3606d05c6e8494a1f72e8c2054d27e07adedd813 100644 --- a/ProcessLib/RichardsMechanics/CMakeLists.txt +++ b/ProcessLib/RichardsMechanics/CMakeLists.txt @@ -3,6 +3,6 @@ get_source_files(SOURCES) ogs_add_library(RichardsMechanics ${SOURCES}) target_link_libraries(RichardsMechanics PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/SmallDeformation/CMakeLists.txt b/ProcessLib/SmallDeformation/CMakeLists.txt index 7b0c2b5a30063dcb9fc99250848ec4f723c23181..166bdd2122a8087658da070707489b1bc678a55d 100644 --- a/ProcessLib/SmallDeformation/CMakeLists.txt +++ b/ProcessLib/SmallDeformation/CMakeLists.txt @@ -3,6 +3,6 @@ get_source_files(SOURCES) ogs_add_library(SmallDeformation ${SOURCES}) target_link_libraries(SmallDeformation PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/SmallDeformationNonlocal/CMakeLists.txt b/ProcessLib/SmallDeformationNonlocal/CMakeLists.txt index 06929dfbfc85c36458940efdc20f7c856d31be53..a889eb32405f7460e97ba414583cdeecc67eaf20 100644 --- a/ProcessLib/SmallDeformationNonlocal/CMakeLists.txt +++ b/ProcessLib/SmallDeformationNonlocal/CMakeLists.txt @@ -5,6 +5,6 @@ target_link_libraries(SmallDeformationNonlocal PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/TES/CMakeLists.txt b/ProcessLib/TES/CMakeLists.txt index 7c10dc5c190b3c7de8bdaa528a92a86d413b386e..ac6d0d890a5bff229b9bde361a02d91b81c6a98e 100644 --- a/ProcessLib/TES/CMakeLists.txt +++ b/ProcessLib/TES/CMakeLists.txt @@ -4,6 +4,6 @@ ogs_add_library(TES ${SOURCES}) target_link_libraries(TES PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/ThermalTwoPhaseFlowWithPP/CMakeLists.txt b/ProcessLib/ThermalTwoPhaseFlowWithPP/CMakeLists.txt index b799aebe18523baeba2c923d3dcf1756cde34ccb..1ce81cf428bddc5e2be27976739af6063eed6228 100644 --- a/ProcessLib/ThermalTwoPhaseFlowWithPP/CMakeLists.txt +++ b/ProcessLib/ThermalTwoPhaseFlowWithPP/CMakeLists.txt @@ -9,6 +9,6 @@ target_link_libraries(ThermalTwoPhaseFlowWithPP PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/ThermoHydroMechanics/CMakeLists.txt b/ProcessLib/ThermoHydroMechanics/CMakeLists.txt index deb6548d49c1b33c94c8b7bb2a5607cc39152edd..e17771bb65ea3f12020d237d5ffea2a1656baa9a 100644 --- a/ProcessLib/ThermoHydroMechanics/CMakeLists.txt +++ b/ProcessLib/ThermoHydroMechanics/CMakeLists.txt @@ -5,6 +5,6 @@ target_link_libraries(ThermoHydroMechanics PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/ThermoMechanicalPhaseField/CMakeLists.txt b/ProcessLib/ThermoMechanicalPhaseField/CMakeLists.txt index 79d48e9fa0cd7ddd047f79a952c4d5936999f276..18d54925590afa7eed354f820f0d319e6ff98781 100644 --- a/ProcessLib/ThermoMechanicalPhaseField/CMakeLists.txt +++ b/ProcessLib/ThermoMechanicalPhaseField/CMakeLists.txt @@ -5,6 +5,6 @@ target_link_libraries(ThermoMechanicalPhaseField PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/ThermoMechanics/CMakeLists.txt b/ProcessLib/ThermoMechanics/CMakeLists.txt index 930baf6e1f570b9d1a27c4079b836af78ea71e4d..b93baacd4fd8a59a96891abd4194b853bbd9837d 100644 --- a/ProcessLib/ThermoMechanics/CMakeLists.txt +++ b/ProcessLib/ThermoMechanics/CMakeLists.txt @@ -3,6 +3,6 @@ get_source_files(SOURCES) ogs_add_library(ThermoMechanics ${SOURCES}) target_link_libraries(ThermoMechanics PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/ThermoRichardsMechanics/CMakeLists.txt b/ProcessLib/ThermoRichardsMechanics/CMakeLists.txt index b7575274b49426840dbd365e3fccf6a117ac07ef..a43e38bd48e53a8c9841fc145e9854fb95a3b97d 100644 --- a/ProcessLib/ThermoRichardsMechanics/CMakeLists.txt +++ b/ProcessLib/ThermoRichardsMechanics/CMakeLists.txt @@ -3,6 +3,6 @@ get_source_files(SOURCES) ogs_add_library(ThermoRichardsMechanics ${SOURCES}) target_link_libraries(ThermoRichardsMechanics PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/TwoPhaseFlowWithPP/CMakeLists.txt b/ProcessLib/TwoPhaseFlowWithPP/CMakeLists.txt index bde2ca3eac0367ba13752fd123114af1278a7500..1ccb23a8a0965025f598b3ae55e2c97cac2d9bc7 100644 --- a/ProcessLib/TwoPhaseFlowWithPP/CMakeLists.txt +++ b/ProcessLib/TwoPhaseFlowWithPP/CMakeLists.txt @@ -3,6 +3,6 @@ get_source_files(SOURCES) ogs_add_library(TwoPhaseFlowWithPP ${SOURCES}) target_link_libraries(TwoPhaseFlowWithPP PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/ProcessLib/TwoPhaseFlowWithPrho/CMakeLists.txt b/ProcessLib/TwoPhaseFlowWithPrho/CMakeLists.txt index ef858c780f1c6f4995d71b71f3ff9128dba43b2c..211da79bcff66b2d5568a7abec863e12aacb153c 100644 --- a/ProcessLib/TwoPhaseFlowWithPrho/CMakeLists.txt +++ b/ProcessLib/TwoPhaseFlowWithPrho/CMakeLists.txt @@ -5,6 +5,6 @@ target_link_libraries(TwoPhaseFlowWithPrho PUBLIC ProcessLib PRIVATE ParameterLib) -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) include(Tests.cmake) endif() diff --git a/Tests/xdmfdiff/CMakeLists.txt b/Tests/xdmfdiff/CMakeLists.txt index 267a0d71306b8aceb83e80c2a3d750460034b880..7b947b010404e2d25de8b655049a1dea6e7c89db 100644 --- a/Tests/xdmfdiff/CMakeLists.txt +++ b/Tests/xdmfdiff/CMakeLists.txt @@ -1,3 +1,3 @@ add_executable(xdmfdiff xdmfdiff.cpp) target_link_libraries(xdmfdiff OgsXdmf std::filesystem tclap) -install(PROGRAMS $<TARGET_FILE:xdmfdiff> DESTINATION bin COMPONENT ogs_extras) +install(PROGRAMS $<TARGET_FILE:xdmfdiff> DESTINATION bin) diff --git a/scripts/cmake/CPM.cmake b/scripts/cmake/CPM.cmake index 73ee2d0eb7202dbcc781663c48ab3e7db0c05652..f777eb0e3fa85222074976101f5efa5427787ab3 100644 --- a/scripts/cmake/CPM.cmake +++ b/scripts/cmake/CPM.cmake @@ -1,4 +1,4 @@ -set(CPM_DOWNLOAD_VERSION 0.28.4) +set(CPM_DOWNLOAD_VERSION 0.31.1) if(CPM_SOURCE_CACHE) # Expand relative path. This is important if the provided path contains a tilde (~) diff --git a/scripts/cmake/CompilerSetup.cmake b/scripts/cmake/CompilerSetup.cmake index f3fe1e20f5f60a435ed38ed43f056668db490980..4a207fdc4a4ebe8da9635a73f307bdd8d3a8dabb 100644 --- a/scripts/cmake/CompilerSetup.cmake +++ b/scripts/cmake/CompilerSetup.cmake @@ -83,7 +83,7 @@ if(COMPILER_IS_GCC OR COMPILER_IS_CLANG OR COMPILER_IS_INTEL) required! Found version ${CMAKE_CXX_COMPILER_VERSION}.") endif() endif() - add_compile_options(-fext-numeric-literals) + add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fext-numeric-literals>) include(GCCSanitizer) endif() diff --git a/scripts/cmake/ConanSetup.cmake b/scripts/cmake/ConanSetup.cmake index 4dc1cde427cf5d7830515c1c74fb5b5d9a8cdccc..9b97ed7b29c59472ae1b453100839deb2a69dd94 100644 --- a/scripts/cmake/ConanSetup.cmake +++ b/scripts/cmake/ConanSetup.cmake @@ -33,19 +33,16 @@ set(CONAN_SYSTEM_INCLUDES ON) include(${PROJECT_SOURCE_DIR}/scripts/cmake/conan/conan.cmake) set(CONAN_REQUIRES - boost/${ogs.minimum_version.boost}@conan/stable vtk/${ogs.tested_version.vtk}@bilke/stable CACHE INTERNAL "" ) set(CONAN_OPTIONS - boost:header_only=True vtk:minimal=True vtk:ioxml=True vtk:iolegacy=True CACHE INTERNAL "" ) - if((UNIX AND NOT APPLE) AND BUILD_SHARED_LIBS) set(CONAN_OPTIONS ${CONAN_OPTIONS} vtk:fPIC=True) endif() @@ -54,24 +51,6 @@ if(OGS_USE_MPI) set(CONAN_OPTIONS ${CONAN_OPTIONS} vtk:mpi_minimal=True) endif() -if(OGS_USE_XDMF) - list(APPEND CONAN_REQUIRES - hdf5/${ogs.tested_version.hdf5} - libxml2/${ogs.tested_version.libxml2} - ) - if(UNIX AND NOT APPLE) - list(APPEND CONAN_OPTIONS libxml2:iconv=False) - endif() - if(MSVC) - # Hack: Conan HDF5 not found on Windows - # Use custom FindHDF5 with forced values from Conan - list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/scripts/cmake/conan/win-hdf5") - else() - # Hack: Suppress hdf5 compiler wrapper checks - set(HDF5_C_COMPILER_EXECUTABLE "OFF" CACHE INTERNAL "") - endif() -endif() - if(OGS_USE_PETSC) set(CONAN_REQUIRES ${CONAN_REQUIRES} petsc/${ogs.minimum_version.petsc}@bilke/testing) if(OGS_CONAN_USE_SYSTEM_OPENMPI) @@ -83,17 +62,12 @@ if(OGS_USE_LIS) set(CONAN_REQUIRES ${CONAN_REQUIRES} lis/1.7.9@bilke/stable) endif() -if(OGS_USE_CVODE) - set(CONAN_REQUIRES ${CONAN_REQUIRES} cvode/2.8.2@bilke/stable) -endif() - if(OGS_USE_MFRONT) set(CONAN_REQUIRES ${CONAN_REQUIRES} tfel/3.3.0@bilke/testing) endif() if(OGS_BUILD_GUI) set(CONAN_REQUIRES ${CONAN_REQUIRES} - shapelib/1.3.0@bilke/stable # libgeotiff/1.4.2@bilke/stable # TODO # Overrides for dependency mismatches bzip2/1.0.8 @@ -124,6 +98,10 @@ if(OGS_USE_NETCDF) set(CONAN_REQUIRES ${CONAN_REQUIRES} netcdf-cxx/4.3.1-1@bilke/testing) endif() +if(NOT DEFINED CONAN_REQUIRES) + return() +endif() + conan_check(VERSION ${ogs.minimum_version.conan}) conan_config_install(ITEM ${PROJECT_SOURCE_DIR}/scripts/cmake/conan/config) diff --git a/scripts/cmake/Dependencies.cmake b/scripts/cmake/Dependencies.cmake index 67c9d6fa0f966510e601abbc482a0ca89b035b83..7cc8199dab1f2aaac59a1ba9f6b8304b6119d26e 100644 --- a/scripts/cmake/Dependencies.cmake +++ b/scripts/cmake/Dependencies.cmake @@ -1,4 +1,4 @@ -if(BUILD_TESTING) +if(OGS_BUILD_TESTING) CPMAddPackage( NAME googletest GITHUB_REPOSITORY google/googletest @@ -6,6 +6,7 @@ if(BUILD_TESTING) OPTIONS "INSTALL_GTEST OFF" "gtest_force_shared_crt ON" + EXCLUDE_FROM_ALL YES ) CPMAddPackage( @@ -113,10 +114,11 @@ if(OGS_USE_MFRONT) CPMAddPackage( NAME MGIS GITHUB_REPOSITORY ufz/MFrontGenericInterfaceSupport - GIT_TAG 56c5e35fb571d992714e663c6bf61ad5354ba296 + GIT_TAG 04e7d1bfad83fdc36a5fedb9c3d2e3b0d4b7fccf OPTIONS "enable-doxygen-doc OFF" "enable-fortran-bindings OFF" + EXCLUDE_FROM_ALL YES ) if(MGIS_ADDED) set_target_properties(MFrontGenericInterface PROPERTIES CXX_STANDARD 11) @@ -124,8 +126,68 @@ if(OGS_USE_MFRONT) endif() endif() +CPMFindPackage( + NAME Boost + GITHUB_REPOSITORY Orphis/boost-cmake + VERSION ${ogs.minimum_version.boost} +) + if(OGS_USE_XDMF) - find_package(ZLIB REQUIRED) # ZLIB is a HDF5 dependency + # ZLIB is a HDF5 dependency + CPMFindPackage( + NAME ZLIB + GITHUB_REPOSITORY madler/zlib + VERSION 1.2.11 + EXCLUDE_FROM_ALL YES + ) + if(ZLIB_ADDED) + add_library(ZLIB::ZLIB ALIAS zlibstatic) + endif() + + string(REPLACE "." "_" HDF5_TAG ${ogs.minimum_version.hdf5}) + CPMFindPackage( + NAME HDF5 + GITHUB_REPOSITORY HDFGroup/hdf5 + GIT_TAG hdf5-${HDF5_TAG} + VERSION ${ogs.minimum_version.hdf5} + OPTIONS + "HDF5_EXTERNALLY_CONFIGURED 1" + "HDF5_GENERATE_HEADERS OFF" + "HDF5_BUILD_TOOLS OFF" + "HDF5_BUILD_EXAMPLES OFF" + "HDF5_BUILD_HL_LIB OFF" + "HDF5_BUILD_FORTRAN OFF" + "HDF5_BUILD_CPP_LIB OFF" + "HDF5_BUILD_JAVA OFF" + EXCLUDE_FROM_ALL YES + ) + if(HDF5_ADDED) + target_include_directories(hdf5-static INTERFACE ${HDF5_BINARY_DIR}) + list(APPEND DISABLE_WARNINGS_TARGETS hdf5-static) + set(HDF5_LIBRARIES hdf5-static) + set(HDF5_C_INCLUDE_DIR ${HDF5_SOURCE_DIR}) + set(HDF5_INCLUDE_DIR ${HDF5_SOURCE_DIR}) + endif() + + CPMFindPackage( + NAME LibXml2 + GITHUB_REPOSITORY GNOME/libxml2 + VERSION ${ogs.minimum_version.libxml2} + GIT_TAG f93ca3e140a371b26366f747a408588c631e0fd1 + OPTIONS + "LIBXML2_WITH_TESTS OFF" + "LIBXML2_WITH_PROGRAMS OFF" + "LIBXML2_WITH_ICONV OFF" + "LIBXML2_WITH_ICU OFF" + "LIBXML2_WITH_LZMA OFF" + "LIBXML2_WITH_PYTHON OFF" + "LIBXML2_WITH_ZLIB OFF" + EXCLUDE_FROM_ALL YES + ) + if(LibXml2_ADDED) + add_library(LibXml2::LibXml2 ALIAS LibXml2) + set(LIBXML2_INCLUDE_DIR ${LibXml2_SOURCE_DIR}) + endif() CPMAddPackage( NAME xdmf @@ -139,16 +201,8 @@ if(OGS_USE_XDMF) ${xdmf_SOURCE_DIR} ${xdmf_BINARY_DIR} ) - if(OGS_USE_CONAN AND UNIX AND APPLE) - find_package(Iconv REQUIRED) - endif() - if(MSVC AND OGS_USE_CONAN) - # Hack: Conan HDF5 not found on Windows - target_link_libraries(OgsXdmf ${CONAN_LIBS}) - else() - target_link_libraries(OgsXdmf Boost::boost ${Iconv_LIBRARIES} ZLIB::ZLIB) - endif() + target_link_libraries(OgsXdmf Boost::boost ZLIB::ZLIB) target_include_directories(OgsXdmfCore PUBLIC ${xdmf_SOURCE_DIR}/core @@ -156,8 +210,7 @@ if(OGS_USE_XDMF) PRIVATE ${xdmf_SOURCE_DIR}/CMake/VersionSuite ) - find_package(LibXml2 REQUIRED) # LibXml2 is a XdmfCore dependency - target_link_libraries(OgsXdmfCore PUBLIC LibXml2::LibXml2) + target_link_libraries(OgsXdmfCore PUBLIC Boost::boost LibXml2::LibXml2 ${HDF5_LIBRARIES}) set_target_properties(OgsXdmf OgsXdmfCore PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR} @@ -201,6 +254,7 @@ if(OGS_BUILD_GUI) VERSION 1.13 GITHUB_REPOSITORY ufz/rapidxml GIT_TAG 2ae4b2888165a393dfb6382168825fddf00c27b9 + EXCLUDE_FROM_ALL YES ) if(rapidxml_ADDED) add_library(rapidxml INTERFACE IMPORTED) @@ -208,9 +262,48 @@ if(OGS_BUILD_GUI) endif() endif() +if(OGS_BUILD_GUI) + CPMAddPackage( + NAME shapelib + GITHUB_REPOSITORY OSGeo/shapelib + VERSION 1.5.0 + EXCLUDE_FROM_ALL YES + ) + if(shapelib_ADDED) + target_include_directories(shp INTERFACE ${shapelib_SOURCE_DIR}) + endif() +endif() + +if(OGS_USE_CVODE) + CPMAddPackage( + NAME CVODE + GITHUB_REPOSITORY ufz/cvode + VERSION 2.8.2 + GIT_TAG 42d786bff4f950045d2de941677ecd4432cec855 + OPTIONS "EXAMPLES_ENABLE OFF" + EXCLUDE_FROM_ALL YES + ) + if(CVODE_ADDED) + add_library(CVODE::CVODE INTERFACE IMPORTED) + target_include_directories(CVODE::CVODE INTERFACE + ${CVODE_SOURCE_DIR}/include + ${CVODE_BINARY_DIR}/include + ) + target_link_libraries(CVODE::CVODE INTERFACE + sundials_cvode_static + sundials_nvecserial_static + ) + endif() +endif() + # Disable warnings foreach(TARGET ${DISABLE_WARNINGS_TARGETS}) target_compile_options(${TARGET} PRIVATE $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:-w> $<$<CXX_COMPILER_ID:MSVC>:/W0>) endforeach() + +# Hack: Disable tests from dependencies +configure_file(${PROJECT_SOURCE_DIR}/scripts/cmake/test/CTestCustom.in.cmake + ${PROJECT_BINARY_DIR}/CTestCustom.cmake @ONLY +) diff --git a/scripts/cmake/Find.cmake b/scripts/cmake/Find.cmake index 241199f36441b4e49513caef9715e4fc92ec7e88..1a2e1f2ba0a2bbfafbbd5368285c1a6306bf70d8 100644 --- a/scripts/cmake/Find.cmake +++ b/scripts/cmake/Find.cmake @@ -60,8 +60,6 @@ find_program(GMSH gmsh) ###################### ### Find libraries ### ###################### -find_package(Boost ${ogs.minimum_version.boost} REQUIRED) - set(VTK_COMPONENTS vtkIOXML vtkIOLegacy) if(OGS_BUILD_GUI) set(VTK_COMPONENTS ${VTK_COMPONENTS} @@ -161,18 +159,6 @@ if(OGS_USE_MPI) find_package(MPI REQUIRED) endif() -find_package(Shapelib) -if(Shapelib_FOUND) - include_directories(SYSTEM ${Shapelib_INCLUDE_DIRS}) -elseif(OGS_BUILD_GUI) - message(FATAL_ERROR "Shapelib not found but it is required for OGS_BUILD_GUI!") -endif() - -## Sundials cvode ode-solver library -if(OGS_USE_CVODE) - find_package(CVODE REQUIRED) -endif() - find_package(Filesystem REQUIRED COMPONENTS Final Experimental) configure_file(${PROJECT_SOURCE_DIR}/BaseLib/filesystem.h.in ${PROJECT_BINARY_DIR}/BaseLib/filesystem.h) diff --git a/scripts/cmake/MetisSetup.cmake b/scripts/cmake/MetisSetup.cmake index 1fcf26182fda1d6eb48836c81bcacd967ea091c0..13ff2047ea704f5701fb491aebf5d3f1564278f8 100644 --- a/scripts/cmake/MetisSetup.cmake +++ b/scripts/cmake/MetisSetup.cmake @@ -50,7 +50,7 @@ set(METIS_SOURCES ) add_executable(mpmetis ${METIS_SOURCES}) target_link_libraries(mpmetis ogs_metis) -install(TARGETS mpmetis RUNTIME DESTINATION bin COMPONENT ogs_partmesh) +install(TARGETS mpmetis RUNTIME DESTINATION bin) # Disable warnings if(MSVC) diff --git a/scripts/cmake/PythonSetup.cmake b/scripts/cmake/PythonSetup.cmake index 9c681984790d0750b2cc96ddaed78229db1d0c4d..499baf4d51ab4f82b40a0df0d174c6db161f426d 100644 --- a/scripts/cmake/PythonSetup.cmake +++ b/scripts/cmake/PythonSetup.cmake @@ -43,7 +43,7 @@ set(LOCAL_VIRTUALENV_BIN_DIRS ) if(POETRY) - if(BUILD_TESTING) + if(OGS_BUILD_TESTING) list(APPEND PYTHON_PACKAGES snakemake=${ogs.minimum_version.snakemake}) endif() execute_process(COMMAND ${CMD_COMMAND} poetry add ${PYTHON_PACKAGES} diff --git a/scripts/cmake/conan/win-hdf5/FindHDF5.cmake b/scripts/cmake/conan/win-hdf5/FindHDF5.cmake deleted file mode 100644 index 1f973c5228301fa9c63b3ae73331eb4819f496f8..0000000000000000000000000000000000000000 --- a/scripts/cmake/conan/win-hdf5/FindHDF5.cmake +++ /dev/null @@ -1,14 +0,0 @@ -if(HDF5_FOUND) - return() -endif() - -set(HDF5_FOUND TRUE CACHE INTERNAL "") -set(HDF5_VERSION "${ogs.tested_version.hdf5}" CACHE INTERNAL "") -set(HDF5_DEFINITIONS "" CACHE INTERNAL "") -set(HDF5_INCLUDE_DIRS ${CONAN_INCLUDE_DIRS_HDF5} CACHE INTERNAL "") -foreach(LIB ${CONAN_LIBS_HDF5}) - find_library(HDF5_LIB NAMES ${LIB} PATHS ${CONAN_LIB_DIRS_HDF5}) - list(APPEND HDF5_LIBRARIES ${HDF5_LIB}) -endforeach() -set(HDF5_LIBRARIES ${HDF5_LIBRARIES} CACHE INTERNAL "") -message(STATUS "Found HDF5 ${ogs.tested_version.hdf5} via Conan: ${CONAN_HDF5_ROOT}") diff --git a/scripts/cmake/packaging/Pack.cmake b/scripts/cmake/packaging/Pack.cmake index 08f4da70c79bb6e90dad1dff598343c98ed3c59d..729350aef06d6cf6292d14705d7f08560bda4f34 100644 --- a/scripts/cmake/packaging/Pack.cmake +++ b/scripts/cmake/packaging/Pack.cmake @@ -3,6 +3,13 @@ if(IS_SUBPROJECT) return() endif() +# Put ogs installs into its own component and then only install +# this component (avoids third-party installs from CPM). +set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME ogs) +set(CPACK_INSTALL_CMAKE_PROJECTS + "${PROJECT_BINARY_DIR};${PROJECT_NAME};${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME};/" +) + option(OGS_INSTALL_DEPENDENCIES "Package dependencies.") include(packaging/PackagingMacros) include(packaging/ArchiveTestdata) @@ -54,31 +61,6 @@ endif() include (CPack) -cpack_add_component_group(Applications - DISPLAY_NAME Applications - DESCRIPTION "OpenGeoSys applications" - EXPANDED - BOLD_TITLE -) - -cpack_add_component_group(Utilities - DISPLAY_NAME Utilities - DESCRIPTION "OpenGeoSys utilities" - EXPANDED -) - -cpack_add_component(ogs_extras - DISPLAY_NAME "Extra tools" - DESCRIPTION "Miscellaneous tools." - GROUP Utilities -) - -cpack_add_component(ogs_docs - DISPLAY_NAME "Documentation" - DESCRIPTION "PDF documentation." - GROUP Utilities -) - if(OGS_USE_CONAN) # Install Qt platform shared libraries install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/platforms DESTINATION bin OPTIONAL) diff --git a/scripts/cmake/packaging/PackagingMac.cmake b/scripts/cmake/packaging/PackagingMac.cmake index cf2c265c256ea92e15edd2af23255579a04a4344..38f9e46e78558cbda1acc78dde42ca6ece723ab8 100644 --- a/scripts/cmake/packaging/PackagingMac.cmake +++ b/scripts/cmake/packaging/PackagingMac.cmake @@ -28,5 +28,5 @@ if(OGS_BUILD_GUI) file(WRITE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qt.conf" "[Paths]\nPlugins = ../${_qt_plugin_dir}\n") install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qt.conf" - DESTINATION bin COMPONENT ogs_gui) + DESTINATION bin) endif() diff --git a/scripts/cmake/packaging/PackagingWin.cmake b/scripts/cmake/packaging/PackagingWin.cmake index 50caebdf49eaec02c9f00ac69ce5d3b100301a9b..485483693456f45bfee70345b9c93c66924fe10b 100644 --- a/scripts/cmake/packaging/PackagingWin.cmake +++ b/scripts/cmake/packaging/PackagingWin.cmake @@ -28,5 +28,5 @@ if(OGS_BUILD_GUI) file(WRITE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qt.conf" "[Paths]\nPlugins = ../${_qt_plugin_dir}\n") install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qt.conf" - DESTINATION bin COMPONENT ogs_gui) + DESTINATION bin) endif() diff --git a/scripts/cmake/test/CTestCustom.in.cmake b/scripts/cmake/test/CTestCustom.in.cmake new file mode 100644 index 0000000000000000000000000000000000000000..5f401e4561a71f0e996822fd06b5e7a490fd3a63 --- /dev/null +++ b/scripts/cmake/test/CTestCustom.in.cmake @@ -0,0 +1,12 @@ +file (STRINGS "@PROJECT_BINARY_DIR@/CTestTestfile.cmake" LINES) + +# overwrite the file.... +file(WRITE "@PROJECT_BINARY_DIR@/CTestTestfile.cmake" "") + +# loop through the lines, +foreach(LINE IN LISTS LINES) + # remove unwanted parts + string(REGEX REPLACE ".*_deps/.*" "" STRIPPED "${LINE}") + # and write the (changed) line ... + file(APPEND "@PROJECT_BINARY_DIR@/CTestTestfile.cmake" "${STRIPPED}\n") +endforeach() diff --git a/scripts/cmake/test/MeshTest.cmake b/scripts/cmake/test/MeshTest.cmake index 0240f963dfa5026ad5944708ab419be75b31dc34..e27040f8a2d514dbb42107035395f86c42f15a09 100644 --- a/scripts/cmake/test/MeshTest.cmake +++ b/scripts/cmake/test/MeshTest.cmake @@ -17,7 +17,7 @@ # ) function (MeshTest) - if(NOT BUILD_TESTING) + if(NOT OGS_BUILD_TESTING) return() endif() # parse arguments diff --git a/scripts/cmake/test/OgsTest.cmake b/scripts/cmake/test/OgsTest.cmake index bcf10c5181f5ff6f2a66a7b5958824e587fa349a..efc854e1698513fc2e880d1a7b1802946ff85c13 100644 --- a/scripts/cmake/test/OgsTest.cmake +++ b/scripts/cmake/test/OgsTest.cmake @@ -1,6 +1,6 @@ function (OgsTest) - if(NOT OGS_BUILD_CLI OR NOT BUILD_TESTING) + if(NOT OGS_BUILD_CLI OR NOT OGS_BUILD_TESTING) return() endif() set(options DISABLED) diff --git a/scripts/cmake/test/Test.cmake b/scripts/cmake/test/Test.cmake index 41e6d3a317d04f7912faf7f88be69166970a286a..881fc11e731a15350a59b114a53acb47343f7515 100644 --- a/scripts/cmake/test/Test.cmake +++ b/scripts/cmake/test/Test.cmake @@ -41,20 +41,6 @@ if(OGS_BUILD_UTILS) generateStructuredMesh ) endif() -if(OGS_USE_MFRONT) - list(APPEND test_dependencies - MFrontGenericBehaviourInterfaceTest - MFrontGenericBehaviourInterfaceTest2 - MFrontGenericBehaviourInterfaceTest3 - BoundsCheckTest - ParameterTest - IntegrateTest - IntegrateTest2 - IntegrateTest2b - IntegrateTest3 - IntegrateTest3b - BehaviourTest) -endif() add_custom_target( ctest diff --git a/scripts/env/eve/cli.sh b/scripts/env/eve/cli.sh index 19e453d8553073127fc4b5a14bb1f1f7a311d63e..26a9707970857039a01776c26cf010edd219aa30 100644 --- a/scripts/env/eve/cli.sh +++ b/scripts/env/eve/cli.sh @@ -14,7 +14,6 @@ module load git/2.23.0 # Libraries module load boost/1.67.0-1 -module load eigen/3.3.9-1-cmake module load vtk/8.2.0/foss2019b/serial module load HDF5/1.10.5-nompi diff --git a/web/content/docs/devguide/advanced/configuration-options.md b/web/content/docs/devguide/advanced/configuration-options.md index 8b470fc2e95852cbfbf9b6ba92203c2c11da7da1..317a5fb1cdfb46b368cb11cc7899df88b3f9065f 100644 --- a/web/content/docs/devguide/advanced/configuration-options.md +++ b/web/content/docs/devguide/advanced/configuration-options.md @@ -19,7 +19,7 @@ CMake switches to enable / disable parts of OGS. - `OGS_BUILD_CLI` - Builds the simulator. *Defaults* to *ON*. If set to *OFF* all processes are also disabled. - `OGS_BUILD_GUI` - Builds the Data Explorer. *Defaults* to *OFF*. -- `BUILD_TESTING` - Builds the test executables. *Defaults* to *ON*. +- `OGS_BUILD_TESTING` - Builds the test executables. *Defaults* to *ON*. - `OGS_BUILD_UTILS` - Builds several utilities. - `OGS_NO_EXTERNAL_LIBS` - Disables all external optional dependencies. - `OGS_BUILD_PROCESS_X` - For enabling/disabling compilation of process `X`. diff --git a/web/data/versions.json b/web/data/versions.json index 0dffb933ddff37f276a38eb8b7f3ee9fd12dbee0..2c52288dde54f7b13021af2e3d6de2251cf32a5b 100644 --- a/web/data/versions.json +++ b/web/data/versions.json @@ -20,12 +20,11 @@ "qt": "5.14.2", "python": "3.6", "snakemake": "5.27.4", - "hdf5": "1.10.5" + "hdf5": "1.10.5", + "libxml2": "2.9.10" }, "tested_version": { "vtk": "8.2.0", - "hdf5": "1.12.0", - "libxml2": "2.9.10", "ubuntu": "20.04" }, "ctest": {