From 2fa05449127ff37e9ece23c5449021e3440d2665 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 29 Nov 2015 14:09:21 +0100 Subject: [PATCH] Changed: Don't generate revision.h anymore --HG-- branch : develop --- code/CMakeLists.txt | 1 - code/CMakeModules/GetRevision.cmake | 9 ----- code/CMakeModules/nel.cmake | 54 ----------------------------- code/revision.h.in | 7 ---- 4 files changed, 71 deletions(-) delete mode 100644 code/revision.h.in diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index a1f3df8aa..f3fabaad0 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -94,7 +94,6 @@ NL_SETUP_BUILD_FLAGS() #Platform specifics SETUP_EXTERNAL() -NL_GEN_REVISION_H() IF(WIN32) SET(WINSOCK2_LIB ws2_32.lib) diff --git a/code/CMakeModules/GetRevision.cmake b/code/CMakeModules/GetRevision.cmake index 158d407c4..7e42274cf 100644 --- a/code/CMakeModules/GetRevision.cmake +++ b/code/CMakeModules/GetRevision.cmake @@ -72,12 +72,3 @@ IF(SOURCE_DIR AND NOT DEFINED REVISION) MESSAGE(STATUS "Read revision ${REVISION} from file") ENDIF() ENDIF() - -IF(SOURCE_DIR AND DEFINED REVISION) - IF(EXISTS ${SOURCE_DIR}/revision.h.in) - MESSAGE(STATUS "Revision: ${REVISION}") - NOW(BUILD_DATE) - CONFIGURE_FILE(${SOURCE_DIR}/revision.h.in revision.h.txt) - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy revision.h.txt revision.h) # copy_if_different - ENDIF() -ENDIF() diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 802458ca3..aad4a245a 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -20,60 +20,6 @@ MACRO(NL_GEN_PC name) ENDIF(NOT WIN32 AND WITH_INSTALL_LIBRARIES) ENDMACRO(NL_GEN_PC) -### -# Helper macro that generates revision.h from revision.h.in -### -MACRO(NL_GEN_REVISION_H) - IF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in) - SET(TOOL_FOUND OFF) - - IF(EXISTS "${CMAKE_SOURCE_DIR}/../.svn/") - FIND_PACKAGE(Subversion) - - IF(SUBVERSION_FOUND) - SET(TOOL_FOUND ON) - ENDIF(SUBVERSION_FOUND) - ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/../.svn/") - - IF(EXISTS "${CMAKE_SOURCE_DIR}/../.hg/") - FIND_PACKAGE(Mercurial) - - IF(MERCURIAL_FOUND) - SET(TOOL_FOUND ON) - ENDIF(MERCURIAL_FOUND) - ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/../.hg/") - - # 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}) - SET(HAVE_REVISION_H ON) - ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h) - - IF(TOOL_FOUND) - # a custom target that is always built - ADD_CUSTOM_TARGET(revision ALL - COMMAND ${CMAKE_COMMAND} - -DSOURCE_DIR=${CMAKE_SOURCE_DIR} - -DROOT_DIR=${CMAKE_SOURCE_DIR}/.. - -DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/CMakeModules - -P ${CMAKE_SOURCE_DIR}/CMakeModules/GetRevision.cmake) - - # revision.h is a generated file - SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/revision.h - PROPERTIES GENERATED TRUE - HEADER_FILE_ONLY TRUE) - SET(HAVE_REVISION_H ON) - ENDIF(TOOL_FOUND) - - IF(HAVE_REVISION_H) - INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) - ADD_DEFINITIONS(-DHAVE_REVISION_H) - ENDIF(HAVE_REVISION_H) - ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in) -ENDMACRO(NL_GEN_REVISION_H) - ### # ### diff --git a/code/revision.h.in b/code/revision.h.in deleted file mode 100644 index 6c5e9b8b1..000000000 --- a/code/revision.h.in +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef REVISION_H -#define REVISION_H - -#cmakedefine REVISION "${REVISION}" -#cmakedefine BUILD_DATE "${BUILD_DATE}" - -#endif