Okay with your help, I change a little...
rule evaluate-header-is-available ( properties * : header-file * )
{
if [ path.exists $(header-file) ]
{
echo $(header-file) "= found" ;
return $(properties) ;
}
else
{
echo $(header-file) "= not found" ;
}
}
and after in my project I use the rule:
[ evaluate-header-is-available <define>FLAG_NEEDED_TO_DEFINE : /usr/include/unistd.h ]
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 mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users