CMakeLists.txt 1.88 KB
Newer Older
1
# ******************************************************************************
2
# Copyright 2017-2019 Intel Corporation
3
#
4 5 6
# Licensed 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
7
#
8
#     http://www.apache.org/licenses/LICENSE-2.0
9
#
10 11 12 13 14
# 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.
15
# ******************************************************************************
16

17 18 19 20 21 22 23
set (SRC
    main.cpp
    util.cpp
    uncomment.cpp
    header_rewrite.cpp
)

24 25
set(LLVM_LIB_DIR ${LLVM_INCLUDE_DIR}/../lib/clang/5.0.2/include)
get_filename_component(LLVM_LIB_DIR ${LLVM_LIB_DIR} ABSOLUTE)
26

27 28 29 30 31 32 33 34
list(APPEND HEADER_SEARCH_DEFINES CLANG_BUILTIN_HEADERS_PATH="${LLVM_LIB_DIR}")
list(APPEND HEADER_SEARCH_DEFINES NGRAPH_HEADERS_PATH="${NGRAPH_INCLUDE_PATH}")

if(NGRAPH_CPU_ENABLE)
    get_target_property(MKLDNN_INCLUDE_DIR libmkldnn INTERFACE_INCLUDE_DIRECTORIES)
    get_target_property(EIGEN_INCLUDE_DIR libeigen INTERFACE_INCLUDE_DIRECTORIES)
    list(APPEND HEADER_SEARCH_DEFINES EIGEN_HEADERS_PATH="${EIGEN_INCLUDE_DIR}")
    list(APPEND HEADER_SEARCH_DEFINES MKLDNN_HEADERS_PATH="${MKLDNN_INCLUDE_DIR}")
35 36
endif()

37 38
if(NGRAPH_TBB_ENABLE)
    list(APPEND HEADER_SEARCH_DEFINES TBB_HEADERS_PATH="${TBB_ROOT}/include")
39
endif()
40 41

add_executable(resource_generator EXCLUDE_FROM_ALL ${SRC})
42 43 44 45 46

if (NOT NGRAPH_DEX_ONLY)
    add_dependencies(resource_generator ext_llvm)
endif()

47 48 49
if(NGRAPH_CPU_ENABLE)
    add_dependencies(resource_generator ext_eigen ext_mkldnn)
endif()
50 51 52

set_source_files_properties(main.cpp PROPERTIES COMPILE_DEFINITIONS "${HEADER_SEARCH_DEFINES}")