Skip to contentSkip to conversation

cmake versus autotools in recipe files versus source

DISCUSSION Robert P. J. Day 2 participants 3 messages May 29, 2021

lore
Share & tools
lore
#0 lore raw

(yet another in an endless series of dumb questions as i get asked
about these things by colleagues and realize i don't know the answer.)

can someone clarify the oddity of recipes whose source contains a
CMakeLists.txt file at the top, but whose recipe does not "inherit cmake"?

example: oe-core's "lzo" -- the recipe file contains:

inherit autotools ptest

but the unpacked source contains a "CMakeLists.txt" file (as well as autotools stuff).

is that just to give the user the option of building with cmake or
autotools?

rday

#1 lore raw

Hi Robert

Quoted 11 lines · Robert P. J. Day

(yet another in an endless series of dumb questions as i get asked
about these things by colleagues and realize i don't know the answer.)

can someone clarify the oddity of recipes whose source contains a
CMakeLists.txt file at the top, but whose recipe does not "inherit cmake"?

example: oe-core's "lzo" -- the recipe file contains:

Quoted 7 lines

inherit autotools ptest

but the unpacked source contains a "CMakeLists.txt" file (as well as autotools stuff).

is that just to give the user the option of building with cmake or
autotools?

OE does not get to decide what build system a component will choose to use and with time
many packages switch their build systems from one to other and some add multiple build systems that
end user can choose to use one over other. What OE does is tries to use most stable/robust one
that is supported by the particular community and developers, in some case they allow an overlap for
few releases when they are migrating from one to other. So we wait until new system is functionally
equivalent to prior one.

In example you cited OE is prefering to use autotools over cmake when building lzo at the moment
if it so happens that CMake is what they are moving to and its officially declared as supported them we
will switch to.

HTH
-Khem

Quoted 5 lines

rday

#2 lore raw
Quoted 31 lines · Khem Raj

Hi Robert

Quoted 11 lines · Robert P. J. Day

(yet another in an endless series of dumb questions as i get asked
about these things by colleagues and realize i don't know the answer.)

can someone clarify the oddity of recipes whose source contains a
CMakeLists.txt file at the top, but whose recipe does not "inherit cmake"?

example: oe-core's "lzo" -- the recipe file contains:

Quoted 7 lines

inherit autotools ptest

but the unpacked source contains a "CMakeLists.txt" file (as well as autotools stuff).

is that just to give the user the option of building with cmake or
autotools?

OE does not get to decide what build system a component will choose to use and with time many packages switch their build systems from one to other and some add multiple build systems that end user can choose to use one over other. What OE does is tries to use most stable/robust one that is supported by the particular community and developers, in some case they allow an overlap for few releases when they are migrating from one to other. So we wait until new system is functionally equivalent to prior one.

Quoted 4 lines

In example you cited OE is prefering to use autotools over cmake when building lzo at the moment if it so happens that CMake is what they are moving to and its officially declared as supported them we will switch to.

right, that's what i thought ... while the source itself supports
building with either cmake or autotools, OE chooses the autotools option, until such time as it decides otherwise.

rday