This repository has been archived by the owner on Jun 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathCMakeLists.txt
97 lines (88 loc) · 4.65 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Copyright (c) 2012-2018, Association Scientifique pour la Geologie et ses
# Applications (ASGA). All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of ASGA nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ASGA BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# http://www.ring-team.org
#
# RING Project
# Ecole Nationale Superieure de Geologie - GeoRessources
# 2 Rue du Doyen Marcel Roubault - TSA 70605
# 54518 VANDOEUVRE-LES-NANCY
# FRANCE
#------------------------------------------------------------------------------------------------
# Root CMakeList of RINGMesh project
#------------------------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.1)
#------------------------------------------------------------------------------------------------
# Options of the RINGMesh project
# They can be set
# 1 - using CMake GUI,
# 2 - in command line: cmake -D<var>:<type>=<value> MyProjectFolder
# Project options
# Optional components of RINGMesh - creation of specific targets
option(RINGMESH_WITH_GRAPHICS "Compile viewer" OFF)
option(RINGMESH_WITH_UTILITIES "Compile utility executables" OFF)
option(RINGMESH_WITH_TUTORIALS "Compile API trainings and tuturials" OFF)
option(RINGMESH_WITH_TESTS "Compile test projects" OFF)
option(RINGMESH_WITH_RESQML2 "RESQML2 support: compile with FesAPI (not avaible for MACOS)" OFF)
# Optional custom steps
option(BUILD_GEOGRAM_WITHOUT_EXE "Compile geogram without tests and executables" ON)
option(USE_SUPERBUILD "Whether or not a superbuild should be invoked" ON)
mark_as_advanced(BUILD_GEOGRAM_WITHOUT_EXE USE_SUPERBUILD)
# Select Available Mesher
# Each selected mesher will increase the RINGMesh functionalities.
# By default RINGMesh is compiled with Tetgen
# Check Tetgen licences to ensure you have the right to use it freely
option(RINGMESH_WITH_TETGEN "Use Tetgen tetrahedral mesher" ON)
# If a path is specified RINGMesh will be compiled to work with - empty by default
set(MG_TETRA "" CACHE PATH "Path to MG-Tetra")
if(MG_TETRA)
set(USE_MG_TETRA ON)
message(STATUS "Using MG-Tetra directory = ${MG_TETRA}")
endif(MG_TETRA)
#------------------------------------------------------------------------------------------------
# Ensure consistent choice in configuration options
include(CMakeDependentOption)
# Option to build ringmesh-view. Disable when RINGMESH_WITH_GRAPHICS
# is OFF. The fist time RINGMESH_WITH_GRAPHICS is ON, this
# option is ON.
CMAKE_DEPENDENT_OPTION(BUILD_RINGMESH_VIEW "Build ringmesh-view" ON
"RINGMESH_WITH_GRAPHICS" OFF)
# Check that RINGMesh has been cloned and not downloaded
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git)
message(FATAL_ERROR
"This directory is not a complete git project."
"To configure RINGMesh, first clone it from its repository."
)
endif()
# CMake is called, a main project (super build project) is generated first.
# This main project is responsible to create third party cmake projects including
# the one of RINGMesh. This is done during compilation, i.e., RINGMesh.cmake is
# called (USE_SUPERBUILD = OFF) when the super build project is compiled.
if(USE_SUPERBUILD)
include(cmake/SuperBuild.cmake)
else(USE_SUPERBUILD)
include(cmake/RINGMesh.cmake)
endif(USE_SUPERBUILD)
include(tools/external_tools.cmake)