From 240a4f2f1a796bbdc8bbe6da50278affa5ff1f07 Mon Sep 17 00:00:00 2001 From: apio Date: Thu, 19 Jan 2023 22:30:23 +0100 Subject: [PATCH] chore: Add examples to CMake as opt-in targets --- CMakeLists.txt | 4 +++- examples/CMakeLists.txt | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 examples/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index a96a07f..7f28664 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,4 +29,6 @@ else() endif() install(TARGETS minitar DESTINATION lib) -install(FILES minitar.h DESTINATION include) \ No newline at end of file +install(FILES minitar.h DESTINATION include) + +add_subdirectory(examples) \ No newline at end of file diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..a7c9476 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,5 @@ +add_executable(list EXCLUDE_FROM_ALL list.c) +target_link_libraries(list PRIVATE minitar) + +add_executable(untar EXCLUDE_FROM_ALL untar.c) +target_link_libraries(untar PRIVATE minitar) \ No newline at end of file