automaticlly generate build version infor

Former-commit-id: 7ed02faa146b614ee06327b95a8dba4154a904f9
pull/191/head
groot 2019-06-06 10:34:10 +08:00
parent d019ccc338
commit 741c5e90eb
1 changed files with 3 additions and 4 deletions

View File

@ -23,7 +23,8 @@ GET_GIT_BRANCH_NAME(GIT_BRANCH_NAME)
string(REGEX REPLACE "\n" "" GIT_BRANCH_NAME ${GIT_BRANCH_NAME})
set(MEGASEARCH_VERSION "${GIT_BRANCH_NAME}")
string(REGEX REPLACE "branch-" "" MEGASEARCH_VERSION ${MEGASEARCH_VERSION})
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]" MEGASEARCH_VERSION "${MEGASEARCH_VERSION}")
message(STATUS "Build version = ${MEGASEARCH_VERSION}")
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(BUILD_TYPE "release")
@ -34,9 +35,7 @@ message(STATUS "Build type = ${BUILD_TYPE}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.cf ${CMAKE_CURRENT_SOURCE_DIR}/version.h)
string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" MEGASEARCH_BASE_VERSION "${MEGASEARCH_VERSION}")
project(megasearch VERSION "${MEGASEARCH_BASE_VERSION}")
project(megasearch VERSION "${MEGASEARCH_VERSION}")
project(vecwise_engine LANGUAGES CUDA CXX)
set(MEGASEARCH_VERSION_MAJOR "${megasearch_VERSION_MAJOR}")