Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 557280

Summary: cmake-utils.eclass: mycmakeargs & MYCMAKEARGS are different variables with special behavior
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: EclassesAssignee: Gentoo KDE team <kde>
Status: RESOLVED WONTFIX    
Severity: normal CC: qa
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-08-11 06:27:43 UTC
This is really awfully ugly. Long story short:

    local cmakeargs=(
        ${warn_unused_cli}
        -C "${common_config}"
        -G "$(_generator_to_use)"
        -DCMAKE_INSTALL_PREFIX="${EPREFIX}${PREFIX}"
        "${mycmakeargs_local[@]}" # <-- here mycmakeargs are added
        -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}"
        -DCMAKE_INSTALL_DO_STRIP=OFF
        -DCMAKE_USER_MAKE_RULES_OVERRIDE="${build_rules}"
        -DCMAKE_TOOLCHAIN_FILE="${toolchain_file}"
        "${MYCMAKEARGS}" # <-- here MYCMAKEARGS are added
    )

So we have two variables different only in capitalization with different behavior and without any documentation. I dare those are supposed to be two different variable names, like mycmakeargs_post or something.
Comment 1 Michael Palimaka (kensington) gentoo-dev 2015-08-11 12:03:33 UTC
It's like EXTRA_ECONF. I'm not sure what we can do about it without breaking any unknown users.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-08-11 14:05:53 UTC
I suggest:

1. adding mycmakeargs_post[@] (note: it's an array this time :P),

2. keeping MYCMAKEARGS backwards compat with eqawarn.
Comment 3 Michael Palimaka (kensington) gentoo-dev 2015-08-11 14:21:22 UTC
That seems reasonable. How about a name like EXTRA_CMAKEARGS instead in line with the EXTRA_ECONF theme?
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-08-11 14:47:46 UTC
Nah. EXTRA_* scheme is for make.conf, not ebuilds.
Comment 5 Michael Palimaka (kensington) gentoo-dev 2017-06-24 15:43:43 UTC
(In reply to Michał Górny from comment #4)
> Nah. EXTRA_* scheme is for make.conf, not ebuilds.

MYCMAKEARGS is not supposed to be used in ebuilds AFAIK.
Comment 6 Michael Palimaka (kensington) gentoo-dev 2017-06-24 16:16:16 UTC
If you see someone using it in an ebuild, tell them not to.