Skip to content

Commit

Permalink
move verbose_add_subdirectory() function definition to BRLCAD_Util. d…
Browse files Browse the repository at this point in the history
…ocument global it relies on.
  • Loading branch information
brlcad committed Jan 22, 2025
1 parent 1767ffe commit 3073d56
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
18 changes: 0 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2281,24 +2281,6 @@ mark_as_advanced(BUILD_TESTING)
# Set up the BRL-CAD wrapper around find_package
include(BRLCAD_Find_Package)

# We've done the toplevel configure steps, now add the subdirectories
function(verbose_add_subdirectory root dir)
if(BRLCAD_PRINT_MSGS)
if(NOT "${root}" STREQUAL "")
message("-- Adding ${root}/${dir}...")
else(NOT "${root}" STREQUAL "")
message("-- Adding ${dir}...")
endif(NOT "${root}" STREQUAL "")
endif(BRLCAD_PRINT_MSGS)
add_subdirectory(${dir})
if(BRLCAD_PRINT_MSGS)
if(NOT "${root}" STREQUAL "")
message("-- Adding ${root}/${dir} - done")
else(NOT "${root}" STREQUAL "")
message("-- Adding ${dir} - done")
endif(NOT "${root}" STREQUAL "")
endif(BRLCAD_PRINT_MSGS)
endfunction()

###
# traverse into the source tree with intentional ordering
Expand Down
24 changes: 24 additions & 0 deletions misc/CMake/BRLCAD_Util.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,30 @@ function(deps_expand seed_dir out_var)
set(${out_var} ${fdeps} PARENT_SCOPE)
endfunction(deps_expand)


###
# Function to automatically log (before and after) when subdirs are
# added, conditioned on whether the BRLCAD_PRINT_MSGS global is set.
###
function(verbose_add_subdirectory root dir)
if(BRLCAD_PRINT_MSGS)
if(NOT "${root}" STREQUAL "")
message("-- Adding ${root}/${dir}...")
else(NOT "${root}" STREQUAL "")
message("-- Adding ${dir}...")
endif(NOT "${root}" STREQUAL "")
endif(BRLCAD_PRINT_MSGS)
add_subdirectory(${dir})
if(BRLCAD_PRINT_MSGS)
if(NOT "${root}" STREQUAL "")
message("-- Adding ${root}/${dir} - done")
else(NOT "${root}" STREQUAL "")
message("-- Adding ${dir} - done")
endif(NOT "${root}" STREQUAL "")
endif(BRLCAD_PRINT_MSGS)
endfunction()


# Local Variables:
# tab-width: 8
# mode: cmake
Expand Down

0 comments on commit 3073d56

Please sign in to comment.