From 471fb21d40119f61ad37ef52f6cf23144a6c32ce Mon Sep 17 00:00:00 2001 From: "Dr. Patrick Urbanke" Date: Sun, 24 Nov 2024 13:06:10 +0100 Subject: [PATCH] Wrap in REFLECTCPP_USE_VCPKG --- CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d5ed6769..90195b73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,12 +103,14 @@ if (REFLECTCPP_AVRO) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_avro.cpp ) - target_include_directories(reflectcpp SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") - if (MSVC) - target_link_libraries(reflectcpp PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/avro${CMAKE_STATIC_LIBRARY_SUFFIX}") - else () - target_link_libraries(reflectcpp PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libavro${CMAKE_STATIC_LIBRARY_SUFFIX}") - endif () + if(REFLECTCPP_USE_VCPKG) + target_include_directories(reflectcpp SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") + if (MSVC) + target_link_libraries(reflectcpp PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/avro${CMAKE_STATIC_LIBRARY_SUFFIX}") + else () + target_link_libraries(reflectcpp PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libavro${CMAKE_STATIC_LIBRARY_SUFFIX}") + endif () + endif() endif () if (REFLECTCPP_BSON)