Skip to content

Commit

Permalink
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
richardeakin committed Jun 25, 2017
1 parent 33fa97d commit 147168f
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions proj/cmake/utilities.cmake
@@ -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()

0 comments on commit 147168f

Please sign in to comment.