mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
cmake.bbclass: restore OECMAKE_SOURCEPATH
Some packages put their CMakeLists.txt file in a subdirectory, so assuming that
it is in ${S} won't work.
Restore OECMAKE_SOURCEPATH (defaulting to ${S}) so that the location of
CMakeLists.txt can be set if required.
Based on a patch by Miroslav Keš <miroslav.kes@gmail.com>
(From OE-Core rev: 2c23d7ab913a636aa0ab6a6e899cf6211d1e2714)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
540b7a196a
commit
f3d2e32a14
@@ -1,3 +1,6 @@
|
|||||||
|
# Path to the CMake file to process.
|
||||||
|
OECMAKE_SOURCEPATH ?= "${S}"
|
||||||
|
|
||||||
DEPENDS_prepend = "cmake-native "
|
DEPENDS_prepend = "cmake-native "
|
||||||
B = "${WORKDIR}/build"
|
B = "${WORKDIR}/build"
|
||||||
|
|
||||||
@@ -65,8 +68,8 @@ EOF
|
|||||||
addtask generate_toolchain_file after do_patch before do_configure
|
addtask generate_toolchain_file after do_patch before do_configure
|
||||||
|
|
||||||
cmake_do_configure() {
|
cmake_do_configure() {
|
||||||
if [ "${OECMAKE_BUILDPATH}" -o "${OECMAKE_SOURCEPATH}" ]; then
|
if [ "${OECMAKE_BUILDPATH}" ]; then
|
||||||
bbnote "cmake.bbclass no longer uses OECMAKE_SOURCEPATH and OECMAKE_BUILDPATH. The default behaviour is now out-of-tree builds with B=WORKDIR/build."
|
bbnote "cmake.bbclass no longer uses OECMAKE_BUILDPATH. The default behaviour is now out-of-tree builds with B=WORKDIR/build."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${S}" != "${B}" ]; then
|
if [ "${S}" != "${B}" ]; then
|
||||||
@@ -84,7 +87,7 @@ cmake_do_configure() {
|
|||||||
|
|
||||||
cmake \
|
cmake \
|
||||||
${OECMAKE_SITEFILE} \
|
${OECMAKE_SITEFILE} \
|
||||||
${S} \
|
${OECMAKE_SOURCEPATH} \
|
||||||
-DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
|
-DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
|
||||||
-DCMAKE_INSTALL_BINDIR:PATH=${bindir} \
|
-DCMAKE_INSTALL_BINDIR:PATH=${bindir} \
|
||||||
-DCMAKE_INSTALL_SBINDIR:PATH=${sbindir} \
|
-DCMAKE_INSTALL_SBINDIR:PATH=${sbindir} \
|
||||||
|
|||||||
Reference in New Issue
Block a user