From bb1fe9561ce34015acda56c71db3555cdb6cde6a Mon Sep 17 00:00:00 2001 From: Javier Moreno Date: Wed, 17 Oct 2018 10:54:04 +0200 Subject: [PATCH] Refs #3561 - Generate uROS_Agent module --- .../CMakeLists.txt | 32 +++++ .../Modules/FindMicroXRCEDDS_Agent.cmake | 124 ++++++++++++++++++ ...croxrcedds_agent_cmake_module-extras.cmake | 15 +++ microxrcedds_agent_cmake_module/package.xml | 22 ++++ CMakeLists.txt => uROS_Agent/CMakeLists.txt | 0 README.md => uROS_Agent/README.md | 0 {bin => uROS_Agent/bin}/Xml_interface_gen.py | 0 .../bin}/Xml_read_default_profiles.py | 0 package.xml => uROS_Agent/package.xml | 0 .../resource}/StaticValues.xml | 0 .../uros_agent}/__init__.py | 0 11 files changed, 193 insertions(+) create mode 100644 microxrcedds_agent_cmake_module/CMakeLists.txt create mode 100644 microxrcedds_agent_cmake_module/cmake/Modules/FindMicroXRCEDDS_Agent.cmake create mode 100644 microxrcedds_agent_cmake_module/microxrcedds_agent_cmake_module-extras.cmake create mode 100644 microxrcedds_agent_cmake_module/package.xml rename CMakeLists.txt => uROS_Agent/CMakeLists.txt (100%) rename README.md => uROS_Agent/README.md (100%) rename {bin => uROS_Agent/bin}/Xml_interface_gen.py (100%) rename {bin => uROS_Agent/bin}/Xml_read_default_profiles.py (100%) rename package.xml => uROS_Agent/package.xml (100%) rename {resource => uROS_Agent/resource}/StaticValues.xml (100%) rename {uros_agent => uROS_Agent/uros_agent}/__init__.py (100%) diff --git a/microxrcedds_agent_cmake_module/CMakeLists.txt b/microxrcedds_agent_cmake_module/CMakeLists.txt new file mode 100644 index 0000000..8d17615 --- /dev/null +++ b/microxrcedds_agent_cmake_module/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +cmake_minimum_required(VERSION 3.5) + +project(microxrcedds_agent_cmake_module) + +find_package(ament_cmake REQUIRED) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + ament_lint_auto_find_test_dependencies() +endif() + +ament_package( + CONFIG_EXTRAS "microxrcedds_agent_cmake_module-extras.cmake" + ) + +install(DIRECTORY cmake + DESTINATION share/${PROJECT_NAME} + ) diff --git a/microxrcedds_agent_cmake_module/cmake/Modules/FindMicroXRCEDDS_Agent.cmake b/microxrcedds_agent_cmake_module/cmake/Modules/FindMicroXRCEDDS_Agent.cmake new file mode 100644 index 0000000..8df1b34 --- /dev/null +++ b/microxrcedds_agent_cmake_module/cmake/Modules/FindMicroXRCEDDS_Agent.cmake @@ -0,0 +1,124 @@ +# Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +############################################################################### +# +# CMake module for finding eProsima MICROXRCEDDS_AGENT. +# +# Output variables: +# +# - MicroXRCEDDS_Agent_FOUND: flag indicating if the package was found +# - MicroXRCEDDS_Agent_INCLUDE_DIR: Paths to the header files +# +# Example usage: +# +# find_package(uros_agent_cmake_module REQUIRED) +# find_package(MicroXRCEDDS_Agent MODULE) +# # use MicroXRCEDDS_Agent_* variables +# +############################################################################### + +# lint_cmake: -convention/filename, -package/stdargs + +set(MicroXRCEDDS_Agent_FOUND FALSE) + +find_package(microxrcedds_agent REQUIRED CONFIG) +find_package(fastcdr REQUIRED CONFIG) +find_package(fastrtps REQUIRED CONFIG) + +find_path(MicroXRCEDDS_Agent_INCLUDE_DIR NAMES uxr) + +string(REGEX MATCH "^[0-9]+\\.[0-9]+" microxrcedds_agent_MAJOR_MINOR_VERSION "${microxrcedds_agent_VERSION}") +string(REGEX MATCH "^[0-9]+\\.[0-9]+" fastcdr_MAJOR_MINOR_VERSION "${fastcdr_VERSION}") +string(REGEX MATCH "^[0-9]+\\.[0-9]+" fastrtps_MAJOR_MINOR_VERSION "${fastrtps_VERSION}") + +## +find_library(MicroXRCEDDS_Agent_LIBRARY_RELEASE + NAMES microxrcedds_agent-${microxrcedds_agent_MAJOR_MINOR_VERSION} microxrcedds_agent) + +find_library(MicroXRCEDDS_Agent_LIBRARY_DEBUG + NAMES microxrcedds_agentd-${microxrcedds_agent_MAJOR_MINOR_VERSION} microxrcedds_agentd) + +if(MicroXRCEDDS_Agent_LIBRARY_RELEASE AND MicroXRCEDDS_Agent_LIBRARY_DEBUG) + set(MicroXRCEDDS_Agent_LIBRARIES + optimized ${MicroXRCEDDS_Agent_LIBRARY_RELEASE} + debug ${MicroXRCEDDS_Agent_LIBRARY_DEBUG} + ) +elseif(MicroXRCEDDS_Agent_LIBRARY_RELEASE) + set(MicroXRCEDDS_Agent_LIBRARIES + ${MicroXRCEDDS_Agent_LIBRARY_RELEASE} + ) +elseif(MicroXRCEDDS_Agent_LIBRARY_DEBUG) + set(MicroXRCEDDS_Agent_LIBRARIES + ${MicroXRCEDDS_Agent_LIBRARY_DEBUG} + ) +else() + set(MicroXRCEDDS_Agent_LIBRARIES "") +endif() + +## +find_library(FastRTPS_LIBRARY_RELEASE + NAMES fastrtps-${fastrtps_MAJOR_MINOR_VERSION} fastrtps) + +find_library(FastRTPS_LIBRARY_DEBUG + NAMES fastrtpsd-${fastrtps_MAJOR_MINOR_VERSION} fastrtpsd) + +if(FastRTPS_LIBRARY_RELEASE AND FastRTPS_LIBRARY_DEBUG) + set(FastRTPS_LIBRARIES + optimized ${FastRTPS_LIBRARY_RELEASE} + debug ${FastRTPS_LIBRARY_DEBUG} + ) +elseif(FastRTPS_LIBRARY_RELEASE) + set(FastRTPS_LIBRARIES + ${MicroXRCEDDS_Agent_LIBRARY_RELEASE} + ) +elseif(FastRTPS_LIBRARY_DEBUG) + set(FastRTPS_LIBRARIES + ${MicroXRCEDDS_Agent_LIBRARY_DEBUG} + ) +else() + set(FastRTPS_LIBRARIES "") +endif() + +## +find_library(FastCDR_LIBRARY_RELEASE + NAMES fastcdr-${fastcdr_MAJOR_MINOR_VERSION} fastcdr) + +find_library(FastCDR_LIBRARY_DEBUG + NAMES fastcdrd-${fastcdr_MAJOR_MINOR_VERSION} fastcdrd) + +if(FastCDR_LIBRARY_RELEASE AND FastCDR_LIBRARY_DEBUG) + set(FastCDR_LIBRARIES + optimized ${FastCDR_LIBRARY_RELEASE} + debug ${FastCDR_LIBRARY_DEBUG} + ) +elseif(FastCDR_LIBRARY_RELEASE) + set(FastCDR_LIBRARIES + ${FastCDR_LIBRARY_RELEASE} + ) +elseif(FastCDR_LIBRARY_DEBUG) + set(FastCDR_LIBRARIES + ${FastCDR_LIBRARY_DEBUG} + ) +else() + set(FastCDR_LIBRARIES "") +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(MicroXRCEDDS_Agent + FOUND_VAR MicroXRCEDDS_Agent_FOUND + REQUIRED_VARS + MicroXRCEDDS_Agent_INCLUDE_DIR + MicroXRCEDDS_Agent_LIBRARIES +) \ No newline at end of file diff --git a/microxrcedds_agent_cmake_module/microxrcedds_agent_cmake_module-extras.cmake b/microxrcedds_agent_cmake_module/microxrcedds_agent_cmake_module-extras.cmake new file mode 100644 index 0000000..d8b7862 --- /dev/null +++ b/microxrcedds_agent_cmake_module/microxrcedds_agent_cmake_module-extras.cmake @@ -0,0 +1,15 @@ +# Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +list(INSERT CMAKE_MODULE_PATH 0 "${microxrcedds_agent_cmake_module_DIR}/Modules") diff --git a/microxrcedds_agent_cmake_module/package.xml b/microxrcedds_agent_cmake_module/package.xml new file mode 100644 index 0000000..6750cbe --- /dev/null +++ b/microxrcedds_agent_cmake_module/package.xml @@ -0,0 +1,22 @@ + + + + microxrcedds_agent_cmake_module + 0.1.0 + Provide CMake module to find eProsima Micro XRCE-DDS Agent + Javier Moreno + Apache License 2.0 + Javier Moreno + + ament_cmake + + ament_lint_auto + ament_lint_common + + microxrcedds_agent + microxrcedds_agent + + + ament_cmake + + diff --git a/CMakeLists.txt b/uROS_Agent/CMakeLists.txt similarity index 100% rename from CMakeLists.txt rename to uROS_Agent/CMakeLists.txt diff --git a/README.md b/uROS_Agent/README.md similarity index 100% rename from README.md rename to uROS_Agent/README.md diff --git a/bin/Xml_interface_gen.py b/uROS_Agent/bin/Xml_interface_gen.py similarity index 100% rename from bin/Xml_interface_gen.py rename to uROS_Agent/bin/Xml_interface_gen.py diff --git a/bin/Xml_read_default_profiles.py b/uROS_Agent/bin/Xml_read_default_profiles.py similarity index 100% rename from bin/Xml_read_default_profiles.py rename to uROS_Agent/bin/Xml_read_default_profiles.py diff --git a/package.xml b/uROS_Agent/package.xml similarity index 100% rename from package.xml rename to uROS_Agent/package.xml diff --git a/resource/StaticValues.xml b/uROS_Agent/resource/StaticValues.xml similarity index 100% rename from resource/StaticValues.xml rename to uROS_Agent/resource/StaticValues.xml diff --git a/uros_agent/__init__.py b/uROS_Agent/uros_agent/__init__.py similarity index 100% rename from uros_agent/__init__.py rename to uROS_Agent/uros_agent/__init__.py