CMakeLists.txt
author Peter Kovacs <kpeter@inf.elte.hu>
Fri, 24 Apr 2009 12:22:06 +0200
changeset 613 b1811c363299
parent 549 ba659d676331
child 619 ec817dfc2cb7
permissions -rw-r--r--
Bug fix in NetworkSimplex (#234)
alpar@225
     1
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
alpar@225
     2
alpar@478
     3
IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
alpar@478
     4
  INCLUDE(${CMAKE_SOURCE_DIR}/cmake/version.cmake)
alpar@478
     5
ELSE(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
alpar@478
     6
  SET(PROJECT_NAME "LEMON")
alpar@478
     7
  SET(PROJECT_VERSION "hg-tip" CACHE STRING "LEMON version string.")
alpar@478
     8
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
alpar@225
     9
alpar@225
    10
PROJECT(${PROJECT_NAME})
alpar@225
    11
ladanyi@549
    12
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
alpar@225
    13
alpar@225
    14
INCLUDE(FindDoxygen)
alpar@225
    15
INCLUDE(FindGhostscript)
ladanyi@473
    16
FIND_PACKAGE(GLPK 4.33)
ladanyi@473
    17
ladanyi@473
    18
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
ladanyi@473
    19
alpar@507
    20
IF(MSVC)
alpar@507
    21
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4800 /wd4996")
alpar@507
    22
# Suppressed warnings:
alpar@507
    23
# C4250: 'class1' : inherits 'class2::member' via dominance
alpar@507
    24
# C4355: 'this' : used in base member initializer list
alpar@507
    25
# C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
alpar@507
    26
# C4996: 'function': was declared deprecated
alpar@507
    27
ENDIF(MSVC)
alpar@507
    28
ladanyi@473
    29
IF(GLPK_FOUND)
ladanyi@473
    30
  SET(HAVE_LP TRUE)
ladanyi@473
    31
  SET(HAVE_MIP TRUE)
ladanyi@473
    32
  SET(HAVE_GLPK TRUE)
ladanyi@473
    33
ENDIF(GLPK_FOUND)
alpar@225
    34
alpar@485
    35
INCLUDE(CheckTypeSize)
alpar@485
    36
CHECK_TYPE_SIZE("long long" LONG_LONG)
alpar@485
    37
alpar@225
    38
ENABLE_TESTING()
alpar@225
    39
alpar@225
    40
ADD_SUBDIRECTORY(lemon)
ladanyi@549
    41
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
ladanyi@549
    42
  ADD_SUBDIRECTORY(demo)
ladanyi@549
    43
  ADD_SUBDIRECTORY(tools)
ladanyi@549
    44
  ADD_SUBDIRECTORY(doc)
ladanyi@549
    45
  ADD_SUBDIRECTORY(test)
ladanyi@549
    46
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
alpar@225
    47
ladanyi@552
    48
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
ladanyi@552
    49
  IF(WIN32)
ladanyi@552
    50
    SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
ladanyi@552
    51
    SET(CPACK_PACKAGE_VENDOR "EGRES")
ladanyi@552
    52
    SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
ladanyi@552
    53
      "LEMON - Library of Efficient Models and Optimization in Networks")
ladanyi@552
    54
    SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
alpar@225
    55
ladanyi@552
    56
    SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
alpar@225
    57
ladanyi@552
    58
    SET(CPACK_PACKAGE_INSTALL_DIRECTORY
ladanyi@552
    59
      "${PROJECT_NAME} ${PROJECT_VERSION}")
ladanyi@552
    60
    SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
ladanyi@552
    61
      "${PROJECT_NAME} ${PROJECT_VERSION}")
alpar@225
    62
ladanyi@552
    63
    SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
alpar@225
    64
ladanyi@552
    65
    SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
ladanyi@552
    66
    SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
ladanyi@552
    67
    SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
ladanyi@552
    68
    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
alpar@225
    69
ladanyi@552
    70
    SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
ladanyi@552
    71
      "C++ header files")
ladanyi@552
    72
    SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
ladanyi@552
    73
      "DLL and import library")
ladanyi@552
    74
    SET(CPACK_COMPONENT_BIN_DESCRIPTION
ladanyi@552
    75
      "Command line utilities")
ladanyi@552
    76
    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
ladanyi@552
    77
      "Doxygen generated documentation")
alpar@225
    78
ladanyi@552
    79
    SET(CPACK_COMPONENT_HEADERS_DEPENDS library)
alpar@225
    80
ladanyi@552
    81
    SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
ladanyi@552
    82
    SET(CPACK_COMPONENT_LIBRARY_GROUP "Development")
ladanyi@552
    83
    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation")
alpar@225
    84
ladanyi@552
    85
    SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
ladanyi@552
    86
      "Components needed to develop software using LEMON")
ladanyi@552
    87
    SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION
ladanyi@552
    88
      "Documentation of LEMON")
alpar@225
    89
ladanyi@552
    90
    SET(CPACK_ALL_INSTALL_TYPES Full Developer)
alpar@225
    91
ladanyi@552
    92
    SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
ladanyi@552
    93
    SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full)
ladanyi@552
    94
    SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
alpar@225
    95
ladanyi@552
    96
    SET(CPACK_GENERATOR "NSIS")
ladanyi@552
    97
    SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico")
ladanyi@552
    98
    SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
ladanyi@552
    99
    #SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
ladanyi@552
   100
    SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
ladanyi@552
   101
    SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
ladanyi@552
   102
    SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
ladanyi@552
   103
    SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
ladanyi@552
   104
    SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
ladanyi@552
   105
    SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
ladanyi@552
   106
      CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\"
ladanyi@552
   107
      ")
ladanyi@552
   108
    SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
ladanyi@552
   109
      !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
ladanyi@552
   110
      Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\"
ladanyi@552
   111
      ")
alpar@225
   112
ladanyi@552
   113
    INCLUDE(CPack)
ladanyi@552
   114
  ENDIF(WIN32)
ladanyi@552
   115
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})