gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Add dist target to CMAKE conf. (#434)
0 3 0
default
3 files changed with 37 insertions and 1 deletions:
↑ Collapse diff ↑
Ignore white space 192 line context
... ...
@@ -95,162 +95,189 @@
95 95
    "Flags used by the C++ compiler during maintainer builds."
96 96
    FORCE )
97 97
SET( CMAKE_C_FLAGS_MAINTAINER "-Werror -O0" CACHE STRING
98 98
    "Flags used by the C compiler during maintainer builds."
99 99
    FORCE )
100 100
SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER
101 101
    "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
102 102
    "Flags used for linking binaries during maintainer builds."
103 103
    FORCE )
104 104
SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER
105 105
    "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
106 106
    "Flags used by the shared libraries linker during maintainer builds."
107 107
    FORCE )
108 108
MARK_AS_ADVANCED(
109 109
    CMAKE_CXX_FLAGS_MAINTAINER
110 110
    CMAKE_C_FLAGS_MAINTAINER
111 111
    CMAKE_EXE_LINKER_FLAGS_MAINTAINER
112 112
    CMAKE_SHARED_LINKER_FLAGS_MAINTAINER )
113 113

	
114 114
IF(CMAKE_CONFIGURATION_TYPES)
115 115
  LIST(APPEND CMAKE_CONFIGURATION_TYPES Maintainer)
116 116
  LIST(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
117 117
  SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
118 118
      "Add the configurations that we need"
119 119
      FORCE)
120 120
 endif()
121 121

	
122 122
IF(NOT CMAKE_BUILD_TYPE)
123 123
  SET(CMAKE_BUILD_TYPE "Release")
124 124
ENDIF()
125 125

	
126 126
SET( CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
127 127
    "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel Maintainer."
128 128
    FORCE )
129 129

	
130 130

	
131 131
INCLUDE(CheckTypeSize)
132 132
CHECK_TYPE_SIZE("long long" LONG_LONG)
133 133
SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
134 134

	
135 135
INCLUDE(FindThreads)
136 136

	
137 137
IF(NOT LEMON_THREADING)
138 138
  IF(CMAKE_USE_PTHREADS_INIT)
139 139
    SET(LEMON_THREADING "Pthread")
140 140
  ELSEIF(CMAKE_USE_WIN32_THREADS_INIT)
141 141
    SET(LEMON_THREADING "Win32")
142 142
  ELSE()
143 143
    SET(LEMON_THREADING "None")
144 144
  ENDIF()
145 145
ENDIF()
146 146

	
147 147
SET( LEMON_THREADING "${LEMON_THREADING}" CACHE STRING
148 148
  "Choose the threading library, options are: Pthread Win32 None."
149 149
  FORCE )
150 150

	
151 151
IF(LEMON_THREADING STREQUAL "Pthread")
152 152
  SET(LEMON_USE_PTHREAD TRUE)
153 153
ELSEIF(LEMON_THREADING STREQUAL "Win32")
154 154
  SET(LEMON_USE_WIN32_THREADS TRUE)
155 155
ENDIF()
156 156

	
157 157
ENABLE_TESTING()
158 158

	
159 159
IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
160 160
  ADD_CUSTOM_TARGET(check ALL COMMAND ${CMAKE_CTEST_COMMAND})
161 161
ELSE()
162 162
  ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})
163 163
ENDIF()
164 164

	
165 165
ADD_SUBDIRECTORY(lemon)
166 166
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
167 167
  ADD_SUBDIRECTORY(contrib)
168 168
  ADD_SUBDIRECTORY(demo)
169 169
  ADD_SUBDIRECTORY(tools)
170 170
  ADD_SUBDIRECTORY(doc)
171 171
  ADD_SUBDIRECTORY(test)
172 172
ENDIF()
173 173

	
174 174
CONFIGURE_FILE(
175 175
  ${PROJECT_SOURCE_DIR}/cmake/LEMONConfig.cmake.in
176 176
  ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
177 177
  @ONLY
178 178
)
179 179
IF(UNIX)
180 180
  INSTALL(
181 181
    FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
182 182
    DESTINATION share/lemon/cmake
183 183
  )
184 184
ELSEIF(WIN32)
185 185
  INSTALL(
186 186
    FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
187 187
    DESTINATION cmake
188 188
  )
