# HG changeset patch
# User Alpar Juttner <alpar@cs.elte.hu>
# Date 1283521039 -7200
# Node ID bba484e8f7426934216f45a488fd9fa030b3380f
# Parent e74b5db4f2c65b830730864ea94f956100f39e0a
Safer call of ./scripts/chg-len.py on Windows.
Still hard to get it worked properly by user. It needs
- a python interpreter in the exec path
- the mercurial modules accessible by this interpreter
diff --git a/CMakeLists.txt b/CMakeLists.txt
a
|
b
|
|
3 | 3 | SET(PROJECT_NAME "LEMON") |
4 | 4 | PROJECT(${PROJECT_NAME}) |
5 | 5 | |
| 6 | INCLUDE(FindPythonInterp) |
| 7 | |
6 | 8 | IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake) |
7 | 9 | INCLUDE(${PROJECT_SOURCE_DIR}/cmake/version.cmake) |
8 | 10 | ELSEIF(DEFINED ENV{LEMON_VERSION}) |
9 | 11 | SET(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.") |
10 | 12 | ELSE() |
11 | 13 | EXECUTE_PROCESS( |
12 | | COMMAND ./scripts/chg-len.py |
| 14 | COMMAND ${PYTHON_EXECUTABLE} ./scripts/chg-len.py |
13 | 15 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
14 | 16 | OUTPUT_VARIABLE HG_REVISION_PATH |
15 | 17 | ERROR_QUIET |
… |
… |
|
25 | 27 | IF(HG_REVISION STREQUAL "") |
26 | 28 | SET(HG_REVISION_ID "hg-tip") |
27 | 29 | ELSE() |
28 | | SET(HG_REVISION_ID ${HG_REVISION_PATH}.${HG_REVISION}) |
| 30 | IF(HG_REVISION_PATH STREQUAL "") |
| 31 | SET(HG_REVISION_ID ${HG_REVISION}) |
| 32 | ELSE() |
| 33 | SET(HG_REVISION_ID ${HG_REVISION_PATH}.${HG_REVISION}) |
| 34 | ENDIF() |
29 | 35 | ENDIF() |
30 | 36 | SET(LEMON_VERSION ${HG_REVISION_ID} CACHE STRING "LEMON version string.") |
31 | 37 | ENDIF() |
… |
… |
|
44 | 50 | CHECK_TYPE_SIZE("long long" LONG_LONG) |
45 | 51 | SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG}) |
46 | 52 | |
47 | | INCLUDE(FindPythonInterp) |
48 | | |
49 | 53 | ENABLE_TESTING() |
50 | 54 | |
51 | 55 | ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND}) |