Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
rolled printing utlities back to a simpler form
Previous version had issues with how argc was handled.
- Loading branch information
1 parent
33fa97d
commit 147168f
Showing
1 changed file
with
14 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
function( _ci_build_message ) | ||
# get the path of the CMakeLists file evaluating this macro relative to the project's root source directory | ||
file( RELATIVE_PATH _curr_file "${PROJECT_SOURCE_DIR}" "${CMAKE_CURRENT_LIST_FILE}" ) | ||
|
||
# Build up all remaining arguments into the _msg var | ||
set( _msg ) | ||
foreach( i RANGE ${ARGC} ) | ||
set( _msg "${_msg}${ARGV${i}}" ) | ||
endforeach() | ||
|
||
# deposit the concatenated message into 'msg' var for the parent function to use | ||
set( msg "(${_curr_file}) -- ${_msg}" PARENT_SCOPE ) | ||
endfunction() | ||
|
||
# Only prints if CINDER_VERBOSE is On | ||
function( ci_log_v ) | ||
if( CINDER_VERBOSE ) | ||
_ci_build_message( "${ARGV}" ) | ||
message( "verbose ${msg}" ) | ||
file( RELATIVE_PATH curr_file "${PROJECT_SOURCE_DIR}" "${CMAKE_CURRENT_LIST_FILE}" ) | ||
set( msg ) | ||
foreach( arg IN LISTS ARGN ) | ||
set( msg "${msg}${arg}" ) | ||
endforeach() | ||
|
||
message( "verbose (${curr_file}) ${msg}" ) | ||
endif() | ||
endfunction() | ||
|
||
# Alawys prints | ||
function( ci_log_i ) | ||
_ci_build_message( "${ARGV}" ) | ||
message( "info ${msg}" ) | ||
file( RELATIVE_PATH curr_file "${PROJECT_SOURCE_DIR}" "${CMAKE_CURRENT_LIST_FILE}" ) | ||
set( msg ) | ||
foreach( arg IN LISTS ARGN ) | ||
set( msg "${msg}${arg}" ) | ||
endforeach() | ||
|
||
message( "info (${curr_file}) ${msg}" ) | ||
endfunction() |