-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy patharbor-config.cmake.in
65 lines (51 loc) · 2.16 KB
/
arbor-config.cmake.in
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
include(CMakeFindDependencyMacro)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}")
# Work around the possibility of being installed in a pip-venv...
get_filename_component(prefix ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${prefix}")
foreach(dep @arbor_export_dependencies@)
find_dependency(${dep})
endforeach()
# TODO Explicitely needed... until I find a way out.
find_dependency(units)
include("${CMAKE_CURRENT_LIST_DIR}/arbor-targets.cmake")
set(_supported_components @arbor_supported_components@)
foreach(component ${arbor_FIND_COMPONENTS})
if(NOT "${component}" IN_LIST _supported_components)
set(arbor_FOUND FALSE)
set(arbor_NOT_FOUND_MESSAGE "Unsupported component: ${component}")
endif()
endforeach()
# Patch properties to remove unnecessary external CUDA dependencies.
set(_override_lang @arbor_override_import_lang@)
if(_override_lang)
foreach(target arbor::arbor arbor::arborenv arbor::arborio)
if(TARGET ${target})
set_target_properties(${target} PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_@arbor_build_config@ "${_override_lang}")
endif()
endforeach()
endif()
# Explicitly add extra link libraries not covered by dependencies above.
# (See though arbor-sim/arbor issue #678).
function(_append_property target property)
if (TARGET ${target})
set(p_append ${ARGN})
get_target_property(p ${target} ${property})
if(p)
list(APPEND p ${p_append})
else()
set(interface_libs ${p_append})
endif()
set_target_properties(${target} PROPERTIES ${property} "${p}")
endif()
endfunction()
set(ARB_VECTORIZE @ARB_VECTORIZE@)
set(ARB_WITH_GPU @ARB_WITH_GPU@)
set(ARB_ARCH @ARB_ARCH@)
set(ARB_MODCC_FLAGS @ARB_MODCC_FLAGS@)
set(ARB_CXX @CMAKE_CXX_COMPILER@)
set(ARB_CXX_FLAGS @CMAKE_CXX_FLAGS@)
set(ARB_CXX_FLAGS_TARGET @ARB_CXX_FLAGS_TARGET_FULL@)
_append_property(arbor::arbor INTERFACE_LINK_LIBRARIES @arbor_add_import_libs@)
_append_property(arbor::arborenv INTERFACE_LINK_LIBRARIES @arborenv_add_import_libs@)
_append_property(arbor::arborio INTERFACE_LINK_LIBRARIES @arborio_add_import_libs@)