Variable Slicer_WC_LAST_CHANGED_DATE is expected to be defined

Cmake error: Variable Slicer_WC_LAST_CHANGED_DATE is expected to be defined.

1>CMake Warning (dev) at CMake/SlicerMacroExtractRepositoryInfo.cmake:87 (message):
1>  Skipping repository info extraction: directory [E:/QY3D/Slicer] is not a
1>  GIT checkout
1>Call Stack (most recent call first):
1>  CMake/SlicerPackageAndUploadTarget.cmake:105 (SlicerMacroExtractRepositoryInfo)
1>  CMake/LastConfigureStep/CMakeLists.txt:41 (include)
1>This warning is for project developers.  Use -Wno-dev to suppress it.
1>
1>CMake Error at CMake/SlicerPackageAndUploadTarget.cmake:118 (message):
1>  Variable Slicer_WC_LAST_CHANGED_DATE is expected to be defined.
1>Call Stack (most recent call first):
1>  CMake/LastConfigureStep/CMakeLists.txt:41 (include)
1>
1>
1>-- Configuring incomplete, errors occurred!

I found articles about it in the forums, but there doesn’t seem to be a solution

Have you downloaded the Slicer source tree az a zip file or you checked out the git repository?

Yes, I deleted the.git file in order to commit the source code to my own Git branch

This is the second time I’ve encountered this problem. The previous time I re-downloaded the Slicer source code, compiled and merged my changes, but it was too time-consuming

As a result of deleting the .git file/folder your git repository got corrupted and Slicer’s build system failed to retrieve the required version information. You need to have a valid git repository, or instead you might be able to set the Slicer_WC_LAST_CHANGED (and other CMake variables) manually.

Do you already use the Slicercustom application template? That makes it straightforward to maintain your own customized version of Slicer.

Yes I am using slicerCAT for development

If I want to set the value of Slicer_WC_LAST_CHANGED, how much should I set it to, or what rules should I follow to set these variables

OK, then all you need to set the GIT_REPOSITORY and GIT_TAG to your Slicer fork repository and branch/tag here:

The build scripts will automatically retrieve all necessary information from there.

Thank you very much, you solved a lot of my problems

1 Like