Skip to content

Commit

Permalink
fix regex for build configuration keywords (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Aug 8, 2018
1 parent 7ab62a8 commit 7b4eebf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Expand Up @@ -18,7 +18,7 @@ if(NOT _exported_libraries STREQUAL "")
continue()
endif()

if("${_arg}" MATCHES "^debug|optimized|general$")
if("${_arg}" MATCHES "^(debug|optimized|general)$")
# remember build configuration keyword
# and get following library
set(_cfg "${_arg}")
Expand Down Expand Up @@ -83,7 +83,7 @@ if(NOT _exported_library_names STREQUAL "")
continue()
endif()

if("${_arg}" MATCHES "^debug|optimized|general$")
if("${_arg}" MATCHES "^(debug|optimized|general)$")
# remember build configuration keyword
# and get following library name
set(_cfg "${_arg}")
Expand Down
Expand Up @@ -47,7 +47,7 @@ macro(ament_export_libraries)
continue()
endif()

if("${_arg}" MATCHES "^debug|optimized|general$")
if("${_arg}" MATCHES "^(debug|optimized|general)$")
# remember build configuration keyword
# and get following library
set(_cfg "${_arg}")
Expand Down
Expand Up @@ -42,7 +42,7 @@ macro(ament_export_library_names)
endif()

foreach(_library_name ${_ARG_UNPARSED_ARGUMENTS})
if("${_library_name}" MATCHES "^debug|optimized|general$")
if("${_library_name}" MATCHES "^(debug|optimized|general)$")
# keep build configuration keyword as-is
list(APPEND _AMENT_EXPORT_LIBRARY_NAMES "${_library_name}")
else()
Expand Down
Expand Up @@ -30,7 +30,7 @@ macro(ament_libraries_pack_build_configuration VAR)
set(_index 0)
while(${_index} LESS ${_count})
list(GET _argn ${_index} _lib)
if("${_lib}" MATCHES "^debug|optimized|general$")
if("${_lib}" MATCHES "^(debug|optimized|general)$")
math(EXPR _index "${_index} + 1")
if(${_index} EQUAL ${_count})
message(FATAL_ERROR "ament_libraries_pack_build_configuration() the list of libraries '${_argn}' ends with '${_lib}' which is a build configuration keyword and must be followed by a library")
Expand Down

0 comments on commit 7b4eebf

Please sign in to comment.