diff options
author | Adrian Freihofer <adrian.freihofer@gmail.com> | 2024-01-22 14:58:19 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-02 10:38:28 +0000 |
commit | afe4c413f7a4e61474e11e8b02cebecdd19fd225 (patch) | |
tree | 433c5a0aa852c301bd35010727a0b10d90a081cb /meta/classes-recipe | |
parent | d50c4a1e362d310ff231adb7366712b70b668a1a (diff) | |
download | poky-afe4c413f7a4e61474e11e8b02cebecdd19fd225.tar.gz |
cmake.bbclass: use --install
Since version 3.15 CMake provides a command-line signature to install an
already-generated project binary tree. This may be used after building a
project to run installation without using the generated build system or
the native build tool.
This is a small improvement, for regular bitbake calls. CMake does not
check the dependencies again which is expected to be faster.
The main motivation for this change is using CMake from an SDK context.
With this change it is possible to initiate the compile step from an
IDE and later on initiating the install step via bitbake which runs the
install step on pseudo.
This is also what the meson.bbclass already does with the --no-rebuild
option.
(From OE-Core rev: 72388593d62d45d54790710b9665eb8f13897c8c)
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe')
-rw-r--r-- | meta/classes-recipe/cmake.bbclass | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/meta/classes-recipe/cmake.bbclass b/meta/classes-recipe/cmake.bbclass index 1e353f660f..3d3781ef33 100644 --- a/meta/classes-recipe/cmake.bbclass +++ b/meta/classes-recipe/cmake.bbclass | |||
@@ -224,12 +224,24 @@ cmake_runcmake_build() { | |||
224 | eval ${DESTDIR:+DESTDIR=${DESTDIR} }${CMAKE_VERBOSE} cmake --build '${B}' "$@" -- ${EXTRA_OECMAKE_BUILD} | 224 | eval ${DESTDIR:+DESTDIR=${DESTDIR} }${CMAKE_VERBOSE} cmake --build '${B}' "$@" -- ${EXTRA_OECMAKE_BUILD} |
225 | } | 225 | } |
226 | 226 | ||
227 | # Install an already-generated project binary tree. Not checking the compile | ||
228 | # dependencies again is particularly important for SDK use cases. | ||
229 | cmake_runcmake_install() { | ||
230 | bbnote ${DESTDIR:+DESTDIR=${DESTDIR} }${CMAKE_VERBOSE} cmake --install '${B}' | ||
231 | eval ${DESTDIR:+DESTDIR=${DESTDIR} }${CMAKE_VERBOSE} cmake --install '${B}' | ||
232 | } | ||
233 | |||
227 | cmake_do_compile() { | 234 | cmake_do_compile() { |
228 | cmake_runcmake_build --target ${OECMAKE_TARGET_COMPILE} | 235 | cmake_runcmake_build --target ${OECMAKE_TARGET_COMPILE} |
229 | } | 236 | } |
230 | 237 | ||
231 | cmake_do_install() { | 238 | cmake_do_install() { |
232 | DESTDIR='${D}' cmake_runcmake_build --target ${OECMAKE_TARGET_INSTALL} | 239 | if [ "${OECMAKE_TARGET_INSTALL}" = "install" ]; then |
240 | DESTDIR='${D}' cmake_runcmake_install | ||
241 | else | ||
242 | # Legacy path which supports also custom install targets | ||
243 | DESTDIR='${D}' cmake_runcmake_build --target ${OECMAKE_TARGET_INSTALL} | ||
244 | fi | ||
233 | } | 245 | } |
234 | 246 | ||
235 | EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file | 247 | EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file |