Skip to content

Commit

Permalink
Add separate option to enable Examples installing
Browse files Browse the repository at this point in the history
  • Loading branch information
tbhaxor committed Aug 16, 2023
1 parent 7f0e288 commit 27d3335
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 20 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ option(BUILD_SHARED_LIBS "Build using shared libraries" OFF)
option(PCAPPP_USE_DPDK "Setup PcapPlusPlus with DPDK. In this case you must also set DPDK_ROOT")
option(PCAPPP_USE_PF_RING "Setup PcapPlusPlus with PF_RING. In this case you must also set PF_RING_ROOT")
option(PCAPPP_INSTALL "Install Pcap++" ${PCAPPP_MAIN_PROJECT})
option(PCAPPP_INSTALL_EXAMPLES "Install Pcap++ examples" OFF)

# Set C++11
set(CMAKE_CXX_STANDARD 11)
Expand Down
2 changes: 1 addition & 1 deletion Examples/ArpSpoofing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif()

set_target_properties(ArpSpoofing PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS ArpSpoofing
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/Arping/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif()

set_target_properties(Arping PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS Arping
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/DNSResolver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif()

set_target_properties(DNSResolver PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS DNSResolver
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/DnsSpoofing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif()

set_target_properties(DnsSpoofing PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS DnsSpoofing
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/DpdkBridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ target_link_libraries(DpdkBridge PUBLIC PcapPlusPlus::Pcap++)

set_target_properties(DpdkBridge PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS DpdkBridge
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/DpdkExample-FilterTraffic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ target_link_libraries(DpdkTrafficFilter PUBLIC PcapPlusPlus::Pcap++)

set_target_properties(DpdkTrafficFilter PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS DpdkTrafficFilter
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/HttpAnalyzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif()

set_target_properties(HttpAnalyzer PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS HttpAnalyzer
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/IPDefragUtil/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif()

set_target_properties(IPDefragUtil PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS IPDefragUtil
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/IPFragUtil/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif()

set_target_properties(IPFragUtil PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS IPFragUtil
EXPORT PcapPlusPlusTargets
Expand Down
4 changes: 2 additions & 2 deletions Examples/IcmpFileTransfer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif()

set_target_properties(IcmpFileTransfer-catcher PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS IcmpFileTransfer-catcher
EXPORT PcapPlusPlusTargets
Expand All @@ -27,7 +27,7 @@ endif()

set_target_properties(IcmpFileTransfer-pitcher PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS IcmpFileTransfer-pitcher
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/KniPong/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ target_link_libraries(KniPong PUBLIC PcapPlusPlus::Pcap++)

set_target_properties(KniPong PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS KniPong
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/PcapPlusPlus-benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ target_link_libraries(benchmark PUBLIC PcapPlusPlus::Pcap++)

set_target_properties(benchmark PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS benchmark
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/PcapPrinter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif()

set_target_properties(PcapPrinter PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS PcapPrinter
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/PcapSearch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif()

set_target_properties(PcapSearch PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS PcapSearch
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/PcapSplitter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif()

set_target_properties(PcapSplitter PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS PcapSplitter
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/PfRingExample-FilterTraffic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ target_link_libraries(PfRingTrafficFilter PUBLIC PcapPlusPlus::Pcap++)

set_target_properties(PfRingTrafficFilter PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS PfRingTrafficFilter
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/SSLAnalyzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif()

set_target_properties(SSLAnalyzer PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS SSLAnalyzer
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/TLSFingerprinting/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif()
set_target_properties(TLSFingerprinting PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}"
RUNTIME_OUTPUT_NAME "TLSFingerprinting")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS TLSFingerprinting
EXPORT PcapPlusPlusTargets
Expand Down
2 changes: 1 addition & 1 deletion Examples/TcpReassembly/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif()

set_target_properties(TcpReassembly PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PCAPPP_BINARY_EXAMPLES_DIR}")

if(PCAPPP_INSTALL)
if(PCAPPP_INSTALL_EXAMPLES)
install(
TARGETS TcpReassembly
EXPORT PcapPlusPlusTargets
Expand Down

0 comments on commit 27d3335

Please sign in to comment.