COIN-OR::LEMON - Graph Library

source: lemon/CMakeLists.txt @ 993:e74b5db4f2c6

Last change on this file since 993:e74b5db4f2c6 was 993:e74b5db4f2c6, checked in by Akos Ladanyi <ladanyi@…>, 14 years ago

Put the output of chg-len.py in the version string (#389)

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