From 5e8ca7a936daf93e10c4946bf7bb6466aeab7d9f Mon Sep 17 00:00:00 2001 From: Yang Kun <91833768+ikspress@users.noreply.github.com> Date: Mon, 2 Sep 2024 22:01:45 +0800 Subject: [PATCH] Add BUILD_EXAMPLES macro --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c921e36..667a412c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,7 @@ message("CMAKE_SHARED_LINKER_FLAGS: " ${CMAKE_SHARED_LINKER_FLAGS}) include_directories(${LIBNFC_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/libutil) set(LIBS ${LIBS} ${LIBNFC_LIBRARIES} ${OPENSSL_LIBRARIES}) +option(BUILD_EXAMPLES "build examples ON/OFF" ON) option(WITH_DEBUG "Extra debug information is outputted when this is turned on" OFF) if(DEFINED CMAKE_INSTALL_LIBDIR) @@ -71,4 +72,7 @@ if(NOT DEFINED SHARE_INSTALL_PREFIX) endif(NOT DEFINED SHARE_INSTALL_PREFIX) add_subdirectory(libfreefare) -add_subdirectory(examples) + +if(BUILD_EXAMPLES) + add_subdirectory(examples) +endif(BUILD_EXAMPLES)