[CMake] Boost on Windows
Andreas Pakulat
apaku at gmx.de
Tue Jun 23 16:34:44 EDT 2009
On 23.06.09 16:17:21, Curtis Rueden wrote:
> > Also, Looking at the CMakeLists.txt file it seems you are trying to parse
> > the Boost_THREAD library variable for something? If you are trying to
> > differentiate between the Release and Debug versions there are the following
> > variables for each boost library.
> >
> > Boost_PROGRAM_OPTIONS_LIBRARY
> > Boost_PROGRAM_OPTIONS_LIBRARY_DEBUG
> > Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE
> >
> > Any of that help?
> >
>
> Thanks, I didn't know about Boost_THREAD_LIBRARY_DEBUG. That helps me
> eliminate a little bit of code.
>
> Anyway, Arnaud Gelas and I took a look at FindBoost.cmake, and discovered
> the problem. FIND_PATH is called to populate Boost_INCLUDE_DIR, but not
> until line 478 (CMake 2.6-patch4), whereas the components are checked before
> that (e.g., around line 303 there is an "IF(Boost_INCLUDE_DIR)" block that
> never executes).
>
> Andreas, shouldn't FIND_PATH be called right away, and once the
> Boost_INCLUDE_DIR is known, then subsequently check for individual
> components of Boost?
You're misreading the FindBoost.cmake code apparently :)
First there's a bit of checking wether we've already found boost and
have stuff in the cache. Then there's setup of a couple of variables
(where to search boost, which versions, take BOOST_ROOT etc. into
account).
Then there's a loop going over the versions and appending a proper
versioned path to the list of include-dirs to be searched. (line 306 and
following, not sure which cmake 2.6 version I have here)
Then comes the find_path for the boost version header, from which the
actual version number is extracted (as there are installations that just
have <includedir>/version.hpp and no version in the includedir)
Afterwards a bit of variables are setup to search for the various
possible names of libs and then under the heading "Begin finding the
boost libs" in line 438 are the actual libs being searched for.
That block you mention in line 303 is actually executed, but only on the
first run of cmake (or if boost is not found on that run also on
subsequent runs).
Andreas
--
You attempt things that you do not even plan because of your extreme stupidity.
More information about the CMake
mailing list