|
|
@@ -51,8 +51,28 @@ else()
|
|
|
rvc_record_build_number()
|
|
|
endif()
|
|
|
|
|
|
+set(DEVOPS_ON FALSE)
|
|
|
+if(MSVC)
|
|
|
+ set(TARGET_PLATFORM Windows)
|
|
|
+else()
|
|
|
+ set(TARGET_PLATFORM UOS)
|
|
|
+endif(MSVC)
|
|
|
+
|
|
|
+if($ENV{PIPELINE_BUILD_ID})
|
|
|
+ message(STATUS "DevOps pipeline environment: $ENV{DEVOPS_ENV}")
|
|
|
+
|
|
|
+ message(STATUS "PIPELINE_BUILD_ID: $ENV{PIPELINE_BUILD_ID}")
|
|
|
+ message(STATUS "PIPELINE_NAME: $ENV{PIPELINE_NAME}")
|
|
|
+ message(STATUS "DEVOPS_GROUPID: $ENV{DEVOPS_GROUPID}")
|
|
|
+ message(STATUS "DEVOPS_ARTIFACTID: $ENV{DEVOPS_ARTIFACTID}")
|
|
|
+ message(STATUS "PIPELINE_NUMBER: $ENV{PIPELINE_NUMBER}")
|
|
|
+ message(STATUS "PIPELINE_BRANCH: $ENV{PIPELINE_BRANCH}")
|
|
|
+
|
|
|
+ set(DEVOPS_ON TRUE)
|
|
|
+endif()
|
|
|
+
|
|
|
#Set the project version
|
|
|
-set(RAW_VERSION_STRING "0.0.4-dev1")
|
|
|
+set(RAW_VERSION_STRING "0.0.5-dev1")
|
|
|
string(STRIP ${RAW_VERSION_STRING} RAW_VERSION_STRING)
|
|
|
|
|
|
set(VERSION_REGEX "^.?([0-9]+)\\.([0-9]+)\\.([0-9]+)-?(.*)")
|
|
|
@@ -60,16 +80,29 @@ string(REGEX REPLACE "${VERSION_REGEX}" "\\1" RVC_VERSION_MAJOR "${RAW_VERSION_S
|
|
|
string(REGEX REPLACE "${VERSION_REGEX}" "\\2" RVC_VERSION_MINOR "${RAW_VERSION_STRING}")
|
|
|
string(REGEX REPLACE "${VERSION_REGEX}" "\\3" RVC_VERSION_REVISION "${RAW_VERSION_STRING}")
|
|
|
string(REGEX REPLACE "${VERSION_REGEX}" "\\4" RVC_VERSION_SUFFIX "${RAW_VERSION_STRING}")
|
|
|
-
|
|
|
-if(BUILD_NUMBER EQUAL 0)
|
|
|
- set(VERSION_DEV_REGEX "^.?([0-9]+)\\.([0-9]+)\\.([0-9]+)-?([A-Za-z]*)(.*)")
|
|
|
- string(REGEX REPLACE "${VERSION_DEV_REGEX}" "\\5" RVC_DEV_NUM "${RAW_VERSION_STRING}")
|
|
|
+set(VERSION_DEV_REGEX "^.?([0-9]+)\\.([0-9]+)\\.([0-9]+)-?([A-Za-z]*)(.*)")
|
|
|
+string(REGEX REPLACE "${VERSION_DEV_REGEX}" "\\5" RVC_DEV_NUM "${RAW_VERSION_STRING}")
|
|
|
+
|
|
|
+if(DEVOPS_ON)
|
|
|
+ set(BUILD_NUMBER $ENV{PIPELINE_NUMBER})
|
|
|
+ set(DEVOPS_ENV_STR $ENV{DEVOPS_ENV})
|
|
|
+ string(TOLOWER $ENV{DEVOPS_ENV} DEVOPS_ENV_STR)
|
|
|
+ # set(RVC_VERSION_SUFFIX "${DEVOPS_ENV_STR}$ENV{PIPELINE_NUMBER}")
|
|
|
+ set(RVC_VERSION_SUFFIX "$ENV{DEVOPS_ENV}($ENV{PIPELINE_NAME})")
|
|
|
+
|
|
|
+ string(COMPARE EQUAL ${DEVOPS_ENV_STR} "uat" IS_DEVOPS_UAT)
|
|
|
+ if(IS_DEVOPS_UAT)
|
|
|
+ set(BUILD_NUMBER 0)
|
|
|
+ message(STATUS "UAT devops environment, reset build number.")
|
|
|
+ unset(RVC_VERSION_SUFFIX)
|
|
|
+ endif(IS_DEVOPS_UAT)
|
|
|
+elseif(BUILD_NUMBER EQUAL 0)
|
|
|
set(BUILD_NUMBER ${RVC_DEV_NUM})
|
|
|
-else()
|
|
|
- message(STATUS "BUILD_NUMBER ${BUILD_NUMBER}")
|
|
|
-endif()
|
|
|
+endif(DEVOPS_ON)
|
|
|
|
|
|
+message(STATUS "BUILD_NUMBER ${BUILD_NUMBER}")
|
|
|
set(RVC_VERSION_BUILD "${BUILD_NUMBER}")
|
|
|
+
|
|
|
set(RVC_API_VERSION "${RVC_VERSION_MAJOR}")
|
|
|
set(RVC_VERSION "${RVC_VERSION_MAJOR}.${RVC_VERSION_MINOR}.${RVC_VERSION_REVISION}.${RVC_VERSION_BUILD}")
|
|
|
set(RVC_FRAMEWORK_VERSION "${RVC_VERSION_MAJOR}.${RVC_VERSION_MINOR}.${RVC_VERSION_REVISION}")
|
|
|
@@ -300,8 +333,8 @@ else()
|
|
|
set(CMAKE_INSTALL_LIBDIR ${RVC_RUNTIME_PATH})
|
|
|
endif(MSVC)
|
|
|
|
|
|
-set(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_GENERATOR_PLATFORM}-${BUILD_TYPE_NAME}")
|
|
|
-set(CPACK_TOPLEVEL_TAG "${CMAKE_SYSTEM_NAME}-${CMAKE_GENERATOR_PLATFORM}-${BUILD_TYPE_NAME}")
|
|
|
+set(CPACK_SYSTEM_NAME "${TARGET_PLATFORM}-${BUILD_TYPE_NAME}")
|
|
|
+set(CPACK_TOPLEVEL_TAG "${TARGET_PLATFORM}-${BUILD_TYPE_NAME}")
|
|
|
|
|
|
if(MSVC)
|
|
|
string(REPLACE "\\" "/" OUTPUT_VERSION_DIR_PATH ${OUTPUT_VERSION_DIR_PATH})
|
|
|
@@ -423,6 +456,7 @@ if(BUILD_DEVADAPTER)
|
|
|
endif(BUILD_DEVADAPTER)
|
|
|
|
|
|
set(CMAKE_INSTALL_LOCAL_ONLY ON)
|
|
|
+
|
|
|
# Config package information.
|
|
|
set(CPACK_SOURCE_IGNORE_FILES "/\\\\.git/;/\\\\.gitignore;/CMakeCache.txt;/\\\\build;/\\\\out")
|
|
|
string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_lower)
|
|
|
@@ -436,6 +470,7 @@ set(CPACK_PACKAGE_VERSION ${RVC_VERSION_FULL})
|
|
|
set(CPACK_PACKAGE_VERSION_MAJOR ${RVC_VERSION_MAJOR})
|
|
|
set(CPACK_PACKAGE_VERSION_MINOR ${RVC_VERSION_MINOR})
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH ${RVC_VERSION_REVISION})
|
|
|
+# set(CMAKE_PROJECT_HOMEPAGE_URL "TODO")
|
|
|
|
|
|
# Configure package type
|
|
|
if(MSVC)
|
|
|
@@ -447,14 +482,24 @@ if(MSVC)
|
|
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "C:\\\\Run")
|
|
|
endif()
|
|
|
else(MSVC)
|
|
|
- if( NOT CPACK_GENERATOR)
|
|
|
- # set(CPACK_GENERATOR "ZIP")
|
|
|
- # message(STATUS "set zip package file type")
|
|
|
- set(CPACK_GENERATOR "TGZ")
|
|
|
- message(STATUS "set tgz package file type")
|
|
|
- endif()
|
|
|
+ if(PACK_AS_DEB_PKG)
|
|
|
+ # This is not the same purpose as CMAKE_INSTALL_PREFIX
|
|
|
+ # which is used when installing from the build tree without building a package
|
|
|
+ set(CPACK_PACKAGING_INSTALL_PREFIX "/opt")
|
|
|
+ # set(CPACK_PACKAGE_INSTALL_DIRECTORY "/opt")
|
|
|
+ include(pack4deb)
|
|
|
+ message(STATUS "set deb package file type")
|
|
|
+ else()
|
|
|
+ if( NOT CPACK_GENERATOR)
|
|
|
+ # set(CPACK_GENERATOR "ZIP")
|
|
|
+ # message(STATUS "set zip package file type")
|
|
|
+ set(CPACK_GENERATOR "TGZ")
|
|
|
+ message(STATUS "set tgz package file type")
|
|
|
+ endif()
|
|
|
+ endif(PACK_AS_DEB_PKG)
|
|
|
endif(MSVC)
|
|
|
|
|
|
+
|
|
|
if(MSVC)
|
|
|
if(MSVC_RUNTIME STREQUAL "dynamic")
|
|
|
# the INSTALL command is not called. The user can use the variable
|
|
|
@@ -503,9 +548,9 @@ install(FILES "${CMAKE_SOURCE_DIR}/addin/hardwarecfg/${ROOT_INI_NAME}"
|
|
|
COMPONENT scripts)
|
|
|
install(PROGRAMS ${BAT_SCRIPTS} DESTINATION "${PACK_INSTALL_PREFIX_VERSION}" COMPONENT scripts)
|
|
|
install(FILES "${CMAKE_SOURCE_DIR}/addin/Run.ini" DESTINATION "${PACK_INSTALL_RUN_DIR}/./.." COMPONENT scripts)
|
|
|
-if(NOT MSVC)
|
|
|
+if(NOT MSVC AND NOT PACK_AS_DEB_PKG)
|
|
|
install(PROGRAMS "${CMAKE_SOURCE_DIR}/addin/install.sh" DESTINATION "${PACK_INSTALL_RUN_DIR}/./.." COMPONENT scripts)
|
|
|
-endif(NOT MSVC)
|
|
|
+endif(NOT MSVC AND NOT PACK_AS_DEB_PKG)
|
|
|
|
|
|
list(REMOVE_DUPLICATES RVC_CONAN_DEP_LIBS)
|
|
|
if(CONAN_LIB_DIRS_QT)
|