From b15ec0fcd6e3cefd054008cd86c65b0a9ea2123a Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 6 Jun 2019 11:21:23 +0200 Subject: [PATCH] YarpIDL: Fix output for nested thrift files Fix #2044 --- cmake/YarpIDL.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmake/YarpIDL.cmake b/cmake/YarpIDL.cmake index 287e676c743..1d5ec90cdab 100644 --- a/cmake/YarpIDL.cmake +++ b/cmake/YarpIDL.cmake @@ -384,6 +384,9 @@ function(_YARP_IDL_THRIFT_TO_FILE_LIST file path basename ext gen_srcs_var gen_h list(APPEND gen_hdrs ${path}/${namespace_dir}/${basename}_common.h) endif() + string(REGEX REPLACE "/(/|$)" "\\1" gen_srcs "${gen_srcs}") + string(REGEX REPLACE "/(/|$)" "\\1" gen_hdrs "${gen_hdrs}") + set(${gen_srcs_var} ${gen_srcs} PARENT_SCOPE) set(${gen_hdrs_var} ${gen_hdrs} PARENT_SCOPE) endfunction() @@ -430,6 +433,9 @@ function(_YARP_IDL_ROSMSG_TO_FILE_LIST file path pkg basename ext gen_srcs_var g endif() endif() + string(REGEX REPLACE "/(/|$)" "\\1" gen_srcs "${gen_srcs}") + string(REGEX REPLACE "/(/|$)" "\\1" gen_hdrs "${gen_hdrs}") + set(${gen_srcs_var} ${gen_srcs} PARENT_SCOPE) set(${gen_hdrs_var} ${gen_hdrs} PARENT_SCOPE) endfunction() @@ -527,11 +533,7 @@ function(YARP_ADD_IDL var) endif() endforeach() foreach(gen_file ${gen_hdrs}) - if("${family}" STREQUAL "thrift") - set(out "${hdrs_out_dir}/${path}/${gen_file}") - else() - set(out "${hdrs_out_dir}/${gen_file}") - endif() + set(out "${hdrs_out_dir}/${gen_file}") list(FIND ${var} ${out} x) if(x EQUAL -1) list(APPEND output "${out}")