CMakeLists.txt
author Peter Kovacs <kpeter@inf.elte.hu>
Sat, 07 Oct 2017 16:22:04 +0200
changeset 1412 3ca508482e4c
parent 1343 20f95cd51aba
parent 1344 ca4e4a5e9b6e
child 1404 c8d0179a32a2
permissions -rw-r--r--
Change misleading method name in Vf2pp (#597)

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