From fb4e8c479ff109202f5a1e54c747416657511336 Mon Sep 17 00:00:00 2001 From: Pierre Tremblay Date: Tue, 14 Nov 2023 15:46:01 -0500 Subject: [PATCH] Addressed code review comments. --- CMakeLists.txt | 7 +++---- cmake/utils.cmake | 16 ++++++++-------- lib/mayaHydra/hydraExtensions/mhBuildInfo.h.src | 8 ++++---- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22d330458f..87543e57b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,10 +34,9 @@ set(PXR_OVERRIDE_PLUGINPATH_NAME PXR_PLUGINPATH_NAME CACHE STRING "Name of env var USD searches to find plugins") # Build-related information, expected to be passed in by the parent build. -set(PEPTIDE_JENKINS_BUILD 0 CACHE STRING "Build number.") -set(PEPTIDE_GIT_COMMIT "Unknown Git commit" CACHE STRING "Build commit.") -set(PEPTIDE_GIT_BRANCH "Unknown Git branch" CACHE STRING "Build branch.") -set(PEPTIDE_PRODUCT_DATE "Unknown build date" CACHE STRING "Build date.") +set(MAYAHYDRA_BUILD_NUMBER 0 CACHE STRING "Build number.") +set(MAYAHYDRA_GIT_COMMIT "Unknown_Git_commit" CACHE STRING "Build commit.") +set(MAYAHYDRA_GIT_BRANCH "Unknown_Git_branch" CACHE STRING "Build branch.") #------------------------------------------------------------------------------ # internal flags to control build diff --git a/cmake/utils.cmake b/cmake/utils.cmake index d5bc1bc57e..1c106386ac 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -319,16 +319,16 @@ function(mayaHydra_compute_timestamp) string(TIMESTAMP WEEKDAY "%w") set(MH_WEEK_DAYS "Sun" "Mon" "Tue" "Wed" "Thu" "Fri" "Sat") list(GET MH_WEEK_DAYS ${WEEKDAY} WEEKDAY) - string(TIMESTAMP PRODUCT_DATE "\"${WEEKDAY} %m/%d/%Y, %Y%m%d%H%M\"") + string(TIMESTAMP BUILD_DATE "\"${WEEKDAY} %m/%d/%Y, %Y%m%d%H%M\"") - set(MH_PRODUCT_DATE "${PRODUCT_DATE}" CACHE STRING "Product Date") + set(MAYAHYDRA_BUILD_DATE "${BUILD_DATE}" CACHE STRING "Build Date") - # For non-Jenkins builds (i.e. developers), don't reset the timestamps - # unless a clean build is made. This is annoying as it causes all the - # version file to be regenerated and thus all libraries and executable to - # be relinked. Else, do force a new timestamp!!! - if (NOT PEPTIDE_JENKINS_BUILD EQUAL 0) - set(MH_PRODUCT_DATE "${PRODUCT_DATE}" CACHE STRING "Product Date" FORCE) + # For build pipeline builds, force a new timestamp. For developer builds, + # resetting the timestamps is annoying as it causes all the version file to + # be regenerated and thus all libraries and executable to be relinked. + # Therefore, don't reset the timestamps unless a clean build is made. + if (NOT MAYAHYDRA_BUILD_NUMBER EQUAL 0) + set(MAYAHYDRA_BUILD_DATE "${BUILD_DATE}" CACHE STRING "Build Date" FORCE) endif() endfunction(mayaHydra_compute_timestamp) mayaHydra_compute_timestamp() diff --git a/lib/mayaHydra/hydraExtensions/mhBuildInfo.h.src b/lib/mayaHydra/hydraExtensions/mhBuildInfo.h.src index 0b21492d22..d6c9eb152f 100644 --- a/lib/mayaHydra/hydraExtensions/mhBuildInfo.h.src +++ b/lib/mayaHydra/hydraExtensions/mhBuildInfo.h.src @@ -20,10 +20,10 @@ #include #include -#define MAYAHYDRA_BUILD_NUMBER ${PEPTIDE_JENKINS_BUILD} -#define MAYAHYDRA_GIT_COMMIT "${PEPTIDE_GIT_COMMIT}" -#define MAYAHYDRA_GIT_BRANCH "${PEPTIDE_GIT_BRANCH}" -#define MAYAHYDRA_BUILD_DATE ${MH_PRODUCT_DATE} +#define MAYAHYDRA_BUILD_NUMBER ${MAYAHYDRA_BUILD_NUMBER} +#define MAYAHYDRA_GIT_COMMIT "${MAYAHYDRA_GIT_COMMIT}" +#define MAYAHYDRA_GIT_BRANCH "${MAYAHYDRA_GIT_BRANCH}" +#define MAYAHYDRA_BUILD_DATE ${MAYAHYDRA_BUILD_DATE} namespace MAYAHYDRA_NS_DEF {