From 80e8b0a0cbb98b337fd2b1812766ac40ce1e1459 Mon Sep 17 00:00:00 2001 From: Chan Lee Date: Sat, 28 Sep 2024 22:36:19 +0800 Subject: [PATCH] exclude examples and tests from packaging --- CMakeLists.txt | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 06c257cac1..f324c160b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -304,16 +304,19 @@ add_subdirectory(Packet++) add_subdirectory(Pcap++) add_subdirectory(Common++) -if(PCAPPP_BUILD_EXAMPLES) - set(PCAPPP_BINARY_EXAMPLES_DIR ${CMAKE_BINARY_DIR}/examples_bin) - add_subdirectory(Examples) -endif() +# exclude examples and tests from packaging +if(NOT PCAPPP_PACKAGE) + if(PCAPPP_BUILD_EXAMPLES) + set(PCAPPP_BINARY_EXAMPLES_DIR ${CMAKE_BINARY_DIR}/examples_bin) + add_subdirectory(Examples) + endif() -if(PCAPPP_BUILD_TESTS - OR PCAPPP_BUILD_FUZZERS - OR PCAPPP_BUILD_EXAMPLES) - include(CTest) - add_subdirectory(Tests) + if(PCAPPP_BUILD_TESTS + OR PCAPPP_BUILD_FUZZERS + OR PCAPPP_BUILD_EXAMPLES) + include(CTest) + add_subdirectory(Tests) + endif() endif() if(PCAPPP_INSTALL)