Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 799
avtomaton Avatar asked Jan 07 '23 14:01

avtomaton


2 Answers

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
like image 171
taketwo Avatar answered Jan 30 '23 12:01

taketwo


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.

like image 45
Cloud Cho Avatar answered Jan 30 '23 11:01

Cloud Cho