Search code examples
c++point-cloud-library

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

Solution

  • 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