Commit 782afe31 authored by Ilya Churaev's avatar Ilya Churaev Committed by Scott Cyphers

Added auto generated configs for nGraph (#3790)

* Added auto generated configs for nGraph

* Fixed absolute paths

* Fixed comments
parent 388f449b
......@@ -629,8 +629,30 @@ if (NGRAPH_PYTHON_BUILD_ENABLE)
add_subdirectory(python)
endif()
include(CMakePackageConfigHelpers)
export(TARGETS ngraph NAMESPACE ngraph:: FILE "${CMAKE_CURRENT_BINARY_DIR}/ngraphTargets.cmake")
install(EXPORT ngraphTargets
FILE ngraphTargets.cmake
NAMESPACE ngraph::
DESTINATION cmake)
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/share/ngraphConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/ngraphConfig.cmake
INSTALL_DESTINATION cmake)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/ngraphConfigVersion.cmake
VERSION ${NGRAPH_VERSION}
COMPATIBILITY SameMajorVersion)
install(DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/licenses
DESTINATION "${CMAKE_INSTALL_PREFIX}"
)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ngraphConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/ngraphConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX}/cmake )
# ******************************************************************************
# Copyright 2017-2019 Intel Corporation
#
# 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
#
# 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.
# ******************************************************************************
#
#
# FindNGraph
# ------
#
# This will define the following variables:
#
# ngraph_FOUND - True if the system has the nGraph library
# NGRAPH_LIBRARIES - nGraph libraries
# ngraph::ngraph - nGraph core target
#
#
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(Threads)
if(NOT TARGET ngraph)
include("${CMAKE_CURRENT_LIST_DIR}/ngraphTargets.cmake")
endif()
set(NGRAPH_LIBRARIES ngraph::ngraph)
check_required_components(ngraph)
......@@ -644,7 +644,11 @@ elseif(APPLE)
endif()
# Defines macro in C++ to load backend plugin
target_include_directories(ngraph PUBLIC "${NGRAPH_INCLUDE_PATH}")
target_include_directories(ngraph PUBLIC $<BUILD_INTERFACE:${NGRAPH_INCLUDE_PATH}> $<INSTALL_INTERFACE:include>)
#Add an alias so that library can be used inside the build tree, e.g. when testing
add_library(ngraph::ngraph ALIAS ngraph)
if (NOT WIN32)
find_package(Threads REQUIRED)
target_link_libraries(ngraph PUBLIC dl Threads::Threads)
......@@ -669,8 +673,7 @@ endif()
#-----------------------------------------------------------------------------------------------
# nGraph
install(FILES ${CMAKE_BINARY_DIR}/VERSION DESTINATION ${CMAKE_INSTALL_PREFIX})
install(TARGETS ngraph DESTINATION ${NGRAPH_INSTALL_LIB}) # libngraph.so
install(TARGETS ngraph DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT ngraphTargets) # libngraph.so
install(DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/
DESTINATION "${NGRAPH_INSTALL_INCLUDE}/ngraph"
......@@ -678,7 +681,7 @@ install(DIRECTORY
PATTERN "*.hpp"
PATTERN "*.h"
)
install(FILES ${CMAKE_BINARY_DIR}/src/ngraph/version.hpp
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.hpp
DESTINATION "${NGRAPH_INSTALL_INCLUDE}/ngraph")
set(CPACK_GENERATOR "DEB")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment