-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
77 lines (61 loc) · 2.17 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
#
# see README.md for copyright and license information
#
cmake_minimum_required(VERSION 3.1)
if("${CMAKE_VERSION}" VERSION_GREATER 3.3)
cmake_policy(SET CMP0057 NEW)
endif()
message(STATUS "Using cmake version ${CMAKE_VERSION}")
project(EXACONSTIT LANGUAGES CXX)
if (ENABLE_FORTRAN)
enable_language(Fortran)
endif()
enable_language(C)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
################################
# BLT
################################
if (DEFINED BLT_SOURCE_DIR)
# Support having a shared BLT outside of the repository if given a BLT_SOURCE_DIR
if (NOT EXISTS ${BLT_SOURCE_DIR}/SetupBLT.cmake)
message(FATAL_ERROR "Given BLT_SOURCE_DIR does not contain SetupBLT.cmake")
endif()
else()
# Use internal BLT if no BLT_SOURCE_DIR is given
# We currently don't support this option
set(BLT_SOURCE_DIR "${PROJECT_SOURCE_DIR}/cmake/blt" CACHE PATH "")
if (NOT EXISTS ${BLT_SOURCE_DIR}/SetupBLT.cmake)
message(FATAL_ERROR
"The BLT submodule is not present. "
"Run the following two commands in your git repository: \n"
" git submodule init\n"
" git submodule update\n"
"Or you can point to an outside of source BLT repository by "
"defining the variable BLT_SOURCE_DIR on your command line " )
endif()
endif()
set(ENABLE_GTEST OFF CACHE BOOL "")
set(ENABLE_FRUIT OFF CACHE BOOL "")
if(ENABLE_TESTS)
set(ENABLE_GTEST ON CACHE BOOL "" FORCE)
endif(ENABLE_TESTS)
include(${BLT_SOURCE_DIR}/SetupBLT.cmake)
# set(BUILD_STATIC_LIBS ON CACHE BOOL "Build static libraries")
# set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries")
if(ENABLE_CUDA)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -restrict --extended-lambda --expt-relaxed-constexpr")
endif()
################################
# Include standard build system logic and options
################################
include(cmake/CMakeBasics.cmake)
################################
# Add source subdirectories
################################
add_subdirectory(src/)
if(ENABLE_TESTS)
add_subdirectory(test)
endif(ENABLE_TESTS)
add_subdirectory(scripts/meshing)