mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-25 08:16:16 +00:00
Changed: #1444 Allow to provide custom revision.h
This commit is contained in:
parent
04d9624935
commit
bedd0f3c52
1 changed files with 20 additions and 13 deletions
|
@ -30,21 +30,28 @@ 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)
|
||||||
|
|
||||||
# a custom target that is always built
|
# if already generated
|
||||||
ADD_CUSTOM_TARGET(revision ALL
|
IF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h)
|
||||||
DEPENDS ${CMAKE_BINARY_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
|
||||||
|
ADD_CUSTOM_TARGET(revision ALL
|
||||||
|
DEPENDS ${CMAKE_BINARY_DIR}/revision.h)
|
||||||
|
|
||||||
# creates revision.h using cmake script
|
# creates revision.h using cmake script
|
||||||
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/revision.h
|
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/revision.h
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
-DSOURCE_DIR=${CMAKE_SOURCE_DIR}
|
-DSOURCE_DIR=${CMAKE_SOURCE_DIR}
|
||||||
-DROOT_DIR=${CMAKE_SOURCE_DIR}/..
|
-DROOT_DIR=${CMAKE_SOURCE_DIR}/..
|
||||||
-P ${CMAKE_SOURCE_DIR}/CMakeModules/GetRevision.cmake)
|
-P ${CMAKE_SOURCE_DIR}/CMakeModules/GetRevision.cmake)
|
||||||
|
|
||||||
# revision.h is a generated file
|
# revision.h is a generated file
|
||||||
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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue