Initial commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# generated from ament/cmake/core/templates/nameConfig-version.cmake.in
|
||||
set(PACKAGE_VERSION "0.0.0")
|
||||
|
||||
set(PACKAGE_VERSION_EXACT False)
|
||||
set(PACKAGE_VERSION_COMPATIBLE False)
|
||||
|
||||
if("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}")
|
||||
set(PACKAGE_VERSION_EXACT True)
|
||||
set(PACKAGE_VERSION_COMPATIBLE True)
|
||||
endif()
|
||||
|
||||
if("${PACKAGE_FIND_VERSION}" VERSION_LESS "${PACKAGE_VERSION}")
|
||||
set(PACKAGE_VERSION_COMPATIBLE True)
|
||||
endif()
|
||||
42
build/cpp_srvcli/ament_cmake_core/cpp_srvcliConfig.cmake
Normal file
42
build/cpp_srvcli/ament_cmake_core/cpp_srvcliConfig.cmake
Normal file
@@ -0,0 +1,42 @@
|
||||
# generated from ament/cmake/core/templates/nameConfig.cmake.in
|
||||
|
||||
# prevent multiple inclusion
|
||||
if(_cpp_srvcli_CONFIG_INCLUDED)
|
||||
# ensure to keep the found flag the same
|
||||
if(NOT DEFINED cpp_srvcli_FOUND)
|
||||
# explicitly set it to FALSE, otherwise CMake will set it to TRUE
|
||||
set(cpp_srvcli_FOUND FALSE)
|
||||
elseif(NOT cpp_srvcli_FOUND)
|
||||
# use separate condition to avoid uninitialized variable warning
|
||||
set(cpp_srvcli_FOUND FALSE)
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
set(_cpp_srvcli_CONFIG_INCLUDED TRUE)
|
||||
|
||||
# output package information
|
||||
if(NOT cpp_srvcli_FIND_QUIETLY)
|
||||
message(STATUS "Found cpp_srvcli: 0.0.0 (${cpp_srvcli_DIR})")
|
||||
endif()
|
||||
|
||||
# warn when using a deprecated package
|
||||
if(NOT "" STREQUAL "")
|
||||
set(_msg "Package 'cpp_srvcli' is deprecated")
|
||||
# append custom deprecation text if available
|
||||
if(NOT "" STREQUAL "TRUE")
|
||||
set(_msg "${_msg} ()")
|
||||
endif()
|
||||
# optionally quiet the deprecation message
|
||||
if(NOT cpp_srvcli_DEPRECATED_QUIET)
|
||||
message(DEPRECATION "${_msg}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# flag package as ament-based to distinguish it after being find_package()-ed
|
||||
set(cpp_srvcli_FOUND_AMENT_PACKAGE TRUE)
|
||||
|
||||
# include all config extra files
|
||||
set(_extras "")
|
||||
foreach(_extra ${_extras})
|
||||
include("${cpp_srvcli_DIR}/${_extra}")
|
||||
endforeach()
|
||||
14
build/cpp_srvcli/ament_cmake_core/package.cmake
Normal file
14
build/cpp_srvcli/ament_cmake_core/package.cmake
Normal file
@@ -0,0 +1,14 @@
|
||||
set(_AMENT_PACKAGE_NAME "cpp_srvcli")
|
||||
set(cpp_srvcli_VERSION "0.0.0")
|
||||
set(cpp_srvcli_MAINTAINER "caixiang <939387484@qq.com>")
|
||||
set(cpp_srvcli_BUILD_DEPENDS "rclcpp" "tutorial_interfaces")
|
||||
set(cpp_srvcli_BUILDTOOL_DEPENDS "ament_cmake")
|
||||
set(cpp_srvcli_BUILD_EXPORT_DEPENDS "rclcpp" "tutorial_interfaces")
|
||||
set(cpp_srvcli_BUILDTOOL_EXPORT_DEPENDS )
|
||||
set(cpp_srvcli_EXEC_DEPENDS "rclcpp" "tutorial_interfaces")
|
||||
set(cpp_srvcli_TEST_DEPENDS "ament_lint_auto" "ament_lint_common")
|
||||
set(cpp_srvcli_GROUP_DEPENDS )
|
||||
set(cpp_srvcli_MEMBER_OF_GROUPS )
|
||||
set(cpp_srvcli_DEPRECATED "")
|
||||
set(cpp_srvcli_EXPORT_TAGS)
|
||||
list(APPEND cpp_srvcli_EXPORT_TAGS "<build_type>ament_cmake</build_type>")
|
||||
@@ -0,0 +1,4 @@
|
||||
# copied from
|
||||
# ament_cmake_core/cmake/environment_hooks/environment/ament_prefix_path.sh
|
||||
|
||||
ament_prepend_unique_value AMENT_PREFIX_PATH "$AMENT_CURRENT_PREFIX"
|
||||
@@ -0,0 +1,14 @@
|
||||
# generated from ament/cmake/core/templates/nameConfig-version.cmake.in
|
||||
set(PACKAGE_VERSION "@PACKAGE_VERSION@")
|
||||
|
||||
set(PACKAGE_VERSION_EXACT False)
|
||||
set(PACKAGE_VERSION_COMPATIBLE False)
|
||||
|
||||
if("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}")
|
||||
set(PACKAGE_VERSION_EXACT True)
|
||||
set(PACKAGE_VERSION_COMPATIBLE True)
|
||||
endif()
|
||||
|
||||
if("${PACKAGE_FIND_VERSION}" VERSION_LESS "${PACKAGE_VERSION}")
|
||||
set(PACKAGE_VERSION_COMPATIBLE True)
|
||||
endif()
|
||||
@@ -0,0 +1,42 @@
|
||||
# generated from ament/cmake/core/templates/nameConfig.cmake.in
|
||||
|
||||
# prevent multiple inclusion
|
||||
if(_@PROJECT_NAME@_CONFIG_INCLUDED)
|
||||
# ensure to keep the found flag the same
|
||||
if(NOT DEFINED @PROJECT_NAME@_FOUND)
|
||||
# explicitly set it to FALSE, otherwise CMake will set it to TRUE
|
||||
set(@PROJECT_NAME@_FOUND FALSE)
|
||||
elseif(NOT @PROJECT_NAME@_FOUND)
|
||||
# use separate condition to avoid uninitialized variable warning
|
||||
set(@PROJECT_NAME@_FOUND FALSE)
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
set(_@PROJECT_NAME@_CONFIG_INCLUDED TRUE)
|
||||
|
||||
# output package information
|
||||
if(NOT @PROJECT_NAME@_FIND_QUIETLY)
|
||||
message(STATUS "Found @PROJECT_NAME@: @PACKAGE_VERSION@ (${@PROJECT_NAME@_DIR})")
|
||||
endif()
|
||||
|
||||
# warn when using a deprecated package
|
||||
if(NOT "@PACKAGE_DEPRECATED@" STREQUAL "")
|
||||
set(_msg "Package '@PROJECT_NAME@' is deprecated")
|
||||
# append custom deprecation text if available
|
||||
if(NOT "@PACKAGE_DEPRECATED@" STREQUAL "TRUE")
|
||||
set(_msg "${_msg} (@PACKAGE_DEPRECATED@)")
|
||||
endif()
|
||||
# optionally quiet the deprecation message
|
||||
if(NOT @PROJECT_NAME@_DEPRECATED_QUIET)
|
||||
message(DEPRECATION "${_msg}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# flag package as ament-based to distinguish it after being find_package()-ed
|
||||
set(@PROJECT_NAME@_FOUND_AMENT_PACKAGE TRUE)
|
||||
|
||||
# include all config extra files
|
||||
set(_extras "@PACKAGE_CONFIG_EXTRA_FILES@")
|
||||
foreach(_extra ${_extras})
|
||||
include("${@PROJECT_NAME@_DIR}/${_extra}")
|
||||
endforeach()
|
||||
21
build/cpp_srvcli/ament_cmake_core/stamps/package.xml.stamp
Normal file
21
build/cpp_srvcli/ament_cmake_core/stamps/package.xml.stamp
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>cpp_srvcli</name>
|
||||
<version>0.0.0</version>
|
||||
<description>C++ client server tutorial</description>
|
||||
<maintainer email="939387484@qq.com">caixiang</maintainer>
|
||||
<license>Apache-2.0</license>
|
||||
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
|
||||
<depend>rclcpp</depend>
|
||||
<depend>tutorial_interfaces</depend>
|
||||
|
||||
<test_depend>ament_lint_auto</test_depend>
|
||||
<test_depend>ament_lint_common</test_depend>
|
||||
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
||||
@@ -0,0 +1,150 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright 2014-2015 Open Source Robotics Foundation, Inc.
|
||||
#
|
||||
# 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.
|
||||
|
||||
import argparse
|
||||
from collections import OrderedDict
|
||||
import os
|
||||
import sys
|
||||
|
||||
from catkin_pkg.package import parse_package_string
|
||||
|
||||
|
||||
def main(argv=sys.argv[1:]):
|
||||
"""
|
||||
Extract the information from package.xml and make them accessible to CMake.
|
||||
|
||||
Parse the given package.xml file and
|
||||
print CMake code defining several variables containing the content.
|
||||
"""
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Parse package.xml file and print CMake code defining '
|
||||
'several variables',
|
||||
)
|
||||
parser.add_argument(
|
||||
'package_xml',
|
||||
type=argparse.FileType('r', encoding='utf-8'),
|
||||
help='The path to a package.xml file',
|
||||
)
|
||||
parser.add_argument(
|
||||
'outfile',
|
||||
nargs='?',
|
||||
help='The filename where the output should be written to',
|
||||
)
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
try:
|
||||
package = parse_package_string(
|
||||
args.package_xml.read(), filename=args.package_xml.name)
|
||||
except Exception as e:
|
||||
print("Error parsing '%s':" % args.package_xml.name, file=sys.stderr)
|
||||
raise e
|
||||
finally:
|
||||
args.package_xml.close()
|
||||
|
||||
lines = generate_cmake_code(package)
|
||||
if args.outfile:
|
||||
with open(args.outfile, 'w', encoding='utf-8') as f:
|
||||
for line in lines:
|
||||
f.write('%s\n' % line)
|
||||
else:
|
||||
for line in lines:
|
||||
print(line)
|
||||
|
||||
|
||||
def get_dependency_values(key, depends):
|
||||
dependencies = []
|
||||
|
||||
# Filter the dependencies, checking for any condition attributes
|
||||
dependencies.append((key, ' '.join([
|
||||
'"%s"' % str(d) for d in depends
|
||||
if d.condition is None or d.evaluate_condition(os.environ)
|
||||
])))
|
||||
|
||||
for d in depends:
|
||||
comparisons = [
|
||||
'version_lt',
|
||||
'version_lte',
|
||||
'version_eq',
|
||||
'version_gte',
|
||||
'version_gt']
|
||||
for comp in comparisons:
|
||||
value = getattr(d, comp, None)
|
||||
if value is not None:
|
||||
dependencies.append(('%s_%s_%s' % (key, str(d), comp.upper()),
|
||||
'"%s"' % value))
|
||||
return dependencies
|
||||
|
||||
|
||||
def generate_cmake_code(package):
|
||||
"""
|
||||
Return a list of CMake set() commands containing the manifest information.
|
||||
|
||||
:param package: catkin_pkg.package.Package
|
||||
:returns: list of str
|
||||
"""
|
||||
variables = []
|
||||
variables.append(('VERSION', '"%s"' % package.version))
|
||||
|
||||
variables.append((
|
||||
'MAINTAINER',
|
||||
'"%s"' % (', '.join([str(m) for m in package.maintainers]))))
|
||||
|
||||
variables.extend(get_dependency_values('BUILD_DEPENDS',
|
||||
package.build_depends))
|
||||
variables.extend(get_dependency_values('BUILDTOOL_DEPENDS',
|
||||
package.buildtool_depends))
|
||||
variables.extend(get_dependency_values('BUILD_EXPORT_DEPENDS',
|
||||
package.build_export_depends))
|
||||
variables.extend(get_dependency_values('BUILDTOOL_EXPORT_DEPENDS',
|
||||
package.buildtool_export_depends))
|
||||
variables.extend(get_dependency_values('EXEC_DEPENDS',
|
||||
package.exec_depends))
|
||||
variables.extend(get_dependency_values('TEST_DEPENDS',
|
||||
package.test_depends))
|
||||
variables.extend(get_dependency_values('GROUP_DEPENDS',
|
||||
package.group_depends))
|
||||
variables.extend(get_dependency_values('MEMBER_OF_GROUPS',
|
||||
package.member_of_groups))
|
||||
|
||||
deprecated = [e.content for e in package.exports
|
||||
if e.tagname == 'deprecated']
|
||||
variables.append(('DEPRECATED',
|
||||
'"%s"' % ((deprecated[0] if deprecated[0] else 'TRUE')
|
||||
if deprecated
|
||||
else '')))
|
||||
|
||||
lines = []
|
||||
lines.append('set(_AMENT_PACKAGE_NAME "%s")' % package.name)
|
||||
for (k, v) in variables:
|
||||
lines.append('set(%s_%s %s)' % (package.name, k, v))
|
||||
|
||||
lines.append('set(%s_EXPORT_TAGS)' % package.name)
|
||||
replaces = OrderedDict()
|
||||
replaces['${prefix}/'] = ''
|
||||
replaces['\\'] = '\\\\' # escape backslashes
|
||||
replaces['"'] = '\\"' # prevent double quotes to end the CMake string
|
||||
replaces[';'] = '\\;' # prevent semicolons to be interpreted as list separators
|
||||
for export in package.exports:
|
||||
export = str(export)
|
||||
for k, v in replaces.items():
|
||||
export = export.replace(k, v)
|
||||
lines.append('list(APPEND %s_EXPORT_TAGS "%s")' % (package.name, export))
|
||||
|
||||
return lines
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
5
build/cpp_srvcli/ament_cmake_core/stamps/path.sh.stamp
Normal file
5
build/cpp_srvcli/ament_cmake_core/stamps/path.sh.stamp
Normal file
@@ -0,0 +1,5 @@
|
||||
# copied from ament_cmake_core/cmake/environment_hooks/environment/path.sh
|
||||
|
||||
if [ -d "$AMENT_CURRENT_PREFIX/bin" ]; then
|
||||
ament_prepend_unique_value PATH "$AMENT_CURRENT_PREFIX/bin"
|
||||
fi
|
||||
@@ -0,0 +1,112 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright 2014-2015 Open Source Robotics Foundation, Inc.
|
||||
#
|
||||
# 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.
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
|
||||
from ament_package.templates import get_environment_hook_template_path
|
||||
from ament_package.templates import get_package_level_template_names
|
||||
from ament_package.templates import get_package_level_template_path
|
||||
from ament_package.templates import get_prefix_level_template_names
|
||||
from ament_package.templates import get_prefix_level_template_path
|
||||
|
||||
IS_WINDOWS = os.name == 'nt'
|
||||
|
||||
|
||||
def main(argv=sys.argv[1:]):
|
||||
"""
|
||||
Extract the information about templates provided by ament_package.
|
||||
|
||||
Call the API provided by ament_package and
|
||||
print CMake code defining several variables containing information about
|
||||
the available templates.
|
||||
"""
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Extract information about templates provided by '
|
||||
'ament_package and print CMake code defining several '
|
||||
'variables',
|
||||
)
|
||||
parser.add_argument(
|
||||
'outfile',
|
||||
nargs='?',
|
||||
help='The filename where the output should be written to',
|
||||
)
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
lines = generate_cmake_code()
|
||||
if args.outfile:
|
||||
basepath = os.path.dirname(args.outfile)
|
||||
if not os.path.exists(basepath):
|
||||
os.makedirs(basepath)
|
||||
with open(args.outfile, 'w') as f:
|
||||
for line in lines:
|
||||
f.write('%s\n' % line)
|
||||
else:
|
||||
for line in lines:
|
||||
print(line)
|
||||
|
||||
|
||||
def generate_cmake_code():
|
||||
"""
|
||||
Return a list of CMake set() commands containing the template information.
|
||||
|
||||
:returns: list of str
|
||||
"""
|
||||
variables = []
|
||||
|
||||
if not IS_WINDOWS:
|
||||
variables.append((
|
||||
'ENVIRONMENT_HOOK_LIBRARY_PATH',
|
||||
'"%s"' % get_environment_hook_template_path('library_path.sh')))
|
||||
else:
|
||||
variables.append(('ENVIRONMENT_HOOK_LIBRARY_PATH', ''))
|
||||
|
||||
ext = '.bat.in' if IS_WINDOWS else '.sh.in'
|
||||
variables.append((
|
||||
'ENVIRONMENT_HOOK_PYTHONPATH',
|
||||
'"%s"' % get_environment_hook_template_path('pythonpath' + ext)))
|
||||
|
||||
templates = []
|
||||
for name in get_package_level_template_names():
|
||||
templates.append('"%s"' % get_package_level_template_path(name))
|
||||
variables.append((
|
||||
'PACKAGE_LEVEL',
|
||||
templates))
|
||||
|
||||
templates = []
|
||||
for name in get_prefix_level_template_names():
|
||||
templates.append('"%s"' % get_prefix_level_template_path(name))
|
||||
variables.append((
|
||||
'PREFIX_LEVEL',
|
||||
templates))
|
||||
|
||||
lines = []
|
||||
for (k, v) in variables:
|
||||
if isinstance(v, list):
|
||||
lines.append('set(ament_cmake_package_templates_%s "")' % k)
|
||||
for vv in v:
|
||||
lines.append('list(APPEND ament_cmake_package_templates_%s %s)'
|
||||
% (k, vv))
|
||||
else:
|
||||
lines.append('set(ament_cmake_package_templates_%s %s)' % (k, v))
|
||||
# Ensure backslashes are replaced with forward slashes because CMake cannot
|
||||
# parse files with backslashes in it.
|
||||
return [line.replace('\\', '/') for line in lines]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user