From 3a8c9941f7cc9a1e54cc3798b78e313a45fa7c90 Mon Sep 17 00:00:00 2001 From: Sajid Date: Mon, 30 Sep 2024 09:06:09 +0600 Subject: [PATCH] don't build sample and tests if included as a library --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 760491d..9385352 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,5 +33,9 @@ project ("PowerRecomp-ALL") add_subdirectory(PowerAnalyse) add_subdirectory(PowerRecomp) add_subdirectory(PowerUtils) -add_subdirectory(PowerSample) -add_subdirectory(PowerTests) + +# Only build sample and tests if this is the top level project +if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) + add_subdirectory(PowerSample) + add_subdirectory(PowerTests) +endif()