Skip to content

Commit

Permalink
Add basic ament package template
Browse files Browse the repository at this point in the history
  • Loading branch information
asherikov committed Sep 9, 2024
1 parent dba9776 commit fcfcf9e
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 10 deletions.
10 changes: 0 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,6 @@ private_build: assert_PKG_arg_must_be_specified
--packages-up-to ${PKG}


new: assert_PKG_arg_must_be_specified
mkdir -p "${WORKSPACE_SRC}"
cp -R ${CCWS_DIR}/pkg_template/catkin "${WORKSPACE_SRC}/${PKG}"
mkdir -p "${WORKSPACE_SRC}/${PKG}/include/${PKG}"
cd "${WORKSPACE_SRC}/${PKG}"; git init
find "${WORKSPACE_SRC}/${PKG}" -type f | xargs sed -i "s/@@PACKAGE@@/${PKG}/g"
find "${WORKSPACE_SRC}/${PKG}" -type f | xargs sed -i "s/@@AUTHOR@@/${AUTHOR}/g"
find "${WORKSPACE_SRC}/${PKG}" -type f | xargs sed -i "s/@@EMAIL@@/${EMAIL}/g"
find "${WORKSPACE_SRC}/${PKG}" -type f | xargs sed -i "s/@@LICENSE@@/${LICENSE}/g"

add:
test -f "${WORKSPACE_SRC}/.${REPO_LIST_FORMAT}" || ${MAKE} wsinit
bash -c "\
Expand Down
44 changes: 44 additions & 0 deletions ccws/examples/pkg_ament/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
cmake_minimum_required(VERSION 3.16)
project(@@PACKAGE@@)

#if(CCWS_CLANG_TIDY)
# set(CMAKE_CXX_CLANG_TIDY "${CCWS_CLANG_TIDY}" CACHE STRING "" FORCE)
#endif()
#if(CCWS_CXX_FLAGS)
# set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CCWS_CXX_FLAGS}")
# set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CCWS_LINKER_FLAGS}")
#else()
# set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# set(CMAKE_VERBOSE_MAKEFILE ON)
#
# if(NOT CMAKE_CXX_STANDARD)
# set(CMAKE_CXX_STANDARD 17)
# set(CMAKE_CXX_STANDARD_REQUIRED ON)
# endif()
#
# if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# add_compile_options(-Wall -Wextra -Wpedantic -Werror)
# endif()
#endif()


# find dependencies
find_package(ament_cmake REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)


if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
File renamed without changes.
18 changes: 18 additions & 0 deletions ccws/examples/pkg_ament/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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>@@PACKAGE@@</name>
<version>0.1.0</version>
<description>The @@PACKAGE@@ package</description>
<maintainer email="@@EMAIL@@">@@AUTHOR@@</maintainer>
<license>@@LICENSE@@</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>
File renamed without changes.
1 change: 1 addition & 0 deletions ccws/examples/pkg_catkin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@@PACKAGE@@
File renamed without changes.
19 changes: 19 additions & 0 deletions ccws/make/new.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
new: assert_PKG_arg_must_be_specified
mkdir -p "${WORKSPACE_SRC}"
${MAKE} new_${OS_DISTRO_BUILD}
mkdir -p "${WORKSPACE_SRC}/${PKG}/include/${PKG}"
cd "${WORKSPACE_SRC}/${PKG}"; git init
find "${WORKSPACE_SRC}/${PKG}" -type f | xargs sed -i "s/@@PACKAGE@@/${PKG}/g"
find "${WORKSPACE_SRC}/${PKG}" -type f | xargs sed -i "s/@@AUTHOR@@/${AUTHOR}/g"
find "${WORKSPACE_SRC}/${PKG}" -type f | xargs sed -i "s/@@EMAIL@@/${EMAIL}/g"
find "${WORKSPACE_SRC}/${PKG}" -type f | xargs sed -i "s/@@LICENSE@@/${LICENSE}/g"

new_bionic: new_focal
# passthrough

new_focal:
cp -R ${CCWS_DIR}/examples/pkg_catkin "${WORKSPACE_SRC}/${PKG}"

new_jammy:
cp -R ${CCWS_DIR}/examples/pkg_ament "${WORKSPACE_SRC}/${PKG}"

0 comments on commit fcfcf9e

Please sign in to comment.