mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-30 20:59:12 +08:00
89 lines
3.1 KiB
CMake
89 lines
3.1 KiB
CMake
|
if(TARGET tensorflow_cc::tensorflow_cc OR TARGET tensorflow_cc::tensorflow_framework)
|
||
|
if(NOT (TARGET tensorflow_cc::tensorflow_cc AND TARGET tensorflow_cc::tensorflow_framework))
|
||
|
message(FATAL_ERROR "Some (but not all) targets in this config.cmake were already defined.")
|
||
|
endif()
|
||
|
|
||
|
return()
|
||
|
endif()
|
||
|
|
||
|
add_library(tensorflow_cc::tensorflow_cc SHARED IMPORTED GLOBAL)
|
||
|
add_library(tensorflow_cc::tensorflow_framework SHARED IMPORTED GLOBAL)
|
||
|
|
||
|
# Compute the installation prefix from this tensorflow-cc-config.cmake file location.
|
||
|
# CMAKE_CURRENT_LIST_DIR = [vcpkg_installed_dir]/[target_triplet]/share/tensorflow-cc
|
||
|
get_filename_component(TENSORFLOW_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY)
|
||
|
# TENSORFLOW_INSTALL_PREFIX = [vcpkg_installed_dir]/[target_triplet]/share
|
||
|
get_filename_component(TENSORFLOW_INSTALL_PREFIX "${TENSORFLOW_INSTALL_PREFIX}" DIRECTORY)
|
||
|
# TENSORFLOW_INSTALL_PREFIX = [vcpkg_installed_dir]/[target_triplet]
|
||
|
|
||
|
target_include_directories(tensorflow_cc::tensorflow_cc
|
||
|
INTERFACE
|
||
|
"${TENSORFLOW_INSTALL_PREFIX}/include"
|
||
|
"${TENSORFLOW_INSTALL_PREFIX}/include/tensorflow-external"
|
||
|
"${TENSORFLOW_INSTALL_PREFIX}/include/tensorflow-external/src"
|
||
|
)
|
||
|
target_include_directories(tensorflow_cc::tensorflow_framework
|
||
|
INTERFACE
|
||
|
"${TENSORFLOW_INSTALL_PREFIX}/include/tensorflow-external"
|
||
|
"${TENSORFLOW_INSTALL_PREFIX}/include/tensorflow-external/src"
|
||
|
)
|
||
|
|
||
|
if(@TENSORFLOW_HAS_RELEASE@)
|
||
|
set_property(TARGET tensorflow_cc::tensorflow_cc
|
||
|
PROPERTY IMPORTED_LOCATION
|
||
|
"${TENSORFLOW_INSTALL_PREFIX}/lib/@TF_LIB_NAME@"
|
||
|
)
|
||
|
set_property(TARGET tensorflow_cc::tensorflow_framework
|
||
|
PROPERTY IMPORTED_LOCATION
|
||
|
"${TENSORFLOW_INSTALL_PREFIX}/lib/@TF_FRAMEWORK_NAME@"
|
||
|
)
|
||
|
|
||
|
set_property(TARGET tensorflow_cc::tensorflow_cc
|
||
|
APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE
|
||
|
)
|
||
|
set_property(TARGET tensorflow_cc::tensorflow_framework
|
||
|
APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE
|
||
|
)
|
||
|
|
||
|
set_property(TARGET tensorflow_cc::tensorflow_cc
|
||
|
PROPERTY IMPORTED_LOCATION_RELEASE
|
||
|
"${TENSORFLOW_INSTALL_PREFIX}/lib/@TF_LIB_NAME@"
|
||
|
)
|
||
|
set_property(TARGET tensorflow_cc::tensorflow_framework
|
||
|
PROPERTY IMPORTED_LOCATION_RELEASE
|
||
|
"${TENSORFLOW_INSTALL_PREFIX}/lib/@TF_FRAMEWORK_NAME@"
|
||
|
)
|
||
|
endif()
|
||
|
|
||
|
if(@TENSORFLOW_HAS_DEBUG)
|
||
|
if(NOT @TENSORFLOW_HAS_RELEASE)
|
||
|
set_property(TARGET tensorflow_cc::tensorflow_cc
|
||
|
PROPERTY IMPORTED_LOCATION
|
||
|
"${TENSORFLOW_INSTALL_PREFIX}/debug/lib/@TF_LIB_NAME@"
|
||
|
)
|
||
|
set_property(TARGET tensorflow_cc::tensorflow_framework
|
||
|
PROPERTY IMPORTED_LOCATION
|
||
|
"${TENSORFLOW_INSTALL_PREFIX}/debug/lib/@TF_FRAMEWORK_NAME@"
|
||
|
)
|
||
|
endif()
|
||
|
|
||
|
set_property(TARGET tensorflow_cc::tensorflow_cc
|
||
|
APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG
|
||
|
)
|
||
|
set_property(TARGET tensorflow_cc::tensorflow_framework
|
||
|
APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG
|
||
|
)
|
||
|
|
||
|
set_property(TARGET tensorflow_cc::tensorflow_cc
|
||
|
PROPERTY IMPORTED_LOCATION_DEBUG
|
||
|
"${TENSORFLOW_INSTALL_PREFIX}/debug/lib/@TF_LIB_NAME@"
|
||
|
)
|
||
|
set_property(TARGET tensorflow_cc::tensorflow_framework
|
||
|
PROPERTY IMPORTED_LOCATION_DEBUG
|
||
|
"${TENSORFLOW_INSTALL_PREFIX}/debug/lib/@TF_FRAMEWORK_NAME@"
|
||
|
)
|
||
|
endif()
|
||
|
|
||
|
set(tensorflow_cc_FOUND TRUE)
|
||
|
set(tensorflow_framework_FOUND TRUE)
|