Safer call of ./scripts/chg-len.py on Windows (#389)
authorAlpar Juttner <alpar@cs.elte.hu>
Fri, 03 Sep 2010 15:37:19 +0200
changeset 8997d166b8b8018
parent 898 e74b5db4f2c6
child 900 659ba4805a48
Safer call of ./scripts/chg-len.py on Windows (#389)

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
CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Wed Aug 25 22:02:40 2010 +0200
     1.2 +++ b/CMakeLists.txt	Fri Sep 03 15:37:19 2010 +0200
     1.3 @@ -3,13 +3,15 @@
     1.4  SET(PROJECT_NAME "LEMON")
     1.5  PROJECT(${PROJECT_NAME})
     1.6  
     1.7 +INCLUDE(FindPythonInterp)
     1.8 +
     1.9  IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake)
    1.10    INCLUDE(${PROJECT_SOURCE_DIR}/cmake/version.cmake)
    1.11  ELSEIF(DEFINED ENV{LEMON_VERSION})
    1.12    SET(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.")
    1.13  ELSE()
    1.14    EXECUTE_PROCESS(
    1.15 -    COMMAND ./scripts/chg-len.py
    1.16 +    COMMAND ${PYTHON_EXECUTABLE} ./scripts/chg-len.py
    1.17      WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
    1.18      OUTPUT_VARIABLE HG_REVISION_PATH
    1.19      ERROR_QUIET
    1.20 @@ -25,7 +27,11 @@
    1.21    IF(HG_REVISION STREQUAL "")
    1.22      SET(HG_REVISION_ID "hg-tip")
    1.23    ELSE()
    1.24 -    SET(HG_REVISION_ID ${HG_REVISION_PATH}.${HG_REVISION})
    1.25 +    IF(HG_REVISION_PATH STREQUAL "")
    1.26 +      SET(HG_REVISION_ID ${HG_REVISION})
    1.27 +    ELSE()
    1.28 +      SET(HG_REVISION_ID ${HG_REVISION_PATH}.${HG_REVISION})
    1.29 +    ENDIF()
    1.30    ENDIF()
    1.31    SET(LEMON_VERSION ${HG_REVISION_ID} CACHE STRING "LEMON version string.")
    1.32  ENDIF()
    1.33 @@ -44,8 +50,6 @@
    1.34  CHECK_TYPE_SIZE("long long" LONG_LONG)
    1.35  SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
    1.36  
    1.37 -INCLUDE(FindPythonInterp)
    1.38 -
    1.39  ENABLE_TESTING()
    1.40  
    1.41  ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})