Skip to content

Commit

Permalink
fix: GH-29
Browse files Browse the repository at this point in the history
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 <filip.dutescu@gmail.com>
  • Loading branch information
filipdutescu committed Oct 4, 2021
1 parent 4b6ae29 commit 895f714
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 895f714

Please sign in to comment.