forked from ORNL-CEES/DataTransferKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
128 lines (105 loc) · 5.04 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
##---------------------------------------------------------------------------##
## DataTransferKit/CMakeLists.txt
## Stuart R. Slattery
##---------------------------------------------------------------------------##
## TriBITS package file for the DataTransferKit package
##---------------------------------------------------------------------------##
##---------------------------------------------------------------------------##
## Define the package
##---------------------------------------------------------------------------##
TRIBITS_PACKAGE_DECL(DataTransferKit)
TRIBITS_ADD_DEBUG_OPTION()
TRIBITS_ADD_SHOW_DEPRECATED_WARNINGS_OPTION()
##---------------------------------------------------------------------------##
## Explicit template instantiation
##---------------------------------------------------------------------------##
# Setup the same ETI as Tpetra but do not set global ordinal types as
# additional scalar types.
# check tpetra variables are defined.
ASSERT_DEFINED(TpetraCore_ETI_SCALARS)
ASSERT_DEFINED(TpetraCore_ETI_LORDS)
ASSERT_DEFINED(TpetraCore_ETI_GORDS)
ASSERT_DEFINED(TpetraCore_ETI_NODES)
# set the eti types
SET (${PACKAGE_NAME}_ETI_SCALARS_TEMP ) # start with the empty list
FOREACH (scalarName IN LISTS TpetraCore_ETI_SCALARS)
LIST (FIND TpetraCore_ETI_GORDS ${scalarName} scalarNameIndex)
IF (-1 EQUAL scalarNameIndex) # not in the list of integer types
LIST (APPEND ${PACKAGE_NAME}_ETI_SCALARS_TEMP ${scalarName})
ENDIF ()
ENDFOREACH ()
SET(${PACKAGE_NAME}_ETI_SCALARS ${${PACKAGE_NAME}_ETI_SCALARS_TEMP})
SET(${PACKAGE_NAME}_ETI_LORDS ${TpetraCore_ETI_LORDS})
SET(${PACKAGE_NAME}_ETI_GORDS ${TpetraCore_ETI_GORDS})
SET(${PACKAGE_NAME}_ETI_NODES ${TpetraCore_ETI_NODES})
# make the eti variables globally accessible
GLOBAL_SET(${PACKAGE_NAME}_ETI_SCALARS ${${PACKAGE_NAME}_ETI_SCALARS})
GLOBAL_SET(${PACKAGE_NAME}_ETI_LORDS ${${PACKAGE_NAME}_ETI_LORDS})
GLOBAL_SET(${PACKAGE_NAME}_ETI_GORDS ${${PACKAGE_NAME}_ETI_GORDS})
GLOBAL_SET(${PACKAGE_NAME}_ETI_NODES ${${PACKAGE_NAME}_ETI_NODES})
##---------------------------------------------------------------------------##
## Set the path to the DTKData directory.
##---------------------------------------------------------------------------##
# Search for one of the mesh files in the DTKData directory
find_file(DTK_DATA_MESH_FILE cube_mesh.exo PATHS
${${PACKAGE_NAME}_SOURCE_DIR}/data/exodus
${${PACKAGE_NAME}_SOURCE_DIR}/DTKData/exodus
NO_DEFAULT_PATH
)
if(DTK_DATA_MESH_FILE)
# Get the location of the mesh file
get_filename_component(DTK_DATA_DIR ${DTK_DATA_MESH_FILE} DIRECTORY)
# Strip "/exodus" from the path
string(REGEX REPLACE "/exodus" "" DTK_DATA_DIR ${DTK_DATA_DIR})
message("-- DTKData found at ${DTK_DATA_DIR}")
else()
set(DTK_DATA_DIR DTK_DATA_DIR-NOTFOUND)
message("-- DTKData NOT found")
endif()
##---------------------------------------------------------------------------##
## Print the revision number to stdout
##---------------------------------------------------------------------------##
FIND_PACKAGE(Git)
IF(GIT_FOUND AND EXISTS ${${PACKAGE_NAME}_SOURCE_DIR}/.git)
EXECUTE_PROCESS(
COMMAND ${GIT_EXECUTABLE} log --pretty=format:%H -n 1
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE DataTransferKit_GIT_COMMIT_HASH
)
ELSE()
SET(DataTransferKit_GIT_COMMIT_HASH "Not a git repository")
ENDIF()
MESSAGE("DTK Revision = '${DataTransferKit_GIT_COMMIT_HASH}'")
##---------------------------------------------------------------------------##
## Do standard postprocessing
##---------------------------------------------------------------------------##
TRIBITS_PROCESS_SUBPACKAGES()
TRIBITS_PACKAGE_DEF()
TRIBITS_PACKAGE_POSTPROCESS()
##---------------------------------------------------------------------------##
## Check C++ code style using clang-format
##---------------------------------------------------------------------------##
IF(DataTransferKit_ENABLE_ClangFormat)
INCLUDE(CodeFormat)
ENDIF()
##---------------------------------------------------------------------------##
## Build the documentation published on http://datatransferkit.readthedocs.org
##---------------------------------------------------------------------------##
IF(DataTransferKit_ENABLE_ReadTheDocs)
ADD_SUBDIRECTORY(docs)
ENDIF()
##---------------------------------------------------------------------------##
## Generate the Doxygen documentation
##---------------------------------------------------------------------------##
IF(DataTransferKit_ENABLE_Doxygen)
ADD_SUBDIRECTORY(docs/doxygen)
ENDIF()
##---------------------------------------------------------------------------##
## Generate a .ycm_extra_conf.py file for use with YouCompleteMe
##---------------------------------------------------------------------------##
IF(DataTransferKit_ENABLE_YouCompleteMe)
INCLUDE(CodeCompletion)
ENDIF()
##---------------------------------------------------------------------------##
## end of DataTransferKit/CMakeLists.txt
##---------------------------------------------------------------------------##