summaryrefslogtreecommitdiffstats
path: root/meta/classes/cmake.bbclass
diff options
context:
space:
mode:
authorMike Crowe <mac@mcrowe.com>2017-11-12 16:39:23 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-12 10:54:40 +0100
commit03830e2eb94bd49caa25a056d85a2068f5a63c13 (patch)
tree3970da0d82c5e8c9ce942b97f8bb3408e7caef0d /meta/classes/cmake.bbclass
parentfdd18c8805d6c23723b8d173a3f0e5d15781d272 (diff)
downloadpoky-03830e2eb94bd49caa25a056d85a2068f5a63c13.tar.gz
cmake: Avoid passing empty prefix to os.path.relpath
With meta-micro, ${prefix} is the empty string. This means that CMAKE_INSTALL_BINDIR:PATH and friends end up containing paths starting with many instances of "../", presumably due to os.path.relpath attempting to find its way to the current directory. Let's avoid this by ensuring that the root path always ends in a slash. If it already ends in a slash then adding another one shouldn't cause any problems. (From OE-Core rev: 67b19414c1c17f71f39c971b9f9fdd1f776516a1) Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/cmake.bbclass')
-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 a5cffedbc6..f80a7e2f1d 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -161,15 +161,15 @@ cmake_do_configure() {
161 $oecmake_sitefile \ 161 $oecmake_sitefile \
162 ${OECMAKE_SOURCEPATH} \ 162 ${OECMAKE_SOURCEPATH} \
163 -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \ 163 -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
164 -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix'))} \ 164 -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix') + '/')} \
165 -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir'), d.getVar('prefix'))} \ 165 -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir'), d.getVar('prefix') + '/')} \
166 -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix'))} \ 166 -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix') + '/')} \
167 -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \ 167 -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
168 -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir'), d. getVar('prefix'))} \ 168 -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir'), d. getVar('prefix') + '/')} \
169 -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \ 169 -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \
170 -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix'))} \ 170 -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix') + '/')} \
171 -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir'), d.getVar('prefix'))} \ 171 -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir'), d.getVar('prefix') + '/')} \
172 -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir'), d.getVar('prefix'))} \ 172 -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir'), d.getVar('prefix') + '/')} \
173 -DCMAKE_INSTALL_SO_NO_EXE=0 \ 173 -DCMAKE_INSTALL_SO_NO_EXE=0 \
174 -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \ 174 -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
175 -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 \ 175 -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 \