From d79e518869fde425a6a961cab438d7a353c78d8f Mon Sep 17 00:00:00 2001 From: Lars Bilke <lars.bilke@ufz.de> Date: Wed, 3 Feb 2021 13:19:56 +0100 Subject: [PATCH] [CMake] Reworked presets structure. --- CMakeLists.txt | 2 - CMakePresets.json | 144 +++++++++++++++++++++++++------ scripts/ci/jobs/build-linux.yml | 1 + scripts/ci/jobs/code-quality.yml | 1 + 4 files changed, 122 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 60ab198c409..6a92bee7aa0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,8 +184,6 @@ endif() option(OGS_CHECK_HEADER_COMPILATION "Check header for standalone compilation." OFF) -option(OGS_USE_PYTHON "Interface with Python" ${Python3_FOUND}) - option(OGS_USE_MFRONT "Enable solid material models by MFront (https://tfel.sourceforge.net)" OFF) diff --git a/CMakePresets.json b/CMakePresets.json index 1319a413379..3ab4166ef4c 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -7,36 +7,39 @@ }, "configurePresets": [ { - "name": "_ninja_release", + "name": "_binary_dir", "hidden": true, - "displayName": "Default Config (Release)", - "description": "Default build using the Ninja generator", - "generator": "Ninja", - "binaryDir": "${sourceDir}/build/${presetName}", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" - } + "binaryDir": "${sourceDir}/build/${presetName}" }, { - "name": "release", - "inherits": "_ninja_release", + "name": "_release", + "hidden": true, + "inherits": "_binary_dir", "cacheVariables": { - "OGS_BUILD_UTILS": "ON", - "OGS_USE_PYTHON": "ON" + "CMAKE_BUILD_TYPE": "Release" } }, { - "name": "debug", - "inherits": "release", - "displayName": "Default Config (Debug)", + "name": "_debug", + "hidden": true, + "inherits": "_binary_dir", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" } }, { - "name": "release-gui", - "inherits": "release", - "displayName": "GUI Config (Release)", + "name": "_ninja", + "hidden": true, + "generator": "Ninja" + }, + { + "name": "_msvc", + "hidden": true, + "generator": "Visual Studio 16 2019" + }, + { + "name": "_gui", + "hidden": true, "cacheVariables": { "OGS_BUILD_CLI": "OFF", "OGS_BUILD_GUI": "ON", @@ -44,11 +47,10 @@ } }, { - "name": "release-petsc", - "inherits": "_ninja_release", - "displayName": "PETSc Config (Release)", - "description": "PETSc build using MPI compiler (mpicc, mpic++)", + "name": "_petsc", + "hidden": true, "cacheVariables": { + "OGS_USE_PYTHON": "OFF", "BUILD_SHARED_LIBS": "ON", "OGS_USE_CONAN": "OFF", "OGS_USE_PETSC": "ON" @@ -58,12 +60,106 @@ "CXX": "mpic++" } }, + { + "name": "release", + "inherits": [ + "_ninja", + "_release" + ] + }, + { + "name": "debug", + "inherits": [ + "_ninja", + "_debug" + ] + }, + { + "name": "release-gui", + "inherits": [ + "release", + "_gui" + ] + }, + { + "name": "debug-gui", + "inherits": [ + "debug", + "_gui" + ] + }, + { + "name": "release-petsc", + "inherits": [ + "release", + "_petsc" + ] + }, + { + "name": "debug-petsc", + "inherits": [ + "debug", + "_petsc" + ] + }, + { + "name": "msvc-release", + "inherits": [ + "_msvc", + "_release" + ] + }, + { + "name": "msvc-debug", + "inherits": [ + "_msvc", + "_debug" + ] + }, + { + "name": "msvc-release-gui", + "inherits": [ + "msvc-release", + "_gui" + ] + }, + { + "name": "msvc-debug-gui", + "inherits": [ + "msvc-debug", + "_gui" + ] + }, + { + "name": "_all", + "hidden": true, + "cacheVariables": { + "OGS_USE_MFRONT": "ON", + "OGS_USE_XDMF": "ON" + } + }, + { + "name": "release-all", + "inherits": [ + "release", + "_all" + ] + }, + { + "name": "debug-all", + "inherits": [ + "debug", + "_all" + ] + }, { "name": "ci-simplest", - "inherits": "_ninja_release", + "inherits": "release", "cacheVariables": { + "OGS_BUILD_UTILS": "OFF", + "OGS_USE_PYTHON": "OFF", "OGS_USE_CONAN": "OFF", - "OGS_DISABLE_POETRY": "ON" + "OGS_USE_POETRY": "OFF" } } ] diff --git a/scripts/ci/jobs/build-linux.yml b/scripts/ci/jobs/build-linux.yml index d8c9da5f4ea..c9002c05009 100644 --- a/scripts/ci/jobs/build-linux.yml +++ b/scripts/ci/jobs/build-linux.yml @@ -28,6 +28,7 @@ build linux (no unity): BUILD_CTEST: "false" CMAKE_PRESET: release CMAKE_ARGS: >- + -DOGS_USE_PYTHON=OFF -DOGS_USE_CONAN=OFF -DOGS_USE_MFRONT=ON -DOGS_USE_UNITY_BUILDS=OFF diff --git a/scripts/ci/jobs/code-quality.yml b/scripts/ci/jobs/code-quality.yml index 59916cf3f8b..a44664c5369 100644 --- a/scripts/ci/jobs/code-quality.yml +++ b/scripts/ci/jobs/code-quality.yml @@ -8,6 +8,7 @@ cppcheck: script: - > cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DOGS_USE_CONAN=OFF + -DOGS_USE_PYTHON=OFF -DOGS_BUILD_UTILS=OFF -DOGS_USE_UNITY_BUILDS=OFF -DOGS_USE_XDMF=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - bash cppcheck.sh artifacts: -- GitLab