forked from OAID/Tengine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
54 lines (40 loc) · 1.98 KB
/
CMakeLists.txt
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
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# License); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Copyright (c) 2021, OPEN AI LAB
# Author: [email protected]
#
# unset for regeneration
UNSET (_OP_HEADER_PATH)
UNSET (_TENGINE_OP_SOURCE)
SET (_OP_ROOT "${CMAKE_SOURCE_DIR}/source/operator")
# generate header file searching path
LIST (APPEND _OP_HEADER_PATH "${CMAKE_SOURCE_DIR}/source/operator/prototype")
# config the operator prototype
AUX_SOURCE_DIRECTORY("${_OP_ROOT}/prototype" _OP_PROTOTYPE_SOURCE)
GENERATE_REGISTER_HEADER_FILE("register_" "unregister_" "_op" "${_OP_ROOT}/prototype.h.in" "${CMAKE_BINARY_DIR}/source/operator/prototype.h" "${_OP_PROTOTYPE_SOURCE}")
# operator level source files
FILE (GLOB _OP_LEVEL_SOURCE "${CMAKE_SOURCE_DIR}/source/operator/*.c")
# gather
LIST (APPEND _TENGINE_OP_SOURCE ${_OP_LEVEL_SOURCE})
LIST (APPEND _TENGINE_OP_SOURCE ${_OP_PROTOTYPE_SOURCE})
# add to src group
TENGINE_SOURCE_GROUP ("operator" ${_OP_LEVEL_SOURCE})
TENGINE_SOURCE_GROUP ("operator/prototype" ${_OP_PROTOTYPE_SOURCE})
# set all to cache
SET (TENGINE_OP_HEADER_PATH ${_OP_HEADER_PATH} CACHE INTERNAL "Tengine operator level header searching path" FORCE)
SET (TENGINE_OPERATOR_SOURCE ${_TENGINE_OP_SOURCE} CACHE INTERNAL "Tengine operator level source files" FORCE)