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