aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorThomas Witt <Thomas.Witt@bmw.de>2016-08-22 16:27:11 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-23 15:26:10 +0100
commit3d37394f8f279d127db85784cf01056d27c19b36 (patch)
treeb4a10468d9164070de1353ef48a13b608acc2563 /meta/classes
parent42a0d59d5923fb43882d8e60f6973b45b263e262 (diff)
downloadopenembedded-core-3d37394f8f279d127db85784cf01056d27c19b36.tar.gz
cmake.bbclass: call cmake with a relative path
CMake wants a relative path for CMAKE_INSTALL_*DIR, an absolute path breaks cross-compilation. This fact is documented in the following ticket: https://cmake.org/Bug/view.php?id=14367 $sysconfdir and $localstatedir are not relative to $prefix, so they are still set as absolute paths. With his change ${PROJECT}Targets.cmake that are generated by cmakes "export" function will contain relative paths instead of absolute ones. (From OE-Core rev: c03b32bd71dbe04f2f239556fea0b53215e403d7) Signed-off-by: Thomas Witt <Thomas.Witt@bmw.de> Signed-off-by: Clemens Lang <clemens.lang@bmw-carit.de> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/cmake.bbclass14
1 files changed, 7 insertions, 7 deletions
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index 02f313a861..77ab626f9f 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -108,15 +108,15 @@ cmake_do_configure() {
${OECMAKE_SITEFILE} \
${OECMAKE_SOURCEPATH} \
-DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
- -DCMAKE_INSTALL_BINDIR:PATH=${bindir} \
- -DCMAKE_INSTALL_SBINDIR:PATH=${sbindir} \
- -DCMAKE_INSTALL_LIBEXECDIR:PATH=${libexecdir} \
+ -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir', True), d.getVar('prefix', True))} \
+ -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir', True), d.getVar('prefix', True))} \
+ -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir', True), d.getVar('prefix', True))} \
-DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
- -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${sharedstatedir} \
+ -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir', True), d. getVar('prefix', True))} \
-DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \
- -DCMAKE_INSTALL_LIBDIR:PATH=${libdir} \
- -DCMAKE_INSTALL_INCLUDEDIR:PATH=${includedir} \
- -DCMAKE_INSTALL_DATAROOTDIR:PATH=${datadir} \
+ -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir', True), d.getVar('prefix', True))} \
+ -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir', True), d.getVar('prefix', True))} \
+ -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir', True), d.getVar('prefix', True))} \
-DCMAKE_INSTALL_SO_NO_EXE=0 \
-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
-DCMAKE_VERBOSE_MAKEFILE=1 \