enable/disable for cmake

Elan Ruusamäe glen at pld-linux.org
Wed May 28 10:20:53 CEST 2014


On 27.05.2014 17:39, Jakub Bogusz wrote:
> On Mon, May 26, 2014 at 10:08:00PM +0300, Elan Ruusamäe wrote:
>> for autotools we have macros for --enable, --disable, --with --without
>> http://git.pld-linux.org/?p=packages/rpm-build-macros.git;a=blob;f=rpm.macros;h=fb44ba49b4492d80ddf696d04c427b16f9661d96;hb=b89253d0468b9a528a89c47bfc36e7274666310f#l339
>>
>> would be nice to have same for cmake as well
>> how to name them?
>>
>> for cmake it's simplier: need only one macro, as there's only need for
>> -DFOO=ON|OFF
> Is there any advantage?
> I don't find %{__cmake_on foo FOO} more readable than %{?with_foo:-DFOO=ON}.
but what if you need to set OFF as well?

is this readable?
     -DWITH_UTEMPTER=O%{!?with_utempter:FF}%{?with_utempter:N} \

it's definately more typing!

> I'm already confused sometimes, which argument to __with_without is
> bcond name and which is option... __with_unless, __without_if and
> __with_without_not are even less straight.
but as said, for cmake imho only one macro needed:

%{__cmake_bool foo}

i don't see point having separate macros for OFF and ON,
we should always set value not depend on project default.


-- 
glen



More information about the pld-devel-en mailing list