support install prefix and default install

Former-commit-id: cada287cbf3b4ef2e32e8039aa7836bb76a6adb1
pull/191/head
xj.lin 2019-05-09 12:05:35 +08:00
parent 77f86fdeee
commit 146bb9e6d4
3 changed files with 22 additions and 0 deletions

View File

@ -72,3 +72,15 @@ if (BUILD_UNIT_TEST)
endif(BUILD_UNIT_TEST)
add_custom_target(Clean-All COMMAND ${CMAKE_BUILD_TOOL} clean)
#install
install(FILES
start_server.sh
stop_server.sh
DESTINATION
scripts)
install(FILES
conf/server_config.yaml
conf/vecwise_engine_log.conf
DESTINATION
conf)

View File

@ -2,6 +2,7 @@
BUILD_TYPE="Debug"
BUILD_UNITTEST="off"
INSTALL_PREFIX=$(pwd)/megasearch
while getopts "p:t:uh" arg
do
@ -13,12 +14,16 @@ do
echo "Build and run unittest cases" ;
BUILD_UNITTEST="on";
;;
p)
INSTALL_PREFIX=$OPTARG
;;
h) # help
echo "
parameter:
-t: build type
-u: building unit test options
-p: install prefix
usage:
./build.sh -t \${BUILD_TYPE} [-u] [-h]
@ -43,6 +48,7 @@ cd cmake_build
CUDA_COMPILER=/usr/local/cuda/bin/nvcc
CMAKE_CMD="cmake -DBUILD_UNIT_TEST=${BUILD_UNITTEST} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_CUDA_COMPILER=${CUDA_COMPILER} \
$@ ../"
@ -56,3 +62,5 @@ if [[ ${BUILD_TYPE} != "Debug" ]]; then
strip src/vecwise_server
fi
make install

View File

@ -79,3 +79,5 @@ set(license_generator_src
${CMAKE_CURRENT_SOURCE_DIR}/license/LicenseGenerator.cpp)
add_executable(license_generator ${license_generator_src})
install(TARGETS vecwise_server DESTINATION bin)