Commit a32f4c09 authored by GILLES Sebastien's avatar GILLES Sebastien

#1220 CMake: replace the SETTINGS_FILE by a -C call (see...

#1220 CMake: replace the SETTINGS_FILE by a -C call (see https://stackoverflow.com/questions/17588517/how-to-store-cmake-build-settings).
parent 62827ea5
......@@ -5,11 +5,11 @@ cmake_minimum_required(VERSION 3.8)
# ===================================================================================================================
# Include a file with default setting. Some of them might be overriden by command line, such as the C or C++ compiler.
# ===================================================================================================================
if(NOT SETTINGS_FILE)
message(FATAL_ERROR "-DSETTINGS_FILE must be present in the command line and point to a file that specify the paths and settings to use in the build. Examples are given in cmake/Settings folder; feel free to copy and adapt them to your needs.")
endif()
include(${SETTINGS_FILE})
# if(NOT SETTINGS_FILE)
# message(FATAL_ERROR "-DSETTINGS_FILE must be present in the command line and point to a file that specify the paths and settings to use in the build. Examples are given in cmake/Settings folder; feel free to copy and adapt them to your needs.")
# endif()
#
# include(${SETTINGS_FILE})
if(MOREFEM_CHECK_UPDATE_GHOSTS_CALL_RELEVANCE)
......@@ -45,16 +45,17 @@ endif()
set(MOREFEM_INSTALL_DIR ${MOREFEM_INSTALL_DIR}/${CMAKE_BUILD_TYPE})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/cmake)
# Set C and CXX compilers from the values read in the setting file. Might be overridden in command line.
if (NOT DEFINED CMAKE_C_COMPILER)
set(CMAKE_C_COMPILER ${MPI_CC})
endif()
if (NOT DEFINED CMAKE_CXX_COMPILER)
set(CMAKE_CXX_COMPILER ${MPI_CXX})
endif()
# Set C and CXX compilers from the values read in the setting file. Might be overridden in command line.
# if (NOT DEFINED CMAKE_C_COMPILER)
# set(CMAKE_C_COMPILER ${MPI_CC})
# endif()
#
# if (NOT DEFINED CMAKE_CXX_COMPILER)
# set(CMAKE_CXX_COMPILER ${MPI_CXX})
# endif()
#
# ===================================================================================================================
# Set project.
......
......@@ -139,9 +139,6 @@ function(extract_header_files _target _list _include_dir)
if(h OR hpp OR hxx)
string(REPLACE ${_include_dir} "\${MOREFEM_INSTALL_DIR_INCL}" shorter_path ${source})
message("NCL " ${_include_dir})
message("SOURCE " ${source} " => " ${shorter_path})
list(APPEND ret ${shorter_path})
endif()
......
set(MOREFEM_INSTALL_DIR /Volumes/Data/sebastien/MoReFEM/CMake/shared CACHE PATH "Installation directory for executables and libraries. This will be completed with a subdirectory giving away the compilation mode (Debug, Release, etc...)")
set(CMAKE_C_COMPILER /Users/Shared/LibraryVersions/llvm-clang/Openmpi/bin/mpicc CACHE FILEPATH "C compiler. Prefer to use an openmpi wrapper.")
set(CMAKE_CXX_COMPILER /Users/Shared/LibraryVersions/clang/Openmpi/bin/mpic++ CACHE FILEPATH "C++ compiler. Prefer to use an openmpi wrapper.")
set(LIBRARY_TYPE SHARED CACHE BOOL "Choose either STATIC or SHARED.")
set(BUILD_MOREFEM_UNIQUE_LIBRARY True CACHE BOOL "Whether a unique library is built for MoReFEM core libraries or on the contrary if it is splitted in modules.")
set(MOREFEM_CHECK_UPDATE_GHOSTS_CALL_RELEVANCE False CACHE BOOL "If true, add a (costly) method that gives an hint whether an UpdateGhost() call was relevant or not.")
set(MOREFEM_EXTENDED_TIME_KEEP False CACHE BOOL "If true, TimeKeep gains the ability to track times between each call of PrintTimeElapsed(). If not, PrintTimeElapsed() is flatly ignored. False is the best choice in production!")
set(MOREFEM_CHECK_NAN_AND_INF False CACHE BOOL "If true, there are additional checks that no nan and inf appears in the code. Even if False, solver always check for the validity of its solution (if a nan or an inf is present the SolveLinear() or SolveNonLinear() operation throws with a dedicated Petsc error). Advised in debug mode and up to you in release mode.")
set(OPEN_MPI_INCL_DIR /Users/Shared/LibraryVersions/clang/Openmpi/include CACHE PATH "Include directory of Openmpi library.")
set(OPEN_MPI_LIB_DIR /Users/Shared/LibraryVersions/clang/Openmpi/lib CACHE PATH "Lib directory of Openmpi library." )
set(BLAS_CUSTOM_LINKER True CACHE BOOL "If BLAS_CUSTOM_LINKER is true, BLAS_LIB field must give the command use to link with Blas. For instance on macOS it is usually \"-framework Accelerate\" (Beware: Without the quotes CMake will mute this into -framework -Accelerate). If False, FindLibrary is used to find the Blas library to be used, as for the other libraries in this file. The difference is that the name of the .a, .so or .dylib is not known, so it must be given in BLAS_LIB_NAME field. For instance openblas to find libopenblas.a in BLAS_LIB_DIR.")
set(BLAS_LIB_DIR None CACHE STRING "None or path to the lib directory of Blas (see BLAS_CUSTOM_LINKER).")
set(BLAS_LIB "-framework Accelerate" CACHE STRING "Name of the Blas lib (e.g. openblas) or command to pass if custom linker is used; see BLAS_CUSTOM_LINKER." )
set(PETSC_GENERAL_INCL_DIR /Users/Shared/LibraryVersions/clang/Petsc/include CACHE PATH "Include directory of Petsc library common to any build.")
set(PETSC_DEBUG_INCL_DIR /Users/Shared/LibraryVersions/clang/Petsc/debug/include CACHE PATH "Include directory of Petsc library specific to debug configuration.")
set(PETSC_RELEASE_INCL_DIR /Users/Shared/LibraryVersions/clang/Petsc/release/include CACHE PATH "Include directory of Petsc library specific to release configuration.")
set(PETSC_DEBUG_LIB_DIR /Users/Shared/LibraryVersions/clang/Petsc/debug/lib CACHE PATH "Library directory of Petsc in debug mode.")
set(PETSC_RELEASE_LIB_DIR /Users/Shared/LibraryVersions/clang/Petsc/release/lib CACHE PATH "Library directory of Petsc in release mode.")
set(PARMETIS_INCL_DIR /Users/Shared/LibraryVersions/clang/Parmetis/include CACHE PATH "Include directory of Parmetis library.")
set(PARMETIS_LIB_DIR /Users/Shared/LibraryVersions/clang/Parmetis/lib CACHE PATH "Lib directory of Parmetis library.")
# Lua library.
set(LUA_INCL_DIR /Users/Shared/LibraryVersions/clang/Lua/include CACHE PATH "Include directory of Lua library.")
set(LUA_LIB_DIR /Users/Shared/LibraryVersions/clang/Lua/lib CACHE PATH "Lib directory of Lua library.")
set(BOOST_INCL_DIR /Users/Shared/LibraryVersions/clang/Boost/include CACHE PATH "Include directory of Boost library.")
set(BOOST_LIB_DIR /Users/Shared/LibraryVersions/clang/Boost/lib CACHE PATH "Lib directory of Boost library.")
set(PHILLIPS_DIR False CACHE BOOL "If you want to couple Morefem with Phillips library. False in most of the cases! Beware: it is not put in MOREFEM_COMMON_DEP; if you need it you must add it in your add_executable command.")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment