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