Hi Adam~

[Adam]
Are you sure this logic is right? It looks very odd. Does CMake set WIN32 for a 
64-bit Windows toolchain? Didn't you say you were building on Linux?

[Kent]
My software compiles cross platform, and we support windows too.  WIN32 is set 
for 64bit platforms.  I do have the windows build compiling properly with 
boost.  I'm specifically having problems with linux.

[Adam]
You don't set ADDITIONAL_VERSIONS. That's probably not the problem.
IIRC, it's:
set(Boost_ADDITIONAL_VERSIONS "1.44 1.44.0")

[Kent]
I did not originally set Boost_ADDITIONAL_VERSIONS.  I did set it now, and ran 
a clean recompile, but no change.  My Boost_LIBRARIES still came out as:
-- Boost_LIBRARIES: /usr/lib/libboost_program_options-mt.a

Even though I've specified BOOST_LIBRARYDIR as:
BOOST_LIBRARYDIR = /home/kknox/sdk/boost_1_44_0/stage/lib

Kent

-----Original Message-----
From: Adam J Richardson [mailto:[email protected]] 
Sent: Thursday, November 04, 2010 4:56 AM
To: Knox, Kent
Cc: [email protected]
Subject: Linking Boost on Linux on 64bit host and 32bit target

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 04 Nov 2010 04:35:57 -0400
[email protected] wrote:
> Hi all~

Hi Kent.

> I have a project using Boost that should compile for both 64bit and 
> 32bit on a 64bit host.  This works fine for a 64bit target, but I 
> can't get this to work for a 32bit target.

I'm having problems linking Boost too. But enough about me.

> In order to compile for 32bit on a 64bit host, I have a -D parameter 
> called BUILD64.  Here is my logic to initialize this var:
> 
> if( WIN32 )
>       set( BUILD64 ${CMAKE_CL_64} )
> else()
>       option( BUILD64 "Build a 64-bit product" OFF )
>       if( BUILD64 )
>               message( STATUS "64-bit build" )
>       endif( )
> endif()

Are you sure this logic is right? It looks very odd. Does CMake set
WIN32 for a 64-bit Windows toolchain? Didn't you say you were building on Linux?

> The syntax for finding boost is thus:
> set( Boost_USE_MULTITHREADED ON )
> set( Boost_USE_STATIC_LIBS   ON )
> set( Boost_DETAILED_FAILURE_MSG   ON )
> # set( Boost_DEBUG ON )
> find_package( Boost 1.33.0 COMPONENTS program_options )

You don't set ADDITIONAL_VERSIONS. That's probably not the problem.
IIRC, it's:

set(Boost_ADDITIONAL_VERSIONS "1.44 1.44.0")

... if you wanted to try it anyway.

Regards,
Adam J Richardson
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkzSgx0ACgkQSUH6dLOqvqmfKwCg6qttDVOXnpqHYoZwfjzUyHax
ubMAniQAF6EYxsIUYkqXPQiMwFxop6uB
=ngaQ
-----END PGP SIGNATURE-----

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to