Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yuhao Liu
ogs
Commits
3d595b9b
Verified
Commit
3d595b9b
authored
4 years ago
by
Lars Bilke
Browse files
Options
Downloads
Patches
Plain Diff
[cmake-format] Top-level CMakeLists.txt
parent
353baf57
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.cmake-format.yaml
+5
-0
5 additions, 0 deletions
.cmake-format.yaml
.pre-commit-config.yaml
+1
-1
1 addition, 1 deletion
.pre-commit-config.yaml
CMakeLists.txt
+49
-31
49 additions, 31 deletions
CMakeLists.txt
with
55 additions
and
32 deletions
.cmake-format.yaml
+
5
−
0
View file @
3d595b9b
...
@@ -3,6 +3,7 @@ format:
...
@@ -3,6 +3,7 @@ format:
max_subgroups_hwrap
:
3
max_subgroups_hwrap
:
3
dangle_parens
:
true
dangle_parens
:
true
command_case
:
"
unchanged"
command_case
:
"
unchanged"
line_width
:
80
lint
:
lint
:
disabled_codes
:
disabled_codes
:
-
"
C0301"
-
"
C0301"
...
@@ -10,6 +11,10 @@ lint:
...
@@ -10,6 +11,10 @@ lint:
-
"
C0113"
# Missing COMMAND for optional dependencies.
-
"
C0113"
# Missing COMMAND for optional dependencies.
parse
:
parse
:
vartags
:
-
!!python/tuple
-
set_property
-
-
cmdline
additional_commands
:
additional_commands
:
addtest
:
addtest
:
pargs
:
pargs
:
...
...
This diff is collapsed.
Click to expand it.
.pre-commit-config.yaml
+
1
−
1
View file @
3d595b9b
...
@@ -10,7 +10,7 @@ repos:
...
@@ -10,7 +10,7 @@ repos:
-
id
:
check-merge-conflict
-
id
:
check-merge-conflict
-
id
:
check-xml
-
id
:
check-xml
-
id
:
check-yaml
-
id
:
check-yaml
exclude
:
'
^scripts/ci/.*'
exclude
:
'
^scripts/ci/.*
|.cmake-format.yaml
'
-
id
:
check-toml
-
id
:
check-toml
-
repo
:
local
-
repo
:
local
hooks
:
hooks
:
...
...
This diff is collapsed.
Click to expand it.
CMakeLists.txt
+
49
−
31
View file @
3d595b9b
...
@@ -21,26 +21,32 @@ include(CTest)
...
@@ -21,26 +21,32 @@ include(CTest)
set
(
CMAKE_EXPORT_COMPILE_COMMANDS ON
)
set
(
CMAKE_EXPORT_COMPILE_COMMANDS ON
)
option
(
BUILD_SHARED_LIBS
"Create shared libraries?"
OFF
)
option
(
BUILD_SHARED_LIBS
"Create shared libraries?"
OFF
)
option
(
OGS_BUILD_CLI
"Should the OGS simulator be built?"
ON
)
option
(
OGS_BUILD_CLI
"Should the OGS simulator be built?"
ON
)
set
(
CMAKE_LIBRARY_SEARCH_PATH
set
(
CMAKE_LIBRARY_SEARCH_PATH
""
""
CACHE PATH
CACHE PATH
"Additional library installation path, e.g. /opt/local or C:/libs"
)
"Additional library installation path, e.g. /opt/local or C:/libs"
)
set
(
OGS_CPU_ARCHITECTURE
"native"
CACHE STRING
"Processor architecture, \
set
(
OGS_CPU_ARCHITECTURE
"native"
CACHE STRING
"Processor architecture, \
defaults to native (*nix) / blend (MSVC)."
)
defaults to native (*nix) / blend (MSVC)."
)
option
(
OGS_ENABLE_AVX2
"Enable the use of AVX2 instructions"
OFF
)
option
(
OGS_ENABLE_AVX2
"Enable the use of AVX2 instructions"
OFF
)
option
(
OGS_USE_CONAN
"Should Conan package manager be used?"
ON
)
option
(
OGS_USE_CONAN
"Should Conan package manager be used?"
ON
)
set
(
OGS_CONAN_BUILD
"missing"
CACHE STRING
"Possible values: all, missing, \
set
(
OGS_CONAN_BUILD
"missing"
CACHE STRING
"Possible values: all, missing, \
never or list of libs to build"
)
never or list of libs to build"
)
if
(
WIN32
)
if
(
WIN32
)
option
(
OGS_DISABLE_CLCACHE
"Disables clcache compiler cache."
OFF
)
option
(
OGS_DISABLE_CLCACHE
"Disables clcache compiler cache."
OFF
)
else
()
else
()
option
(
OGS_DISABLE_CCACHE
"Disables ccache compiler cache."
OFF
)
option
(
OGS_DISABLE_CCACHE
"Disables ccache compiler cache."
OFF
)
endif
()
endif
()
if
(
${
CMAKE_VERSION
}
VERSION_GREATER_EQUAL 3.16
)
if
(
${
CMAKE_VERSION
}
VERSION_GREATER_EQUAL 3.16
)
option
(
OGS_USE_UNITY_BUILDS
"Enables Unity builds for faster compilation."
ON
)
option
(
OGS_USE_UNITY_BUILDS
"Enables Unity builds for faster compilation."
ON
)
endif
()
endif
()
option
(
OGS_USE_PYTHON
"Interface with Python"
ON
)
option
(
OGS_USE_PYTHON
"Interface with Python"
ON
)
option
(
OGS_USE_POETRY
"Enables automatic Python virtual environment handling with poetry."
ON
)
option
(
OGS_USE_POETRY
"Enables automatic Python virtual environment handling with poetry."
ON
)
if
(
WIN32
)
if
(
WIN32
)
option
(
OGS_BUILD_SWMM
"Should the SWMM interface be built?"
ON
)
option
(
OGS_BUILD_SWMM
"Should the SWMM interface be built?"
ON
)
endif
()
endif
()
...
@@ -50,9 +56,9 @@ endif()
...
@@ -50,9 +56,9 @@ endif()
# Third-party libraries, names come from Conan package names
# Third-party libraries, names come from Conan package names
foreach
(
lib vtk qt petsc tfel
)
foreach
(
lib vtk qt petsc tfel
)
set
(
OGS_LIB_
${
lib
}
set
(
OGS_LIB_
${
lib
}
"Default"
CACHE STRING
"Default
"
"Which
${
LIB
}
library should be used?
"
CACHE STRING
"Which
${
LIB
}
library should be used?"
)
)
set_property
(
CACHE OGS_LIB_
${
lib
}
PROPERTY STRINGS
"Default"
"System"
)
set_property
(
CACHE OGS_LIB_
${
lib
}
PROPERTY STRINGS
"Default"
"System"
)
endforeach
()
endforeach
()
...
@@ -88,7 +94,8 @@ include(CppCheck)
...
@@ -88,7 +94,8 @@ include(CppCheck)
# Profiling
# Profiling
if
((
CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC
)
AND GPROF_PATH
)
if
((
CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC
)
AND GPROF_PATH
)
option
(
OGS_PROFILE
option
(
OGS_PROFILE
"Enables compiling with flags set for profiling with gprof."
OFF
)
"Enables compiling with flags set for profiling with gprof."
OFF
)
endif
()
# GCC AND GPROF_PATH
endif
()
# GCC AND GPROF_PATH
option
(
OGS_BUILD_GUI
"Should the Data Explorer be built?"
OFF
)
option
(
OGS_BUILD_GUI
"Should the Data Explorer be built?"
OFF
)
...
@@ -111,22 +118,26 @@ option(EIGEN_NO_DEBUG "Disables Eigen's assertions" OFF)
...
@@ -111,22 +118,26 @@ option(EIGEN_NO_DEBUG "Disables Eigen's assertions" OFF)
# to take a look at https://github.com/ufz/ogs/issues/1881.
# to take a look at https://github.com/ufz/ogs/issues/1881.
option
(
EIGEN_DONT_VECTORIZE
"Disables explicit vectorization when defined."
ON
)
option
(
EIGEN_DONT_VECTORIZE
"Disables explicit vectorization when defined."
ON
)
set
(
OGS_EIGEN_DYNAMIC_SHAPE_MATRICES
set
(
OGS_EIGEN_DYNAMIC_SHAPE_MATRICES
"Default"
"Default"
CACHE STRING
"Use dynamically allocated shape matrices"
CACHE STRING
"Use dynamically allocated shape matrices"
)
)
set_property
(
CACHE OGS_EIGEN_DYNAMIC_SHAPE_MATRICES
set_property
(
PROPERTY STRINGS
"Default"
"ON"
"OFF"
)
CACHE OGS_EIGEN_DYNAMIC_SHAPE_MATRICES PROPERTY STRINGS
"Default"
"ON"
"OFF"
)
if
(
OGS_EIGEN_DYNAMIC_SHAPE_MATRICES STREQUAL
"Default"
)
if
(
OGS_EIGEN_DYNAMIC_SHAPE_MATRICES STREQUAL
"Default"
)
if
(
CMAKE_BUILD_TYPE STREQUAL
"Release"
if
(
CMAKE_BUILD_TYPE STREQUAL
"Release"
OR CMAKE_BUILD_TYPE STREQUAL
OR CMAKE_BUILD_TYPE STREQUAL
"RelWithDebInfo"
)
"RelWithDebInfo"
)
set
(
OGS_EIGEN_DYNAMIC_SHAPE_MATRICES_INTERNAL OFF
)
set
(
OGS_EIGEN_DYNAMIC_SHAPE_MATRICES_INTERNAL OFF
)
else
()
else
()
set
(
OGS_EIGEN_DYNAMIC_SHAPE_MATRICES_INTERNAL ON
)
set
(
OGS_EIGEN_DYNAMIC_SHAPE_MATRICES_INTERNAL ON
)
endif
()
endif
()
else
()
else
()
set
(
OGS_EIGEN_DYNAMIC_SHAPE_MATRICES_INTERNAL
set
(
OGS_EIGEN_DYNAMIC_SHAPE_MATRICES_INTERNAL
${
OGS_EIGEN_DYNAMIC_SHAPE_MATRICES
}
)
${
OGS_EIGEN_DYNAMIC_SHAPE_MATRICES
}
)
endif
()
endif
()
# Eigen End
# Eigen End
...
@@ -149,31 +160,37 @@ endif()
...
@@ -149,31 +160,37 @@ endif()
option
(
OGS_COVERAGE
"Enables code coverage measurements with gcov/lcov."
OFF
)
option
(
OGS_COVERAGE
"Enables code coverage measurements with gcov/lcov."
OFF
)
# Options controlling which FEM elements will be compiled
# Options controlling which FEM elements will be compiled
set
(
OGS_MAX_ELEMENT_DIM
set
(
OGS_MAX_ELEMENT_DIM
3
3
CACHE STRING
"Maximum dimension of FEM elements to be built."
CACHE STRING
"Maximum dimension of FEM elements to be built."
)
)
set
(
OGS_MAX_ELEMENT_ORDER
set
(
OGS_MAX_ELEMENT_ORDER
2 CACHE STRING
2
"Maximum order of FEM elements to be built."
CACHE STRING
"Maximum order of FEM elements to be built."
)
)
option
(
OGS_ENABLE_ELEMENT_SIMPLEX
option
(
OGS_ENABLE_ELEMENT_SIMPLEX
"Build FEM elements for simplices (triangles, tetrahedra)."
ON
)
"Build FEM elements for simplices (triangles, tetrahedra)."
ON
)
option
(
OGS_ENABLE_ELEMENT_CUBOID
option
(
OGS_ENABLE_ELEMENT_CUBOID
"Build FEM elements for cuboids (quads, hexahedra)."
ON
)
"Build FEM elements for cuboids (quads, hexahedra)."
ON
)
option
(
OGS_ENABLE_ELEMENT_PRISM
"Build FEM elements for prisms."
ON
)
option
(
OGS_ENABLE_ELEMENT_PRISM
"Build FEM elements for prisms."
ON
)
option
(
OGS_ENABLE_ELEMENT_PYRAMID
"Build FEM elements for pyramids."
ON
)
option
(
OGS_ENABLE_ELEMENT_PYRAMID
"Build FEM elements for pyramids."
ON
)
if
(
NOT OGS_MAX_ELEMENT_DIM MATCHES
"^[0-3]$"
)
if
(
NOT OGS_MAX_ELEMENT_DIM MATCHES
"^[0-3]$"
)
message
(
FATAL_ERROR
"OGS_MAX_ELEMENT_DIM must be an integer between 0 and 3."
)
message
(
FATAL_ERROR
"OGS_MAX_ELEMENT_DIM must be an integer between 0 and 3."
)
endif
()
endif
()
if
(
NOT OGS_MAX_ELEMENT_ORDER MATCHES
"^[0-9]$"
)
if
(
NOT OGS_MAX_ELEMENT_ORDER MATCHES
"^[0-9]$"
)
message
(
FATAL_ERROR
"OGS_MAX_ELEMENT_ORDER must be an integer."
)
message
(
FATAL_ERROR
"OGS_MAX_ELEMENT_ORDER must be an integer."
)
endif
()
endif
()
option
(
OGS_CHECK_HEADER_COMPILATION
"Check header for standalone compilation."
option
(
OGS_CHECK_HEADER_COMPILATION
"Check header for standalone compilation."
OFF
)
OFF
)
option
(
OGS_USE_MFRONT
option
(
OGS_USE_MFRONT
"Enable solid material models by MFront (https://tfel.sourceforge.net)"
"Enable solid material models by MFront (https://tfel.sourceforge.net)"
OFF
)
OFF
)
# ---- Definitions ----
# ---- Definitions ----
if
(
OGS_USE_LIS
)
if
(
OGS_USE_LIS
)
include_directories
(
SYSTEM
${
LIS_INCLUDE_DIR
}
)
include_directories
(
SYSTEM
${
LIS_INCLUDE_DIR
}
)
...
@@ -225,7 +242,8 @@ add_subdirectory(MeshGeoToolsLib)
...
@@ -225,7 +242,8 @@ add_subdirectory(MeshGeoToolsLib)
add_subdirectory
(
NumLib
)
add_subdirectory
(
NumLib
)
if
(
OGS_BUILD_PROCESS_ComponentTransport
if
(
OGS_BUILD_PROCESS_ComponentTransport
OR OGS_BUILD_PROCESS_RichardsComponentTransport
)
OR OGS_BUILD_PROCESS_RichardsComponentTransport
)
add_subdirectory
(
ChemistryLib
)
add_subdirectory
(
ChemistryLib
)
endif
()
endif
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment