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