Skip to content
Snippets Groups Projects
Commit 035f8c2f authored by Fabian Paus's avatar Fabian Paus
Browse files

CMake: armarx_gui_plugin fix failure if the plugin name contains 'GuiPlugin'

parent ee5e57ea
No related branches found
No related tags found
No related merge requests found
......@@ -83,7 +83,8 @@ function(armarx_gui_plugin PLUGIN_NAME SOURCES QT_MOC_HDRS QT_UIS QT_RESOURCES C
set(GENERATE_BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_NAME}_autogen/include")
#gui plugin name
string(REPLACE "GuiPlugin" "" ARMARX_GUI_PLUGIN_PREFIX "${ARMARX_TARGET_NAME}")
# Make sure to remove only the last 'GuiPlugin' otherwise you cannot name your plugins '*GuiPlugin'
string(REGEX REPLACE "GuiPlugin$" "" ARMARX_GUI_PLUGIN_PREFIX "${ARMARX_TARGET_NAME}")
#autogen header if none was supplied
set(tmp_headers ${HEADERS})
......@@ -104,7 +105,7 @@ function(armarx_gui_plugin PLUGIN_NAME SOURCES QT_MOC_HDRS QT_UIS QT_RESOURCES C
list(REMOVE_DUPLICATES tmp_headers)
list(LENGTH tmp_headers tmp_headers_len)
if(NOT "1" STREQUAL "${tmp_headers_len}")
message(FATAL_ERROR "Failed to auto generate the GuiPlugin headers! Error: Can't find the widget controller")
message(FATAL_ERROR "Failed to auto generate the GuiPlugin headers! Error: Can't find the widget controller '${tmp_regex}'")
endif()
list(GET tmp_headers 0 tmp_hdr)
set(ARMARX_GUI_PLUGIN_WIDGET_CONTROLLER_HEDER "${subdir}/${tmp_hdr}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment