-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
89 lines (73 loc) · 3.13 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
# ***************************************************************************
# This file is part of the Colored Abstract Simplicial Complex library.
# Copyright (C) 2016-2021
# by Christopher T. Lee, John Moody, Rommie Amaro, J. Andrew McCammon,
# and Michael Holst
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
# ***************************************************************************
cmake_minimum_required(VERSION 3.10)
# Disable in source builds
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
# Add path to custom modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake-modules")
#####################################################################
# Project GAMer
#####################################################################
project(CASC VERSION 1.0.5
DESCRIPTION "Simplicial complex data structure for arbitrary dimensions with stored data"
HOMEPAGE_URL "https://ctlee.github.io/casc/"
LANGUAGES CXX)
# Require c++14 and standard libraries
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Check if casc is being used directly or via add_subdirectory
set(CASC_MASTER_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(CASC_MASTER_PROJECT ON)
endif()
#####################################################################
# Options
#####################################################################
option(CASC_INSTALL "Install casc header files?" ${CASC_MASTER_PROJECT})
option(BUILD_CASCTESTS "Build the test scripts?" ${CASC_MASTER_PROJECT})
# option(BUILD_CASCEXAMPLES "Build the CASC surface mesh example?" ${CASC_MASTER_PROJECT})
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
set(CASC_VERSION ${CASC_VERSION_MAJOR}.${CASC_VERSION_MINOR}.${CASC_VERSION_PATCH})
message(STATUS "casc v${CASC_VERSION}")
# Cache variables
set(CASC_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/include" CACHE INTERNAL "")
include(GNUInstallDirs)
add_library(casc INTERFACE)
target_include_directories(casc INTERFACE
$<BUILD_INTERFACE:${CASC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
if(CASC_INSTALL)
install(DIRECTORY ${CASC_INCLUDE_DIR}/casc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
# TODO (0): Also setup cmake support files cascConfig.cmake etc.
endif()
if(BUILD_CASCTESTS)
enable_testing()
add_subdirectory(tests)
endif(BUILD_CASCTESTS)
# if(BUILD_CASCEXAMPLES)
# add_subdirectory(examples)
# endif(BUILD_CASCEXAMPLES)
add_subdirectory(docs)