[CMake] Why FindBoost messaging not unified?

Fabio Fracassi fabio.fracassi at charite.de
Fri Oct 9 06:05:41 EDT 2009


Philip Lowman schrieb:
> If you have any other CMake related suggestions please feel free to 
> accompany your mailing list posts with a feature request and/or patch 
> on the bugtracker if you have the time.
>
> http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/FindBoost.cmake?root=CMake&view=log 
> <http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/FindBoost.cmake?root=CMake&view=log>
>
I have always wondered why FindBoost doesn't add some speculative future 
Versions into _Boost_KNOWN_VERSIONS so that at least the Boost versions 
that are likely to appear during the lifecycle of the current CMake 
version are found without resorting to user supplied 
Boost_ADDITIONAL_VERSIONS. There is no harm in searching for versions 
that are never going to be released (except maybe longer search time), 
is there?

I was thinking of something along the lines of the attached patch.
Or is this a horrible idea?

regards

Fabio

--- a/FindBoost.cmake
+++ b/FindBoost.cmake
@@ -285,10 +285,21 @@ if(Boost_FIND_VERSION_EXACT)
 else(Boost_FIND_VERSION_EXACT)
   # The user has not requested an exact version.  Among known
   # versions, find those that are acceptable to the user request.
+ 
+  # To make this a bit more "furure-proof" we speculate a bit on
+  # what versions of boost might be released in the future
+  # Of course these versions should be moved to _Boost_KNOWN_VERSIONS
+  # proper once they are released, or pruned when it is clear that they
+  # are not going to come out.
+  set(_Boost_FUTURE_VERSIONS
+    "1.40.1" "1.41.0" "1.41" "1.41.1" "1.42.0" "1.42" "1.42.1"
+    "1.43.0" "1.43" "1.43.1" "1.44.0" "1.44" "1.44.1")
+
   set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
     "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37"
     "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
-    "1.34" "1.33.1" "1.33.0" "1.33")
+    "1.34" "1.33.1" "1.33.0" "1.33"
+    ${_Boost_FUTURE_VERSIONS})
   set(_boost_TEST_VERSIONS)
   if(Boost_FIND_VERSION)
     set(_Boost_FIND_VERSION_SHORT 
"${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
-- 


More information about the CMake mailing list