Skip to content

Commit

Permalink
Addressed code review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ppt-adsk committed Nov 14, 2023
1 parent 7157990 commit fb4e8c4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
8 changes: 4 additions & 4 deletions lib/mayaHydra/hydraExtensions/mhBuildInfo.h.src
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
#include <mayaHydraLib/api.h>
#include <mayaHydraLib/mayaHydra.h>

#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 {

Expand Down

0 comments on commit fb4e8c4

Please sign in to comment.