Boost logo

Boost Interest :

Subject: Re: [Boost-cmake] Another small issue with Boost.CMake and FindBoost.cmake
From: Michael Jackson (mike.jackson_at_[hidden])
Date: 2009-12-16 14:41:57

On 12/16/09 2:11 PM, in article 87fx7a3fa0.fsf_at_[hidden], "Troy D.
Straszheim" wrote:

> Michael Jackson <mike.jackson_at_[hidden]> writes:
>> On 12/16/09 1:41 PM, in article
>> 2A66CBE0-57C7-45D4-8D44-CDDC6B93557F_at_[hidden],
>> "Michael Jackson"
>> wrote:
>>> Trying things out on windows and I noticed that when I build static
>>> libraries that the names of the libraries are NOT prefixed with "lib"
>>> like in the bjam version of the build. This causes the FindBoost
>>> included with CMake 2.6.4 and 2.8.0 to NOT find an installed boost on
>>> Windows using Visual Studio.
>>> Where would this sort of thing be set in the CMake files?
>>> _________________________________________________________
>>> Mike Jackson
>> On line 705 of BoostCore.cmake is the line that sets the library prefix
>> using the LIBPREFIX variable. From what I can tell this cmake variable is
>> Not set anywhere else in the build system (at least that I can find). Adding
>> a Cmake cache entry for LIBPREFIX:STRING=lib on windows for static builds
>> allowed the proper naming. Not sure if this is by design or got left out by
>> accident.
>> Maybe we need a "bjam" compatible mode to set all these types of things for
>> the next few releases of boost and Cmake. At least until Cmake as it is
>> distributed can handle the new paths in the boost installation.
> I'm almost certain this is simple oversight. I'm reliant on windows
> guys for testing. You may just be the first to look carefully at this.
> -t

In the FindBoost.cmake file there is a line like:

  # Setting some more suffixes for the library
  SET (Boost_LIB_PREFIX "")
  if ( WIN32 AND Boost_USE_STATIC_LIBS )
    SET (Boost_LIB_PREFIX "lib")

Which means the Boost.Cmake project really needs to mimic this, which it
tried to do, but just missed like you said, probably just over looked it.

In that same BoostCore.cmake file there is:

# On Windows, we need static and shared libraries to have
# different names, so we follow the Boost.Build version 2 style
# and prepend "lib" to the name.
       PREFIX "${LIBPREFIX}" <===== Probably just change this?
Change that to:

       PREFIX "lib"

Mike Jackson

Boost-cmake list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at