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