Skip to content

Commit 6b093d8

Browse files
Merge pull request #1 from microROS/develop
Develop
2 parents 7f3931f + 27203c2 commit 6b093d8

14 files changed

Lines changed: 1130 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
cmake_minimum_required(VERSION 3.5)
16+
17+
project(microxrcedds_agent_cmake_module)
18+
19+
find_package(ament_cmake REQUIRED)
20+
21+
if(BUILD_TESTING)
22+
find_package(ament_lint_auto REQUIRED)
23+
ament_lint_auto_find_test_dependencies()
24+
endif()
25+
26+
ament_package(
27+
CONFIG_EXTRAS "microxrcedds_agent_cmake_module-extras.cmake"
28+
)
29+
30+
install(DIRECTORY cmake
31+
DESTINATION share/${PROJECT_NAME}
32+
)
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
###############################################################################
16+
#
17+
# CMake module for finding eProsima MICROXRCEDDS_AGENT.
18+
#
19+
# Output variables:
20+
#
21+
# - MicroXRCEDDS_Agent_FOUND: flag indicating if the package was found
22+
# - MicroXRCEDDS_Agent_INCLUDE_DIR: Paths to the header files
23+
#
24+
# Example usage:
25+
#
26+
# find_package(uros_agent_cmake_module REQUIRED)
27+
# find_package(MicroXRCEDDS_Agent MODULE)
28+
# # use MicroXRCEDDS_Agent_* variables
29+
#
30+
###############################################################################
31+
32+
# lint_cmake: -convention/filename, -package/stdargs
33+
34+
set(MicroXRCEDDS_Agent_FOUND FALSE)
35+
36+
find_package(microxrcedds_agent REQUIRED CONFIG)
37+
find_package(fastcdr REQUIRED CONFIG)
38+
find_package(fastrtps REQUIRED CONFIG)
39+
40+
find_path(MicroXRCEDDS_Agent_INCLUDE_DIR NAMES uxr)
41+
42+
string(REGEX MATCH "^[0-9]+\\.[0-9]+" microxrcedds_agent_MAJOR_MINOR_VERSION "${microxrcedds_agent_VERSION}")
43+
string(REGEX MATCH "^[0-9]+\\.[0-9]+" fastcdr_MAJOR_MINOR_VERSION "${fastcdr_VERSION}")
44+
string(REGEX MATCH "^[0-9]+\\.[0-9]+" fastrtps_MAJOR_MINOR_VERSION "${fastrtps_VERSION}")
45+
46+
##
47+
find_library(MicroXRCEDDS_Agent_LIBRARY_RELEASE
48+
NAMES microxrcedds_agent-${microxrcedds_agent_MAJOR_MINOR_VERSION} microxrcedds_agent)
49+
50+
find_library(MicroXRCEDDS_Agent_LIBRARY_DEBUG
51+
NAMES microxrcedds_agentd-${microxrcedds_agent_MAJOR_MINOR_VERSION} microxrcedds_agentd)
52+
53+
if(MicroXRCEDDS_Agent_LIBRARY_RELEASE AND MicroXRCEDDS_Agent_LIBRARY_DEBUG)
54+
set(MicroXRCEDDS_Agent_LIBRARIES
55+
optimized ${MicroXRCEDDS_Agent_LIBRARY_RELEASE}
56+
debug ${MicroXRCEDDS_Agent_LIBRARY_DEBUG}
57+
)
58+
elseif(MicroXRCEDDS_Agent_LIBRARY_RELEASE)
59+
set(MicroXRCEDDS_Agent_LIBRARIES
60+
${MicroXRCEDDS_Agent_LIBRARY_RELEASE}
61+
)
62+
elseif(MicroXRCEDDS_Agent_LIBRARY_DEBUG)
63+
set(MicroXRCEDDS_Agent_LIBRARIES
64+
${MicroXRCEDDS_Agent_LIBRARY_DEBUG}
65+
)
66+
else()
67+
set(MicroXRCEDDS_Agent_LIBRARIES "")
68+
endif()
69+
70+
##
71+
find_library(FastRTPS_LIBRARY_RELEASE
72+
NAMES fastrtps-${fastrtps_MAJOR_MINOR_VERSION} fastrtps)
73+
74+
find_library(FastRTPS_LIBRARY_DEBUG
75+
NAMES fastrtpsd-${fastrtps_MAJOR_MINOR_VERSION} fastrtpsd)
76+
77+
if(FastRTPS_LIBRARY_RELEASE AND FastRTPS_LIBRARY_DEBUG)
78+
set(FastRTPS_LIBRARIES
79+
optimized ${FastRTPS_LIBRARY_RELEASE}
80+
debug ${FastRTPS_LIBRARY_DEBUG}
81+
)
82+
elseif(FastRTPS_LIBRARY_RELEASE)
83+
set(FastRTPS_LIBRARIES
84+
${MicroXRCEDDS_Agent_LIBRARY_RELEASE}
85+
)
86+
elseif(FastRTPS_LIBRARY_DEBUG)
87+
set(FastRTPS_LIBRARIES
88+
${MicroXRCEDDS_Agent_LIBRARY_DEBUG}
89+
)
90+
else()
91+
set(FastRTPS_LIBRARIES "")
92+
endif()
93+
94+
##
95+
find_library(FastCDR_LIBRARY_RELEASE
96+
NAMES fastcdr-${fastcdr_MAJOR_MINOR_VERSION} fastcdr)
97+
98+
find_library(FastCDR_LIBRARY_DEBUG
99+
NAMES fastcdrd-${fastcdr_MAJOR_MINOR_VERSION} fastcdrd)
100+
101+
if(FastCDR_LIBRARY_RELEASE AND FastCDR_LIBRARY_DEBUG)
102+
set(FastCDR_LIBRARIES
103+
optimized ${FastCDR_LIBRARY_RELEASE}
104+
debug ${FastCDR_LIBRARY_DEBUG}
105+
)
106+
elseif(FastCDR_LIBRARY_RELEASE)
107+
set(FastCDR_LIBRARIES
108+
${FastCDR_LIBRARY_RELEASE}
109+
)
110+
elseif(FastCDR_LIBRARY_DEBUG)
111+
set(FastCDR_LIBRARIES
112+
${FastCDR_LIBRARY_DEBUG}
113+
)
114+
else()
115+
set(FastCDR_LIBRARIES "")
116+
endif()
117+
118+
include(FindPackageHandleStandardArgs)
119+
find_package_handle_standard_args(MicroXRCEDDS_Agent
120+
FOUND_VAR MicroXRCEDDS_Agent_FOUND
121+
REQUIRED_VARS
122+
MicroXRCEDDS_Agent_INCLUDE_DIR
123+
MicroXRCEDDS_Agent_LIBRARIES
124+
)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2018 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
list(INSERT CMAKE_MODULE_PATH 0 "${microxrcedds_agent_cmake_module_DIR}/Modules")
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="2">
4+
<name>microxrcedds_agent_cmake_module</name>
5+
<version>0.1.0</version>
6+
<description>Provide CMake module to find eProsima Micro XRCE-DDS Agent</description>
7+
<maintainer email="javiermoreno@eprosima.com">Javier Moreno</maintainer>
8+
<license>Apache License 2.0</license>
9+
<author>Javier Moreno</author>
10+
11+
<buildtool_depend>ament_cmake</buildtool_depend>
12+
13+
<test_depend>ament_lint_auto</test_depend>
14+
<test_depend>ament_lint_common</test_depend>
15+
16+
<build_depend>microxrcedds_agent</build_depend>
17+
<build_export_depend>microxrcedds_agent</build_export_depend>
18+
19+
<export>
20+
<build_type>ament_cmake</build_type>
21+
</export>
22+
</package>

0 commit comments

Comments
 (0)