From 66c6ebd6c1313c673274ae5a27c1915b713509cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez?= Date: Mon, 11 Mar 2024 14:20:59 +0100 Subject: [PATCH] Support new fastdds naming (#315) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refs #19451. Support new fastdds naming Signed-off-by: Ricardo González Moreno * Refs #19451. Fix in swig cmake files Signed-off-by: Ricardo González Moreno --------- Signed-off-by: Ricardo González Moreno --- colcon.pkg | 2 +- src/main/java/com/eprosima/fastdds/fastddsgen.java | 8 +++----- .../com/eprosima/fastdds/idl/templates/CMakeLists.stg | 2 +- .../java/com/eprosima/fastdds/idl/templates/SwigCMake.stg | 6 +++--- src/main/java/com/eprosima/fastdds/solution/Solution.java | 8 ++++---- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/colcon.pkg b/colcon.pkg index ffb1f984..49c80ffa 100644 --- a/colcon.pkg +++ b/colcon.pkg @@ -1,5 +1,5 @@ { "name": "fastddsgen", "type": "gradle", - "test-dependencies" : ["fastrtps"] + "test-dependencies" : ["fastdds"] } diff --git a/src/main/java/com/eprosima/fastdds/fastddsgen.java b/src/main/java/com/eprosima/fastdds/fastddsgen.java index a75cf188..ce9c6f0c 100644 --- a/src/main/java/com/eprosima/fastdds/fastddsgen.java +++ b/src/main/java/com/eprosima/fastdds/fastddsgen.java @@ -73,7 +73,7 @@ public class fastddsgen private static ArrayList m_platforms = null; private Vector m_idlFiles; - protected static String m_appEnv = "FASTRTPSHOME"; + protected static String m_appEnv = "FASTDDSHOME"; private String m_exampleOption = null; private boolean m_ppDisable = false; //TODO private boolean m_replace = false; @@ -86,7 +86,7 @@ public class fastddsgen private boolean m_publishercode = true; private boolean m_subscribercode = true; private boolean m_atLeastOneStructure = false; - protected static String m_localAppProduct = "fastrtps"; + protected static String m_localAppProduct = "fastdds"; private ArrayList m_includePaths = new ArrayList(); // Mapping where the key holds the path to the template file and the value the wanted output file name @@ -451,7 +451,7 @@ public boolean execute() } // Add product library - solution.addLibrary("fastrtps"); + solution.addLibrary("fastdds"); for (int count = 0; returnedValue && (count < m_idlFiles.size()); ++count) { @@ -528,8 +528,6 @@ private String getVersion() { try { - //InputStream input = this.getClass().getResourceAsStream("/fastrtps_version.h"); - InputStream input = this.getClass().getClassLoader().getResourceAsStream("version"); byte[] b = new byte[input.available()]; input.read(b); diff --git a/src/main/java/com/eprosima/fastdds/idl/templates/CMakeLists.stg b/src/main/java/com/eprosima/fastdds/idl/templates/CMakeLists.stg index fd869d74..04648f07 100644 --- a/src/main/java/com/eprosima/fastdds/idl/templates/CMakeLists.stg +++ b/src/main/java/com/eprosima/fastdds/idl/templates/CMakeLists.stg @@ -39,7 +39,7 @@ $endif$ # Find requirements find_package(fastcdr REQUIRED) -find_package(fastrtps 2.12 REQUIRED) +find_package(fastdds 3 REQUIRED) $solution.projects : { project | $pub_sub_execs(project=project, libraries=solution.libraries, test=test)$}; separator="\n"$ diff --git a/src/main/java/com/eprosima/fastdds/idl/templates/SwigCMake.stg b/src/main/java/com/eprosima/fastdds/idl/templates/SwigCMake.stg index e6ae5523..6de3bd8d 100644 --- a/src/main/java/com/eprosima/fastdds/idl/templates/SwigCMake.stg +++ b/src/main/java/com/eprosima/fastdds/idl/templates/SwigCMake.stg @@ -45,7 +45,7 @@ message(STATUS "Configuring python wrapper for types in $project.name$...") project($project.name$) find_package(fastcdr REQUIRED) -find_package(fastrtps REQUIRED) +find_package(fastdds 3 REQUIRED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -64,7 +64,7 @@ target_include_directories(\${PROJECT_NAME} PUBLIC target_link_libraries(\${PROJECT_NAME} PUBLIC fastcdr - fastrtps + fastdds $project.dependencies : { dep | $dep$}; separator=" "$ ) @@ -110,7 +110,7 @@ endif() target_link_libraries(\${\${PROJECT_NAME}_MODULE} Python3::Module - fastrtps + fastdds \${PROJECT_NAME} ) diff --git a/src/main/java/com/eprosima/fastdds/solution/Solution.java b/src/main/java/com/eprosima/fastdds/solution/Solution.java index 697c864f..6510c389 100644 --- a/src/main/java/com/eprosima/fastdds/solution/Solution.java +++ b/src/main/java/com/eprosima/fastdds/solution/Solution.java @@ -49,7 +49,7 @@ public ArrayList getLibraries() for(int count = 0; count < libraries.size(); ++count) { - if(m_example.contains("Win") && libraries.get(count).startsWith("fastrtps")) + if(m_example.contains("Win") && libraries.get(count).startsWith("fastdds")) ret.add(libraries.get(count) + "-" + m_version); else ret.add(libraries.get(count)); @@ -65,7 +65,7 @@ public ArrayList getLibrariesDebug() for(int count = 0; count < libraries.size(); ++count) { - if(m_example.contains("Win") && libraries.get(count).startsWith("fastrtps")) + if(m_example.contains("Win") && libraries.get(count).startsWith("fastdds")) ret.add(libraries.get(count) + "d-" + m_version); else ret.add(libraries.get(count) + "d"); @@ -83,7 +83,7 @@ public ArrayList getLibrariesStatic() { if(libraries.get(count).startsWith("ndds")) ret.add(libraries.get(count) + "z"); - else if(m_example.contains("Win") && libraries.get(count).startsWith("fastrtps")) + else if(m_example.contains("Win") && libraries.get(count).startsWith("fastdds")) ret.add("lib" + libraries.get(count) + "-" + m_version); else ret.add("lib" + libraries.get(count)); @@ -101,7 +101,7 @@ public ArrayList getLibrariesStaticDebug() { if(libraries.get(count).startsWith("ndds")) ret.add(libraries.get(count) + "zd"); - else if(m_example.contains("Win") && libraries.get(count).startsWith("fastrtps")) + else if(m_example.contains("Win") && libraries.get(count).startsWith("fastdds")) ret.add("lib" + libraries.get(count) + "d-" + m_version); else ret.add("lib" + libraries.get(count) + "d");