How to determine PCL (Point Cloud Library) version in C++ code?
Asked Answered
C

2

5

Is there any way to check PCL version in C++ code?
I need compatibility between 1.6 and 1.7 on source code level, i. e. something like this:

#if PCL_VERSION >= 1.7
// some tasty functionality
#else
some old replacement
#endif
Cyrene answered 12/9, 2015 at 14:18 Comment(0)
P
6

The PCL version and some other useful preprocessor macros are defined in "pcl_config.h" header file. For example, to conditionally compile some fallback code for versions lower than 1.7.2, you can write:

#include <pcl/pcl_config.h>

#if PCL_VERSION_COMPARE(<, 1, 7, 2)
  ... fallback code ...
#endif
Pratique answered 13/9, 2015 at 10:3 Comment(0)
M
4

If you just want to see PCL version,

#include <pcl/pcl_config.h>
std::cout << PCL_VERSION << std::endl;

For example, 100901 meaning 1.9.1.

Meeks answered 4/5, 2019 at 0:40 Comment(1)
There's also PCL_VERSION_PRETTY.Survival

© 2022 - 2024 — McMap. All rights reserved.