diff --git a/Modules/BasicPlugin.cmake b/Modules/BasicPlugin.cmake index 8bf2862a..66726a8e 100644 --- a/Modules/BasicPlugin.cmake +++ b/Modules/BasicPlugin.cmake @@ -337,11 +337,12 @@ endfunction() \ :command:`!cet_build_plugin` attempts to locate a command to invoke to build a plugin ```` of type ````. - If there exists a CMake variable :variable:`!_builder`, the - first element of its value will be searched for as a command to - invoke, and any further elements will be prepended to `` - ...``. Otherwise, a command ```` or ``_plugin`` will be - invoked if found. + If there exists a CMake variable :variable:`!_builder` + (where ```` is ```` after stripping any + namespace prefix (``*::``), the first element of its value will be + searched for as a command to invoke, and any further elements will be + prepended to `` ...``. Otherwise, a command ```` or + ``_plugin`` will be invoked if found. If a suitable command :command:`!` is found, it shall be invoked: @@ -364,7 +365,8 @@ macro(cet_build_plugin NAME BASE) if ("${BASE}" STREQUAL "") message(SEND_ERROR "vacuous BASE argument to cet_build_plugin()") else() - foreach (_cbp_command IN ITEMS ${${BASE}_builder} ${BASE} ${BASE}_plugin) + string(REGEX REPLACE "^.*::" "" base_varstem "${BASE}") + foreach (_cbp_command IN ITEMS "${${base_varstem}_builder}" "${BASE}" "${BASE}_plugin") list(POP_FRONT _cbp_command _cbp_cmd_name) if (COMMAND ${_cbp_cmd_name}) list(PREPEND _cbp_cmd_names ${_cbp_cmd_name}) # Handle recursion.