Boost logo

Boost :

Subject: Re: [boost] Boost CMake support - Request for Comment
From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2018-10-16 14:39:17


On Tue, Oct 16, 2018 at 9:13 AM Edward Diener via Boost <
boost_at_[hidden]> wrote:

> On 10/16/2018 3:34 AM, Alexander Grund via Boost wrote:
> >
> > Similar for predef:
> > include(BoostPredefCheck)
> > boost_predef_check(RESULT "BOOST_OS_WINDOWS != 0" "BOOST_OS_VMS != 0")
> > if(RESULT) add_executable(...) endif()
> >
> > Work is about the same and yes some checks can be omitted (e.g.
> > boost_predef_check(RESULT "BOOST_OS_WINDOWS != 0") --> RESULT==WIN32
> > standard CMake variable)
>
> Even if there is a standard CMake variable it would be worthwhile to
> have the check so that libraries which use the check can use the same
> syntax throughout.
>

Actually the CMake built-in is not equivalent to the Predef version AFAICT.
For instance the Predef version can compare against version numbers, and
not just zero and non-zero unlike the CMake WIN32 boolean var. The next
closest CMake var would be CMAKE_SYSTEM_VERSION.. Although I do love how
the format of the version number is not documented for that :-) Hence the
closer equivalent would be "WIN32 && CMAKE_SYSTEM_VERSION != 0" (where 0
could be 8.1 maybe?). Also in B2 you wouldn't use Predef for checking the
OS like above. You would just use the built in "<target-os>windows" feature.

-- 
-- Rene Rivera
-- Grafik - Don't Assume Anything
-- Robot Dreams - http://robot-dreams.net

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk