Skip to contentSkip to conversation

cmake.bbclass: remove ${prefix} assignment

PATCH In review Kevron Rees 2 participants 2 messages Nov 14, 2015 – Nov 16, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmake.bbclass: remove ${prefix} assignment

CMAKE_INSTALL_PREFIX has a different semantic meaning than ${prefix}[1]. cmake treats CMAKE_INSTALL_PREFIX the same as the DESTDIR environment variable. Setting CMAKE_INSTALL_PREFIX to ${prefix} is inappropriate.

This will likely break a lot of cmake recipes that have do_post_install hacks to get around this bug.

[1] - https://cmake.org/cmake/help/v3.0/variable/CMAKE_INSTALL_PREFIX.html

---
 meta/classes/cmake.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/cmake.bbclass +1 -1
index ae3cc02..b7d5950 100644
@@ -108,7 +108,7 @@ cmake_do_configure() {
 	cmake \
 	  ${OECMAKE_SITEFILE} \
 	  ${OECMAKE_SOURCEPATH} \
-	  -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
+	  -DCMAKE_INSTALL_PREFIX:PATH="" \
 	  -DCMAKE_INSTALL_BINDIR:PATH=${bindir} \
 	  -DCMAKE_INSTALL_SBINDIR:PATH=${sbindir} \
 	  -DCMAKE_INSTALL_LIBEXECDIR:PATH=${libexecdir} \
Signature · 1 line
2.1.4
#1 lore raw

Am 14.11.2015 um 02:24 schrieb Kevron Rees:

Quoted 2 lines

CMAKE_INSTALL_PREFIX has a different semantic meaning than ${prefix}[1]. cmake treats CMAKE_INSTALL_PREFIX the same as the DESTDIR environment variable.

CMAKE_INSTALL_PREFIX and DESTDIR are different and used together [1]:
[...] install the concerned software using the installation prefix [...] prepended with the DESTDIR [...]

Quoted 2 lines

Setting
CMAKE_INSTALL_PREFIX to ${prefix} is inappropriate.

Why? It configures the prefix.
${prefix} is set to "/usr" in bitbake.conf. The default CMAKE_INSTALL_PREFIX is "/usr/local"

Quoted 2 lines

This will likely break a lot of cmake recipes that have do_post_install hacks to get around this bug.

What hacks do you mean?

Quoted 20 lines

[1] - https://cmake.org/cmake/help/v3.0/variable/CMAKE_INSTALL_PREFIX.html

---
  meta/classes/cmake.bbclass | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/cmake.bbclass +1 -1
index ae3cc02..b7d5950 100644
@@ -108,7 +108,7 @@ cmake_do_configure() {
  	cmake \
  	  ${OECMAKE_SITEFILE} \
  	  ${OECMAKE_SOURCEPATH} \
-	  -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
+	  -DCMAKE_INSTALL_PREFIX:PATH="" \
  	  -DCMAKE_INSTALL_BINDIR:PATH=${bindir} \
  	  -DCMAKE_INSTALL_SBINDIR:PATH=${sbindir} \
  	  -DCMAKE_INSTALL_LIBEXECDIR:PATH=${libexecdir} \