-
Notifications
You must be signed in to change notification settings - Fork 757
cmake: relax package compatibility constraints #1298
Conversation
This relaxes the compatibility constraints to what cmake calls "SameMajorVersion", ie., the version found must be >= than the version requested, and major has to match exactly. This essentially uses the same code as cmake's `write_basic_package_version_file()`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave FALSE
initialization of the UNSUITABLE
and EXACT
flags in. I've learned not to make assumptions about the initial state of variables used to communicate with CMake's internals, and prefer being explicit in these cases.
Otherwise this looks good to me. Thanks for taking the time to fix this up!
I can put the initialization back in, I agree that it makes it more self-contained. I actually got curious, because the documentation does not really say anything about a default for those variables, but the cmake-provided standard config-version creator assumed them to be false. So I looked at the cmake source code. It does explicitly unset those variables (which makes them evaluate to false), so it is well defined the way it is, but again, it's clearer if we set them explicitly. |
FWIW, not sure that was clear, I did put the initialization to |
LGTM, I'll merge this soon. |
Will merge once I update CUB to match. |
Specifically, this ports the following PRs to CUB: - NVIDIA/thrust#1297 Add install rule option for add_subdirectory users. - NVIDIA/thrust#1298 Enforce semantic versioning in CMake version configs. - NVIDIA/thrust#1300 Use FindPackageHandleStandardArgs in CMake config.
Specifically, this ports the following PRs to CUB: - NVIDIA/thrust#1297 Add install rule option for add_subdirectory users. - NVIDIA/thrust#1298 Enforce semantic versioning in CMake version configs. - NVIDIA/thrust#1300 Use FindPackageHandleStandardArgs in CMake config.
This relaxes the compatibility constraints to what cmake calls "SameMajorVersion", ie., the version found must be >= than the
version requested, and major has to match exactly.
This essentially uses the same code as cmake's
write_basic_package_version_file()
.Fixes #1293.