Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pcl version check for letting users know the version issue #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ endif()

if (BUILD_WITH_PCL)
find_package(PCL REQUIRED)
if(PCL_VERSION VERSION_LESS "1.11.0")
message(FATAL_ERROR "The found PCL version ${PCL_VERSION} is too low. Required is at least 1.11.0")
endif()
Comment on lines 58 to +61
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be simplified to just

Suggested change
find_package(PCL REQUIRED)
if(PCL_VERSION VERSION_LESS "1.11.0")
message(FATAL_ERROR "The found PCL version ${PCL_VERSION} is too low. Required is at least 1.11.0")
endif()
find_package(PCL 1.11.0 REQUIRED)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So nice, @valgur, but if so, what if one uses PCL 1.12. or more higher version?
Plus, it's my personal question, but I'm curious whether it is possible to install multiple PCL versions on a machine. Thx!

Copy link
Owner

@koide3 koide3 Apr 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LimHyungTae
Thanks for your contribution. The way suggested by @valgur only specifies the minimum required version and should accept newer versions.

Possibly you can switch different PCL versions with some cmake arguments. But, I'm not very familiar with the way handling multiple versions of a library in cmake.

add_compile_definitions(BUILD_WITH_PCL)
if (NOT TARGET PCL::PCL)
add_library(PCL::PCL INTERFACE IMPORTED)
Expand Down