CMakeLists.txt
author Alpar Juttner <alpar@cs.elte.hu>
Fri, 13 Feb 2009 15:01:09 +0000
changeset 558 06787db0ef5f
parent 554 e6ae4999cf22
parent 503 64c2641286df
child 564 2b6d5d22bb23
permissions -rw-r--r--
Change LEMON's isnan() to isNaN() for the sake of AIX/xlC

Certain xlC versions implement isnan() as a #define.
alpar@225
     1
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
alpar@225
     2
alpar@503
     3
IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
alpar@503
     4
  INCLUDE(${CMAKE_SOURCE_DIR}/cmake/version.cmake)
alpar@503
     5
ELSE(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
alpar@503
     6
  SET(PROJECT_NAME "LEMON")
alpar@503
     7
  SET(PROJECT_VERSION "hg-tip" CACHE STRING "LEMON version string.")
alpar@503
     8
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
alpar@225
     9
alpar@225
    10
PROJECT(${PROJECT_NAME})
alpar@225
    11
alpar@225
    12
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
alpar@225
    13
alpar@225
    14
INCLUDE(FindDoxygen)
alpar@225
    15
INCLUDE(FindGhostscript)
ladanyi@496
    16
FIND_PACKAGE(GLPK 4.33)
ladanyi@496
    17
ladanyi@496
    18
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
ladanyi@496
    19
alpar@554
    20
IF(MSVC)
alpar@554
    21
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4800 /wd4996")
alpar@554
    22
# Suppressed warnings:
alpar@554
    23
# C4250: 'class1' : inherits 'class2::member' via dominance
alpar@554
    24
# C4355: 'this' : used in base member initializer list
alpar@554
    25
# C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
alpar@554
    26
# C4996: 'function': was declared deprecated
alpar@554
    27
ENDIF(MSVC)
alpar@554
    28
ladanyi@496
    29
IF(GLPK_FOUND)
ladanyi@496
    30
  SET(HAVE_LP TRUE)
ladanyi@496
    31
  SET(HAVE_MIP TRUE)
ladanyi@496
    32
  SET(HAVE_GLPK TRUE)
ladanyi@496
    33
ENDIF(GLPK_FOUND)
alpar@225
    34
alpar@225
    35
ENABLE_TESTING()
alpar@225
    36
alpar@225
    37
ADD_SUBDIRECTORY(lemon)
alpar@225
    38
ADD_SUBDIRECTORY(demo)
alpar@225
    39
ADD_SUBDIRECTORY(doc)
alpar@225
    40
ADD_SUBDIRECTORY(test)
alpar@225
    41
alpar@225
    42
IF(WIN32)
alpar@225
    43
  SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
ladanyi@502
    44
  SET(CPACK_PACKAGE_VENDOR "EGRES")
alpar@225
    45
  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
ladanyi@236
    46
    "LEMON - Library of Efficient Models and Optimization in Networks")
alpar@225
    47
  SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
alpar@225
    48
alpar@225
    49
  SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
alpar@225
    50
alpar@225
    51
  SET(CPACK_PACKAGE_INSTALL_DIRECTORY
ladanyi@274
    52
    "${PROJECT_NAME} ${PROJECT_VERSION}")
alpar@225
    53
  SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
ladanyi@274
    54
    "${PROJECT_NAME} ${PROJECT_VERSION}")
alpar@225
    55
ladanyi@502
    56
  SET(CPACK_COMPONENTS_ALL headers library html_documentation)
alpar@225
    57
ladanyi@502
    58
  SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
ladanyi@502
    59
  SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
ladanyi@502
    60
  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
alpar@225
    61
ladanyi@502
    62
  SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
ladanyi@502
    63
    "C++ header files")
ladanyi@502
    64
  SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
ladanyi@502
    65
    "DLL and import library")
ladanyi@502
    66
  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
ladanyi@502
    67
    "Doxygen generated documentation")
alpar@225
    68
ladanyi@502
    69
  SET(CPACK_COMPONENT_HEADERS_DEPENDS library)
alpar@225
    70
ladanyi@502
    71
  SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
ladanyi@502
    72
  SET(CPACK_COMPONENT_LIBRARY_GROUP "Development")
ladanyi@502
    73
  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation")
alpar@225
    74
ladanyi@502
    75
  SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
ladanyi@502
    76
    "Components needed to develop software using LEMON")
ladanyi@502
    77
  SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION
ladanyi@502
    78
    "Documentation of LEMON")
alpar@225
    79
ladanyi@502
    80
  SET(CPACK_ALL_INSTALL_TYPES Full Developer)
alpar@225
    81
ladanyi@502
    82
  SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
ladanyi@502
    83
  SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full)
ladanyi@502
    84
  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
alpar@225
    85
alpar@225
    86
  SET(CPACK_GENERATOR "NSIS")
alpar@225
    87
  SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/lemon.ico")
alpar@225
    88
  SET(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/cmake/nsis/uninstall.ico")
alpar@225
    89
  #SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
alpar@225
    90
  SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
alpar@225
    91
  SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
alpar@225
    92
  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
alpar@225
    93
  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
alpar@225
    94
  SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
alpar@225
    95
  SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
alpar@225
    96
    CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\doc\\\\index.html\\\"
alpar@225
    97
    ")
alpar@225
    98
  SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
alpar@225
    99
    !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
alpar@225
   100
    Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\"
alpar@225
   101
    ")
alpar@225
   102
alpar@225
   103
  INCLUDE(CPack)
alpar@225
   104
ENDIF(WIN32)