CMakeLists.txt
author Peter Kovacs <kpeter@inf.elte.hu>
Fri, 26 Feb 2010 23:53:09 +0100
changeset 841 aa8c9008b3de
parent 680 257e91516e09
child 897 e20fecd1945f
child 964 2b6bffe0e7e8
permissions -rw-r--r--
Better return type for cycleLength() functions (#179)
in the min mean cycle algorithms.

The original Value type is used instead of the LargeValue type,
which is introduced for internal computations.
alpar@225
     1
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
alpar@225
     2
ladanyi@678
     3
SET(PROJECT_NAME "LEMON")
ladanyi@678
     4
PROJECT(${PROJECT_NAME})
alpar@225
     5
ladanyi@678
     6
IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake)
ladanyi@678
     7
  INCLUDE(${PROJECT_SOURCE_DIR}/cmake/version.cmake)
ladanyi@678
     8
ELSEIF(DEFINED ENV{LEMON_VERSION})
ladanyi@678
     9
  SET(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.")
ladanyi@678
    10
ELSE()
ladanyi@678
    11
  EXECUTE_PROCESS(
ladanyi@678
    12
    COMMAND hg id -i
ladanyi@678
    13
    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
ladanyi@678
    14
    OUTPUT_VARIABLE HG_REVISION
ladanyi@678
    15
    ERROR_QUIET
ladanyi@678
    16
    OUTPUT_STRIP_TRAILING_WHITESPACE
ladanyi@678
    17
  )
ladanyi@680
    18
  IF(HG_REVISION STREQUAL "")
ladanyi@680
    19
    SET(HG_REVISION "hg-tip")
ladanyi@680
    20
  ENDIF()
ladanyi@678
    21
  SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.")
ladanyi@678
    22
ENDIF()
ladanyi@678
    23
ladanyi@678
    24
SET(PROJECT_VERSION ${LEMON_VERSION})
alpar@225
    25
ladanyi@549
    26
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
alpar@225
    27
ladanyi@679
    28
FIND_PACKAGE(Doxygen)
ladanyi@679
    29
FIND_PACKAGE(Ghostscript)
ladanyi@473
    30
FIND_PACKAGE(GLPK 4.33)
ladanyi@620
    31
FIND_PACKAGE(CPLEX)
ladanyi@621
    32
FIND_PACKAGE(COIN)
ladanyi@473
    33
alpar@496
    34
INCLUDE(CheckTypeSize)
ladanyi@677
    35
CHECK_TYPE_SIZE("long long" LONG_LONG)
ladanyi@677
    36
SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
alpar@496
    37
alpar@744
    38
INCLUDE(FindPythonInterp)
alpar@744
    39
alpar@225
    40
ENABLE_TESTING()
alpar@225
    41
alpar@225
    42
ADD_SUBDIRECTORY(lemon)
ladanyi@549
    43
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
ladanyi@549
    44
  ADD_SUBDIRECTORY(demo)
ladanyi@549
    45
  ADD_SUBDIRECTORY(tools)
ladanyi@549
    46
  ADD_SUBDIRECTORY(doc)
ladanyi@549
    47
  ADD_SUBDIRECTORY(test)
ladanyi@679
    48
ENDIF()
alpar@225
    49
ladanyi@675
    50
CONFIGURE_FILE(
ladanyi@675
    51
  ${PROJECT_SOURCE_DIR}/cmake/LEMONConfig.cmake.in
ladanyi@675
    52
  ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
ladanyi@675
    53
  @ONLY
ladanyi@675
    54
)
ladanyi@675
    55
IF(UNIX)
ladanyi@675
    56
  INSTALL(
ladanyi@675
    57
    FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
ladanyi@675
    58
    DESTINATION share/lemon/cmake
ladanyi@675
    59
  )
ladanyi@675
    60
ELSEIF(WIN32)
ladanyi@675
    61
  INSTALL(
ladanyi@675
    62
    FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
ladanyi@675
    63
    DESTINATION cmake
ladanyi@675
    64
  )
ladanyi@679
    65
ENDIF()
ladanyi@675
    66
ladanyi@679
    67
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR} AND WIN32)
ladanyi@679
    68
  SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
ladanyi@679
    69
  SET(CPACK_PACKAGE_VENDOR "EGRES")
ladanyi@679
    70
  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
ladanyi@679
    71
    "LEMON - Library for Efficient Modeling and Optimization in Networks")
ladanyi@679
    72
  SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
alpar@225
    73
ladanyi@679
    74
  SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
alpar@225
    75
ladanyi@679
    76
  SET(CPACK_PACKAGE_INSTALL_DIRECTORY
ladanyi@679
    77
    "${PROJECT_NAME} ${PROJECT_VERSION}")
ladanyi@679
    78
  SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
ladanyi@679
    79
    "${PROJECT_NAME} ${PROJECT_VERSION}")
alpar@225
    80
ladanyi@679
    81
  SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
alpar@225
    82
ladanyi@679
    83
  SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
ladanyi@679
    84
  SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
ladanyi@679
    85
  SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
ladanyi@679
    86
  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
alpar@225
    87
ladanyi@679
    88
  SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
ladanyi@679
    89
    "C++ header files")
ladanyi@679
    90
  SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
ladanyi@679
    91
    "DLL and import library")
ladanyi@679
    92
  SET(CPACK_COMPONENT_BIN_DESCRIPTION
ladanyi@679
    93
    "Command line utilities")
ladanyi@679
    94
  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
ladanyi@679
    95
    "Doxygen generated documentation")
alpar@225
    96
ladanyi@679
    97
  SET(CPACK_COMPONENT_HEADERS_DEPENDS library)
alpar@225
    98
ladanyi@679
    99
  SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
ladanyi@679
   100
  SET(CPACK_COMPONENT_LIBRARY_GROUP "Development")
ladanyi@679
   101
  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation")
alpar@225
   102
ladanyi@679
   103
  SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
ladanyi@679
   104
    "Components needed to develop software using LEMON")
ladanyi@679
   105
  SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION
ladanyi@679
   106
    "Documentation of LEMON")
alpar@225
   107
ladanyi@679
   108
  SET(CPACK_ALL_INSTALL_TYPES Full Developer)
alpar@225
   109
ladanyi@679
   110
  SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
ladanyi@679
   111
  SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full)
ladanyi@679
   112
  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
alpar@225
   113
ladanyi@679
   114
  SET(CPACK_GENERATOR "NSIS")
ladanyi@679
   115
  SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico")
ladanyi@679
   116
  SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
ladanyi@679
   117
  #SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
ladanyi@679
   118
  SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
ladanyi@679
   119
  SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
ladanyi@679
   120
  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
ladanyi@679
   121
  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
ladanyi@679
   122
  SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
ladanyi@679
   123
  SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
ladanyi@679
   124
    CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\"
ladanyi@679
   125
    ")
ladanyi@679
   126
  SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
ladanyi@679
   127
    !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
ladanyi@679
   128
    Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\"
ladanyi@679
   129
    ")
alpar@225
   130
ladanyi@679
   131
  INCLUDE(CPack)
ladanyi@679
   132
ENDIF()