alpar@1305
|
1 |
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
alpar@225
|
2 |
|
alpar@1322
|
3 |
IF(POLICY CMP0048)
|
alpar@1322
|
4 |
CMAKE_POLICY(SET CMP0048 OLD)
|
alpar@1322
|
5 |
ENDIF(POLICY CMP0048)
|
alpar@1313
|
6 |
|
alpar@1344
|
7 |
IF(POLICY CMP0026)
|
alpar@1344
|
8 |
#This is for copying the dll's needed by glpk (in lp_test and mip_test)
|
alpar@1344
|
9 |
CMAKE_POLICY(SET CMP0026 OLD)
|
alpar@1344
|
10 |
ENDIF(POLICY CMP0026)
|
alpar@1344
|
11 |
|
ladanyi@725
|
12 |
SET(PROJECT_NAME "LEMON")
|
ladanyi@725
|
13 |
PROJECT(${PROJECT_NAME})
|
alpar@225
|
14 |
|
alpar@1033
|
15 |
INCLUDE(FindPythonInterp)
|
alpar@1033
|
16 |
INCLUDE(FindWget)
|
alpar@1033
|
17 |
|
ladanyi@725
|
18 |
IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake)
|
ladanyi@725
|
19 |
INCLUDE(${PROJECT_SOURCE_DIR}/cmake/version.cmake)
|
ladanyi@725
|
20 |
ELSEIF(DEFINED ENV{LEMON_VERSION})
|
ladanyi@725
|
21 |
SET(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.")
|
ladanyi@725
|
22 |
ELSE()
|
ladanyi@725
|
23 |
EXECUTE_PROCESS(
|
alpar@1134
|
24 |
COMMAND
|
alpar@1134
|
25 |
hg log -r. --template "{latesttag}"
|
alpar@1033
|
26 |
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
alpar@1134
|
27 |
OUTPUT_VARIABLE HG_REVISION_TAG
|
alpar@1033
|
28 |
ERROR_QUIET
|
alpar@1033
|
29 |
OUTPUT_STRIP_TRAILING_WHITESPACE
|
alpar@1033
|
30 |
)
|
alpar@1033
|
31 |
EXECUTE_PROCESS(
|
alpar@1134
|
32 |
COMMAND
|
alpar@1134
|
33 |
hg log -r. --template "{latesttagdistance}"
|
ladanyi@725
|
34 |
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
alpar@1134
|
35 |
OUTPUT_VARIABLE HG_REVISION_DIST
|
ladanyi@725
|
36 |
ERROR_QUIET
|
ladanyi@725
|
37 |
OUTPUT_STRIP_TRAILING_WHITESPACE
|
ladanyi@725
|
38 |
)
|
alpar@1134
|
39 |
EXECUTE_PROCESS(
|
alpar@1134
|
40 |
COMMAND
|
alpar@1134
|
41 |
hg log -r. --template "{node|short}"
|
alpar@1134
|
42 |
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
alpar@1134
|
43 |
OUTPUT_VARIABLE HG_REVISION_ID
|
alpar@1134
|
44 |
ERROR_QUIET
|
alpar@1134
|
45 |
OUTPUT_STRIP_TRAILING_WHITESPACE
|
alpar@1134
|
46 |
)
|
alpar@1134
|
47 |
|
alpar@1134
|
48 |
IF(HG_REVISION_TAG STREQUAL "")
|
alpar@1033
|
49 |
SET(HG_REVISION_ID "hg-tip")
|
alpar@1033
|
50 |
ELSE()
|
alpar@1134
|
51 |
IF(HG_REVISION_TAG STREQUAL "null")
|
alpar@1134
|
52 |
SET(HG_REVISION_TAG "trunk")
|
alpar@1134
|
53 |
ELSEIF(HG_REVISION_TAG MATCHES "^r")
|
alpar@1134
|
54 |
STRING(SUBSTRING ${HG_REVISION_TAG} 1 -1 HG_REVISION_TAG)
|
alpar@1134
|
55 |
ENDIF()
|
alpar@1134
|
56 |
IF(HG_REVISION_DIST STREQUAL "0")
|
alpar@1134
|
57 |
SET(HG_REVISION ${HG_REVISION_TAG})
|
alpar@1033
|
58 |
ELSE()
|
alpar@1134
|
59 |
SET(HG_REVISION
|
alpar@1134
|
60 |
"${HG_REVISION_TAG}+${HG_REVISION_DIST}-${HG_REVISION_ID}")
|
alpar@1033
|
61 |
ENDIF()
|
ladanyi@727
|
62 |
ENDIF()
|
alpar@1134
|
63 |
|
alpar@1134
|
64 |
SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.")
|
ladanyi@725
|
65 |
ENDIF()
|
ladanyi@725
|
66 |
|
ladanyi@725
|
67 |
SET(PROJECT_VERSION ${LEMON_VERSION})
|
alpar@225
|
68 |
|
ladanyi@596
|
69 |
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
alpar@225
|
70 |
|
ladanyi@726
|
71 |
FIND_PACKAGE(Doxygen)
|
ladanyi@726
|
72 |
FIND_PACKAGE(Ghostscript)
|
alpar@1232
|
73 |
|
alpar@1340
|
74 |
IF(WIN32)
|
alpar@1340
|
75 |
SET(LEMON_WIN32 TRUE)
|
alpar@1340
|
76 |
ENDIF(WIN32)
|
alpar@1340
|
77 |
|
alpar@1232
|
78 |
SET(LEMON_ENABLE_GLPK YES CACHE STRING "Enable GLPK solver backend.")
|
alpar@1232
|
79 |
SET(LEMON_ENABLE_ILOG YES CACHE STRING "Enable ILOG (CPLEX) solver backend.")
|
alpar@1232
|
80 |
SET(LEMON_ENABLE_COIN YES CACHE STRING "Enable COIN solver backend.")
|
alpar@1264
|
81 |
SET(LEMON_ENABLE_SOPLEX YES CACHE STRING "Enable SoPlex solver backend.")
|
alpar@1232
|
82 |
|
alpar@1232
|
83 |
IF(LEMON_ENABLE_GLPK)
|
alpar@1232
|
84 |
FIND_PACKAGE(GLPK 4.33)
|
alpar@1232
|
85 |
ENDIF(LEMON_ENABLE_GLPK)
|
alpar@1232
|
86 |
IF(LEMON_ENABLE_ILOG)
|
alpar@1232
|
87 |
FIND_PACKAGE(ILOG)
|
alpar@1232
|
88 |
ENDIF(LEMON_ENABLE_ILOG)
|
alpar@1232
|
89 |
IF(LEMON_ENABLE_COIN)
|
alpar@1232
|
90 |
FIND_PACKAGE(COIN)
|
alpar@1232
|
91 |
ENDIF(LEMON_ENABLE_COIN)
|
alpar@1264
|
92 |
IF(LEMON_ENABLE_SOPLEX)
|
alpar@1264
|
93 |
FIND_PACKAGE(SOPLEX)
|
alpar@1264
|
94 |
ENDIF(LEMON_ENABLE_SOPLEX)
|
alpar@1232
|
95 |
|
alpar@1232
|
96 |
IF(GLPK_FOUND)
|
alpar@1232
|
97 |
SET(LEMON_HAVE_LP TRUE)
|
alpar@1232
|
98 |
SET(LEMON_HAVE_MIP TRUE)
|
alpar@1232
|
99 |
SET(LEMON_HAVE_GLPK TRUE)
|
alpar@1232
|
100 |
ENDIF(GLPK_FOUND)
|
alpar@1232
|
101 |
IF(ILOG_FOUND)
|
alpar@1232
|
102 |
SET(LEMON_HAVE_LP TRUE)
|
alpar@1232
|
103 |
SET(LEMON_HAVE_MIP TRUE)
|
alpar@1234
|
104 |
SET(LEMON_HAVE_CPLEX TRUE)
|
alpar@1232
|
105 |
ENDIF(ILOG_FOUND)
|
alpar@1232
|
106 |
IF(COIN_FOUND)
|
alpar@1232
|
107 |
SET(LEMON_HAVE_LP TRUE)
|
alpar@1232
|
108 |
SET(LEMON_HAVE_MIP TRUE)
|
alpar@1232
|
109 |
SET(LEMON_HAVE_CLP TRUE)
|
alpar@1232
|
110 |
SET(LEMON_HAVE_CBC TRUE)
|
alpar@1232
|
111 |
ENDIF(COIN_FOUND)
|
alpar@1264
|
112 |
IF(SOPLEX_FOUND)
|
alpar@1264
|
113 |
SET(LEMON_HAVE_LP TRUE)
|
alpar@1264
|
114 |
SET(LEMON_HAVE_SOPLEX TRUE)
|
alpar@1264
|
115 |
ENDIF(SOPLEX_FOUND)
|
alpar@1232
|
116 |
|
alpar@1232
|
117 |
IF(ILOG_FOUND)
|
alpar@1232
|
118 |
SET(DEFAULT_LP "CPLEX")
|
alpar@1232
|
119 |
SET(DEFAULT_MIP "CPLEX")
|
alpar@1232
|
120 |
ELSEIF(COIN_FOUND)
|
alpar@1232
|
121 |
SET(DEFAULT_LP "CLP")
|
alpar@1232
|
122 |
SET(DEFAULT_MIP "CBC")
|
alpar@1232
|
123 |
ELSEIF(GLPK_FOUND)
|
alpar@1232
|
124 |
SET(DEFAULT_LP "GLPK")
|
alpar@1232
|
125 |
SET(DEFAULT_MIP "GLPK")
|
alpar@1264
|
126 |
ELSEIF(SOPLEX_FOUND)
|
alpar@1264
|
127 |
SET(DEFAULT_LP "SOPLEX")
|
alpar@1232
|
128 |
ENDIF()
|
alpar@1232
|
129 |
|
alpar@1232
|
130 |
IF(NOT LEMON_DEFAULT_LP OR
|
alpar@1232
|
131 |
(NOT ILOG_FOUND AND (LEMON_DEFAULT_LP STREQUAL "CPLEX")) OR
|
alpar@1232
|
132 |
(NOT COIN_FOUND AND (LEMON_DEFAULT_LP STREQUAL "CLP")) OR
|
alpar@1264
|
133 |
(NOT GLPK_FOUND AND (LEMON_DEFAULT_LP STREQUAL "GLPK")) OR
|
alpar@1264
|
134 |
(NOT SOPLEX_FOUND AND (LEMON_DEFAULT_LP STREQUAL "SOPLEX")))
|
alpar@1232
|
135 |
SET(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING
|
alpar@1264
|
136 |
"Default LP solver backend (GLPK, CPLEX, CLP or SOPLEX)" FORCE)
|
alpar@1300
|
137 |
ELSE()
|
alpar@1300
|
138 |
SET(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING
|
alpar@1300
|
139 |
"Default LP solver backend (GLPK, CPLEX, CLP or SOPLEX)")
|
alpar@1232
|
140 |
ENDIF()
|
alpar@1232
|
141 |
IF(NOT LEMON_DEFAULT_MIP OR
|
alpar@1232
|
142 |
(NOT ILOG_FOUND AND (LEMON_DEFAULT_MIP STREQUAL "CPLEX")) OR
|
alpar@1232
|
143 |
(NOT COIN_FOUND AND (LEMON_DEFAULT_MIP STREQUAL "CBC")) OR
|
alpar@1232
|
144 |
(NOT GLPK_FOUND AND (LEMON_DEFAULT_MIP STREQUAL "GLPK")))
|
alpar@1232
|
145 |
SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING
|
alpar@1232
|
146 |
"Default MIP solver backend (GLPK, CPLEX or CBC)" FORCE)
|
alpar@1300
|
147 |
ELSE()
|
alpar@1300
|
148 |
SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING
|
alpar@1300
|
149 |
"Default MIP solver backend (GLPK, CPLEX or CBC)")
|
alpar@1232
|
150 |
ENDIF()
|
alpar@1232
|
151 |
|
ladanyi@496
|
152 |
|
alpar@1033
|
153 |
IF(DEFINED ENV{LEMON_CXX_WARNING})
|
alpar@1033
|
154 |
SET(CXX_WARNING $ENV{LEMON_CXX_WARNING})
|
alpar@1033
|
155 |
ELSE()
|
alpar@1033
|
156 |
IF(CMAKE_COMPILER_IS_GNUCXX)
|
alpar@1053
|
157 |
SET(CXX_WARNING "-Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas")
|
alpar@1033
|
158 |
SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb")
|
alpar@1033
|
159 |
SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb")
|
alpar@1033
|
160 |
ELSEIF(MSVC)
|
alpar@1033
|
161 |
# This part is unnecessary 'casue the same is set by the lemon/core.h.
|
alpar@1327
|
162 |
# Still kept as an example.
|
alpar@1327
|
163 |
|
alpar@1327
|
164 |
# SET(CXX_WARNING "/wd4250 /wd4267 /wd4355 /wd4503 /wd4800 /wd4996")
|
alpar@1327
|
165 |
|
alpar@1033
|
166 |
# Suppressed warnings:
|
alpar@1033
|
167 |
# C4250: 'class1' : inherits 'class2::member' via dominance
|
alpar@1327
|
168 |
# C4267: conversion from 'size_t' to 'type', possible loss of data
|
alpar@1033
|
169 |
# C4355: 'this' : used in base member initializer list
|
alpar@1033
|
170 |
# C4503: 'function' : decorated name length exceeded, name was truncated
|
alpar@1033
|
171 |
# C4800: 'type' : forcing value to bool 'true' or 'false'
|
alpar@1033
|
172 |
# (performance warning)
|
alpar@1033
|
173 |
# C4996: 'function': was declared deprecated
|
alpar@1033
|
174 |
ELSE()
|
alpar@1125
|
175 |
SET(CXX_WARNING "-Wall")
|
alpar@1033
|
176 |
ENDIF()
|
alpar@1033
|
177 |
ENDIF()
|
alpar@1033
|
178 |
SET(LEMON_CXX_WARNING_FLAGS ${CXX_WARNING} CACHE STRING "LEMON warning flags.")
|
alpar@1033
|
179 |
|
alpar@1033
|
180 |
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LEMON_CXX_WARNING_FLAGS}")
|
alpar@1033
|
181 |
|
alpar@1185
|
182 |
IF(MSVC)
|
alpar@1326
|
183 |
SET(CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}")
|
alpar@1185
|
184 |
SET( CMAKE_CXX_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
|
alpar@1033
|
185 |
"Flags used by the C++ compiler during maintainer builds."
|
alpar@1185
|
186 |
)
|
alpar@1185
|
187 |
SET( CMAKE_C_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
|
alpar@1033
|
188 |
"Flags used by the C compiler during maintainer builds."
|
alpar@1185
|
189 |
)
|
alpar@1185
|
190 |
SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER
|
alpar@1185
|
191 |
"${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING
|
alpar@1185
|
192 |
"Flags used for linking binaries during maintainer builds."
|
alpar@1185
|
193 |
)
|
alpar@1185
|
194 |
SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER
|
alpar@1185
|
195 |
"${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING
|
alpar@1185
|
196 |
"Flags used by the shared libraries linker during maintainer builds."
|
alpar@1185
|
197 |
)
|
alpar@1185
|
198 |
ELSE()
|
alpar@1185
|
199 |
SET( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb -O0" CACHE STRING
|
alpar@1185
|
200 |
"Flags used by the C++ compiler during maintainer builds."
|
alpar@1185
|
201 |
)
|
alpar@1185
|
202 |
SET( CMAKE_C_FLAGS_MAINTAINER "-Werror -O0" CACHE STRING
|
alpar@1185
|
203 |
"Flags used by the C compiler during maintainer builds."
|
alpar@1185
|
204 |
)
|
alpar@1185
|
205 |
SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER
|
alpar@1310
|
206 |
"${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING
|
alpar@1033
|
207 |
"Flags used for linking binaries during maintainer builds."
|
alpar@1185
|
208 |
)
|
alpar@1185
|
209 |
SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER
|
alpar@1310
|
210 |
"${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING
|
alpar@1033
|
211 |
"Flags used by the shared libraries linker during maintainer builds."
|
alpar@1185
|
212 |
)
|
alpar@1185
|
213 |
ENDIF()
|
alpar@1185
|
214 |
|
alpar@1033
|
215 |
MARK_AS_ADVANCED(
|
alpar@1033
|
216 |
CMAKE_CXX_FLAGS_MAINTAINER
|
alpar@1033
|
217 |
CMAKE_C_FLAGS_MAINTAINER
|
alpar@1033
|
218 |
CMAKE_EXE_LINKER_FLAGS_MAINTAINER
|
alpar@1033
|
219 |
CMAKE_SHARED_LINKER_FLAGS_MAINTAINER )
|
alpar@1033
|
220 |
|
alpar@1033
|
221 |
IF(CMAKE_CONFIGURATION_TYPES)
|
alpar@1033
|
222 |
LIST(APPEND CMAKE_CONFIGURATION_TYPES Maintainer)
|
alpar@1033
|
223 |
LIST(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
|
alpar@1033
|
224 |
SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
|
alpar@1033
|
225 |
"Add the configurations that we need"
|
alpar@1033
|
226 |
FORCE)
|
alpar@1033
|
227 |
endif()
|
alpar@1033
|
228 |
|
alpar@1033
|
229 |
IF(NOT CMAKE_BUILD_TYPE)
|
alpar@1033
|
230 |
SET(CMAKE_BUILD_TYPE "Release")
|
alpar@1033
|
231 |
ENDIF()
|
alpar@1033
|
232 |
|
alpar@1033
|
233 |
SET( CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
|
alpar@1033
|
234 |
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel Maintainer."
|
alpar@1033
|
235 |
FORCE )
|
alpar@1033
|
236 |
|
alpar@1033
|
237 |
|
alpar@515
|
238 |
INCLUDE(CheckTypeSize)
|
ladanyi@724
|
239 |
CHECK_TYPE_SIZE("long long" LONG_LONG)
|
ladanyi@724
|
240 |
SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
|
alpar@515
|
241 |
|
deba@1131
|
242 |
INCLUDE(FindThreads)
|
alpar@1132
|
243 |
|
alpar@1132
|
244 |
IF(NOT LEMON_THREADING)
|
alpar@1132
|
245 |
IF(CMAKE_USE_PTHREADS_INIT)
|
alpar@1132
|
246 |
SET(LEMON_THREADING "Pthread")
|
alpar@1132
|
247 |
ELSEIF(CMAKE_USE_WIN32_THREADS_INIT)
|
alpar@1132
|
248 |
SET(LEMON_THREADING "Win32")
|
alpar@1132
|
249 |
ELSE()
|
alpar@1132
|
250 |
SET(LEMON_THREADING "None")
|
alpar@1132
|
251 |
ENDIF()
|
alpar@1132
|
252 |
ENDIF()
|
alpar@1132
|
253 |
|
alpar@1132
|
254 |
SET( LEMON_THREADING "${LEMON_THREADING}" CACHE STRING
|
alpar@1132
|
255 |
"Choose the threading library, options are: Pthread Win32 None."
|
alpar@1132
|
256 |
FORCE )
|
alpar@1132
|
257 |
|
alpar@1132
|
258 |
IF(LEMON_THREADING STREQUAL "Pthread")
|
alpar@1132
|
259 |
SET(LEMON_USE_PTHREAD TRUE)
|
alpar@1132
|
260 |
ELSEIF(LEMON_THREADING STREQUAL "Win32")
|
alpar@1132
|
261 |
SET(LEMON_USE_WIN32_THREADS TRUE)
|
alpar@1132
|
262 |
ENDIF()
|
alpar@791
|
263 |
|
alpar@225
|
264 |
ENABLE_TESTING()
|
alpar@225
|
265 |
|
alpar@1033
|
266 |
IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
|
alpar@1033
|
267 |
ADD_CUSTOM_TARGET(check ALL COMMAND ${CMAKE_CTEST_COMMAND})
|
alpar@1033
|
268 |
ELSE()
|
alpar@1033
|
269 |
ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})
|
alpar@1033
|
270 |
ENDIF()
|
alpar@1033
|
271 |
|
alpar@225
|
272 |
ADD_SUBDIRECTORY(lemon)
|
ladanyi@596
|
273 |
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
|
alpar@1031
|
274 |
ADD_SUBDIRECTORY(contrib)
|
ladanyi@596
|
275 |
ADD_SUBDIRECTORY(demo)
|
ladanyi@596
|
276 |
ADD_SUBDIRECTORY(tools)
|
ladanyi@596
|
277 |
ADD_SUBDIRECTORY(doc)
|
ladanyi@596
|
278 |
ADD_SUBDIRECTORY(test)
|
ladanyi@726
|
279 |
ENDIF()
|
alpar@225
|
280 |
|
ladanyi@722
|
281 |
CONFIGURE_FILE(
|
ladanyi@722
|
282 |
${PROJECT_SOURCE_DIR}/cmake/LEMONConfig.cmake.in
|
ladanyi@722
|
283 |
${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
|
ladanyi@722
|
284 |
@ONLY
|
ladanyi@722
|
285 |
)
|
ladanyi@722
|
286 |
IF(UNIX)
|
ladanyi@722
|
287 |
INSTALL(
|
ladanyi@722
|
288 |
FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
|
ladanyi@722
|
289 |
DESTINATION share/lemon/cmake
|
ladanyi@722
|
290 |
)
|
ladanyi@722
|
291 |
ELSEIF(WIN32)
|
ladanyi@722
|
292 |
INSTALL(
|
ladanyi@722
|
293 |
FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
|
ladanyi@722
|
294 |
DESTINATION cmake
|
ladanyi@722
|
295 |
)
|
ladanyi@726
|
296 |
ENDIF()
|
ladanyi@722
|
297 |
|
alpar@1135
|
298 |
CONFIGURE_FILE(
|
alpar@1135
|
299 |
${PROJECT_SOURCE_DIR}/cmake/version.cmake.in
|
alpar@1135
|
300 |
${PROJECT_BINARY_DIR}/cmake/version.cmake
|
alpar@1135
|
301 |
@ONLY
|
alpar@1135
|
302 |
)
|
alpar@1135
|
303 |
|
alpar@1135
|
304 |
SET(ARCHIVE_BASE_NAME ${CMAKE_PROJECT_NAME})
|
alpar@1135
|
305 |
STRING(TOLOWER ${ARCHIVE_BASE_NAME} ARCHIVE_BASE_NAME)
|
alpar@1135
|
306 |
SET(ARCHIVE_NAME ${ARCHIVE_BASE_NAME}-${PROJECT_VERSION})
|
alpar@1135
|
307 |
ADD_CUSTOM_TARGET(dist
|
alpar@1135
|
308 |
COMMAND cmake -E remove_directory ${ARCHIVE_NAME}
|
alpar@1135
|
309 |
COMMAND hg archive ${ARCHIVE_NAME}
|
alpar@1135
|
310 |
COMMAND cmake -E copy cmake/version.cmake ${ARCHIVE_NAME}/cmake/version.cmake
|
alpar@1135
|
311 |
COMMAND tar -czf ${ARCHIVE_BASE_NAME}-nodoc-${PROJECT_VERSION}.tar.gz ${ARCHIVE_NAME}
|
alpar@1135
|
312 |
COMMAND zip -r ${ARCHIVE_BASE_NAME}-nodoc-${PROJECT_VERSION}.zip ${ARCHIVE_NAME}
|
alpar@1135
|
313 |
COMMAND cmake -E copy_directory doc/html ${ARCHIVE_NAME}/doc/html
|
alpar@1135
|
314 |
COMMAND tar -czf ${ARCHIVE_NAME}.tar.gz ${ARCHIVE_NAME}
|
alpar@1135
|
315 |
COMMAND zip -r ${ARCHIVE_NAME}.zip ${ARCHIVE_NAME}
|
alpar@1135
|
316 |
COMMAND cmake -E copy_directory doc/html ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
|
alpar@1135
|
317 |
COMMAND tar -czf ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}.tar.gz ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
|
alpar@1135
|
318 |
COMMAND zip -r ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}.zip ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
|
alpar@1135
|
319 |
COMMAND cmake -E remove_directory ${ARCHIVE_NAME}
|
alpar@1135
|
320 |
COMMAND cmake -E remove_directory ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
|
alpar@1135
|
321 |
DEPENDS html
|
alpar@1135
|
322 |
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
|
alpar@1135
|
323 |
|
alpar@1135
|
324 |
# CPACK config (Basically for NSIS)
|
alpar@1033
|
325 |
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
|
ladanyi@726
|
326 |
SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
|
ladanyi@726
|
327 |
SET(CPACK_PACKAGE_VENDOR "EGRES")
|
ladanyi@726
|
328 |
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
|
ladanyi@726
|
329 |
"LEMON - Library for Efficient Modeling and Optimization in Networks")
|
ladanyi@726
|
330 |
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
alpar@225
|
331 |
|
ladanyi@726
|
332 |
SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
|
alpar@225
|
333 |
|
ladanyi@726
|
334 |
SET(CPACK_PACKAGE_INSTALL_DIRECTORY
|
ladanyi@726
|
335 |
"${PROJECT_NAME} ${PROJECT_VERSION}")
|
ladanyi@726
|
336 |
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
|
ladanyi@726
|
337 |
"${PROJECT_NAME} ${PROJECT_VERSION}")
|
alpar@225
|
338 |
|
ladanyi@726
|
339 |
SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
|
alpar@225
|
340 |
|
ladanyi@726
|
341 |
SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
|
ladanyi@726
|
342 |
SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
|
ladanyi@726
|
343 |
SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
|
ladanyi@726
|
344 |
SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
|
alpar@225
|
345 |
|
ladanyi@726
|
346 |
SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
|
ladanyi@726
|
347 |
"C++ header files")
|
ladanyi@726
|
348 |
SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
|
ladanyi@726
|
349 |
"DLL and import library")
|
ladanyi@726
|
350 |
SET(CPACK_COMPONENT_BIN_DESCRIPTION
|
ladanyi@726
|
351 |
"Command line utilities")
|
ladanyi@726
|
352 |
SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
|
ladanyi@726
|
353 |
"Doxygen generated documentation")
|
alpar@225
|
354 |
|
ladanyi@726
|
355 |
SET(CPACK_COMPONENT_HEADERS_DEPENDS library)
|
alpar@225
|
356 |
|
ladanyi@726
|
357 |
SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
|
ladanyi@726
|
358 |
SET(CPACK_COMPONENT_LIBRARY_GROUP "Development")
|
ladanyi@726
|
359 |
SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation")
|
alpar@225
|
360 |
|
ladanyi@726
|
361 |
SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
|
ladanyi@726
|
362 |
"Components needed to develop software using LEMON")
|
ladanyi@726
|
363 |
SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION
|
ladanyi@726
|
364 |
"Documentation of LEMON")
|
alpar@225
|
365 |
|
ladanyi@726
|
366 |
SET(CPACK_ALL_INSTALL_TYPES Full Developer)
|
alpar@225
|
367 |
|
ladanyi@726
|
368 |
SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
|
ladanyi@726
|
369 |
SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full)
|
ladanyi@726
|
370 |
SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
|
alpar@225
|
371 |
|
ladanyi@726
|
372 |
SET(CPACK_GENERATOR "NSIS")
|
ladanyi@726
|
373 |
SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico")
|
ladanyi@726
|
374 |
SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
|
ladanyi@726
|
375 |
#SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
|
ladanyi@726
|
376 |
SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
|
ladanyi@726
|
377 |
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
|
ladanyi@726
|
378 |
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
|
ladanyi@726
|
379 |
SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
|
ladanyi@726
|
380 |
SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
|
ladanyi@726
|
381 |
SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
|
ladanyi@726
|
382 |
CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\"
|
ladanyi@726
|
383 |
")
|
ladanyi@726
|
384 |
SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
|
ladanyi@726
|
385 |
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
|
ladanyi@726
|
386 |
Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\"
|
ladanyi@726
|
387 |
")
|
alpar@225
|
388 |
|
ladanyi@726
|
389 |
INCLUDE(CPack)
|
ladanyi@726
|
390 |
ENDIF()
|