From b8ab0a5a9e160e88a3163da3d8654ce7a0871cea Mon Sep 17 00:00:00 2001 From: Andrew Beltrano Date: Mon, 22 Jul 2024 16:03:01 -0600 Subject: [PATCH] Conditionally include vcpkg port file generation. --- CMakeLists.txt | 1 + packaging/CMakeLists.txt | 4 +++- packaging/vcpkg/ports/netremote/portfile.cmake.in | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d54987c0..ff3cc814 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ include(version) # Configure vcpkg usage within the project. include(vcpkg) +option(NETREMOTE_VCPKG_BUILD_FOR_PORT "Enable building the project via a vcpkg port" OFF) # Add options for vcpkg port file features. option(NETREMOTE_EXCLUDE_PROTOCOL "Disable building the protocol" OFF) diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt index e96f1749..6e80793b 100644 --- a/packaging/CMakeLists.txt +++ b/packaging/CMakeLists.txt @@ -1,5 +1,7 @@ -add_subdirectory(vcpkg) +if (NOT NETREMOTE_VCPKG_BUILD_FOR_PORT) + add_subdirectory(vcpkg) +endif() if (BUILD_FOR_LINUX) add_subdirectory(deb) diff --git a/packaging/vcpkg/ports/netremote/portfile.cmake.in b/packaging/vcpkg/ports/netremote/portfile.cmake.in index 646493ca..1228dc84 100644 --- a/packaging/vcpkg/ports/netremote/portfile.cmake.in +++ b/packaging/vcpkg/ports/netremote/portfile.cmake.in @@ -28,6 +28,7 @@ vcpkg_check_features( vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} OPTIONS + -DNETREMOTE_VCPKG_BUILD_FOR_PORT=ON ${FEATURE_OPTIONS} )