Skip to content

Commit ea26397

Browse files
committed
chore: make reflect-cpp compilable as ros pacakge
1 parent 633beb0 commit ea26397

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
*.toml
5555
*.ubjson
5656
*.xml
57+
!package.xml
5758
*.yml
5859
*.yaml
5960

@@ -94,4 +95,4 @@ share/python-wheels/
9495
MANIFEST
9596

9697
# Docs
97-
site/
98+
site/

CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,11 @@ if (REFLECTCPP_USE_VCPKG)
141141
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake CACHE STRING "Vcpkg toolchain file")
142142
endif ()
143143

144-
project(reflectcpp VERSION 0.23.0 LANGUAGES CXX)
144+
project(reflect_cpp VERSION 0.23.0 LANGUAGES CXX)
145145

146-
if (PROJECT_IS_TOP_LEVEL)
146+
find_package(ament_cmake QUIET)
147+
148+
if (PROJECT_IS_TOP_LEVEL AND ament_cmake_FOUND)
147149
set(REFLECTCPP_INSTALL ON)
148150
endif()
149151

@@ -508,3 +510,7 @@ set(CPACK_RPM_PACKAGE_REQUIRES "")
508510

509511
include(CPack)
510512

513+
if (ament_cmake_FOUND)
514+
ament_package()
515+
endif()
516+

package.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="3">
4+
<name>reflect_cpp</name>
5+
<version>0.1.0</version>
6+
<description>C++ reflection library</description>
7+
<maintainer email="liuzicheng1987@example.com">liuzicheng1987</maintainer>
8+
<license>MIT</license>
9+
10+
<buildtool_depend>ament_cmake</buildtool_depend>
11+
12+
<export>
13+
<build_type>ament_cmake</build_type>
14+
</export>
15+
</package>

0 commit comments

Comments
 (0)