Skip to content
Snippets Groups Projects
Commit 5b94d186 authored by Lars Bilke's avatar Lars Bilke
Browse files

[cmake] top-level cleanup.

parent c012e995
No related branches found
No related tags found
No related merge requests found
# ---- OGS-6 Project ---- # ---- OGS-6 Project ----
# Specify minimum CMake version
cmake_minimum_required(VERSION 3.12) cmake_minimum_required(VERSION 3.12)
# Set CMake policies # Set CMake policies
cmake_policy(SET CMP0011 NEW)
cmake_policy(SET CMP0054 NEW) cmake_policy(SET CMP0054 NEW)
if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW)
cmake_policy(SET CMP0071 NEW) cmake_policy(SET CMP0074 NEW)
endif()
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
if(WIN32 if(WIN32 AND NOT ${CMAKE_GENERATOR} STREQUAL Ninja)
AND NOT ${CMAKE_GENERATOR} STREQUAL Ninja # Force 64-bit VS compiler
AND NOT ${CMAKE_GENERATOR} MATCHES 2015) # does not work on 2015 Force 64-bit
# VS compiler
set(CMAKE_GENERATOR_TOOLSET host=x64) set(CMAKE_GENERATOR_TOOLSET host=x64)
endif() endif()
# Project name
project(OGS-6) project(OGS-6)
include(scripts/cmake/CMakeSetup.cmake) include(scripts/cmake/CMakeSetup.cmake)
...@@ -94,9 +84,6 @@ if((CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC) AND GPROF_PATH) ...@@ -94,9 +84,6 @@ if((CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC) AND GPROF_PATH)
"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
# Enable / Disable parts
option(OGS_DONT_USE_QT "Disables all Qt specific code." OFF)
option(OGS_BUILD_CLI "Should the OGS simulator be built?" ON) option(OGS_BUILD_CLI "Should the OGS simulator be built?" ON)
option(OGS_BUILD_GUI "Should the Data Explorer be built?" OFF) option(OGS_BUILD_GUI "Should the Data Explorer be built?" OFF)
if(OGS_BUILD_GUI) if(OGS_BUILD_GUI)
...@@ -173,13 +160,8 @@ if(NOT WIN32 AND OGS_BUILD_SWMM) ...@@ -173,13 +160,8 @@ if(NOT WIN32 AND OGS_BUILD_SWMM)
endif() endif()
option(OGS_NO_EXTERNAL_LIBS "Builds OGS without any external dependencies." OFF) option(OGS_NO_EXTERNAL_LIBS "Builds OGS without any external dependencies." OFF)
option(OGS_INSITU "Builds OGS with insitu visualization capabilities." OFF) option(OGS_INSITU "Builds OGS with insitu visualization capabilities." OFF)
# Linear solvers
option(OGS_USE_LIS "Use Lis" OFF) option(OGS_USE_LIS "Use Lis" OFF)
# Parallel computing: vector and matrix algebraic caculation, solvers
option(OGS_USE_PETSC "Use PETSc routines" OFF) option(OGS_USE_PETSC "Use PETSc routines" OFF)
# Eigen # Eigen
...@@ -215,8 +197,8 @@ else() ...@@ -215,8 +197,8 @@ 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
# MKL
option(OGS_USE_MKL "Use Intel MKL" OFF) option(OGS_USE_MKL "Use Intel MKL" OFF)
# Logging # Logging
...@@ -293,7 +275,6 @@ if(OGS_USE_PETSC) ...@@ -293,7 +275,6 @@ if(OGS_USE_PETSC)
add_definitions(-DUSE_PETSC) add_definitions(-DUSE_PETSC)
endif() endif()
# Use MPI
if(OGS_USE_MPI) if(OGS_USE_MPI)
add_definitions(-DUSE_MPI) add_definitions(-DUSE_MPI)
endif() endif()
...@@ -333,7 +314,6 @@ if(OGS_FATAL_ABORT) ...@@ -333,7 +314,6 @@ if(OGS_FATAL_ABORT)
add_definitions(-DOGS_FATAL_ABORT) add_definitions(-DOGS_FATAL_ABORT)
endif() endif()
# Logging level
add_definitions(-DLOGOG_LEVEL=${OGS_LOG_LEVEL}) add_definitions(-DLOGOG_LEVEL=${OGS_LOG_LEVEL})
# Packaging # Packaging
...@@ -349,8 +329,6 @@ if(OGS_INSITU) ...@@ -349,8 +329,6 @@ if(OGS_INSITU)
include("${PARAVIEW_USE_FILE}") include("${PARAVIEW_USE_FILE}")
add_definitions(-DUSE_INSITU) add_definitions(-DUSE_INSITU)
endif() endif()
# Add subdirectories with the projects
add_subdirectory(ThirdParty) add_subdirectory(ThirdParty)
include_directories( include_directories(
SYSTEM SYSTEM
...@@ -383,7 +361,6 @@ endif() ...@@ -383,7 +361,6 @@ endif()
file(WRITE ${PROJECT_BINARY_DIR}/disabled-tests.log "${DISABLED_TESTS_LOG}") file(WRITE ${PROJECT_BINARY_DIR}/disabled-tests.log "${DISABLED_TESTS_LOG}")
unset(DISABLED_TESTS_LOG CACHE) # Don't write to CMakeCache.txt unset(DISABLED_TESTS_LOG CACHE) # Don't write to CMakeCache.txt
# The configuration must be called from the source dir and not BaseLib/.
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/BaseLib/BuildInfo.cpp.in" configure_file("${CMAKE_CURRENT_SOURCE_DIR}/BaseLib/BuildInfo.cpp.in"
"${CMAKE_CURRENT_BINARY_DIR}/BaseLib/BuildInfo.cpp" @ONLY) "${CMAKE_CURRENT_BINARY_DIR}/BaseLib/BuildInfo.cpp" @ONLY)
......
...@@ -3,8 +3,8 @@ set(CMAKE_CXX_STANDARD 17) ...@@ -3,8 +3,8 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
# < VS 15.0; macOS: https://github.com/sakra/cotire/issues/139 # macOS: https://github.com/sakra/cotire/issues/139
if(MSVC_VERSION LESS 1910 OR APPLE OR ${CMAKE_CXX_COMPILER} MATCHES "clcache") if(APPLE OR ${CMAKE_CXX_COMPILER} MATCHES "clcache")
set(OGS_USE_PCH OFF CACHE INTERNAL "") set(OGS_USE_PCH OFF CACHE INTERNAL "")
endif() endif()
if(OGS_USE_PCH) if(OGS_USE_PCH)
......
...@@ -22,7 +22,7 @@ The minimum prerequisites to build OGS are: ...@@ -22,7 +22,7 @@ The minimum prerequisites to build OGS are:
## Step: Install a compiler ## Step: Install a compiler
::: {.win} ::: {.win}
As we use lots of features of the C++11-standard we support **Visual Studio 2015** and up. Therefore you will need at least **Windows 7** (64-bit recommended). It is perfectly fine to use the free Community Edition of Visual Studio. As we use lots of features of the C++17-standard we support **Visual Studio 2017** and up. Therefore you will need at least **Windows 7** (64-bit recommended). It is perfectly fine to use the free Community Edition of Visual Studio.
- Download and install [Visual Studio Community 2017](https://www.visualstudio.com/de/thank-you-downloading-visual-studio/?sku=Community&rel=15) - Download and install [Visual Studio Community 2017](https://www.visualstudio.com/de/thank-you-downloading-visual-studio/?sku=Community&rel=15)
- Select the *workload* `Desktop Development with C++` - Select the *workload* `Desktop Development with C++`
...@@ -31,11 +31,11 @@ As we use lots of features of the C++11-standard we support **Visual Studio 2015 ...@@ -31,11 +31,11 @@ As we use lots of features of the C++11-standard we support **Visual Studio 2015
::: :::
::: {.linux} ::: {.linux}
If you have a recent linux distribution you should also have a recent gcc. Please check that you have at least **gcc 6.2**: If you have a recent linux distribution you should also have a recent gcc. Please check that you have at least **gcc 7.3**:
```bash ```bash
$ gcc --version $ gcc --version
gcc (GCC) 6.2.0 gcc (GCC) 7.3.0
``` ```
::: :::
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment