From d4491fc474719753188904646da97ac2750b84a0 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Thu, 7 Nov 2024 10:07:37 +0100 Subject: [PATCH] More robust no vcpkg option (#33) --- CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3511ea6..9aba510 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.17) -set(MV_EXAMPLES_USE_VCPKG OFF) if(DEFINED CMAKE_TOOLCHAIN_FILE AND CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg") set(MV_EXAMPLES_USE_VCPKG ON) set(VCPKG_LIBRARY_LINKAGE "dynamic" CACHE STRING "Link vcpkg libraries dynamically") @@ -12,9 +11,15 @@ endif() set(PROJECT "ExamplePlugins") PROJECT(${PROJECT}) -# vcpkg is used together with conan on ci -if(DEFINED VCPKG_TARGET_TRIPLET) - set(MV_EXAMPLES_USE_VCPKG ON) +if(DEFINED MV_EXAMPLES_USE_VCPKG AND NOT MV_EXAMPLES_USE_VCPKG) + # vcpkg is used together with conan on ci + if(DEFINED VCPKG_TARGET_TRIPLET) + set(MV_EXAMPLES_USE_VCPKG ON) + else() + set(MV_EXAMPLES_USE_VCPKG OFF) + endif() +else() + set(MV_EXAMPLES_USE_VCPKG OFF) endif() add_subdirectory(ExampleView)