From ee410664f897327421904158cb0a275ab4009a4b Mon Sep 17 00:00:00 2001 From: Alexey Klimkin Date: Thu, 21 Jan 2021 11:16:06 -0800 Subject: [PATCH] Avoid globbing sources Helps to automatically re-run cmake if new files added. --- CMakeLists.txt | 3 --- libcoz/CMakeLists.txt | 9 +++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eea1beb..f601486 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,9 +12,6 @@ include(GNUInstallDirs) find_package(Threads REQUIRED) find_package(libelfin REQUIRED) -file(GLOB_RECURSE sources libcoz/*.cpp) -file(GLOB_RECURSE headers include/*.h) - install(PROGRAMS coz DESTINATION bin) install(FILES LICENSE.md DESTINATION licenses) diff --git a/libcoz/CMakeLists.txt b/libcoz/CMakeLists.txt index 2cff026..09fa793 100644 --- a/libcoz/CMakeLists.txt +++ b/libcoz/CMakeLists.txt @@ -1,3 +1,12 @@ +set(sources + inspect.cpp + libcoz.cpp + perf.cpp + profiler.cpp + real.cpp) +set(headers + ${PROJECT_SOURCE_DIR}/include/coz.h) + add_library(coz MODULE ${sources}) set_target_properties(coz PROPERTIES PUBLIC_HEADER "${headers}") if(CONAN_PACKAGE_VERSION)