summaryrefslogtreecommitdiffstats
path: root/meta/classes/cmake.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-01-16 13:25:15 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-18 12:50:36 +0000
commit0c0a239011515d1b62951818c1dbe43c0f474160 (patch)
tree244a428934bfca875bf74b600af93d054d358058 /meta/classes/cmake.bbclass
parent9b302481982cb6ca92342f9bd5c9b54168424f57 (diff)
downloadpoky-0c0a239011515d1b62951818c1dbe43c0f474160.tar.gz
cmake: allow target names to be overridden
Don't hardcode the targets used in do_compile and do_install, instead build "all" and "install" by default but respect OECMAKE_TARGET_COMPILE and OECMAKE_TARGET_INSTALL variables. (From OE-Core rev: 806765ec466597d38231d4be303cb48c26e21466) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/cmake.bbclass')
-rw-r--r--meta/classes/cmake.bbclass11
1 files changed, 7 insertions, 4 deletions
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index a4079dab0d..10c4edcf1a 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -34,6 +34,9 @@ EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
34EXTRA_OECMAKE_BUILD_prepend_task-compile = "${PARALLEL_MAKE} " 34EXTRA_OECMAKE_BUILD_prepend_task-compile = "${PARALLEL_MAKE} "
35EXTRA_OECMAKE_BUILD_prepend_task-install = "${PARALLEL_MAKEINST} " 35EXTRA_OECMAKE_BUILD_prepend_task-install = "${PARALLEL_MAKEINST} "
36 36
37OECMAKE_TARGET_COMPILE ?= "all"
38OECMAKE_TARGET_INSTALL ?= "install"
39
37FILES_${PN}-dev += "${libdir}/cmake ${datadir}/cmake" 40FILES_${PN}-dev += "${libdir}/cmake ${datadir}/cmake"
38 41
39# CMake expects target architectures in the format of uname(2), 42# CMake expects target architectures in the format of uname(2),
@@ -140,13 +143,13 @@ cmake_do_configure() {
140 143
141do_compile[progress] = "percent" 144do_compile[progress] = "percent"
142cmake_do_compile() { 145cmake_do_compile() {
143 bbnote VERBOSE=1 cmake --build '${B}' -- ${EXTRA_OECMAKE_BUILD} 146 bbnote VERBOSE=1 cmake --build '${B}' --target ${OECMAKE_TARGET_COMPILE} -- ${EXTRA_OECMAKE_BUILD}
144 VERBOSE=1 cmake --build '${B}' -- ${EXTRA_OECMAKE_BUILD} 147 VERBOSE=1 cmake --build '${B}' --target ${OECMAKE_TARGET_COMPILE} -- ${EXTRA_OECMAKE_BUILD}
145} 148}
146 149
147cmake_do_install() { 150cmake_do_install() {
148 bbnote DESTDIR='${D}' cmake --build '${B}' --target install -- ${EXTRA_OECMAKE_BUILD} 151 bbnote DESTDIR='${D}' cmake --build '${B}' --target ${OECMAKE_TARGET_INSTALL} -- ${EXTRA_OECMAKE_BUILD}
149 DESTDIR='${D}' cmake --build '${B}' --target install -- ${EXTRA_OECMAKE_BUILD} 152 DESTDIR='${D}' cmake --build '${B}' --target ${OECMAKE_TARGET_INSTALL} -- ${EXTRA_OECMAKE_BUILD}
150} 153}
151 154
152EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file 155EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file