Skip to content

Commit 2644f9b

Browse files
committed
cmake: vcpkg search path
1 parent abbb667 commit 2644f9b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

build/cmake/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ project(utki)
44

55
# !!! find_package must go after project() declaration !!!
66
# Otherwise VCPKG does not set the CMAKE_PREFIX_PATH to find packages.
7-
find_package(myci CONFIG REQUIRED)
7+
find_package(myci
8+
CONFIG
9+
REQUIRED
10+
# For host VCPKG dependencies like myci, we need to explicitly tell where to find them,
11+
# because VCPKG adds only target triplet installed directory to the CMAKE_PREFIX_PATH.
12+
# If host==target the VCPKG_HOST_TRIPLET is not set, which is fine, because target dir is searched anyway.
13+
PATHS
14+
${CMAKE_BINARY_DIR}/vcpkg_installed/${VCPKG_HOST_TRIPLET}/share/myci
15+
)
816

917
set(srcs)
1018
myci_add_source_files(srcs

0 commit comments

Comments
 (0)