aboutsummaryrefslogtreecommitdiff
path: root/ports/tensorflow-cc/tensorflow-cc-config-static.cmake.in
blob: 7f0171470656497db53aa4450010cec69110b8e7 (plain)
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
55
56
if(TARGET tensorflow_cc::tensorflow_cc)
	return()
endif()

add_library(tensorflow_cc::tensorflow_cc STATIC 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-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_cc
		APPEND PROPERTY IMPORTED_CONFIGURATIONS
			RELEASE
	)

	set_property(TARGET tensorflow_cc::tensorflow_cc
		PROPERTY IMPORTED_LOCATION_RELEASE
			"${TENSORFLOW_INSTALL_PREFIX}/lib/@TF_LIB_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@"
		)
	endif()
	
	set_property(TARGET tensorflow_cc::tensorflow_cc
		APPEND PROPERTY IMPORTED_CONFIGURATIONS
			DEBUG
	)

	set_property(TARGET tensorflow_cc::tensorflow_cc
		PROPERTY IMPORTED_LOCATION_DEBUG
			"${TENSORFLOW_INSTALL_PREFIX}/debug/lib/@TF_LIB_NAME@"
	)
endif()

set(tensorflow_cc_FOUND TRUE)