From 984cae76ae2f104f1af675d4b16def7dd3b05709 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Fri, 5 Mar 2021 12:48:23 +0300 Subject: [PATCH] Add todo to sources only if root project --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 06877cfe..5c0c6aad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,11 +36,18 @@ endif() set(Boost_USE_STATIC_LIBS ON) +get_directory_property(PSEMEK_PARENT_DIRECTORY PARENT_DIRECTORY) + add_subdirectory(package) add_subdirectory(tools) add_subdirectory(libs) -psemek_add_library(psemek EXCLUDE_FROM_ALL todo.md) +set(PSEMEK_SOURCES) +if(NOT PSEMEK_PARENT_DIRECTORY) + list(APPEND PSEMEK_SOURCES todo.md) +endif() + +psemek_add_library(psemek EXCLUDE_FROM_ALL ${PSEMEK_SOURCES}) target_link_libraries(psemek INTERFACE ${PSEMEK_LIBRARIES}) set_target_properties(psemek PROPERTIES LINKER_LANGUAGE CXX)