cmake-utils.eclass currently defines 10 helper functions to assist in
configuring packages.
For example:
local mycmakeargs=(
$(cmake-utils_use_with foo LibFoo)
)
which outputs -DWITH_LibFoo=ON or OFF
Most of these helpers were introduced before, and could be replaced by,
usex:
local mycmakeargs=(
-DWITH_LibFoo=$(usex foo)
)
In bug #514384 it has been discussed banning many/all of these helpers
in EAPI 6 and later.
With usex, it's much clearer what actually get passed to cmake, reducing
the chance of incorrect arguments, but $(cmake-utils_use_with foo
LibFoo) is considered by some to be cleaner-looking and nicer to read
than -DWITH_LibFoo=$(usex foo)
The helpers also pass the same option multiple times with different
capitalisation variants:
$(cmake-utils_use_with foo) emits -DWITH_foo=OFF -DWITH_FOO=OFF
-DWITH_Foo=OFF
This makes ebuild maintenance a little bit easier, at the expense of
being less "correct" and unknown configure option warnings useless
The helpers themselves are listed below in order of the number of
packages using them:
cmake-utils_use_with 135
cmake-utils_use_enable 106
cmake-utils_use_build 89
cmake-utils_use_find_package 75
cmake-utils_use_use 37
cmake-utils_use_disable 14
cmake-utils_use_want 10
cmake-utils_use_has 8
cmake-utils_use_no 3
cmake-utils_useno 2
What do you think?