-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflashlightConfig.cmake.in
More file actions
125 lines (114 loc) · 3.35 KB
/
flashlightConfig.cmake.in
File metadata and controls
125 lines (114 loc) · 3.35 KB
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
# 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.
#
# Configuration variables
# These variables are visible to downstream projects to express
# information about the configuration with which Flashlight was built
set(FL_BUILD_DISTRIBUTED "@FL_BUILD_DISTRIBUTED@")
# Dependencies
# If not building standalone, don't try to find upstream deps;
# many of these CMake modules aren't standard
if (@FL_BUILD_STANDALONE@)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
include(CMakeFindDependencyMacro)
# Core dependencies
find_dependency(Threads)
if (@FL_USE_ARRAYFIRE@)
find_dependency(ArrayFire 3.7.1)
endif()
# remove when gcc >= 9 required
find_dependency(Filesystem COMPONENTS Final Experimental)
if (@FL_BUILD_DISTRIBUTED@)
find_dependency(MPI)
endif()
# Backend-specific dependencies
if (@FL_USE_CPU@)
if (@FL_BUILD_DISTRIBUTED@)
find_dependency(Gloo)
endif()
endif()
if (@FL_USE_CUDA@)
if (@FL_USE_CUDNN@)
find_dependency(CUDNN 7.1)
endif()
if (@FL_BUILD_DISTRIBUTED@)
find_dependency(NCCL)
endif()
endif()
# App dependencies
if (@FL_BUILD_PKG_RUNTIME@)
find_dependency(gflags)
find_dependency(GLOG)
endif()
# Additional app-specific dependencies
if (@FL_BUILD_PKG_SPEECH@)
find_dependency(SndFile)
# Audio feature components
find_dependency(OpenMP)
find_dependency(Threads)
find_dependency(FFTW3)
if (@FL_USE_MKL@)
find_dependency(MKL)
else()
find_dependency(CBLAS)
endif()
endif()
# Remove this dir from module path
list(REMOVE_AT CMAKE_MODULE_PATH -1)
endif() # FL_BUILD_STANDALONE
################################################################################
@PACKAGE_INIT@
if(NOT TARGET flashlight::flashlight)
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@)
if (@FL_USE_CUDA@)
enable_language(CUDA)
endif()
# For legacy configurations
# Libraries
set(flashlight_LIBRARIES "")
# core
set(flashlight_LIBRARIES ${flashlight_LIBRARIES} flashlight::flashlight)
# pkgs
if (@FL_BUILD_PKG_RUNTIME@)
set(flashlight_LIBRARIES ${flashlight_LIBRARIES} flashlight::fl_pkg_runtime)
endif()
if (@FL_BUILD_PKG_VISION@)
set(flashlight_LIBRARIES ${flashlight_LIBRARIES} flashlight::fl_pkg_vision)
endif()
if (@FL_BUILD_PKG_TEXT@)
set(flashlight_LIBRARIES ${flashlight_LIBRARIES} flashlight::fl_pkg_text)
endif()
if (@FL_BUILD_PKG_SPEECH@)
set(flashlight_LIBRARIES ${flashlight_LIBRARIES} flashlight::fl_pkg_speech)
endif()
if (@FL_BUILD_PKG_HALIDE@)
set(flashlight_LIBRARIES ${flashlight_LIBRARIES} flashlight::fl_pkg_halide)
endif()
# Include dirs
if (EXISTS @PACKAGE_INCLUDE_DIRS@)
set(flashlight_INCLUDE_DIRS @PACKAGE_INCLUDE_DIRS@)
endif()
set(flashlight_FOUND 1)