chore: Add examples to CMake as opt-in targets

This commit is contained in:
apio 2023-01-19 22:30:23 +01:00
parent 9a7629459e
commit 240a4f2f1a
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 8 additions and 1 deletions

View File

@ -30,3 +30,5 @@ endif()
install(TARGETS minitar DESTINATION lib) install(TARGETS minitar DESTINATION lib)
install(FILES minitar.h DESTINATION include) install(FILES minitar.h DESTINATION include)
add_subdirectory(examples)

5
examples/CMakeLists.txt Normal file
View File

@ -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)