[CMake] FindBoost: find both win32 and x64 static libs
Hicham Mouline
hicham at mouline.org
Sat Dec 4 07:18:24 EST 2010
I was wrong. Dmytro pointed out that bjam allows building boost libraries
with the compiler and bitness in the boost library name --layout=versioned.
Therefore, I could have both 32 and 64bit versions in the same directory.
I wonder then if FindBoost is able to detect automatically the right ones
based on the name of the libs.
regards
From: philiplowman at gmail.com [mailto:philiplowman at gmail.com] On Behalf Of
Philip Lowman
Sent: 04 December 2010 11:03
To: Hicham Mouline
Cc: CMake mailing list
Subject: Re: [CMake] FindBoost: find both win32 and x64 static libs
On Tue, Nov 30, 2010 at 5:37 PM, Hicham Mouline <hicham at mouline.org> wrote:
As boost libraries naming convention doesn't include in the lib names
whether they are built by msvc9 win32 or x64, I am forced on a winxp 64 box
where I hold both versions to have a different lib directory under
boost_root.
I set BOOST_ROOT then call FIND_PACKAGE(Boost 1.44 COMPONENTS ...).
Am I supposed to detect which of vc9 32bit or 64bit am I generating for and
then set BOOST_LIBRARYDIR depending on that before calling FIND_PACKAGE?
How do I detect bitness?
You could try something like this:
include(CheckTypeSize)
CHECK_TYPE_SIZE(void* SIZEOF_PTR)
message("size of pointer = ${SIZEOF_PTR}")
Then if SIZEOF_PTR is 4, you would set BOOST_LIBRARYDIR to be
${BOOST_ROOT}/lib32 and if it is 8, you set it to ${BOOST_ROOT}/lib64.
--
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101204/62ebd770/attachment-0001.htm>
More information about the CMake
mailing list