gravatar
ladanyi@tmit.bme.hu
ladanyi@tmit.bme.hu
Put the version string into config.h Also make it possible to set the version using the LEMON_VERSION environment variable, and use the hg revision as version string in case this variable is unset.
0 5 0
default
5 files changed with 25 insertions and 9 deletions:
↑ Collapse diff ↑
Ignore white space 6 line context
... ...
@@ -2,10 +2,21 @@
2 2

	
3
IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
4
  INCLUDE(${CMAKE_SOURCE_DIR}/cmake/version.cmake)
5
ELSE(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
6
  SET(PROJECT_NAME "LEMON")
7
  SET(PROJECT_VERSION "hg-tip" CACHE STRING "LEMON version string.")
8
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
3
SET(PROJECT_NAME "LEMON")
4
PROJECT(${PROJECT_NAME})
9 5

	
10
PROJECT(${PROJECT_NAME})
6
IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake)
7
  INCLUDE(${PROJECT_SOURCE_DIR}/cmake/version.cmake)
8
ELSEIF(DEFINED ENV{LEMON_VERSION})
9
  SET(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.")
10
ELSE()
11
  EXECUTE_PROCESS(
12
    COMMAND hg id -i
13
    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
14
    OUTPUT_VARIABLE HG_REVISION
15
    ERROR_QUIET
16
    OUTPUT_STRIP_TRAILING_WHITESPACE
17
  )
18
  SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.")
19
ENDIF()
20

	
21
SET(PROJECT_VERSION ${LEMON_VERSION})
11 22

	
Show white space 6 line context
1
SET(PROJECT_NAME "@PACKAGE_NAME@")
2
SET(PROJECT_VERSION "@PACKAGE_VERSION@" CACHE STRING "LEMON version string.")
1
SET(LEMON_VERSION "@PACKAGE_VERSION@" CACHE STRING "LEMON version string.")
Ignore white space 6 line context
... ...
@@ -21,2 +21,4 @@
21 21

	
22
AC_DEFINE([LEMON_VERSION], [lemon_version()], [The version string])
23

	
22 24
dnl Do compilation tests using the C++ compiler.
Ignore white space 6 line context
1
#define LEMON_VERSION "@PROJECT_VERSION@"
1 2
#cmakedefine LEMON_HAVE_LONG_LONG 1
Ignore white space 6 line context
1
/* The version string */
2
#undef LEMON_VERSION
3

	
1 4
/* Define to 1 if you have long long */
0 comments (0 inline)