Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
DLR-AMR
GitHub Repository: DLR-AMR/t8code
Path: blob/main/mesh_handle/CMakeLists.txt
902 views
1
# This file is part of t8code.
2
# t8code is a C library to manage a collection (a forest) of multiple
3
# connected adaptive space-trees of general element types in parallel.
4
#
5
# Copyright (C) 2025 the developers
6
#
7
# t8code is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 2 of the License, or
10
# (at your option) any later version.
11
#
12
# t8code is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with t8code; if not, write to the Free Software Foundation, Inc.,
19
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
21
# Define own library for mesh handle.
22
if ( T8CODE_BUILD_AS_SHARED_LIBRARY )
23
add_library( T8_MESH_HANDLE SHARED )
24
set_target_properties( T8_MESH_HANDLE PROPERTIES POSITION_INDEPENDENT_CODE ON )
25
else()
26
add_library( T8_MESH_HANDLE STATIC )
27
endif()
28
29
add_library( T8CODE::T8_MESH_HANDLE ALIAS T8_MESH_HANDLE )
30
set_target_properties(T8_MESH_HANDLE PROPERTIES OUTPUT_NAME mesh_handle)
31
32
target_include_directories( T8_MESH_HANDLE PUBLIC
33
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/..>
34
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/mesh_handle>
35
)
36
37
target_sources(T8_MESH_HANDLE PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/mesh.cxx)
38
install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
39
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
40
FILES_MATCHING PATTERN "*.hxx"
41
)
42
43
target_link_libraries(T8_MESH_HANDLE PUBLIC T8)
44
45
install( TARGETS T8_MESH_HANDLE
46
EXPORT ${PROJECT_NAME}-targets
47
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
48
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
49
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
50
)
51
52
if( T8CODE_EXPORT_COMPILE_COMMANDS )
53
set_target_properties( T8_MESH_HANDLE PROPERTIES EXPORT_COMPILE_COMMANDS ON )
54
endif( T8CODE_EXPORT_COMPILE_COMMANDS )
55
56