You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SetProjectVersion.cmake 1.0KB

3 years ago
123456789101112131415161718192021222324
  1. # Set OpenViBE specific versions.
  2. function(OV_SET_PROJECT_VERSION)
  3. set(OV_GLOBAL_VERSION_MAJOR ${PROJECT_VERSION_MAJOR} PARENT_SCOPE)
  4. set(OV_GLOBAL_VERSION_MINOR ${PROJECT_VERSION_MINOR} PARENT_SCOPE)
  5. set(OV_GLOBAL_VERSION_PATCH ${PROJECT_VERSION_PATCH} PARENT_SCOPE)
  6. set(OV_GLOBAL_VERSION_BUILD ${PROJECT_VERSION_BUILD} PARENT_SCOPE)
  7. set(OV_GLOBAL_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.${PROJECT_VERSION_BUILD} PARENT_SCOPE)
  8. set(OV_PROJECT_BRANCH ${PROJECT_BRANCH} PARENT_SCOPE)
  9. set(OV_PROJECT_COMMITHASH ${PROJECT_COMMITHASH} PARENT_SCOPE)
  10. # Write version to .install file
  11. string(TIMESTAMP BUILD_DATE "%d/%m/%y %H:%M:%S")
  12. set(INSTALL_MANIFEST_STR "[Package]=${PROJECT_NAME}\
  13. \n[Version]=${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.${PROJECT_VERSION_BUILD}\
  14. \n[BuildHash]=${PROJECT_COMMITHASH}\
  15. \n[BuildBranch]=${PROJECT_BRANCH}\
  16. \n[BuildDate]=${BUILD_DATE}"
  17. )
  18. file(WRITE ${CMAKE_BINARY_DIR}/.install "${INSTALL_MANIFEST_STR}")
  19. endfunction()