Refactoring RTABMapConfig.cmake with targets (#904)

* Config: Using cmake targets

* fixed RTABMAP_DEPRECATED build error

* fixed melodic build

* cleanup

* Fixed qhull exported library error

* Update svg depend private

* removed g2o from public interface

* Fixed Windows with external project

* removed some required dep

* Fixed nsis error (also fixed unspecified components)

* updated workflow rules
This commit is contained in:
matlabbe
2023-02-12 16:18:01 -08:00
committed by GitHub
parent 437ed09335
commit 89e3e10d89
191 changed files with 1150 additions and 2199 deletions
+27 -27
View File
@@ -20,7 +20,7 @@
#ifndef UCONVERSION_H
#define UCONVERSION_H
#include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
#include "rtabmap/utilite/utilite_export.h" // DLL export/import defines
#include <string>
#include <vector>
@@ -48,7 +48,7 @@
* @param after the new character replacing the old one
* @return the modified string
*/
std::string UTILITE_EXP uReplaceChar(const std::string & str, char before, char after);
std::string UTILITE_EXPORT uReplaceChar(const std::string & str, char before, char after);
/**
* Replace old characters in a string with the specified string.
@@ -64,7 +64,7 @@ std::string UTILITE_EXP uReplaceChar(const std::string & str, char before, char
* @param after the new string replacing the old character
* @return the modified string
*/
std::string UTILITE_EXP uReplaceChar(const std::string & str, char before, const std::string & after);
std::string UTILITE_EXPORT uReplaceChar(const std::string & str, char before, const std::string & after);
/**
* Transform characters from a string to upper case.
@@ -77,7 +77,7 @@ std::string UTILITE_EXP uReplaceChar(const std::string & str, char before, const
* @param str the string
* @return the modified string
*/
std::string UTILITE_EXP uToUpperCase(const std::string & str);
std::string UTILITE_EXPORT uToUpperCase(const std::string & str);
/**
* Transform characters from a string to lower case.
@@ -90,53 +90,53 @@ std::string UTILITE_EXP uToUpperCase(const std::string & str);
* @param str the string
* @return the modified string
*/
std::string UTILITE_EXP uToLowerCase(const std::string & str);
std::string UTILITE_EXPORT uToLowerCase(const std::string & str);
/**
* Convert a number (unsigned int) to a string.
* @param number the number to convert in a string
* @return the string
*/
std::string UTILITE_EXP uNumber2Str(unsigned int number);
std::string UTILITE_EXPORT uNumber2Str(unsigned int number);
/**
* Convert a number (int) to a string.
* @param number the number to convert in a string
* @return the string
*/
std::string UTILITE_EXP uNumber2Str(int number);
std::string UTILITE_EXPORT uNumber2Str(int number);
/**
* Convert a number (float) to a string.
* @param number the number to convert in a string
* @return the string
*/
std::string UTILITE_EXP uNumber2Str(float number, int precision=6, bool fixed = false);
std::string UTILITE_EXPORT uNumber2Str(float number, int precision=6, bool fixed = false);
/**
* Convert a number (double) to a string.
* @param number the number to convert in a string
* @return the string
*/
std::string UTILITE_EXP uNumber2Str(double number, int precision=6, bool fixed = false);
std::string UTILITE_EXPORT uNumber2Str(double number, int precision=6, bool fixed = false);
/**
* Convert a string to an integer.
* @param the string
* @return the number
*/
int UTILITE_EXP uStr2Int(const std::string & str);
int UTILITE_EXPORT uStr2Int(const std::string & str);
/**
* Convert a string to a float independent of the locale (comma/dot).
* @param the string
* @return the number
*/
float UTILITE_EXP uStr2Float(const std::string & str);
float UTILITE_EXPORT uStr2Float(const std::string & str);
/**
* Convert a string to a double independent of the locale (comma/dot).
* @param the string
* @return the number
*/
double UTILITE_EXP uStr2Double(const std::string & str);
double UTILITE_EXPORT uStr2Double(const std::string & str);
/**
@@ -145,7 +145,7 @@ double UTILITE_EXP uStr2Double(const std::string & str);
* @param boolean the boolean to convert in a string
* @return the string
*/
std::string UTILITE_EXP uBool2Str(bool boolean);
std::string UTILITE_EXPORT uBool2Str(bool boolean);
/**
* Convert a string to a boolean.
* The format used is :
@@ -153,22 +153,22 @@ std::string UTILITE_EXP uBool2Str(bool boolean);
* @param str the string to convert in a boolean
* @return the boolean
*/
bool UTILITE_EXP uStr2Bool(const char * str);
bool UTILITE_EXP uStr2Bool(const std::string & str);
bool UTILITE_EXPORT uStr2Bool(const char * str);
bool UTILITE_EXPORT uStr2Bool(const std::string & str);
/**
* Convert a string to an array of bytes including the null character ('\0').
* @param str the string
* @return the array of bytes
*/
std::vector<unsigned char> UTILITE_EXP uStr2Bytes(const std::string & str);
std::vector<unsigned char> UTILITE_EXPORT uStr2Bytes(const std::string & str);
/**
* Convert an array of bytes to string, the array of bytes must end with the null character ('\0').
* @param bytes the array of bytes
* @return the string
*/
std::string UTILITE_EXP uBytes2Str(const std::vector<unsigned char> & bytes);
std::string UTILITE_EXPORT uBytes2Str(const std::vector<unsigned char> & bytes);
/**
* Convert a bytes array to an hexadecimal string.
@@ -185,7 +185,7 @@ std::string UTILITE_EXP uBytes2Str(const std::vector<unsigned char> & bytes);
* @param bytesLen the length of the bytes array
* @return the hexadecimal string
*/
std::string UTILITE_EXP uBytes2Hex(const char * bytes, unsigned int bytesLen);
std::string UTILITE_EXPORT uBytes2Hex(const char * bytes, unsigned int bytesLen);
/**
* Convert an hexadecimal string to a bytes array.
* The string must be pair length. The hexadecimal
@@ -200,7 +200,7 @@ std::string UTILITE_EXP uBytes2Hex(const char * bytes, unsigned int bytesLen);
* @param hex the hexadecimal string
* @return the bytes array
*/
std::vector<char> UTILITE_EXP uHex2Bytes(const std::string & hex);
std::vector<char> UTILITE_EXPORT uHex2Bytes(const std::string & hex);
/**
* Convert an hexadecimal string to a bytes array.
* The string must be pair length. The hexadecimal
@@ -215,7 +215,7 @@ std::vector<char> UTILITE_EXP uHex2Bytes(const std::string & hex);
* @param bytesLen the hexadecimal string length
* @return the bytes array
*/
std::vector<char> UTILITE_EXP uHex2Bytes(const char * hex, int hexLen);
std::vector<char> UTILITE_EXPORT uHex2Bytes(const char * hex, int hexLen);
/**
* Convert an hexadecimal string to an ascii string. A convenient way
@@ -233,7 +233,7 @@ std::vector<char> UTILITE_EXP uHex2Bytes(const char * hex, int hexLen);
* @param hex the hexadecimal string
* @return the ascii string
*/
std::string UTILITE_EXP uHex2Str(const std::string & hex);
std::string UTILITE_EXPORT uHex2Str(const std::string & hex);
/**
* Convert hexadecimal (left or right part) value to an ascii character.
@@ -247,7 +247,7 @@ std::string UTILITE_EXP uHex2Str(const std::string & hex);
* @param rightPart If we want the character corresponding to the right of left part (4 bits) of the byte value.
* @return the ascii character (in upper case)
*/
unsigned char UTILITE_EXP uHex2Ascii(const unsigned char & c, bool rightPart);
unsigned char UTILITE_EXPORT uHex2Ascii(const unsigned char & c, bool rightPart);
/**
* Convert an ascii character to an hexadecimal value (right 4 bits).
@@ -261,30 +261,30 @@ unsigned char UTILITE_EXP uHex2Ascii(const unsigned char & c, bool rightPart);
* @param c the ascii character
* @return the hexadecimal value
*/
unsigned char UTILITE_EXP uAscii2Hex(const unsigned char & c);
unsigned char UTILITE_EXPORT uAscii2Hex(const unsigned char & c);
/**
* Format a string like printf, and return it as a std::string
*/
std::string UTILITE_EXP uFormatv (const char *fmt, va_list ap);
std::string UTILITE_EXPORT uFormatv (const char *fmt, va_list ap);
/**
* Format a string like printf, and return it as a std::string
*/
std::string UTILITE_EXP uFormat (const char *fmt, ...);
std::string UTILITE_EXPORT uFormat (const char *fmt, ...);
#ifdef _WIN32
/**
* Convert multi-byte string to unicode (wide-char) string.
* Note that returned whar_t * must be deleted : delete [] wText;
*/
UTILITE_EXP wchar_t * createWCharFromChar(const char * text);
UTILITE_EXPORT wchar_t * createWCharFromChar(const char * text);
/**
* Convert unicode (wide-char) string to multi-byte string.
* Note that returned char * must be deleted : delete [] text;
*/
UTILITE_EXP char * createCharFromWChar(const wchar_t * wText);
UTILITE_EXPORT char * createCharFromWChar(const wchar_t * wText);
#endif
#endif /* UCONVERSION_H */
@@ -20,8 +20,6 @@
#ifndef UDESTROYER_H
#define UDESTROYER_H
#include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
/**
* This class is used to delete a dynamically created
* objects. It was mainly designed to remove dynamically created Singleton.
+2 -2
View File
@@ -20,7 +20,7 @@
#ifndef UDIRECTORY_H
#define UDIRECTORY_H
#include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
#include "rtabmap/utilite/utilite_export.h" // DLL export/import defines
#include <string>
#include <vector>
@@ -31,7 +31,7 @@
*
* This class can be used to get file names in a directory.
*/
class UTILITE_EXP UDirectory
class UTILITE_EXPORT UDirectory
{
public:
/**
+2 -2
View File
@@ -20,7 +20,7 @@
#ifndef UEVENT_H
#define UEVENT_H
#include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
#include "rtabmap/utilite/utilite_export.h" // DLL export/import defines
#include <string>
@@ -54,7 +54,7 @@ class UEventsHandler;
* @see UEventsHandler
* @see getClassName()
*/
class UTILITE_EXP UEvent{
class UTILITE_EXPORT UEvent{
public:
virtual ~UEvent() {}
@@ -20,7 +20,7 @@
#ifndef UEVENTSHANDLER_H
#define UEVENTSHANDLER_H
#include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
#include "rtabmap/utilite/utilite_export.h" // DLL export/import defines
#include "rtabmap/utilite/UEventsSender.h"
class UEvent;
@@ -125,7 +125,7 @@ class UEvent;
* @see UThreadNode
*
*/
class UTILITE_EXP UEventsHandler : public UEventsSender {
class UTILITE_EXPORT UEventsHandler : public UEventsSender {
public:
void registerToEventsManager();
@@ -20,7 +20,7 @@
#ifndef UEVENTSMANAGER_H
#define UEVENTSMANAGER_H
#include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
#include "rtabmap/utilite/utilite_export.h" // DLL export/import defines
#include "rtabmap/utilite/UEventsHandler.h"
#include "rtabmap/utilite/UThreadNode.h"
@@ -75,7 +75,7 @@ private:
* @see addHandler()
* @see removeHandler()
*/
class UTILITE_EXP UEventsManager : public UThread{
class UTILITE_EXPORT UEventsManager : public UThread{
public:
@@ -8,11 +8,11 @@
#ifndef UEVENTSSENDER_H_
#define UEVENTSSENDER_H_
#include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
#include "rtabmap/utilite/utilite_export.h" // DLL export/import defines
class UEvent;
class UTILITE_EXP UEventsSender
class UTILITE_EXPORT UEventsSender
{
public:
UEventsSender(){}
+2 -2
View File
@@ -20,7 +20,7 @@
#ifndef FILE_H
#define FILE_H
#include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
#include "rtabmap/utilite/utilite_export.h" // DLL export/import defines
#include "rtabmap/utilite/UDirectory.h"
#include <string>
@@ -30,7 +30,7 @@
*
* This class can be used to modify/erase files on hard drive.
*/
class UTILITE_EXP UFile
class UTILITE_EXPORT UFile
{
public:
/**
+2 -2
View File
@@ -20,7 +20,7 @@
#ifndef ULOGGER_H
#define ULOGGER_H
#include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
#include "rtabmap/utilite/utilite_export.h" // DLL export/import defines
#include "rtabmap/utilite/UMutex.h"
#include "rtabmap/utilite/UDestroyer.h"
@@ -226,7 +226,7 @@ private:
* @see UDEBUG(), UINFO(), UWARN(), UERROR(), UFATAL()
*
*/
class UTILITE_EXP ULogger
class UTILITE_EXPORT ULogger
{
public:
-2
View File
@@ -24,8 +24,6 @@
\brief Basic mathematics functions
*/
#include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
#include <cmath>
#include <list>
#include <vector>
@@ -20,13 +20,13 @@
#ifndef UPROCESSINFO_H
#define UPROCESSINFO_H
#include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
#include "rtabmap/utilite/utilite_export.h" // DLL export/import defines
/**
* This class is used to get some informations
* about the current process.
*/
class UTILITE_EXP UProcessInfo {
class UTILITE_EXPORT UProcessInfo {
public:
UProcessInfo();
virtual ~UProcessInfo();
+2 -2
View File
@@ -20,7 +20,7 @@
#ifndef UTHREADNODE_H
#define UTHREADNODE_H
#include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
#include "rtabmap/utilite/utilite_export.h" // DLL export/import defines
#include "rtabmap/utilite/UThreadC.h"
@@ -83,7 +83,7 @@
* @see mainLoop()
*
*/
class UTILITE_EXP UThread : public UThreadC<void>
class UTILITE_EXPORT UThread : public UThreadC<void>
{
public:
/**
+3 -3
View File
@@ -20,7 +20,7 @@
#ifndef UTIMER_H
#define UTIMER_H
#include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
#include "rtabmap/utilite/utilite_export.h" // DLL export/import defines
#ifdef _WIN32
#include <windows.h>
@@ -43,7 +43,7 @@
* ...
* @endcode
*/
class UTILITE_EXP UTimer
class UTILITE_EXPORT UTimer
{
public:
UTimer();
@@ -81,7 +81,7 @@ public:
* @return double the interval in seconds.
* @deprecated use elapsed() instead.
*/
UTILITE_DEPRECATED(double getInterval());
UTILITE_DEPRECATED double getInterval();
/**
* This method is used to get the interval of
+2 -2
View File
@@ -20,14 +20,14 @@
#ifndef UVARIANT_H
#define UVARIANT_H
#include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
#include "rtabmap/utilite/utilite_export.h" // DLL export/import defines
#include <string>
#include <vector>
/**
* Experimental class...
*/
class UTILITE_EXP UVariant
class UTILITE_EXPORT UVariant
{
public:
enum Type{
@@ -1,46 +0,0 @@
/*
* utilite is a cross-platform library with
* useful utilities for fast and small developing.
* Copyright (C) 2010 Mathieu Labbe
*
* utilite is free library: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* utilite is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UTILITEEXP_H
#define UTILITEEXP_H
/**
* Used mainly on Windows for dynamic linked libraries (dll).
*/
#if defined(_WIN32)
#if defined(rtabmap_utilite_EXPORTS)
#define UTILITE_EXP __declspec( dllexport )
#else
#define UTILITE_EXP __declspec( dllimport )
#endif
#else
#define UTILITE_EXP
#endif
#ifdef __GNUC__
#define UTILITE_DEPRECATED(func) func __attribute__ ((deprecated))
#elif defined(_MSC_VER)
#define UTILITE_DEPRECATED(func) __declspec(deprecated) func
#else
#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
#define UTILITE_DEPRECATED(func) func
#endif
#endif
@@ -36,6 +36,7 @@
#ifndef _U_Thread_Win32_
#define _U_Thread_Win32_
#include "rtabmap/utilite/utilite_export.h"
#include "rtabmap/utilite/Win32/UWin32.h"
#include "rtabmap/utilite/USemaphore.h"
#include "rtabmap/utilite/UMutex.h"
@@ -87,7 +88,7 @@ template
<
typename Thread_T
>
class UTILITE_EXP UThreadC
class UTILITE_EXPORT UThreadC
{
private:
struct Instance;
@@ -241,7 +242,7 @@ class UTILITE_EXP UThreadC
// Explicit Specialization of void
//
template<>
class UTILITE_EXP UThreadC<void>
class UTILITE_EXPORT UThreadC<void>
{
private:
struct Instance;
@@ -9,8 +9,6 @@
#ifndef _U_Win32_
#define _U_Win32_
#include "rtabmap/utilite/UtiLiteExp.h"
#if !defined(_WINDOWS_)
// WIN32 Excludes
#ifdef WIN32_LEAN_AND_MEAN