CMakeLists.txt
author Gabor Gevay <ggab90@gmail.com>
Sun, 05 Jan 2014 22:24:56 +0100
changeset 1336 0759d974de81
parent 1335 39b6e65574c6
child 1337 4add05447ca0
permissions -rw-r--r--
STL style iterators (#325)

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