ycm-cmake-modules
ycm-cmake-modules copied to clipboard
FindOrBuildPackage should check the version all the times
- On the system you have version 1.0 of the package
X - Module
ArequiresXversion 1.0 - Module
BrequiresXversion 1.0 - Module
CrequiresXversion 2.0 - Module
DrequiresXversion 1.0
Assuming that the config files for package X are written properly, CMakeLists.txt will be something like this:
find_or_build_package(A) # -> will call BuildA.cmake
find_or_build_package(B) # -> will call BuildB.cmake
find_or_build_package(C) # -> will call BuildC.cmake
find_or_build_package(D) # -> will call BuildD.cmake
Build{A,B,D}.cmake will have a line:
find_or_build_package(X 1.0)
BuildB.cmake will have a line:
find_or_build_package(X 2.0)
What I expect is that at configure time
-
BuildA.cmakecallsfind_or_build_package(X 1.0). -
find_or_build_package(X 1.0)will findXversion 1.0 and will be happy and mark theXversion 1.0 as available on the system -
BuildB.cmakecallsfind_or_build_package(X 1.0). -
find_or_build_package(X 1.0)should know that a version is available, check the version and since 1.0 is ok, will do nothing. -
BuildC.cmakecallsfind_or_build_package(X 2.0). -
find_or_build_package(X 2.0)should know that a version is already available, but should still check the version, and since 1.0 is not compatible will mark theXversion 2.0 as built by the superbuild -
BuildD.cmakecallsfind_or_build_package(X 1.0). -
find_or_build_package(X 1.0)should know that a version is available, and since this version is built by the superbuild will assume that this version is ok, and will do nothing (if 1.0 and 2.0 are not compatible this should be handled in some other way i.e. consideringXversion 1.0 andXversion 2.0 as 2 different packagesX1andX2, and this is not part of this issue).
Unfortunately, in the configure phase the version is checked only the first time, the other will assume that the version found is ok.