From 895f71438e98fa280f07758ed9efe3dff5813e9b Mon Sep 17 00:00:00 2001 From: Filip Dutescu Date: Mon, 4 Oct 2021 20:51:06 +0300 Subject: [PATCH] fix: GH-29 This commit resolves an issue with verbose messaging, which made it so as the sources and headers where not printed even if the option to do so was turnt on. Signed-off-by: Filip Dutescu --- CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d35d3f2..5fe164f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,17 +59,49 @@ include(cmake/SourcesAndHeaders.cmake) if(${PROJECT_NAME}_BUILD_EXECUTABLE) add_executable(${PROJECT_NAME} ${exe_sources}) + if(${PROJECT_NAME}_VERBOSE_OUTPUT) + verbose_message("Found the following sources:") + foreach(source IN LISTS exe_sources) + verbose_message("* ${source}") + endforeach() + endif() + if(${PROJECT_NAME}_ENABLE_UNIT_TESTING) add_library(${PROJECT_NAME}_LIB ${headers} ${sources}) + + if(${PROJECT_NAME}_VERBOSE_OUTPUT) + verbose_message("Found the following headers:") + foreach(header IN LISTS headers) + verbose_message("* ${header}") + endforeach() + endif() endif() elseif(${PROJECT_NAME}_BUILD_HEADERS_ONLY) add_library(${PROJECT_NAME} INTERFACE) + + if(${PROJECT_NAME}_VERBOSE_OUTPUT) + verbose_message("Found the following headers:") + foreach(header IN LIST headers) + verbose_message("* ${header}") + endforeach() + endif() else() add_library( ${PROJECT_NAME} ${headers} ${sources} ) + + if(${PROJECT_NAME}_VERBOSE_OUTPUT) + verbose_message("Found the following sources:") + foreach(source IN LISTS sources) + verbose_message("* ${source}") + endforeach() + verbose_message("Found the following headers:") + foreach(header IN LISTS headers) + verbose_message("* ${header}") + endforeach() + endif() endif() set_target_properties(