Skip to content

Commit

Permalink
avoid using ARGN for efficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Leeper authored and dirk-thomas committed Aug 18, 2014
1 parent 6abcf11 commit b738a3e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmake/catkin_libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ macro(catkin_pack_libraries_with_build_configuration VAR)
if("${lib}" MATCHES "^debug|optimized|general$")
math(EXPR _index "${_index} + 1")
if(${_index} EQUAL ${_count})
message(FATAL_ERROR "catkin_pack_libraries_with_build_configuration() the list of libraries '${ARGN}' ends with '${lib}' which is a build configuration keyword and must be followed by a library")
message(FATAL_ERROR "catkin_pack_libraries_with_build_configuration() the list of libraries '${_argn}' ends with '${lib}' which is a build configuration keyword and must be followed by a library")
endif()
list(GET _argn ${_index} library)
list(APPEND ${VAR} "${lib}${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}${library}")
Expand All @@ -87,7 +87,7 @@ macro(catkin_pack_libraries_with_build_configuration VAR)
endif()
math(EXPR _index "${_index} + 1")
endwhile()
debug_message(10 "catkin_pack_libraries_with_build_configuration(${VAR} ${ARGN}) ${${VAR}}")
#debug_message(10 "catkin_pack_libraries_with_build_configuration(${VAR} ${_argn}) ${${VAR}}")
endmacro()

#
Expand All @@ -107,7 +107,8 @@ macro(catkin_unpack_libraries_with_build_configuration VAR)
string(REGEX REPLACE "^(debug|optimized|general)${CATKIN_BUILD_CONFIGURATION_KEYWORD_SEPARATOR}(.+)$" "\\1;\\2" lib "${lib}")
list(APPEND ${VAR} "${lib}")
endforeach()
debug_message(10 "catkin_unpack_libraries_with_build_configuration(${VAR} ${ARGN}) ${${VAR}}")
#set(_argn ${ARGN})
#debug_message(10 "catkin_unpack_libraries_with_build_configuration(${VAR} ${_argn}) ${${VAR}}")
endmacro()

#
Expand Down Expand Up @@ -153,5 +154,6 @@ macro(catkin_replace_imported_library_targets VAR)
list(APPEND ${VAR} "${lib}")
endif()
endforeach()
debug_message(10 "catkin_replace_imported_library_targets(${VAR} ${ARGN}) ${${VAR}}")
#set(_argn ${ARGN})
#debug_message(10 "catkin_replace_imported_library_targets(${VAR} ${_argn}) ${${VAR}}")
endmacro()

0 comments on commit b738a3e

Please sign in to comment.