mirror of
https://gitee.com/TarsCloud/TarsCpp.git
synced 2024-12-22 22:16:38 +08:00
change http-demo to cmake
This commit is contained in:
parent
0339acf26a
commit
b2ca1d68c1
@ -10,27 +10,31 @@ APP=$1
|
||||
SERVER=$2
|
||||
SERVANT=$3
|
||||
|
||||
echo "APP:$APP, SERVER:$SERVER, SERVANT:$SERVANT"
|
||||
|
||||
if [ "$SERVER" == "$SERVANT" ]
|
||||
then
|
||||
echo "Error!(ServerName == ServantName)"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
if [ ! -d $APP/$SERVER ]
|
||||
if [ ! -d $SERVER ]
|
||||
then
|
||||
echo "[mkdir: $APP/$SERVER]"
|
||||
mkdir -p $APP/$SERVER
|
||||
echo "[mkdir: $SERVER]"
|
||||
mkdir -p $SERVER
|
||||
fi
|
||||
|
||||
echo "[create server: $APP.$SERVER ...]"
|
||||
|
||||
DEMO_PATH=/usr/local/tars/cpp/script/http_demo
|
||||
|
||||
cp $DEMO_PATH/* $APP/$SERVER/
|
||||
#make cleanall -C $DEMO_PATH
|
||||
|
||||
cd $APP/$SERVER/
|
||||
cp -rf $DEMO_PATH/* $SERVER/
|
||||
|
||||
SRC_FILE="DemoServer.h DemoServer.cpp DemoServantImp.h DemoServantImp.cpp makefile"
|
||||
cd $SERVER/src
|
||||
|
||||
SRC_FILE="DemoServer.h DemoServer.cpp DemoServantImp.h DemoServantImp.cpp CMakeLists.txt"
|
||||
|
||||
for FILE in $SRC_FILE
|
||||
do
|
||||
@ -39,14 +43,20 @@ do
|
||||
|
||||
cat $FILE | sed "s/DemoApp/$APP/g" > $FILE.tmp
|
||||
mv $FILE.tmp $FILE
|
||||
|
||||
|
||||
cat $FILE | sed "s/DemoServant/$SERVANT/g" > $FILE.tmp
|
||||
mv $FILE.tmp $FILE
|
||||
done
|
||||
|
||||
rename "DemoServer" "$SERVER" $SRC_FILE
|
||||
rename "DemoServant" "$SERVANT" $SRC_FILE
|
||||
mv DemoServer.h ${SERVER}.h
|
||||
mv DemoServer.cpp ${SERVER}.cpp
|
||||
mv DemoServantImp.h ${SERVANT}Imp.h
|
||||
mv DemoServantImp.cpp ${SERVANT}Imp.cpp
|
||||
|
||||
cd ../../
|
||||
cd ..
|
||||
mkdir build; cd build
|
||||
cmake ..; make
|
||||
|
||||
#cd ../../
|
||||
|
||||
echo "[done.]"
|
||||
|
@ -12,12 +12,13 @@ else()
|
||||
include (/usr/local/tars/cpp/makefile/tars-tools.cmake)
|
||||
endif()
|
||||
|
||||
set(TARS_WEB_SERVER "upchina@taf.test.whup.com")
|
||||
set(TARS_WEB_HOST "taf.test.whup.com:8080")
|
||||
set(TARS_WEB_HOST "http://tars.test.com")
|
||||
|
||||
include_directories(/usr/local/taf/cpp/thirdparty/include)
|
||||
link_directories(/usr/local/taf/cpp/thirdparty/lib)
|
||||
include_directories(/usr/local/tars/cpp/thirdparty/include)
|
||||
link_directories(/usr/local/tars/cpp/thirdparty/lib)
|
||||
|
||||
#include_directories(/home/tarsprotol/App/OtherServer)
|
||||
|
||||
gen_server(Demo DemoServer)
|
||||
add_subdirectory(src)
|
||||
|
||||
#target_link_libraries(mysqlclient ssl crypto nghttp2-static)
|
||||
|
5
servant/script/http_demo/src/CMakeLists.txt
Normal file
5
servant/script/http_demo/src/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
project(DemoApp-DemoServer)
|
||||
|
||||
gen_server(DemoApp DemoServer)
|
Loading…
Reference in New Issue
Block a user