Multiline command truncated in Pre Build
Posted: Fri Apr 19, 2013 12:50 am
How can I use a multiline Pre Build command? I have a custom-build project with Pre Build commands. One of those is a multiline sed command, i.e.,
It doesn't matter for my question, but this is what I'm trying to do: If this sed mod hasn't already been applied to BasicMessage.h, apply it. The mod replaces a single #include line with multiple preprocessor lines.
This is what I see in the Build tab of Output View:
and this is the contents of the SimpleAmqpClient.sh file that CodeLite creates to execute my Pre Build commands:
CodeLite apparently doesn't expect a command to continue onto multiple lines like this.
Any idea how I can specify a multiline command without resorting to putting it in a file and referencing the file from a Pre Build command (I hate that)?
Code: Select all
grep -q BOOST_HAS <BasicMessage.h || (sed 's:#include <boost/make_shared.hpp>:#ifdef BOOST_HAS_RVALUE_REFS\
#undef BOOST_HAS_RVALUE_REFS\
#include <boost/make_shared.hpp>\
#define BOOST_HAS_RVALUE_REFS\
#else\
#include <boost/make_shared.hpp>\
#endif:' <BasicMessage.h >bmh && cp bmh BasicMessage.h && rm bmh)
This is what I see in the Build tab of Output View:
Code: Select all
MESSAGE: Entering directory `/home/plong/workspace/SimpleAmqpClient'
/bin/sh -f './SimpleAmqpClient.sh'
----------Building project:[ SimpleAmqpClient - Debug ]----------
Executing Pre Build commands ...
./SimpleAmqpClient.sh: line 4: unexpected EOF while looking for matching `''
./SimpleAmqpClient.sh: line 10: syntax error: unexpected end of file
0 errors, 0 warnings
Code: Select all
echo Executing Pre Build commands ...
cd src/SimpleAmqpClient
grep -q BOOST_HAS <BasicMessage.h || (sed 's:#include <boost/make_shared.hpp>:#ifdef BOOST_HAS_RVALUE_REFS\
cd ../..
mkdir build; cd build
cmake -DCMAKE_TOOLCHAIN_FILE=~/Toolchain-z3.cmake -DBOOST_ROOT=$WRKSPC/boost -DRabbitmqc_DIR=$WRKSPC/rabbitmq-c/target ..
echo Done
make
Any idea how I can specify a multiline command without resorting to putting it in a file and referencing the file from a Pre Build command (I hate that)?