diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,13 +3,15 @@ SET(PROJECT_NAME "LEMON") PROJECT(${PROJECT_NAME}) +INCLUDE(FindPythonInterp) + IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake) INCLUDE(${PROJECT_SOURCE_DIR}/cmake/version.cmake) ELSEIF(DEFINED ENV{LEMON_VERSION}) SET(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.") ELSE() EXECUTE_PROCESS( - COMMAND ./scripts/chg-len.py + COMMAND ${PYTHON_EXECUTABLE} ./scripts/chg-len.py WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE HG_REVISION_PATH ERROR_QUIET @@ -25,7 +27,11 @@ IF(HG_REVISION STREQUAL "") SET(HG_REVISION_ID "hg-tip") ELSE() - SET(HG_REVISION_ID ${HG_REVISION_PATH}.${HG_REVISION}) + IF(HG_REVISION_PATH STREQUAL "") + SET(HG_REVISION_ID ${HG_REVISION}) + ELSE() + SET(HG_REVISION_ID ${HG_REVISION_PATH}.${HG_REVISION}) + ENDIF() ENDIF() SET(LEMON_VERSION ${HG_REVISION_ID} CACHE STRING "LEMON version string.") ENDIF() @@ -44,8 +50,6 @@ CHECK_TYPE_SIZE("long long" LONG_LONG) SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG}) -INCLUDE(FindPythonInterp) - ENABLE_TESTING() ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})