Skip to content

Commit

Permalink
More robust no vcpkg option
Browse files Browse the repository at this point in the history
  • Loading branch information
alxvth committed Oct 31, 2024
1 parent 43dbd32 commit de2b494
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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)
Expand Down

0 comments on commit de2b494

Please sign in to comment.