COIN-OR::LEMON - Graph Library

source: lemon/CMakeLists.txt @ 994:7d166b8b8018

Last change on this file since 994:7d166b8b8018 was 994:7d166b8b8018, checked in by Alpar Juttner <alpar@…>, 9 years ago

Safer call of ./scripts/chg-len.py on Windows (#389)

Still hard to get it worked properly by user. It needs

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