[CMake] Re: FindBoost.cmake: please test

Hendrik Sattler post at hendrik-sattler.de
Sun Jan 20 13:45:03 EST 2008


Am Sonntag 20 Januar 2008 schrieb Andreas Pakulat:
> On 20.01.08 15:38:44, Rodolfo Lima wrote:
> > Andreas Pakulat escreveu:
> > > The reason I did that was to simplify the module code.
> >
> > I see, but this variable is only used in a if clause, so instead of
> > writing
> >
> > IF( Boost_USE_NONMULTITHREADED )
> >     SET (_boost_MULTITHREADED "")
> > ENDIF( Boost_USE_NONMULTITHREADED )
> >
> > you could write
> >
> > IF(NOT Boost_USE_MULTITHREADED )
> >     SET (_boost_MULTITHREADED "")
> > ENDIF(NOT Boost_USE_MULTITHREADED )
> >
> > with the same semantics of the former clause, isn't it?
>
> No, because the default should be to use the multithreaded version.
> Actually I currently don't see a way to do this in CMake, without
> requiring the user to set Boost_USE_MULTITHREAD always.

if ( NOT DEFINED Boost_USE_MULTITHREADED )
  set ( Boost_USE_MULTITHREADED ON CACHE BOOL "" FORCE )
endif ( NOT DEFINED Boost_USE_MULTITHREADED )

The user can then switch it off in ccmake easily. Note: ccmake only 
understands ON/OFF for BOOL.

HS


More information about the CMake mailing list