Skip to content

Commit

Permalink
Using CPackOptions for pack-time installer filename selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
simul-build committed Apr 16, 2023
1 parent 83b4b3e commit 4b598a3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
22 changes: 1 addition & 21 deletions pc_client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,30 +125,10 @@ set(CPACK_PACKAGE_NAME "TeleportClientInstaller")
set(CPACK_PACKAGE_VENDOR "Simul")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Installer for the TeleportVR PC CLient")

# get commit id from a file:
file(TOUCH "${CMAKE_SOURCE_DIR}/teleport_commit.properties")
file(READ "${CMAKE_SOURCE_DIR}/teleport_commit.properties" ver)
if(NOT( "${ver}" STREQUAL ""))
message(${ver})
string(REGEX MATCH "TELEPORT_COMMIT= ([a-zA-Z0-9]+)" _ ${ver})
endif()
set(TELEPORT_COMMIT ${CMAKE_MATCH_1})
set(CPACK_PACKAGE_VERSION_MAJOR "${TELEPORT_COMMIT}")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
message("TELEPORT_COMMIT ${TELEPORT_COMMIT}")
if("${TELEPORT_COMMIT}" STREQUAL "")
message("Test installer build.")
message("CPACK_PACKAGING_INSTALL_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX}")
#C:/TestInstallTeleport)
endif()
set(CPACK_PACKAGE_INSTALL_DIRECTORY "TeleportVR")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${TELEPORT_COMMIT}-x64")
message("CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}")
file(WRITE "build_pc_client/installer_filename.properties" "TELEPORT_CLIENT_INSTALLER_FILENAME=${CPACK_PACKAGE_FILE_NAME}.exe")
#
set(CPACK_GENERATOR "NSIS")
set (CPACK_PROJECT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/pc_client/CPackOptions.cmake")
set(CPACK_COMPONENTS_ALL client )

#set(CPACK_COMPONENT_CTDATA_GROUP "data")
Expand Down
18 changes: 18 additions & 0 deletions pc_client/CPackOptions.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

# get commit id from a file:
set(TELEPORT_COMMIT $ENV{TELEPORT_COMMIT})
set(CPACK_PACKAGE_VERSION_MAJOR "${TELEPORT_COMMIT}")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")

message("TELEPORT_COMMIT ${TELEPORT_COMMIT}")

if("${TELEPORT_COMMIT}" STREQUAL "")
message("Test installer build.")
message("CPACK_PACKAGING_INSTALL_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX}")
#C:/TestInstallTeleport)
endif()
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${TELEPORT_COMMIT}-x64")
message("CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}")

0 comments on commit 4b598a3

Please sign in to comment.