Skip to content

Commit 5d2e29d

Browse files
committed
rename libs as modules
1 parent a49201a commit 5d2e29d

File tree

1,813 files changed

+817
-26
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,813 files changed

+817
-26
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@
2222
[submodule "3rdparty/libfyaml"]
2323
path = 3rdparty/libfyaml
2424
url = https://github.com/pantoniou/libfyaml.git
25+
[submodule "3rdparty/mola_common"]
26+
path = 3rdparty/mola_common
27+
url = https://github.com/MOLAorg/mola_common.git

3rdparty/mola_common

Submodule mola_common added at 0cc9ecc

CATKIN_IGNORE

Whitespace-only changes.

COLCON_IGNORE

Whitespace-only changes.

COLCON_IGNORE.README

Lines changed: 0 additions & 7 deletions
This file was deleted.

apps/CMakeLists.txt

Lines changed: 0 additions & 19 deletions
This file was deleted.
File renamed without changes.

modules/mrpt_common/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vscode

modules/mrpt_common/CHANGELOG.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2+
Changelog for package mola_common
3+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
5+
0.4.0 (2024-08-20)
6+
------------------
7+
* Reorganize cmake scripts to make them compatible with both ROS1 catkin and ROS2 ament
8+
* Contributors: Jose Luis Blanco-Claraco
9+
10+
0.3.3 (2024-08-14)
11+
------------------
12+
* make the package to build on ROS 1 too
13+
* Contributors: Jose Luis Blanco-Claraco
14+
15+
0.3.2 (2024-08-09)
16+
------------------
17+
* Fix ament_xmllint warnings
18+
* Contributors: Jose Luis Blanco-Claraco
19+
20+
0.3.1 (2024-04-30)
21+
------------------
22+
* Bump cmake_minimum_required to 3.5
23+
* Fix clang warning
24+
* Contributors: Jose Luis Blanco-Claraco
25+
26+
0.3.0 (2024-01-07)
27+
------------------
28+
* Fix usage of mola:: cmake prefix
29+
* add package file attribute
30+
* Contributors: Jose Luis Blanco-Claraco
31+
32+
0.2.2 (2023-09-08)
33+
------------------
34+
* Fix package name in docs
35+
* Generate ament-correct package for ROS2 builds
36+
* fix lib name in cmake warning message
37+
* Contributors: Jose Luis Blanco-Claraco
38+
39+
0.2.1 (2023-09-02)
40+
------------------
41+
42+
0.2.0 (2023-08-24)
43+
------------------
44+
* First public release as ROS 2 package.

modules/mrpt_common/CMakeLists.txt

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# ------------------------------------------------------------------------------
2+
# A Modular Optimization framework for Localization and mApping
3+
# (MOLA)
4+
#
5+
# Copyright (C) 2018-2025, Jose Luis Blanco-Claraco, contributors (AUTHORS.md)
6+
# All rights reserved.
7+
# Released under BSD-3. See LICENSE file
8+
# ------------------------------------------------------------------------------
9+
10+
# Minimum CMake version: deprecated if <3.5 (as of Apr 2024)
11+
cmake_minimum_required(VERSION 3.5)
12+
13+
if("$ENV{ROS_VERSION}" STREQUAL "2")
14+
set(DETECTED_ROS2 TRUE)
15+
set(PACKAGE_ROS_VERSION 2)
16+
elseif("$ENV{ROS_VERSION}" STREQUAL "1")
17+
set(DETECTED_ROS1 TRUE)
18+
set(PACKAGE_ROS_VERSION 1)
19+
set(CMAKE_CXX_STANDARD 14)
20+
endif()
21+
22+
project(mola_common)
23+
24+
include(GNUInstallDirs) # for install dirs in multilib
25+
include(CMakePackageConfigHelpers)
26+
27+
# Instrumental lib:
28+
add_library(${PROJECT_NAME} INTERFACE)
29+
30+
# Project version:
31+
include(mola-version.cmake)
32+
33+
# Allow build-time finding of this package:
34+
set(mola_common_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Path to mola_common")
35+
36+
# not ament-based builds (standalone, w/o ROS):
37+
if ((NOT DETECTED_ROS2) AND (NOT DETECTED_ROS1))
38+
# Generate: mola_common-version.cmake
39+
include(CMakePackageConfigHelpers)
40+
41+
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.14.0")
42+
set(ARCH_INDEP_FLAG "ARCH_INDEPENDENT")
43+
endif()
44+
45+
write_basic_package_version_file(
46+
# generate to the topmost root binary dir:
47+
${CMAKE_BINARY_DIR}/mola_common-config-version.cmake
48+
VERSION ${MOLA_VERSION_NUMBER_MAJOR}.${MOLA_VERSION_NUMBER_MINOR}.${MOLA_VERSION_NUMBER_PATCH}
49+
COMPATIBILITY AnyNewerVersion
50+
${ARCH_INDEP_FLAG}
51+
)
52+
53+
# Generate: mola_common.cmake
54+
configure_file(
55+
# Input:
56+
mola_common-config.cmake.in
57+
# Output: generate to the topmost root binary dir:
58+
${CMAKE_BINARY_DIR}/mola_common-config.cmake
59+
# Parse: "@var_names@" only
60+
@ONLY
61+
)
62+
63+
# Install files:
64+
install(
65+
FILES
66+
${CMAKE_BINARY_DIR}/${PROJECT_NAME}-config.cmake
67+
${CMAKE_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
68+
${CMAKE_SOURCE_DIR}/mola-version.cmake
69+
DESTINATION
70+
share/${PROJECT_NAME}/cmake
71+
)
72+
73+
# Provide make uninstall:
74+
if (NOT TARGET uninstall)
75+
configure_file(
76+
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
77+
"${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
78+
IMMEDIATE @ONLY)
79+
add_custom_target(uninstall
80+
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/cmake_uninstall.cmake)
81+
endif()
82+
endif()
83+
84+
85+
# -----------------------------------------------------------------------------
86+
# common
87+
# -----------------------------------------------------------------------------
88+
set(CUSTOM_CMAKE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
89+
90+
# Install files common to both, ROS and non-ROS builds:
91+
install(
92+
FILES
93+
${CUSTOM_CMAKE_DIR}/mola_cmake_functions.cmake
94+
${CUSTOM_CMAKE_DIR}/mola-xxx-config.cmake.in
95+
DESTINATION
96+
share/${PROJECT_NAME}/cmake
97+
)
98+
99+
100+
# -----------------------------------------------------------------------------
101+
# ROS1
102+
# -----------------------------------------------------------------------------
103+
if (DETECTED_ROS1)
104+
# Find the required catkin packages
105+
find_package(catkin REQUIRED)
106+
107+
# Declare this project as a catkin package
108+
catkin_package(
109+
CFG_EXTRAS mola_cmake_functions.cmake
110+
)
111+
endif()
112+
113+
# -----------------------------------------------------------------------------
114+
# ROS2
115+
# -----------------------------------------------------------------------------
116+
if (DETECTED_ROS2)
117+
# find dependencies
118+
find_package(ament_cmake REQUIRED)
119+
120+
#ament_target_dependencies(MY_TARGET
121+
# rclcpp...
122+
#)
123+
124+
# Add custom mola cmake macros, as in our non-ament (ROS2) config.cmake file:
125+
# See: mola_common-config.cmake.in
126+
127+
ament_package(
128+
CONFIG_EXTRAS cmake/mola_cmake_functions.cmake
129+
)
130+
endif()

0 commit comments

Comments
 (0)