COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r540 r791  
    11CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
    22
    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)
    9 
     3SET(PROJECT_NAME "LEMON")
    104PROJECT(${PROJECT_NAME})
    115
    12 SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
     6IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake)
     7  INCLUDE(${PROJECT_SOURCE_DIR}/cmake/version.cmake)
     8ELSEIF(DEFINED ENV{LEMON_VERSION})
     9  SET(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.")
     10ELSE()
     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  IF(HG_REVISION STREQUAL "")
     19    SET(HG_REVISION "hg-tip")
     20  ENDIF()
     21  SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.")
     22ENDIF()
    1323
    14 INCLUDE(FindDoxygen)
    15 INCLUDE(FindGhostscript)
     24SET(PROJECT_VERSION ${LEMON_VERSION})
    1625
    17 ADD_DEFINITIONS(-DHAVE_CONFIG_H)
     26SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
     27
     28FIND_PACKAGE(Doxygen)
     29FIND_PACKAGE(Ghostscript)
     30FIND_PACKAGE(GLPK 4.33)
     31FIND_PACKAGE(CPLEX)
     32FIND_PACKAGE(COIN)
    1833
    1934INCLUDE(CheckTypeSize)
    20 CHECK_TYPE_SIZE("long long" LEMON_LONG_LONG)
     35CHECK_TYPE_SIZE("long long" LONG_LONG)
     36SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
     37
     38INCLUDE(FindPythonInterp)
    2139
    2240ENABLE_TESTING()
    2341
    2442ADD_SUBDIRECTORY(lemon)
    25 ADD_SUBDIRECTORY(demo)
    26 ADD_SUBDIRECTORY(doc)
    27 ADD_SUBDIRECTORY(test)
     43IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
     44  ADD_SUBDIRECTORY(demo)
     45  ADD_SUBDIRECTORY(tools)
     46  ADD_SUBDIRECTORY(doc)
     47  ADD_SUBDIRECTORY(test)
     48ENDIF()
    2849
    29 IF(WIN32)
     50CONFIGURE_FILE(
     51  ${PROJECT_SOURCE_DIR}/cmake/LEMONConfig.cmake.in
     52  ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
     53  @ONLY
     54)
     55IF(UNIX)
     56  INSTALL(
     57    FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
     58    DESTINATION share/lemon/cmake
     59  )
     60ELSEIF(WIN32)
     61  INSTALL(
     62    FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
     63    DESTINATION cmake
     64  )
     65ENDIF()
     66
     67IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR} AND WIN32)
    3068  SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
    3169  SET(CPACK_PACKAGE_VENDOR "EGRES")
    3270  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
    33     "LEMON - Library of Efficient Models and Optimization in Networks")
    34   SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
     71    "LEMON - Library for Efficient Modeling and Optimization in Networks")
     72  SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
    3573
    3674  SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
     
    4179    "${PROJECT_NAME} ${PROJECT_VERSION}")
    4280
    43   SET(CPACK_COMPONENTS_ALL headers library html_documentation)
     81  SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
    4482
    4583  SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
    4684  SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
     85  SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
    4786  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
    4887
     
    5190  SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
    5291    "DLL and import library")
     92  SET(CPACK_COMPONENT_BIN_DESCRIPTION
     93    "Command line utilities")
    5394  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
    5495    "Doxygen generated documentation")
     
    72113
    73114  SET(CPACK_GENERATOR "NSIS")
    74   SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/lemon.ico")
    75   SET(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/cmake/nsis/uninstall.ico")
    76   #SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
     115  SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico")
     116  SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
     117  #SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
    77118  SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
    78119  SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
     
    89130
    90131  INCLUDE(CPack)
    91 ENDIF(WIN32)
     132ENDIF()
Note: See TracChangeset for help on using the changeset viewer.