summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2017-04-19 18:57:09 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-29 11:17:22 +0100
commitedb7672c276954fe2020f816c11c09c780ae591c (patch)
tree1b60c0b4a99026ae64ca04fe19e0b26ebe0426c7
parent1fb309447fa8e66f88a6dfe4e65807d23dd18342 (diff)
downloadpoky-edb7672c276954fe2020f816c11c09c780ae591c.tar.gz
cmake.bbclass: Do not use bitbake variable syntax for shell variables
Using bitbake variable syntax (i.e., ${FOO}) for shell variables is bad practice. First of all it is confusing, but more importantly it can lead to weird problems if someone actually defines a bitbake variable with the same name as the shell variable. Also use lower case for local shell variables. (From OE-Core rev: ea6befae799f45cf93771442f242cb023dd809d1) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/cmake.bbclass10
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index 3f670919a8..20d8a61069 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -43,12 +43,12 @@ def map_target_arch_to_uname_arch(target_arch):
43 43
44cmake_do_generate_toolchain_file() { 44cmake_do_generate_toolchain_file() {
45 if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then 45 if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
46 CMAKE_CROSSCOMPILING="set( CMAKE_CROSSCOMPILING FALSE )" 46 cmake_crosscompiling="set( CMAKE_CROSSCOMPILING FALSE )"
47 fi 47 fi
48 cat > ${WORKDIR}/toolchain.cmake <<EOF 48 cat > ${WORKDIR}/toolchain.cmake <<EOF
49# CMake system name must be something like "Linux". 49# CMake system name must be something like "Linux".
50# This is important for cross-compiling. 50# This is important for cross-compiling.
51${CMAKE_CROSSCOMPILING} 51$cmake_crosscompiling
52set( CMAKE_SYSTEM_NAME `echo ${TARGET_OS} | sed -e 's/^./\u&/' -e 's/^\(Linux\).*/\1/'` ) 52set( CMAKE_SYSTEM_NAME `echo ${TARGET_OS} | sed -e 's/^./\u&/' -e 's/^\(Linux\).*/\1/'` )
53set( CMAKE_SYSTEM_PROCESSOR ${@map_target_arch_to_uname_arch(d.getVar('TARGET_ARCH'))} ) 53set( CMAKE_SYSTEM_PROCESSOR ${@map_target_arch_to_uname_arch(d.getVar('TARGET_ARCH'))} )
54set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} ) 54set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} )
@@ -107,13 +107,13 @@ cmake_do_configure() {
107 107
108 # Just like autotools cmake can use a site file to cache result that need generated binaries to run 108 # Just like autotools cmake can use a site file to cache result that need generated binaries to run
109 if [ -e ${WORKDIR}/site-file.cmake ] ; then 109 if [ -e ${WORKDIR}/site-file.cmake ] ; then
110 OECMAKE_SITEFILE=" -C ${WORKDIR}/site-file.cmake" 110 oecmake_sitefile="-C ${WORKDIR}/site-file.cmake"
111 else 111 else
112 OECMAKE_SITEFILE="" 112 oecmake_sitefile=
113 fi 113 fi
114 114
115 cmake \ 115 cmake \
116 ${OECMAKE_SITEFILE} \ 116 $oecmake_sitefile \
117 ${OECMAKE_SOURCEPATH} \ 117 ${OECMAKE_SOURCEPATH} \
118 -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \ 118 -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
119 -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix'))} \ 119 -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix'))} \