From 3e4bbd82cbe0b6e6f9def6f9f5346af3ee0fbcbb Mon Sep 17 00:00:00 2001 From: Alon Druck Date: Mon, 25 Mar 2024 14:47:23 -0300 Subject: [PATCH] Create beluga_tutorial package (#305) Signed-off-by: Alon Druck --- beluga_tutorial/CMakeLists.txt | 37 +++++++++++++++++++++++++++++++ beluga_tutorial/cmake/ament.cmake | 30 +++++++++++++++++++++++++ beluga_tutorial/package.xml | 23 +++++++++++++++++++ beluga_tutorial/src/main.cpp | 11 +++++++++ 4 files changed, 101 insertions(+) create mode 100644 beluga_tutorial/CMakeLists.txt create mode 100644 beluga_tutorial/cmake/ament.cmake create mode 100644 beluga_tutorial/package.xml create mode 100644 beluga_tutorial/src/main.cpp diff --git a/beluga_tutorial/CMakeLists.txt b/beluga_tutorial/CMakeLists.txt new file mode 100644 index 000000000..6a6844673 --- /dev/null +++ b/beluga_tutorial/CMakeLists.txt @@ -0,0 +1,37 @@ +# Copyright 2024 Ekumen, 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. + +cmake_minimum_required(VERSION 3.16) + +project(beluga_tutorial) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +if(NOT CMAKE_BUILD_TYPE) + message(STATUS "Setting build type to 'Release' as none was specified.") + set(CMAKE_BUILD_TYPE + "Release" + CACHE STRING "Build type" FORCE) +endif() + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options( + -Wall + -Wconversion + -Wextra + -Werror + -Wpedantic) +endif() + +include(cmake/ament.cmake) diff --git a/beluga_tutorial/cmake/ament.cmake b/beluga_tutorial/cmake/ament.cmake new file mode 100644 index 000000000..19ceed799 --- /dev/null +++ b/beluga_tutorial/cmake/ament.cmake @@ -0,0 +1,30 @@ +# Copyright 2024 Ekumen, 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. + +set(executable_name ${PROJECT_NAME}_main) + +add_executable(${executable_name} + src/main.cpp +) + +install(TARGETS ${executable_name} + RUNTIME DESTINATION lib/${PROJECT_NAME} +) + +install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME}) + +if(BUILD_TESTING) + # enable_testing() + # add_subdirectory(test) +endif() diff --git a/beluga_tutorial/package.xml b/beluga_tutorial/package.xml new file mode 100644 index 000000000..094b4d65e --- /dev/null +++ b/beluga_tutorial/package.xml @@ -0,0 +1,23 @@ + + + + beluga_tutorial + 1.0.0 + + Tutorial to interface with Beluga. + + Gerardo Puga + Michel Hidalgo + Nahuel Espinosa + Alon Druck + + Apache License 2.0 + + cmake + + beluga + + + cmake + + diff --git a/beluga_tutorial/src/main.cpp b/beluga_tutorial/src/main.cpp new file mode 100644 index 000000000..bd609458d --- /dev/null +++ b/beluga_tutorial/src/main.cpp @@ -0,0 +1,11 @@ +// https://github.com/Ekumen-OS/beluga/issues/279#issuecomment-1903914387 + +#include +#include + +int main() +{ + std::cout << "beluga tutorial - main.cpp executed!!" << std::endl; + + return 0; +} \ No newline at end of file