Comment 3 for bug 1079184

Revision history for this message
Joachim Haga (jobh) wrote : Re: [Bug 1079184] Re: plot-qt does not compile

Yes; but HAS_FOO it is not available to cmake, only to the C
preprocessor, so it has to be checked in every .cpp and .h (the latter
because of the moc step) to avoid an ugly compilation failure. I
think.

On 15 November 2012 15:52, Johan Hake <email address hidden> wrote:
> On 11/15/2012 03:17 PM, Joachim Haga wrote:
>> I believe HAS_FOO are defined at preprocessor level, not at cmake level.
>
> Yes, but they are stored in the dolfin config cmake file which get
> picked up in the local CMakeList file for that demo.
>
>> DOLFIN_ENABLE_FOO should be set if you compile as "make demo_plot-qt" in
>> the tree, but perhaps not if you compile stand-alone? Is that the issue?
>
> Yes, that is what I did. I most often never compile all cpp demos from
> the build directory. When I do that it do indeed compile the demo.
>
>> It is possible to use FOO_FOUND instead, but that will fail if the
>> libraries are installed, but disabled in the DOLFIN build. I guess that
>> could be resolved by suitable #ifdefs.
>
> But HAS_FOO does not get defined if ENABLE_FOO is False, so wouldn't it
> be better to use the former?
>
> Johan
>
>> ** Changed in: dolfin
>> Assignee: (unassigned) => Joachim Haga (jobh)
>>
>