简体   繁体   中英

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, ie something like this:

#if PCL_VERSION >= 1.7
// some tasty functionality
#else
some old replacement
#endif

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM