forked from flashlight/flashlight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflashlightConfig.cmake.in
119 lines (112 loc) · 3.26 KB
/
flashlightConfig.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
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
# flashlight
#
# IMPORTED targets
# ^^^^^^^^^^^^^^^^
#
# Configuration file for flashlight. Provides the following
# `IMPORTED` targets:
#
# ``flashlight::flashlight``
# The complete flashlight library.
#
# The above targets can be linked with your build using ``target_link_library``.
# Example:
#
# add_executable(myexecutable mySource.cpp)
# target_link_library(myexecutable PRIVATE flashlight::flashlight)
#
# The above properly links flashlight with myexecutable. No call to
# ``target_include_directories`` is required.
#
# Dependencies
# If not building standalone, don't try to find upstream deps,
# as many of these find modules won't exist
if (@FL_BUILD_STANDALONE@)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
include(CMakeFindDependencyMacro)
if (@FL_BUILD_LIBRARIES@)
# Lib dependencies
find_dependency(OpenMP)
find_dependency(kenlm)
find_dependency(Threads)
find_dependency(FFTW3)
if (@FL_LIBRARIES_USE_MKL@)
find_dependency(MKL)
else()
find_dependency(CBLAS)
endif()
endif()
# Core dependencies
if (@FL_BUILD_CORE@)
find_dependency(ArrayFire 3.7.1)
endif()
if (@FL_BUILD_DISTRIBUTED@)
find_dependency(MPI)
endif()
# Backend-specific dependencies
if (@FL_USE_CPU@)
find_dependency(DNNL)
if (@FL_BUILD_DISTRIBUTED@)
find_dependency(Gloo)
endif()
endif()
if (@FL_USE_CUDA@)
find_dependency(CUDNN 7.1)
if (@FL_BUILD_DISTRIBUTED@)
find_dependency(NCCL)
endif()
endif()
# App dependencies
if (@FL_BUILD_APP_ASR@ OR
@FL_BUILD_APP_IMGCLASS@ OR
@FL_BUILD_APP_OBJDET@ OR
@FL_BUILD_APP_LM@)
find_dependency(gflags)
find_dependency(GLOG)
endif()
# Additional app-specific dependencies
if (@FL_BUILD_APP_ASR@)
find_dependency(SndFile)
endif()
# Remove this dir from module path
list(REMOVE_AT CMAKE_MODULE_PATH -1)
endif() # FL_BUILD_STANDALONE
################################################################################
@PACKAGE_INIT@
# Library will be installed with any [minimum] flashlight installation -
# use it as a proxy to see if requisite targets exist
if(NOT TARGET flashlight::fl-libraries)
if(EXISTS @PACKAGE_CMAKE_DIR@/flashlightTargets.cmake)
include(@PACKAGE_CMAKE_DIR@/flashlightTargets.cmake)
endif()
endif()
# Flashlight backend variables for downstream config use
set(FL_USE_CPU @FL_USE_CPU@)
set(FL_USE_CUDA @FL_USE_CUDA@)
set(FL_USE_OPENCL @FL_USE_OPENCL@)
if (@FL_USE_CUDA@)
enable_language(CUDA)
endif()
# For legacy configurations
# Libraries
set(flashlight_LIBRARIES flashlight::fl-libraries)
if (@FL_BUILD_CORE@)
set(flashlight_LIBRARIES ${flashlight_LIBRARIES} flashlight::flashlight)
endif()
if (@FL_BUILD_APP_ASR@)
set(flashlight_LIBRARIES ${flashlight_LIBRARIES} flashlight::flashlight-app-asr)
endif()
if (@FL_BUILD_APP_IMGCLASS@)
set(flashlight_LIBRARIES ${flashlight_LIBRARIES} flashlight::flashlight-app-imgclass)
endif()
if (@FL_BUILD_APP_LM@)
set(flashlight_LIBRARIES ${flashlight_LIBRARIES} flashlight::flashlight-app-lm)
endif()
if (@FL_BUILD_APP_OBJDDET@)
set(flashlight_LIBRARIES ${flashlight_LIBRARIES} flashlight::flashlight-app-objdet)
endif()
# Include dirs
if (EXISTS @PACKAGE_INCLUDE_DIRS@)
set(flashlight_INCLUDE_DIRS @PACKAGE_INCLUDE_DIRS@)
endif()
set(flashlight_FOUND 1)