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
1 1
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
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

	
12 23
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
13 24

	
14 25
INCLUDE(FindDoxygen)
15 26
INCLUDE(FindGhostscript)
16 27
FIND_PACKAGE(GLPK 4.33)
17 28
FIND_PACKAGE(CPLEX)
18 29
FIND_PACKAGE(COIN)
19 30

	
20 31
INCLUDE(CheckTypeSize)
21 32
CHECK_TYPE_SIZE("long long" LONG_LONG)
22 33
SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
Ignore 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
... ...
@@ -10,24 +10,26 @@
10 10
			   [],
11 11
			   [lemon_hg_path().lemon_hg_revision()],
12 12
			   [lemon_version_number()])])
13 13

	
14 14
AC_PREREQ([2.59])
15 15
AC_INIT([LEMON], [lemon_version()], [lemon-user@lemon.cs.elte.hu], [lemon])
16 16
AC_CONFIG_AUX_DIR([build-aux])
17 17
AC_CONFIG_MACRO_DIR([m4])
18 18
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects nostdinc])
19 19
AC_CONFIG_SRCDIR([lemon/list_graph.h])
20 20
AC_CONFIG_HEADERS([config.h lemon/config.h])
21 21

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

	
22 24
dnl Do compilation tests using the C++ compiler.
23 25
AC_LANG([C++])
24 26

	
25 27
dnl Check the existence of long long type.
26 28
AC_CHECK_TYPE(long long, [long_long_found=yes], [long_long_found=no])
27 29
if test x"$long_long_found" = x"yes"; then
28 30
  AC_DEFINE([LEMON_HAVE_LONG_LONG], [1], [Define to 1 if you have long long.])
29 31
fi
30 32

	
31 33
dnl Checks for programs.
32 34
AC_PROG_CXX
33 35
AC_PROG_CXXCPP
Ignore white space 6 line context
1
#define LEMON_VERSION "@PROJECT_VERSION@"
1 2
#cmakedefine LEMON_HAVE_LONG_LONG 1
2 3
#cmakedefine LEMON_HAVE_LP 1
3 4
#cmakedefine LEMON_HAVE_MIP 1
4 5
#cmakedefine LEMON_HAVE_GLPK 1
5 6
#cmakedefine LEMON_HAVE_CPLEX 1
6 7
#cmakedefine LEMON_HAVE_CLP 1
7 8
#cmakedefine LEMON_HAVE_CBC 1
Ignore white space 24 line context
1
/* The version string */
2
#undef LEMON_VERSION
3

	
1 4
/* Define to 1 if you have long long */
2 5
#undef LEMON_HAVE_LONG_LONG
3 6

	
4 7
/* Define to 1 if you have any LP solver. */
5 8
#undef LEMON_HAVE_LP
6 9

	
7 10
/* Define to 1 if you have any MIP solver. */
8 11
#undef LEMON_HAVE_MIP
9 12

	
10 13
/* Define to 1 if you have CPLEX. */
11 14
#undef LEMON_HAVE_CPLEX
12 15

	
0 comments (0 inline)