Skip to content

Commit

Permalink
COMP: Modernize searching in list
Browse files Browse the repository at this point in the history
CMake failure in sanity test is resolved by using
modern list searching paradim.

Use 'if( ${var} IN_LIST MYLIST)'

CMake Error at Wrapping/TypedefMacros.cmake:326 (message):
  itk_wrap_class: Invalid option 'EXPLICIT_SPECIALIZATION'.  Possible values
  are POINTER, POINTER_WITH_CONST_POINTER, POINTER_WITH_SUPERCLASS,
  POINTER_WITH_2_SUPERCLASSES, EXPLICIT_SPECIALIZATION,
  POINTER_WITH_EXPLICIT_SPECIALIZATION, ENUM and AUTOPOINTER
Call Stack (most recent call first):
  Wrapping/TypedefMacros.cmake:272 (itk_wrap_named_class)
  Modules/Core/Common/wrapping/vnl_c_vector.wrap:7 (itk_wrap_class)
  Wrapping/TypedefMacros.cmake:196 (include)
  Wrapping/TypedefMacros.cmake:150 (itk_load_submodule)
  Modules/Core/Common/wrapping/CMakeLists.txt:60 (itk_auto_load_submodules)
  • Loading branch information
hjmjohnson authored and dzenanz committed Jan 3, 2022
1 parent ec6849f commit b524b12
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Wrapping/TypedefMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,9 @@ macro(itk_wrap_named_class class swig_name)

if("${ARGC}" EQUAL 3)
set(WRAPPER_WRAP_METHOD "${ARGV2}")
set(ok 0)
foreach(opt POINTER POINTER_WITH_CONST_POINTER POINTER_WITH_SUPERCLASS POINTER_WITH_2_SUPERCLASSES EXPLICIT_SPECIALIZATION POINTER_WITH_EXPLICIT_SPECIALIZATION ENUM AUTOPOINTER)
if("${opt}" STREQUAL "${WRAPPER_WRAP_METHOD}")
set(ok 1)
endif()
endforeach()
if(ok EQUAL 0)
message(SEND_ERROR "itk_wrap_class: Invalid option '${WRAPPER_WRAP_METHOD}'. Possible values are POINTER, POINTER_WITH_CONST_POINTER, POINTER_WITH_SUPERCLASS, POINTER_WITH_2_SUPERCLASSES, EXPLICIT_SPECIALIZATION, POINTER_WITH_EXPLICIT_SPECIALIZATION, ENUM and AUTOPOINTER")
set(VALID_WRAP_METHODS POINTER POINTER_WITH_CONST_POINTER POINTER_WITH_SUPERCLASS POINTER_WITH_2_SUPERCLASSES EXPLICIT_SPECIALIZATION POINTER_WITH_EXPLICIT_SPECIALIZATION ENUM AUTOPOINTER)
if( NOT "${WRAPPER_WRAP_METHOD}" IN_LIST VALID_WRAP_METHODS)
message(SEND_ERROR "itk_wrap_class: Invalid option '${WRAPPER_WRAP_METHOD}'. Possible values are ${VALID_WRAP_METHODS}")
endif()
endif()

Expand Down

0 comments on commit b524b12

Please sign in to comment.