initial commit

This commit is contained in:
Erik Boasson 2018-07-09 13:22:25 +02:00
commit 01ef31359a
23 changed files with 3650 additions and 0 deletions

View file

@ -0,0 +1,31 @@
# Copyright 2016 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(cyclonedds_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 "cyclonedds_cmake_module-extras.cmake"
)
install(DIRECTORY cmake
DESTINATION share/${PROJECT_NAME})

View file

@ -0,0 +1,100 @@
# Copyright 2018 ADLINK Technology Limited
#
# 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 ADLINK CycloneDDS.
#
# Output variables:
#
# - CycloneDDS_FOUND: flag indicating if the package was found
# - CycloneDDS_INCLUDE_DIR: Paths to the header files
#
# Example usage:
#
# find_package(CycloneDDS_cmake_module REQUIRED)
# find_package(CycloneDDS MODULE)
# # use CycloneDDS_* variables
#
###############################################################################
# lint_cmake: -convention/filename, -package/stdargs
set(CycloneDDS_FOUND FALSE)
find_package(fastcdr REQUIRED CONFIG)
find_package(CycloneDDS REQUIRED CONFIG)
string(REGEX MATCH "^[0-9]+\\.[0-9]+" fastcdr_MAJOR_MINOR_VERSION "${fastcdr_VERSION}")
#string(REGEX MATCH "^[0-9]+\\.[0-9]+" cyclonedds_MAJOR_MINOR_VERSION "${cyclonedds_VERSION}")
find_library(FastCDR_LIBRARY_RELEASE
NAMES fastcdr-${fastcdr_MAJOR_MINOR_VERSION} fastcdr)
find_library(FastCDR_LIBRARY_DEBUG
NAMES fastcdrd-${fastcdr_MAJOR_MINOR_VERSION})
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()
#find_library(CycloneDDS_LIBRARY_RELEASE
# NAMES cyclonedds-${cyclonedds_MAJOR_MINOR_VERSION} cyclonedds)
find_library(CycloneDDS_LIBRARY_RELEASE
NAMES cdds cdds)
#find_library(CycloneDDS_LIBRARY_DEBUG
# NAMES cycloneddsd-${cyclonedds_MAJOR_MINOR_VERSION})
set(CycloneDDS_INCLUDE_DIR get_target_property(VAR CycloneDDS::ddsc INTERFACE_INCLUDE_DIRECTORIES))
if(CycloneDDS_LIBRARY_RELEASE AND CycloneDDS_LIBRARY_DEBUG)
set(CycloneDDS_LIBRARIES
optimized ${CycloneDDS_LIBRARY_RELEASE}
debug ${CycloneDDS_LIBRARY_DEBUG}
${FastCDR_LIBRARIES}
)
elseif(CycloneDDS_LIBRARY_RELEASE)
set(CycloneDDS_LIBRARIES
${CycloneDDS_LIBRARY_RELEASE}
${FastCDR_LIBRARIES}
)
elseif(CycloneDDS_LIBRARY_DEBUG)
set(CycloneDDS_LIBRARIES
${CycloneDDS_LIBRARY_DEBUG}
${FastCDR_LIBRARIES}
)
else()
set(CycloneDDS_LIBRARIES "")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CycloneDDS
FOUND_VAR CycloneDDS_FOUND
REQUIRED_VARS
CycloneDDS_INCLUDE_DIR
CycloneDDS_LIBRARIES
)

View file

@ -0,0 +1,15 @@
# Copyright 2016 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 "${cyclonedds_cmake_module_DIR}/Modules")

View file

@ -0,0 +1,18 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>cyclonedds_cmake_module</name>
<version>0.0.1</version>
<description>Provide CMake module to find Eclipse CycloneDDS.</description>
<maintainer email="erik.boasson@adlinktech.com">Erik Boasson</maintainer>
<license>Apache License 2.0</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<export>
<build_type>ament_cmake</build_type>
</export>
</package>