-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGooseFEMConfig.cmake
83 lines (68 loc) · 2.21 KB
/
GooseFEMConfig.cmake
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
# GooseFEM cmake module
#
# This module sets the target:
#
# GooseFEM
#
# In addition, it sets the following variables:
#
# GooseFEM_FOUND - true if GooseFEM found
# GooseFEM_VERSION - GooseFEM's version
# GooseFEM_INCLUDE_DIRS - the directory containing GooseFEM headers
#
# The following support targets are defined to simplify things:
#
# GooseFEM::compiler_warnings - enable compiler warnings
# GooseFEM::assert - enable GooseFEM assertions
# GooseFEM::debug - enable all assertions (slow)
include(CMakeFindDependencyMacro)
# Define target "GooseFEM"
if(NOT TARGET GooseFEM)
include("${CMAKE_CURRENT_LIST_DIR}/GooseFEMTargets.cmake")
get_target_property(GooseFEM_INCLUDE_DIRS GooseFEM INTERFACE_INCLUDE_DIRECTORIES)
endif()
# Find dependencies
find_dependency(xtensor)
find_package(Eigen3)
if (TARGET Eigen3::Eigen)
target_link_libraries(GooseFEM INTERFACE Eigen3::Eigen)
endif()
# Define support target "GooseFEM::compiler_warnings"
if(NOT TARGET GooseFEM::compiler_warnings)
add_library(GooseFEM::compiler_warnings INTERFACE IMPORTED)
if(MSVC)
set_property(
TARGET GooseFEM::compiler_warnings
PROPERTY INTERFACE_COMPILE_OPTIONS
/W4)
else()
set_property(
TARGET GooseFEM::compiler_warnings
PROPERTY INTERFACE_COMPILE_OPTIONS
-Wall -Wextra -pedantic -Wno-unknown-pragmas)
endif()
endif()
# Define support target "GooseFEM::warnings"
if(NOT TARGET GooseFEM::warnings)
add_library(GooseFEM::warnings INTERFACE IMPORTED)
set_property(
TARGET GooseFEM::warnings
PROPERTY INTERFACE_COMPILE_DEFINITIONS
GOOSEFEM_ENABLE_WARNING_PYTHON)
endif()
# Define support target "GooseFEM::assert"
if(NOT TARGET GooseFEM::assert)
add_library(GooseFEM::assert INTERFACE IMPORTED)
set_property(
TARGET GooseFEM::assert
PROPERTY INTERFACE_COMPILE_DEFINITIONS
GOOSEFEM_ENABLE_ASSERT)
endif()
# Define support target "GooseFEM::debug"
if(NOT TARGET GooseFEM::debug)
add_library(GooseFEM::debug INTERFACE IMPORTED)
set_property(
TARGET GooseFEM::debug
PROPERTY INTERFACE_COMPILE_DEFINITIONS
XTENSOR_ENABLE_ASSERT GOOSEFEM_ENABLE_ASSERT)
endif()