-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
73 lines (59 loc) · 2.36 KB
/
CMakeLists.txt
File metadata and controls
73 lines (59 loc) · 2.36 KB
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
#
# This file was copied and modified from https://cmake.org/examples/
#
# CMakeLists files in this project can
# refer to the root source directory of the project as ${T8PROJECT_SOURCE_DIR} and
# to the root binary directory of the project as ${T8PROJECT_BINARY_DIR}.
cmake_minimum_required( VERSION 3.16 )
# rudimentary version handling by setting it manually in this file
set ( T8PROJECT_VERSION_MAJOR 1 )
set ( T8PROJECT_VERSION_MINOR 0 )
set ( T8PROJECT_VERSION_PATCH 0 )
project(
T8PROJECT
DESCRIPTION "A template for project that link against the t8code library."
LANGUAGES C CXX
VERSION "${T8PROJECT_VERSION_MAJOR}.${T8PROJECT_VERSION_MINOR}.${T8PROJECT_VERSION_PATCH}"
)
option( T8PROJECT_ENABLE_VTK "Link against VTK. Must be used if t8code is linked against VTK." OFF )
#
# Enable "make test" to run all the tests
#
include( CTest )
# Set compilers to mpicc and mpicxx
set(CMAKE_C_COMPILER mpicc)
set(CMAKE_CXX_COMPILER mpicxx)
# Searchers for t8code build with CMake
# To add a seach path use
# -DT8CODE_DIR=PATH,
# -DP4EST_DIR=PATH,
# -DSC_DIR=PATH,
find_package ( T8CODE REQUIRED)
#
# Find VTK library.
# If t8code is linked against VTK then t8project should link against it as well.
#
if( T8PROJECT_ENABLE_VTK )
find_package( VTK REQUIRED COMPONENTS
IOXML CommonExecutionModel CommonDataModel
IOGeometry IOXMLParser IOParallelXML IOPLY
ParallelMPI FiltersCore vtksys CommonCore zlib IOLegacy)
if(VTK_FOUND)
message("Found VTK")
endif (VTK_FOUND)
endif( T8PROJECT_ENABLE_VTK )
# Recurse into the "test" subdirectory. This does not actually
# cause another cmake executable to run. The same process will walk through
# the project's entire directory structure.
add_subdirectory (src)
# Add executable called "t8project_helloworld" that is built from the source file
# "t8project_main.cxx". The extensions are automatically found.
add_executable (t8project_helloworld t8project_main.cxx)
# Link the executable to the t8project library. Since the library has
# public include directories we will use those link directories when building
# t8project_demo.
target_link_libraries (t8project_helloworld LINK_PUBLIC t8project T8CODE::T8)
# Recurse into the "test" subdirectory. This does not actually
# cause another cmake executable to run. The same process will walk through
# the project's entire directory structure.
add_subdirectory (test)