Skip to content

Commit

Permalink
Support new fastdds naming (#315)
Browse files Browse the repository at this point in the history
* Refs #19451. Support new fastdds naming

Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>

* Refs #19451. Fix in swig cmake files

Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>

---------

Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
  • Loading branch information
richiware committed Mar 13, 2024
1 parent a0af4fb commit f4d62c6
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/fastddsgen.meta
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"names":
{
"fastrtps": {
"fastdds": {
"cmake-args": [
"-DEPROSIMA_BUILD_TESTS=ON"

Expand Down
2 changes: 1 addition & 1 deletion colcon.pkg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "fastddsgen",
"type": "gradle",
"test-dependencies" : ["fastrtps"]
"test-dependencies" : ["fastdds"]
}
10 changes: 4 additions & 6 deletions src/main/java/com/eprosima/fastdds/fastddsgen.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class fastddsgen
private static ArrayList<String> m_platforms = null;

private Vector<String> 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;
Expand All @@ -85,7 +85,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<String> m_includePaths = new ArrayList<String>();

// Mapping where the key holds the path to the template file and the value the wanted output file name
Expand Down Expand Up @@ -459,7 +459,7 @@ public boolean execute()
}

// Add product library
solution.addLibrary("fastrtps");
solution.addLibrary("fastdds");

for (int count = 0; returnedValue && (count < m_idlFiles.size()); ++count)
{
Expand Down Expand Up @@ -538,8 +538,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);
Expand Down Expand Up @@ -572,7 +570,7 @@ private void showVersion()
private static final String default_container_prealloc_size = "-default-container-prealloc-size";
private static final String default_extensibility_arg = "-default_extensibility";
private static final String default_extensibility_short_arg = "-de";
private static final String specific_platform_arg = "-example";
private static final String specific_platform_arg = "-example";
private static final String extra_template_arg = "-extrastg";
private static final String flat_output_directory_arg = "-flat-output-dir";
private static final String fusion_arg = "-fusion";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"$

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -64,7 +64,7 @@ target_include_directories(\${PROJECT_NAME} PUBLIC
target_link_libraries(\${PROJECT_NAME}
PUBLIC
fastcdr
fastrtps
fastdds
$project.dependencies : { dep | $dep$}; separator=" "$
)

Expand Down Expand Up @@ -110,7 +110,7 @@ endif()

target_link_libraries(\${\${PROJECT_NAME}_MODULE}
Python3::Module
fastrtps
fastdds
\${PROJECT_NAME}
)

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/eprosima/fastdds/solution/Solution.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public ArrayList<String> 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));
Expand All @@ -65,7 +65,7 @@ public ArrayList<String> 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");
Expand All @@ -83,7 +83,7 @@ public ArrayList<String> 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));
Expand All @@ -101,7 +101,7 @@ public ArrayList<String> 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");
Expand Down

0 comments on commit f4d62c6

Please sign in to comment.