COIN-OR::LEMON - Graph Library

Ticket #389: bba484e8f742.patch

File bba484e8f742.patch, 1.6 KB (added by Alpar Juttner, 14 years ago)
  • CMakeLists.txt

    # 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  
    33SET(PROJECT_NAME "LEMON")
    44PROJECT(${PROJECT_NAME})
    55
     6INCLUDE(FindPythonInterp)
     7
    68IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake)
    79  INCLUDE(${PROJECT_SOURCE_DIR}/cmake/version.cmake)
    810ELSEIF(DEFINED ENV{LEMON_VERSION})
    911  SET(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.")
    1012ELSE()
    1113  EXECUTE_PROCESS(
    12     COMMAND ./scripts/chg-len.py
     14    COMMAND ${PYTHON_EXECUTABLE} ./scripts/chg-len.py
    1315    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
    1416    OUTPUT_VARIABLE HG_REVISION_PATH
    1517    ERROR_QUIET
     
    2527  IF(HG_REVISION STREQUAL "")
    2628    SET(HG_REVISION_ID "hg-tip")
    2729  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()
    2935  ENDIF()
    3036  SET(LEMON_VERSION ${HG_REVISION_ID} CACHE STRING "LEMON version string.")
    3137ENDIF()
     
    4450CHECK_TYPE_SIZE("long long" LONG_LONG)
    4551SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
    4652
    47 INCLUDE(FindPythonInterp)
    48 
    4953ENABLE_TESTING()
    5054
    5155ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})