diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 51b07b39ef3811141a7cf0383b85cd357daf60aa..34fc75f792d86f81fc9d78d9f09413c86a18d6f0 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -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) diff --git a/cpp/build.sh b/cpp/build.sh index 53486a45e26199554f4b5572c1f5f626211fa372..300175bfeebdf995430cb61cbba7673d4316ac0d 100755 --- a/cpp/build.sh +++ b/cpp/build.sh @@ -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 + diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt index a073f096c223ac563232aa3bff0cb84f538d636c..f1a23c5c0d0f539abf91b4029d1ba225dd619c37 100644 --- a/cpp/src/CMakeLists.txt +++ b/cpp/src/CMakeLists.txt @@ -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)