From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Greylist: delayed 901 seconds by postgrey-1.34 at layers.openembedded.org; Sun, 12 Nov 2017 14:37:25 UTC Received: from relay.appriver.com (relay101b.appriver.com [207.97.230.15]) by mail.openembedded.org (Postfix) with ESMTP id 08A6E7841C for ; Sun, 12 Nov 2017 14:37:25 +0000 (UTC) X-Note: This Email was scanned by AppRiver SecureTide X-Note-AR-ScanTimeLocal: 11/12/2017 9:22:23 AM X-Note: SecureTide Build: 7/20/2017 1:24:22 PM UTC (2.6.20.0) X-Note: Filtered by 10.238.11.162 X-Policy: brightsign.biz - brightsign.biz X-Policy: brightsign.biz - brightsign.biz X-Primary: mcrowe@brightsign.biz X-Virus-Scan: V- X-Note: ICH-CT/SI:0-1110/SG:1 11/12/2017 9:22:03 AM X-Note-SnifferID: 0 X-Note: TCH-CT/SI:0-70/SG:1 11/12/2017 9:22:03 AM X-GBUdb-Analysis: 0, 213.210.30.29, Ugly c=0.468188 p=-0.87234 Source Normal X-Signature-Violations: 0-0-0-5877-c X-Note: Spam Tests Failed: X-Country-Path: ->->United Kingdom->United States X-Note-Sending-IP: 213.210.30.29 X-Note-Reverse-DNS: elite.brightsigndigital.co.uk X-Note-Return-Path: mcrowe@brightsign.biz X-Note: User Rule Hits: X-Note: Global Rule Hits: G298 G299 G300 G301 G305 G306 G437 X-Note: Encrypt Rule Hits: X-Note: Mail Class: VALID X-Note: Headers Injected Received: from [213.210.30.29] (HELO elite.brightsign) by relay.appriver.com (CommuniGate Pro SMTP 6.1.7) with ESMTPS id 233853227; Sun, 12 Nov 2017 09:22:23 -0500 Received: from chuckie.brightsign ([fd44:d8b8:cab5:cb01::19] helo=chuckie) by elite.brightsign with esmtp (Exim 4.89) (envelope-from ) id 1eDt9U-00030N-NJ; Sun, 12 Nov 2017 14:22:24 +0000 Received: from mac by chuckie with local (Exim 4.89) (envelope-from ) id 1eDt9U-0000No-MH; Sun, 12 Nov 2017 14:22:24 +0000 From: Mike Crowe To: openembedded-core@lists.openembedded.org Date: Sun, 12 Nov 2017 14:22:13 +0000 Message-Id: <20171112142213.1407-1-mac@mcrowe.com> X-Mailer: git-send-email 2.11.0 Cc: Mike Crowe Subject: [PATCH] cmake: Avoid passing empty prefix to os.path.relpath X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Nov 2017 14:37:26 -0000 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. --- meta/classes/cmake.bbclass | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass index ac2c1519b0..59797e121b 100644 --- a/meta/classes/cmake.bbclass +++ b/meta/classes/cmake.bbclass @@ -119,15 +119,15 @@ cmake_do_configure() { $oecmake_sitefile \ ${OECMAKE_SOURCEPATH} \ -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \ - -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix'))} \ - -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir'), d.getVar('prefix'))} \ - -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix'))} \ + -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix') + '/')} \ + -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir'), d.getVar('prefix') + '/')} \ + -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix') + '/')} \ -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \ - -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir'), d. getVar('prefix'))} \ + -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir'), d. getVar('prefix') + '/')} \ -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \ - -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix'))} \ - -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir'), d.getVar('prefix'))} \ - -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir'), d.getVar('prefix'))} \ + -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix') + '/')} \ + -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir'), d.getVar('prefix') + '/')} \ + -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir'), d.getVar('prefix') + '/')} \ -DCMAKE_INSTALL_SO_NO_EXE=0 \ -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \ -DCMAKE_VERBOSE_MAKEFILE=1 \ -- 2.11.0