Changed: #1444 Allow to provide custom revision.h

This commit is contained in:
kervala 2012-10-02 13:12:13 +02:00
parent c9a3e9efbc
commit c202964108

View file

@ -30,6 +30,12 @@ MACRO(NL_GEN_REVISION_H)
ADD_DEFINITIONS(-DHAVE_REVISION_H) ADD_DEFINITIONS(-DHAVE_REVISION_H)
SET(HAVE_REVISION_H ON) SET(HAVE_REVISION_H ON)
# if already generated
IF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h)
# copy it
MESSAGE(STATUS "Copying provided revision.h...")
FILE(COPY ${CMAKE_SOURCE_DIR}/revision.h DESTINATION ${CMAKE_BINARY_DIR})
ELSE(EXISTS ${CMAKE_SOURCE_DIR}/revision.h)
# a custom target that is always built # a custom target that is always built
ADD_CUSTOM_TARGET(revision ALL ADD_CUSTOM_TARGET(revision ALL
DEPENDS ${CMAKE_BINARY_DIR}/revision.h) DEPENDS ${CMAKE_BINARY_DIR}/revision.h)
@ -45,6 +51,7 @@ MACRO(NL_GEN_REVISION_H)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/revision.h SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/revision.h
PROPERTIES GENERATED TRUE PROPERTIES GENERATED TRUE
HEADER_FILE_ONLY TRUE) HEADER_FILE_ONLY TRUE)
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h)
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in) ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in)
ENDMACRO(NL_GEN_REVISION_H) ENDMACRO(NL_GEN_REVISION_H)