COIN-OR::LEMON - Graph Library

source: lemon/CMakeLists.txt @ 725:d1e1cd94bf49

Last change on this file since 725:d1e1cd94bf49 was 725:d1e1cd94bf49, checked in by Akos Ladanyi <ladanyi@…>, 11 years ago

Put the version string into config.h

Also make it possible to set the version using the LEMON_VERSION environment
variable, and use the hg revision as version string in case this variable is
unset.

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