189 189
ENDIF()
190 190

	
191
CONFIGURE_FILE(
192
  ${PROJECT_SOURCE_DIR}/cmake/version.cmake.in
193
  ${PROJECT_BINARY_DIR}/cmake/version.cmake
194
  @ONLY
195
)
196

	
197
SET(ARCHIVE_BASE_NAME ${CMAKE_PROJECT_NAME})
198
STRING(TOLOWER ${ARCHIVE_BASE_NAME} ARCHIVE_BASE_NAME)
199
SET(ARCHIVE_NAME ${ARCHIVE_BASE_NAME}-${PROJECT_VERSION})
200
ADD_CUSTOM_TARGET(dist
201
  COMMAND cmake -E remove_directory ${ARCHIVE_NAME}
202
  COMMAND hg archive ${ARCHIVE_NAME}
203
  COMMAND cmake -E copy cmake/version.cmake ${ARCHIVE_NAME}/cmake/version.cmake
204
  COMMAND tar -czf ${ARCHIVE_BASE_NAME}-nodoc-${PROJECT_VERSION}.tar.gz ${ARCHIVE_NAME}
205
  COMMAND zip -r ${ARCHIVE_BASE_NAME}-nodoc-${PROJECT_VERSION}.zip ${ARCHIVE_NAME}
206
  COMMAND cmake -E copy_directory doc/html ${ARCHIVE_NAME}/doc/html
207
  COMMAND tar -czf ${ARCHIVE_NAME}.tar.gz ${ARCHIVE_NAME}
208
  COMMAND zip -r ${ARCHIVE_NAME}.zip ${ARCHIVE_NAME}
209
  COMMAND cmake -E copy_directory doc/html ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
210
  COMMAND tar -czf ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}.tar.gz ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
211
  COMMAND zip -r ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}.zip ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
212
  COMMAND cmake -E remove_directory ${ARCHIVE_NAME}
213
  COMMAND cmake -E remove_directory ${ARCHIVE_BASE_NAME}-doc-${PROJECT_VERSION}
214
  DEPENDS html
215
  WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
216

	
217
# CPACK config (Basically for NSIS)
191 218
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
192 219
  SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
193 220
  SET(CPACK_PACKAGE_VENDOR "EGRES")
194 221
  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
195 222
    "LEMON - Library for Efficient Modeling and Optimization in Networks")
196 223
  SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
197 224

	
198 225
  SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
199 226

	
200 227
  SET(CPACK_PACKAGE_INSTALL_DIRECTORY
201 228
    "${PROJECT_NAME} ${PROJECT_VERSION}")
202 229
  SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
203 230
    "${PROJECT_NAME} ${PROJECT_VERSION}")
204 231

	
205 232
  SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
206 233

	
207 234
  SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
208 235
  SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
209 236
  SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
210 237
  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
211 238

	
212 239
  SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
213 240
    "C++ header files")
214 241
  SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
215 242
    "DLL and import library")
216 243
  SET(CPACK_COMPONENT_BIN_DESCRIPTION
217 244
    "Command line utilities")
218 245
  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
219 246
    "Doxygen generated documentation")
220 247

	
221 248
  SET(CPACK_COMPONENT_HEADERS_DEPENDS library)
222 249

	
223 250
  SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
224 251
  SET(CPACK_COMPONENT_LIBRARY_GROUP "Development")
225 252
  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation")
226 253

	
227 254
  SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
228 255
    "Components needed to develop software using LEMON")
229 256
  SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION
230 257
    "Documentation of LEMON")
231 258

	
232 259
  SET(CPACK_ALL_INSTALL_TYPES Full Developer)
233 260

	
234 261
  SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
235 262
  SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full)
236 263
  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
237 264

	
238 265
  SET(CPACK_GENERATOR "NSIS")
239 266
  SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico")
240 267
  SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
241 268
  #SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
242 269
  SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
243 270
  SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
244 271
  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
245 272
  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
246 273
  SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
247 274
  SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
248 275
    CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\"
249 276
    ")
250 277
  SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
251 278
    !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
252 279
    Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\"
253 280
    ")
254 281

	
255 282
  INCLUDE(CPack)
