BuildSystem: Cache results from when pulling the revision-information to avoid regenerating revision.h
(should remove the unneeded rebuilding of some core-files due to that the revision.h file has changed timestamp-wise) --HG-- branch : trunk
This commit is contained in:
1 parent
a735d84ecf
commit
88f196f1a9
2 files changed
+9
-6
No files matched your search
+9
-5
@@ -62,8 +62,12 @@ if(NOT BUILDDIR)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Create the actual revision.h file from the above params
|
# Create the actual revision.h file from the above params
|
||||||
configure_file(
|
|
||||||
"${CMAKE_SOURCE_DIR}/revision.h.in.cmake"
|
if(NOT hg_rev_id MATCHES "${hg_rev_id_cached}")
|
||||||
"${BUILDDIR}/revision.h"
|
configure_file(
|
||||||
@ONLY
|
"${CMAKE_SOURCE_DIR}/revision.h.in.cmake"
|
||||||
)
|
"${BUILDDIR}/revision.h"
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
set(hg_rev_id_cached ${hg_rev_id} CACHE TYPE STRING)
|
||||||
|
endif()
|
||||||
@@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
# Need to pass old ${CMAKE_BINARY_DIR} as param because its different at build stage
|
# Need to pass old ${CMAKE_BINARY_DIR} as param because its different at build stage
|
||||||
add_custom_target(revision.h ALL
|
add_custom_target(revision.h ALL
|
||||||
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/revision.h
|
|
||||||
COMMAND ${CMAKE_COMMAND} -DBUILDDIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/genrev.cmake
|
COMMAND ${CMAKE_COMMAND} -DBUILDDIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/genrev.cmake
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
Reference in new issue
Block a user