Boost logo

Boost Users :

Subject: Re: [Boost-users] conditional define
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-03-16 11:57:47


AMDG

On 03/16/2012 06:58 AM, Marc-Antoine ARNAUD wrote:
> I'm using boost BJam to build my project with externals librairies.
> And I need to define variables if I found headers on the machine.
>
> How can we do that ?
>
> project
> : requirements
> <include>.
> <define>FLAG_NEEDED_TO_DEFINE => I need to define only if I found
> header.
> ;
>
>
> lib library : [ glob *.cpp ] ;
>

At the moment the easiest way to do this is:

// header.cpp
#include <header.h>

# Jamfile

import configure ;

obj header_test : header.cpp ;

project
  : requirements
    [ configure.check-target-builds header_test
      "header.h exists" : <define>FLAG_NEEDED_TO_DEFINE ] ;

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net