256 283
ENDIF()
Ignore white space 192 line context
1
SET(LEMON_VERSION "@PACKAGE_VERSION@" CACHE STRING "LEMON version string.")
1
SET(LEMON_VERSION "@LEMON_VERSION@" CACHE STRING "LEMON version string.")
Ignore white space 192 line context
1 1
SET(PACKAGE_NAME ${PROJECT_NAME})
2 2
SET(PACKAGE_VERSION ${PROJECT_VERSION})
3 3
SET(abs_top_srcdir ${PROJECT_SOURCE_DIR})
4 4
SET(abs_top_builddir ${PROJECT_BINARY_DIR})
5 5

	
6 6
SET(LEMON_DOC_SOURCE_BROWSER "NO" CACHE STRING "Include source into the doc (YES/NO).")
7 7

	
8 8
CONFIGURE_FILE(
9 9
  ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in
10 10
  ${PROJECT_BINARY_DIR}/doc/Doxyfile
11 11
  @ONLY
12 12
)
13 13

	
14 14
CONFIGURE_FILE(
15 15
  ${PROJECT_SOURCE_DIR}/doc/mainpage.dox.in
16 16
  ${PROJECT_BINARY_DIR}/doc/mainpage.dox
17 17
  @ONLY
18 18
)
19 19

	
20
# Copy doc from source (if exists)
21
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/html AND 
22
    NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/html/index.html)
23
  MESSAGE(STATUS "Copy doc from source tree")
24
  EXECUTE_PROCESS(
25
    COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/html ${CMAKE_CURRENT_BINARY_DIR}/html
26
    )
27
ENDIF()
28

	
20 29
IF(DOXYGEN_EXECUTABLE AND PYTHONINTERP_FOUND AND GHOSTSCRIPT_EXECUTABLE)
21 30
  FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/)
22 31
  SET(GHOSTSCRIPT_OPTIONS -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha)
23 32
  ADD_CUSTOM_TARGET(html
24 33
    COMMAND ${CMAKE_COMMAND} -E remove_directory gen-images
25 34
    COMMAND ${CMAKE_COMMAND} -E make_directory gen-images
26 35
    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/bipartite_matching.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_matching.eps
27 36
    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/bipartite_partitions.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_partitions.eps
28 37
    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/connected_components.eps
29 38
    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/edge_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/edge_biconnected_components.eps
30 39
    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/grid_graph.png ${CMAKE_CURRENT_SOURCE_DIR}/images/grid_graph.eps
31 40
    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/matching.png ${CMAKE_CURRENT_SOURCE_DIR}/images/matching.eps
32 41
    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/node_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/node_biconnected_components.eps
33 42
    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_0.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_0.eps
34 43
    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_1.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_1.eps
35 44
    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_2.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_2.eps
36 45
    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_3.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_3.eps
37 46
    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_4.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_4.eps
38 47
    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/planar.png ${CMAKE_CURRENT_SOURCE_DIR}/images/planar.eps
39 48
    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/strongly_connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/strongly_connected_components.eps
40 49
    COMMAND ${CMAKE_COMMAND} -E remove_directory html
41 50
    COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/bib2dox.py ${CMAKE_CURRENT_SOURCE_DIR}/references.bib >references.dox
42 51
    COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
43 52
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
44 53
  )
45 54

	
46 55
  SET_TARGET_PROPERTIES(html PROPERTIES PROJECT_LABEL BUILD_DOC)
47 56

	
48 57
  IF(UNIX)
49 58
    INSTALL(
50 59
      DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
51 60
      DESTINATION share/doc/lemon/html
52 61
      COMPONENT html_documentation
53 62
    )
54 63
  ELSEIF(WIN32)
55 64
    INSTALL(
56 65
      DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
57 66
      DESTINATION doc
58 67
      COMPONENT html_documentation
59 68
    )
60 69
  ENDIF()
61 70

	
62 71
ENDIF()
63 72

	
64 73
IF(WGET_FOUND)
65 74
ADD_CUSTOM_TARGET(update-external-tags
66 75
  COMMAND ${CMAKE_COMMAND} -E make_directory dl
67 76
  # COMMAND ${CMAKE_COMMAND} -E copy libstdc++.tag dl
68 77
  COMMAND ${WGET_EXECUTABLE} wget -P dl -N libstdc++.tag.tmp http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/libstdc++.tag
69 78
  COMMAND ${CMAKE_COMMAND} -E rename dl/libstdc++.tag libstdc++.tag
70 79
  COMMAND ${CMAKE_COMMAND} -E remove dl/libstdc++.tag
71 80
  COMMAND ${CMAKE_COMMAND} -E remove_directory dl
72 81
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
73 82
  )
74 83
ENDIF()
0 comments (0 inline)