+ increase minor and build number, rework creation of Version.h
This commit is contained in:
parent
19bc5077c8
commit
1d75efea75
|
@ -1,14 +1,16 @@
|
|||
project(FreeCAD_trunk)
|
||||
set(FREECAD_VERSION "0.16")
|
||||
|
||||
set(PACKAGE_NAME "FreeCAD")
|
||||
set(PACKAGE_VERSION_NAME "Vulcan")
|
||||
set(PACKAGE_VERSION_MAJOR "0")
|
||||
set(PACKAGE_VERSION_MINOR "16")
|
||||
set(PACKAGE_VERSION_PATCH "4665")
|
||||
set(PACKAGE_VERSION_MINOR "17")
|
||||
set(PACKAGE_VERSION_PATCH "6700")
|
||||
|
||||
set(FREECAD_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}")
|
||||
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
|
||||
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
||||
|
||||
cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR)
|
||||
|
||||
if(COMMAND cmake_policy)
|
||||
cmake_policy(SET CMP0003 NEW)
|
||||
|
|
|
@ -1,46 +1,21 @@
|
|||
#FIND_PACKAGE(Subversion)
|
||||
|
||||
#IF(Subversion_FOUND)
|
||||
# Subversion_WC_INFO(${CMAKE_SOURCE_DIR} Project)
|
||||
# MESSAGE(STATUS "Current revision is ${Project_WC_REVISION}")
|
||||
#ENDIF(Subversion_FOUND)
|
||||
set(PACKAGE_WCREF "$WCREV$")
|
||||
set(PACKAGE_WCDATE "$WCDATE$")
|
||||
set(PACKAGE_WCURL "$WCURL$")
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Version.h.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Version.h.in
|
||||
)
|
||||
|
||||
#add_custom_target(Version ALL
|
||||
# COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/SubWCRev.py
|
||||
# --srcdir=${CMAKE_SOURCE_DIR} --bindir=${CMAKE_BINARY_DIR}
|
||||
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
# DEPENDS Version.h.in
|
||||
# COMMENT Building Version.h out of Version.h.in
|
||||
#)
|
||||
|
||||
|
||||
if (WIN32)
|
||||
# TortoiseSVN
|
||||
FIND_PROGRAM(Subversion_WCREF_EXECUTABLE SubWCRev)
|
||||
SET (RESULT 1)
|
||||
if(Subversion_WCREF_EXECUTABLE)
|
||||
EXECUTE_PROCESS(COMMAND ${Subversion_WCREF_EXECUTABLE} ${CMAKE_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Version.h.in ${CMAKE_CURRENT_BINARY_DIR}/Version.h
|
||||
RESULT_VARIABLE RESULT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif(Subversion_WCREF_EXECUTABLE)
|
||||
# No SVN repo
|
||||
if (NOT RESULT EQUAL 0)
|
||||
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/SubWCRev.py
|
||||
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/SubWCRev.py
|
||||
--srcdir=${CMAKE_SOURCE_DIR} --bindir=${CMAKE_BINARY_DIR}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif(NOT RESULT EQUAL 0)
|
||||
else (WIN32)
|
||||
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/SubWCRev.py
|
||||
--srcdir=${CMAKE_SOURCE_DIR} --bindir=${CMAKE_BINARY_DIR}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif (WIN32)
|
||||
|
||||
# as fallback if Version.h isn't created for any reason
|
||||
if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/Version.h)
|
||||
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/Version.h.in VERSION_INFO)
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/Version.h ${VERSION_INFO})
|
||||
set(PACKAGE_WCREF ${PACKAGE_VERSION_PATCH})
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Version.h.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Version.h
|
||||
)
|
||||
endif (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/Version.h)
|
||||
|
|
10
src/Build/Version.h.cmake
Normal file
10
src/Build/Version.h.cmake
Normal file
|
@ -0,0 +1,10 @@
|
|||
|
||||
// Version Number
|
||||
#define FCVersionMajor "${PACKAGE_VERSION_MAJOR}"
|
||||
#define FCVersionMinor "${PACKAGE_VERSION_MINOR}"
|
||||
#define FCVersionName "${PACKAGE_VERSION_NAME}"
|
||||
// test: $Format:Hash (%H), Date: %ci$
|
||||
#define FCRevision "${PACKAGE_WCREF}" //Highest committed revision number
|
||||
#define FCRevisionDate "${PACKAGE_WCDATE}" //Date of highest committed revision
|
||||
#define FCRepositoryURL "${PACKAGE_WCURL}" //Repository URL of the working copy
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
|
||||
// Version Number
|
||||
#define FCVersionMajor "0"
|
||||
#define FCVersionMinor "16"
|
||||
#define FCVersionName "Vulcan"
|
||||
// test: $Format:Hash (%H), Date: %ci$
|
||||
#define FCRevision "$WCREV$" //Highest committed revision number
|
||||
#define FCRevisionDate "$WCDATE$" //Date of highest committed revision
|
||||
#define FCRepositoryURL "$WCURL$" //Repository URL of the working copy
|
||||
|
|
@ -377,9 +377,9 @@ def main():
|
|||
for i in vcs:
|
||||
if i.extractInfo(srcdir):
|
||||
# Open the template file and the version file
|
||||
file = open("%s/src/Build/Version.h.in" % (srcdir))
|
||||
lines = file.readlines()
|
||||
file.close()
|
||||
inp = open("%s/src/Build/Version.h.in" % (bindir))
|
||||
lines = inp.readlines()
|
||||
inp.close()
|
||||
lines = i.writeVersion(lines)
|
||||
out = open("%s/src/Build/Version.h" % (bindir),"w");
|
||||
out.writelines(lines)
|
||||
|
|
Loading…
Reference in New Issue
Block a user