Use eval so that $cmake_opts is properly parsed 28/12028/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Sat, 28 Jul 2018 22:09:08 +0000 (18:09 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Sat, 28 Jul 2018 22:11:36 +0000 (18:11 -0400)
Without eval bash inserts single quotes and breaks parameters passed
if they have quotes in the parameters. For example
`-D CMAKE_CXX_FLAGS="-fPIC -std=gnu++11"`

Issue: RELENG-1075
Change-Id: I77046a7edc0516f0ae28dd2b8cd2c8994ad5079e
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
shell/cmake-build.sh

index a6a41e4..2466c17 100644 (file)
@@ -27,7 +27,7 @@ mkdir -p "$build_dir"
 cd "$build_dir" || exit
 # $cmake_opts needs to wordsplit to pass options.
 # shellcheck disable=SC2086
-cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" $cmake_opts ..
+eval cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" $cmake_opts ..
 # $make_opts needs to wordsplit to pass options.
 # shellcheck disable=SC2086
 make $make_opts