1
-
2
1
# Copyright (c) Meta Platforms, Inc. and affiliates.
3
2
# All rights reserved.
4
3
#
16
15
#
17
16
# This will define the following variables:
18
17
#
19
- # EXECUTORCH_FOUND -- True if the system has the ExecuTorch library
20
- # EXECUTORCH_INCLUDE_DIRS -- The include directories for ExecuTorch
21
- # EXECUTORCH_LIBRARIES -- Libraries to link against
18
+ # EXECUTORCH_FOUND -- True if the system has the ExecuTorch library
19
+ # EXECUTORCH_INCLUDE_DIRS -- The include directories for ExecuTorch
20
+ # EXECUTORCH_LIBRARIES -- Libraries to link against
22
21
#
23
- # The actual values for these variables will be different from what executorch-config.cmake
24
- # in executorch pip package gives, but we wanted to keep the contract of exposing these
25
- # CMake variables.
22
+ # The actual values for these variables will be different from what
23
+ # executorch-config.cmake in executorch pip package gives, but we wanted to keep
24
+ # the contract of exposing these CMake variables.
26
25
27
26
cmake_minimum_required (VERSION 3.19)
28
27
29
28
set (_root "${CMAKE_CURRENT_LIST_DIR} /../../.." )
30
29
set (required_lib_list executorch executorch_core portable_kernels)
31
30
set (EXECUTORCH_LIBRARIES)
32
- set (EXECUTORCH_INCLUDE_DIRS ${_root} /include ${_root} /include /executorch/runtime/core/portable_type/c10 ${_root} /lib)
31
+ set (EXECUTORCH_INCLUDE_DIRS
32
+ ${_root} /include ${_root} /include /executorch/runtime/core/portable_type/c10
33
+ ${_root} /lib
34
+ )
33
35
foreach (lib ${required_lib_list} )
34
36
set (lib_var "LIB_${lib} " )
35
37
add_library (${lib} STATIC IMPORTED )
@@ -40,7 +42,12 @@ foreach(lib ${required_lib_list})
40
42
)
41
43
set_target_properties (${lib} PROPERTIES IMPORTED_LOCATION "${${lib_var} }" )
42
44
target_compile_definitions (${lib} INTERFACE C10_USING_CUSTOM_GENERATED_MACROS)
43
- target_include_directories (${lib} INTERFACE ${_root} /include ${_root} /include /executorch/runtime/core/portable_type/c10 ${_root} /lib)
45
+ target_include_directories (
46
+ ${lib}
47
+ INTERFACE ${_root} /include
48
+ ${_root} /include /executorch/runtime/core/portable_type/c10
49
+ ${_root} /lib
50
+ )
44
51
list (APPEND EXECUTORCH_LIBRARIES ${lib} )
45
52
endforeach ()
46
53
@@ -112,7 +119,12 @@ foreach(lib ${lib_list})
112
119
add_library (${lib} STATIC IMPORTED )
113
120
endif ()
114
121
set_target_properties (${lib} PROPERTIES IMPORTED_LOCATION "${${lib_var} }" )
115
- target_include_directories (${lib} INTERFACE ${_root} /include ${_root} /include /executorch/runtime/core/portable_type/c10 ${_root} /lib)
122
+ target_include_directories (
123
+ ${lib}
124
+ INTERFACE ${_root} /include
125
+ ${_root} /include /executorch/runtime/core/portable_type/c10
126
+ ${_root} /lib
127
+ )
116
128
list (APPEND EXECUTORCH_LIBRARIES ${lib} )
117
129
endif ()
118
130
endforeach ()
0 commit comments