COIN-OR::LEMON - Graph Library

Ticket #658: 76253ddee3ce.patch

File 76253ddee3ce.patch, 53.0 KB (added by Alpar Juttner, 3 years ago)
  • CMakeLists.txt

    # HG changeset patch
    # User Alpar Juttner <alpar@cs.elte.hu>
    # Date 1635414507 -7200
    #      Thu Oct 28 11:48:27 2021 +0200
    # Node ID 76253ddee3ce2303fa8bac87c0158f46fc035632
    # Parent  a278d16bd2d082aa3c52ff4a9b0e2224ddc0549a
    Switch to use lower case CMAKE function names
    
    diff --git a/CMakeLists.txt b/CMakeLists.txt
    a b  
    1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
     1cmake_minimum_required(VERSION 2.8)
    22
    3 IF(POLICY CMP0048)
    4   CMAKE_POLICY(SET CMP0048 OLD)
    5 ENDIF(POLICY CMP0048)
     3if(POLICY CMP0048)
     4  cmake_policy(SET CMP0048 OLD)
     5endif(POLICY CMP0048)
    66
    7 IF(POLICY CMP0043)
    8   CMAKE_POLICY(SET CMP0043 NEW)
    9 ENDIF(POLICY CMP0043)
     7if(POLICY CMP0043)
     8  cmake_policy(SET CMP0043 NEW)
     9endif(POLICY CMP0043)
    1010
    11 IF(POLICY CMP0026)
     11if(POLICY CMP0026)
    1212  #This is for copying the dll's needed by glpk (in lp_test and mip_test)
    13   CMAKE_POLICY(SET CMP0026 NEW)
    14 ENDIF(POLICY CMP0026)
     13  cmake_policy(SET CMP0026 NEW)
     14endif(POLICY CMP0026)
    1515
    16 SET(PROJECT_NAME "LEMON")
    17 PROJECT(${PROJECT_NAME})
     16set(PROJECT_NAME "LEMON")
     17project(${PROJECT_NAME})
    1818
    19 INCLUDE(FindPythonInterp)
    20 INCLUDE(FindWget)
     19include(FindPythonInterp)
     20include(FindWget)
    2121
    22 IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake)
    23   INCLUDE(${PROJECT_SOURCE_DIR}/cmake/version.cmake)
    24 ELSEIF(DEFINED ENV{LEMON_VERSION})
    25   SET(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.")
    26 ELSE()
    27   EXECUTE_PROCESS(
     22if(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake)
     23  include(${PROJECT_SOURCE_DIR}/cmake/version.cmake)
     24elseif(DEFINED ENV{LEMON_VERSION})
     25  set(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.")
     26else()
     27  execute_process(
    2828    COMMAND
    2929    hg log -r. --template "{latesttag}"
    3030    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
     
    3232    ERROR_QUIET
    3333    OUTPUT_STRIP_TRAILING_WHITESPACE
    3434  )
    35   EXECUTE_PROCESS(
     35  execute_process(
    3636    COMMAND
    3737    hg log -r. --template "{latesttagdistance}"
    3838    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
     
    4040    ERROR_QUIET
    4141    OUTPUT_STRIP_TRAILING_WHITESPACE
    4242  )
    43   EXECUTE_PROCESS(
     43  execute_process(
    4444    COMMAND
    4545    hg log -r. --template "{node|short}"
    4646    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
     
    4949    OUTPUT_STRIP_TRAILING_WHITESPACE
    5050  )
    5151
    52   IF(HG_REVISION_TAG STREQUAL "")
    53     SET(HG_REVISION_ID "hg-tip")
    54   ELSE()
    55     IF(HG_REVISION_TAG STREQUAL "null")
    56       SET(HG_REVISION_TAG "trunk")
    57     ELSEIF(HG_REVISION_TAG MATCHES "^r")
    58       STRING(SUBSTRING ${HG_REVISION_TAG} 1 -1 HG_REVISION_TAG)
    59     ENDIF()
    60     IF(HG_REVISION_DIST STREQUAL "0")
    61       SET(HG_REVISION ${HG_REVISION_TAG})
    62     ELSE()
    63       SET(HG_REVISION
     52  if(HG_REVISION_TAG STREQUAL "")
     53    set(HG_REVISION_ID "hg-tip")
     54  else()
     55    if(HG_REVISION_TAG STREQUAL "null")
     56      set(HG_REVISION_TAG "trunk")
     57    elseif(HG_REVISION_TAG MATCHES "^r")
     58      string(SUBSTRING ${HG_REVISION_TAG} 1 -1 HG_REVISION_TAG)
     59    endif()
     60    if(HG_REVISION_DIST STREQUAL "0")
     61      set(HG_REVISION ${HG_REVISION_TAG})
     62    else()
     63      set(HG_REVISION
    6464        "${HG_REVISION_TAG}+${HG_REVISION_DIST}-${HG_REVISION_ID}")
    65     ENDIF()
    66   ENDIF()
     65    endif()
     66  endif()
    6767
    68   SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.")
    69 ENDIF()
     68  set(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.")
     69endif()
    7070
    71 SET(PROJECT_VERSION ${LEMON_VERSION})
     71set(PROJECT_VERSION ${LEMON_VERSION})
    7272
    73 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
     73set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
    7474
    75 FIND_PACKAGE(Doxygen)
    76 FIND_PACKAGE(Ghostscript)
     75find_package(Doxygen)
     76find_package(Ghostscript)
    7777
    78 IF(WIN32)
    79   SET(LEMON_WIN32 TRUE)
    80 ENDIF(WIN32)
     78if(WIN32)
     79  set(LEMON_WIN32 TRUE)
     80endif(WIN32)
    8181
    82 SET(LEMON_ENABLE_GLPK YES CACHE STRING "Enable GLPK solver backend.")
    83 SET(LEMON_ENABLE_ILOG YES CACHE STRING "Enable ILOG (CPLEX) solver backend.")
    84 SET(LEMON_ENABLE_COIN YES CACHE STRING "Enable COIN solver backend.")
    85 SET(LEMON_ENABLE_SOPLEX YES CACHE STRING "Enable SoPlex solver backend.")
     82set(LEMON_ENABLE_GLPK YES CACHE STRING "Enable GLPK solver backend.")
     83set(LEMON_ENABLE_ILOG YES CACHE STRING "Enable ILOG (CPLEX) solver backend.")
     84set(LEMON_ENABLE_COIN YES CACHE STRING "Enable COIN solver backend.")
     85set(LEMON_ENABLE_SOPLEX YES CACHE STRING "Enable SoPlex solver backend.")
    8686
    87 IF(LEMON_ENABLE_GLPK)
    88   FIND_PACKAGE(GLPK 4.33)
    89   IF(GLPK_FOUND)
    90     SET(LEMON_HAVE_LP TRUE)
    91     SET(LEMON_HAVE_MIP TRUE)
    92     SET(LEMON_HAVE_GLPK TRUE)
    93   ENDIF(GLPK_FOUND)
    94 ENDIF(LEMON_ENABLE_GLPK)
    95 IF(LEMON_ENABLE_ILOG)
    96   FIND_PACKAGE(ILOG)
    97   IF(ILOG_FOUND)
    98     SET(LEMON_HAVE_LP TRUE)
    99     SET(LEMON_HAVE_MIP TRUE)
    100     SET(LEMON_HAVE_CPLEX TRUE)
    101   ENDIF(ILOG_FOUND)
    102 ENDIF(LEMON_ENABLE_ILOG)
    103 IF(LEMON_ENABLE_COIN)
    104   FIND_PACKAGE(COIN)
    105   IF(COIN_FOUND)
    106     SET(LEMON_HAVE_LP TRUE)
    107     SET(LEMON_HAVE_MIP TRUE)
    108     SET(LEMON_HAVE_CLP TRUE)
    109     SET(LEMON_HAVE_CBC TRUE)
    110   ENDIF(COIN_FOUND)
    111 ENDIF(LEMON_ENABLE_COIN)
    112 IF(LEMON_ENABLE_SOPLEX)
    113   FIND_PACKAGE(SOPLEX)
    114   IF(SOPLEX_FOUND)
    115     SET(LEMON_HAVE_LP TRUE)
    116     SET(LEMON_HAVE_SOPLEX TRUE)
    117   ENDIF(SOPLEX_FOUND)
    118 ENDIF(LEMON_ENABLE_SOPLEX)
     87if(LEMON_ENABLE_GLPK)
     88  find_package(GLPK 4.33)
     89  if(GLPK_FOUND)
     90    set(LEMON_HAVE_LP TRUE)
     91    set(LEMON_HAVE_MIP TRUE)
     92    set(LEMON_HAVE_GLPK TRUE)
     93  endif(GLPK_FOUND)
     94endif(LEMON_ENABLE_GLPK)
     95if(LEMON_ENABLE_ILOG)
     96  find_package(ILOG)
     97  if(ILOG_FOUND)
     98    set(LEMON_HAVE_LP TRUE)
     99    set(LEMON_HAVE_MIP TRUE)
     100    set(LEMON_HAVE_CPLEX TRUE)
     101  endif(ILOG_FOUND)
     102endif(LEMON_ENABLE_ILOG)
     103if(LEMON_ENABLE_COIN)
     104  find_package(COIN)
     105  if(COIN_FOUND)
     106    set(LEMON_HAVE_LP TRUE)
     107    set(LEMON_HAVE_MIP TRUE)
     108    set(LEMON_HAVE_CLP TRUE)
     109    set(LEMON_HAVE_CBC TRUE)
     110  endif(COIN_FOUND)
     111endif(LEMON_ENABLE_COIN)
     112if(LEMON_ENABLE_SOPLEX)
     113  find_package(SOPLEX)
     114  if(SOPLEX_FOUND)
     115    set(LEMON_HAVE_LP TRUE)
     116    set(LEMON_HAVE_SOPLEX TRUE)
     117  endif(SOPLEX_FOUND)
     118endif(LEMON_ENABLE_SOPLEX)
    119119
    120 IF(ILOG_FOUND)
    121   SET(DEFAULT_LP "CPLEX")
    122   SET(DEFAULT_MIP "CPLEX")
    123 ELSEIF(COIN_FOUND)
    124   SET(DEFAULT_LP "CLP")
    125   SET(DEFAULT_MIP "CBC")
    126 ELSEIF(GLPK_FOUND)
    127   SET(DEFAULT_LP "GLPK")
    128   SET(DEFAULT_MIP "GLPK")
    129 ELSEIF(SOPLEX_FOUND)
    130   SET(DEFAULT_LP "SOPLEX")
    131 ENDIF()
     120if(ILOG_FOUND)
     121  set(DEFAULT_LP "CPLEX")
     122  set(DEFAULT_MIP "CPLEX")
     123elseif(COIN_FOUND)
     124  set(DEFAULT_LP "CLP")
     125  set(DEFAULT_MIP "CBC")
     126elseif(GLPK_FOUND)
     127  set(DEFAULT_LP "GLPK")
     128  set(DEFAULT_MIP "GLPK")
     129elseif(SOPLEX_FOUND)
     130  set(DEFAULT_LP "SOPLEX")
     131endif()
    132132
    133 IF(NOT LEMON_DEFAULT_LP OR
     133if(NOT LEMON_DEFAULT_LP OR
    134134    (NOT ILOG_FOUND AND (LEMON_DEFAULT_LP STREQUAL "CPLEX")) OR
    135135    (NOT COIN_FOUND AND (LEMON_DEFAULT_LP STREQUAL "CLP")) OR
    136136    (NOT GLPK_FOUND AND (LEMON_DEFAULT_LP STREQUAL "GLPK")) OR
    137137    (NOT SOPLEX_FOUND AND (LEMON_DEFAULT_LP STREQUAL "SOPLEX")))
    138   SET(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING
     138  set(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING
    139139    "Default LP solver backend (GLPK, CPLEX, CLP or SOPLEX)" FORCE)
    140 ELSE()
    141   SET(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING
     140else()
     141  set(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING
    142142    "Default LP solver backend (GLPK, CPLEX, CLP or SOPLEX)")
    143 ENDIF()
    144 IF(NOT LEMON_DEFAULT_MIP OR
     143endif()
     144if(NOT LEMON_DEFAULT_MIP OR
    145145    (NOT ILOG_FOUND AND (LEMON_DEFAULT_MIP STREQUAL "CPLEX")) OR
    146146    (NOT COIN_FOUND AND (LEMON_DEFAULT_MIP STREQUAL "CBC")) OR
    147147    (NOT GLPK_FOUND AND (LEMON_DEFAULT_MIP STREQUAL "GLPK")))
    148   SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING
     148  set(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING
    149149    "Default MIP solver backend (GLPK, CPLEX or CBC)" FORCE)
    150 ELSE()
    151   SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING
     150else()
     151  set(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING
    152152    "Default MIP solver backend (GLPK, CPLEX or CBC)")
    153 ENDIF()
     153endif()
    154154
    155 IF( ( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") AND
     155if( ( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") AND
    156156      ("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER_EQUAL "4.8") )
    157157    OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
    158158    OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
    159159    )
    160   SET(LEMON_NO_UNUSED_LOCAL_TYPEDEF_WARNINGS TRUE)
    161 ENDIF()
     160  set(LEMON_NO_UNUSED_LOCAL_TYPEDEF_WARNINGS TRUE)
     161endif()
    162162
    163 IF(DEFINED ENV{LEMON_CXX_WARNING})
    164   SET(CXX_WARNING $ENV{LEMON_CXX_WARNING})
    165 ELSE()
    166   IF( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
     163if(DEFINED ENV{LEMON_CXX_WARNING})
     164  set(CXX_WARNING $ENV{LEMON_CXX_WARNING})
     165else()
     166  if( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
    167167      OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
    168168      )
    169     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")
    170     SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb")
    171     SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb")
    172   ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
    173     SET(CXX_WARNING "-Wall -W -Wunused -Wformat=2 -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wsign-promo -Woverloaded-virtual -fno-strict-aliasing -Wno-unknown-pragmas")
    174     SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb")
    175     SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb")
    176   ELSEIF(MSVC)
     169    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")
     170    set(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb")
     171    set(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb")
     172  elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
     173    set(CXX_WARNING "-Wall -W -Wunused -Wformat=2 -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wsign-promo -Woverloaded-virtual -fno-strict-aliasing -Wno-unknown-pragmas")
     174    set(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb")
     175    set(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb")
     176  elseif(MSVC)
    177177    # This part is unnecessary 'casue the same is set by the lemon/core.h.
    178178    # Still kept as an example.
    179179
    180     # SET(CXX_WARNING "/wd4250 /wd4267 /wd4355 /wd4503 /wd4800 /wd4996")
     180    # set(CXX_WARNING "/wd4250 /wd4267 /wd4355 /wd4503 /wd4800 /wd4996")
    181181
    182182    # Suppressed warnings:
    183183    # C4250: 'class1' : inherits 'class2::member' via dominance
     
    187187    # C4800: 'type' : forcing value to bool 'true' or 'false'
    188188    #        (performance warning)
    189189    # C4996: 'function': was declared deprecated
    190   ELSE()
    191     SET(CXX_WARNING "-Wall")
    192   ENDIF()
    193 ENDIF()
    194 SET(LEMON_CXX_WARNING_FLAGS ${CXX_WARNING} CACHE STRING "LEMON warning flags.")
     190  else()
     191    set(CXX_WARNING "-Wall")
     192  endif()
     193endif()
     194set(LEMON_CXX_WARNING_FLAGS ${CXX_WARNING} CACHE STRING "LEMON warning flags.")
    195195
    196 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LEMON_CXX_WARNING_FLAGS}")
     196set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LEMON_CXX_WARNING_FLAGS}")
    197197
    198 IF(MSVC)
    199   SET( CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}")
    200   SET( CMAKE_CXX_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
     198if(MSVC)
     199  set( CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}")
     200  set( CMAKE_CXX_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
    201201    "Flags used by the C++ compiler during maintainer builds." FORCE
    202202    )
    203   SET( CMAKE_C_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
     203  set( CMAKE_C_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
    204204    "Flags used by the C compiler during maintainer builds." FORCE
    205205    )
    206   SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER
     206  set( CMAKE_EXE_LINKER_FLAGS_MAINTAINER
    207207    "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING
    208208    "Flags used for linking binaries during maintainer builds." FORCE
    209209    )
    210   SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER
     210  set( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER
    211211    "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING
    212212    "Flags used by the shared libraries linker during maintainer builds."
    213213     FORCE
    214214    )
    215 ELSE()
    216   SET( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb -O0" CACHE STRING
     215else()
     216  set( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb -O0" CACHE STRING
    217217    "Flags used by the C++ compiler during maintainer builds." FORCE
    218218    )
    219   SET( CMAKE_C_FLAGS_MAINTAINER "-Werror -O0" CACHE STRING
     219  set( CMAKE_C_FLAGS_MAINTAINER "-Werror -O0" CACHE STRING
    220220    "Flags used by the C compiler during maintainer builds." FORCE
    221221    )
    222   SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER
     222  set( CMAKE_EXE_LINKER_FLAGS_MAINTAINER
    223223    "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING
    224224    "Flags used for linking binaries during maintainer builds." FORCE
    225225    )
    226   SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER
     226  set( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER
    227227    "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING
    228228    "Flags used by the shared libraries linker during maintainer builds." FORCE)
    229 ENDIF()
     229endif()
    230230
    231 MARK_AS_ADVANCED(
     231mark_as_advanced(
    232232    CMAKE_CXX_FLAGS_MAINTAINER
    233233    CMAKE_C_FLAGS_MAINTAINER
    234234    CMAKE_EXE_LINKER_FLAGS_MAINTAINER
    235235    CMAKE_SHARED_LINKER_FLAGS_MAINTAINER )
    236236
    237 IF(CMAKE_CONFIGURATION_TYPES)
    238   LIST(APPEND CMAKE_CONFIGURATION_TYPES Maintainer)
    239   LIST(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
    240   SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
     237if(CMAKE_CONFIGURATION_TYPES)
     238  list(APPEND CMAKE_CONFIGURATION_TYPES Maintainer)
     239  list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
     240  set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
    241241      "Add the configurations that we need"
    242242      FORCE)
    243243 endif()
    244244
    245 IF(NOT CMAKE_BUILD_TYPE)
    246   SET(CMAKE_BUILD_TYPE "Release")
    247 ENDIF()
     245if(NOT CMAKE_BUILD_TYPE)
     246  set(CMAKE_BUILD_TYPE "Release")
     247endif()
    248248
    249 SET( CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
     249set( CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
    250250    "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel Maintainer."
    251251    FORCE )
    252252
    253 SET_DIRECTORY_PROPERTIES(PROPERTIES
     253set_directory_properties(PROPERTIES
    254254  COMPILE_DEFINITIONS
    255255  $<$<OR:$<CONFIG:Debug>,$<CONFIG:Maintainer>>:LEMON_ENABLE_DEBUG>
    256256)
    257257
    258 INCLUDE(CheckTypeSize)
     258include(CheckTypeSize)
    259259CHECK_TYPE_SIZE("long long" LONG_LONG)
    260 SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
     260set(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
    261261
    262 INCLUDE(FindThreads)
     262include(FindThreads)
    263263
    264 IF(NOT LEMON_THREADING)
    265   IF(CMAKE_USE_PTHREADS_INIT)
    266     SET(LEMON_THREADING "Pthread")
    267   ELSEIF(CMAKE_USE_WIN32_THREADS_INIT)
    268     SET(LEMON_THREADING "Win32")
    269   ELSE()
    270     SET(LEMON_THREADING "None")
    271   ENDIF()
    272 ENDIF()
     264if(NOT LEMON_THREADING)
     265  if(CMAKE_USE_PTHREADS_INIT)
     266    set(LEMON_THREADING "Pthread")
     267  elseif(CMAKE_USE_WIN32_THREADS_INIT)
     268    set(LEMON_THREADING "Win32")
     269  else()
     270    set(LEMON_THREADING "None")
     271  endif()
     272endif()
    273273
    274 SET( LEMON_THREADING "${LEMON_THREADING}" CACHE STRING
     274set( LEMON_THREADING "${LEMON_THREADING}" CACHE STRING
    275275  "Choose the threading library, options are: Pthread Win32 None."
    276276  FORCE )
    277277
    278 IF(LEMON_THREADING STREQUAL "Pthread")
    279   SET(LEMON_USE_PTHREAD TRUE)
    280 ELSEIF(LEMON_THREADING STREQUAL "Win32")
    281   SET(LEMON_USE_WIN32_THREADS TRUE)
    282 ENDIF()
     278if(LEMON_THREADING STREQUAL "Pthread")
     279  set(LEMON_USE_PTHREAD TRUE)
     280elseif(LEMON_THREADING STREQUAL "Win32")
     281  set(LEMON_USE_WIN32_THREADS TRUE)
     282endif()
    283283
    284 ENABLE_TESTING()
     284enable_testing()
    285285
    286286
    287 INCLUDE(CheckCXXCompilerFlag)
     287include(CheckCXXCompilerFlag)
    288288CHECK_CXX_COMPILER_FLAG("-std=c++11" LEMON_CXX11)
    289 IF(LEMON_CXX11)
    290   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
    291 ENDIF()
     289if(LEMON_CXX11)
     290  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
     291endif()
    292292
    293293
    294 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
    295   ADD_CUSTOM_TARGET(check ALL COMMAND ${CMAKE_CTEST_COMMAND})
    296 ELSE()
    297   ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})
    298 ENDIF()
     294if(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     295  add_custom_target(check ALL COMMAND ${CMAKE_CTEST_COMMAND})
     296else()
     297  add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
     298endif()
    299299
    300 ADD_SUBDIRECTORY(lemon)
    301 IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
    302   ADD_SUBDIRECTORY(contrib)
    303   ADD_SUBDIRECTORY(demo)
    304   ADD_SUBDIRECTORY(tools)
    305   ADD_SUBDIRECTORY(doc)
    306   ADD_SUBDIRECTORY(test)
    307 ENDIF()
     300add_subdirectory(lemon)
     301if(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
     302  add_subdirectory(contrib)
     303  add_subdirectory(demo)
     304  add_subdirectory(tools)
     305  add_subdirectory(doc)
     306  add_subdirectory(test)
     307endif()
    308308
    309 CONFIGURE_FILE(
     309configure_file(
    310310  ${PROJECT_SOURCE_DIR}/cmake/LEMONConfig.cmake.in
    311311  ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
    312312  @ONLY
    313313)
    314 IF(UNIX)
    315   INSTALL(
     314if(UNIX)
     315  install(
    316316    FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
    317317    DESTINATION share/lemon/cmake
    318318  )
    319 ELSEIF(WIN32)
    320   INSTALL(
     319elseif(WIN32)
     320  install(
    321321    FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
    322322    DESTINATION cmake
    323323  )
    324 ENDIF()
     324endif()
    325325
    326 CONFIGURE_FILE(
     326configure_file(
    327327  ${PROJECT_SOURCE_DIR}/cmake/version.cmake.in
    328328  ${PROJECT_BINARY_DIR}/cmake/version.cmake
    329329  @ONLY
    330330)
    331331
    332 SET(ARCHIVE_BASE_NAME ${CMAKE_PROJECT_NAME})
    333 STRING(TOLOWER ${ARCHIVE_BASE_NAME} ARCHIVE_BASE_NAME)
    334 SET(ARCHIVE_NAME ${ARCHIVE_BASE_NAME}-${PROJECT_VERSION})
    335 ADD_CUSTOM_TARGET(dist
     332set(ARCHIVE_BASE_NAME ${CMAKE_PROJECT_NAME})
     333string(TOLOWER ${ARCHIVE_BASE_NAME} ARCHIVE_BASE_NAME)
     334set(ARCHIVE_NAME ${ARCHIVE_BASE_NAME}-${PROJECT_VERSION})
     335add_custom_target(dist
    336336  COMMAND cmake -E remove_directory ${ARCHIVE_NAME}
    337337  COMMAND hg archive ${ARCHIVE_NAME}
    338338  COMMAND cmake -E copy cmake/version.cmake ${ARCHIVE_NAME}/cmake/version.cmake
     
    350350  WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
    351351
    352352# CPACK config (Basically for NSIS)
    353 IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
    354   SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
    355   SET(CPACK_PACKAGE_VENDOR "EGRES")
    356   SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
     353if(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
     354  set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
     355  set(CPACK_PACKAGE_VENDOR "EGRES")
     356  set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
    357357    "LEMON - Library for Efficient Modeling and Optimization in Networks")
    358   SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
     358  set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
    359359
    360   SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
     360  set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
    361361
    362   SET(CPACK_PACKAGE_INSTALL_DIRECTORY
     362  set(CPACK_PACKAGE_INSTALL_DIRECTORY
    363363    "${PROJECT_NAME} ${PROJECT_VERSION}")
    364   SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
     364  set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
    365365    "${PROJECT_NAME} ${PROJECT_VERSION}")
    366366
    367   SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
     367  set(CPACK_COMPONENTS_ALL headers library html_documentation bin)
    368368
    369   SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
    370   SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
    371   SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
    372   SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
     369  set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
     370  set(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
     371  set(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
     372  set(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
    373373
    374   SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
     374  set(CPACK_COMPONENT_HEADERS_DESCRIPTION
    375375    "C++ header files")
    376   SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
     376  set(CPACK_COMPONENT_LIBRARY_DESCRIPTION
    377377    "DLL and import library")
    378   SET(CPACK_COMPONENT_BIN_DESCRIPTION
     378  set(CPACK_COMPONENT_BIN_DESCRIPTION
    379379    "Command line utilities")
    380   SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
     380  set(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
    381381    "Doxygen generated documentation")
    382382
    383   SET(CPACK_COMPONENT_HEADERS_DEPENDS library)
     383  set(CPACK_COMPONENT_HEADERS_DEPENDS library)
    384384
    385   SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
    386   SET(CPACK_COMPONENT_LIBRARY_GROUP "Development")
    387   SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation")
     385  set(CPACK_COMPONENT_HEADERS_GROUP "Development")
     386  set(CPACK_COMPONENT_LIBRARY_GROUP "Development")
     387  set(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation")
    388388
    389   SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
     389  set(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
    390390    "Components needed to develop software using LEMON")
    391   SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION
     391  set(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION
    392392    "Documentation of LEMON")
    393393
    394   SET(CPACK_ALL_INSTALL_TYPES Full Developer)
     394  set(CPACK_ALL_INSTALL_TYPES Full Developer)
    395395
    396   SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
    397   SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full)
    398   SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
     396  set(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
     397  set(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full)
     398  set(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
    399399
    400   SET(CPACK_GENERATOR "NSIS")
    401   SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico")
    402   SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
    403   #SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
    404   SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
    405   SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
    406   SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
    407   SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
    408   SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
    409   SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
     400  set(CPACK_GENERATOR "NSIS")
     401  set(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico")
     402  set(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
     403  #set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
     404  set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
     405  set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
     406  set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
     407  set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
     408  set(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
     409  set(CPACK_NSIS_CREATE_ICONS_EXTRA "
    410410    CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\"
    411411    ")
    412   SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
     412  set(CPACK_NSIS_DELETE_ICONS_EXTRA "
    413413    !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
    414414    Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\"
    415415    ")
    416416
    417   INCLUDE(CPack)
    418 ENDIF()
     417  include(CPack)
     418endif()
  • cmake/FindCOIN.cmake

    diff --git a/cmake/FindCOIN.cmake b/cmake/FindCOIN.cmake
    a b  
    1 SET(COIN_ROOT_DIR "" CACHE PATH "COIN root directory")
     1set(COIN_ROOT_DIR "" CACHE PATH "COIN root directory")
    22
    3 FIND_PATH(COIN_INCLUDE_DIR coin/CoinUtilsConfig.h
     3find_path(COIN_INCLUDE_DIR coin/CoinUtilsConfig.h
    44  HINTS ${COIN_ROOT_DIR}/include
    55)
    6 FIND_LIBRARY(COIN_CBC_LIBRARY
     6find_library(COIN_CBC_LIBRARY
    77  NAMES Cbc libCbc
    88  HINTS ${COIN_ROOT_DIR}/lib/coin
    99  HINTS ${COIN_ROOT_DIR}/lib
    1010)
    11 FIND_LIBRARY(COIN_CBC_SOLVER_LIBRARY
     11find_library(COIN_CBC_SOLVER_LIBRARY
    1212  NAMES CbcSolver libCbcSolver
    1313  HINTS ${COIN_ROOT_DIR}/lib/coin
    1414  HINTS ${COIN_ROOT_DIR}/lib
    1515)
    16 FIND_LIBRARY(COIN_CGL_LIBRARY
     16find_library(COIN_CGL_LIBRARY
    1717  NAMES Cgl libCgl
    1818  HINTS ${COIN_ROOT_DIR}/lib/coin
    1919  HINTS ${COIN_ROOT_DIR}/lib
    2020)
    21 FIND_LIBRARY(COIN_CLP_LIBRARY
     21find_library(COIN_CLP_LIBRARY
    2222  NAMES Clp libClp
    2323  HINTS ${COIN_ROOT_DIR}/lib/coin
    2424  HINTS ${COIN_ROOT_DIR}/lib
    2525)
    26 FIND_LIBRARY(COIN_COIN_UTILS_LIBRARY
     26find_library(COIN_COIN_UTILS_LIBRARY
    2727  NAMES CoinUtils libCoinUtils
    2828  HINTS ${COIN_ROOT_DIR}/lib/coin
    2929  HINTS ${COIN_ROOT_DIR}/lib
    3030)
    31 FIND_LIBRARY(COIN_OSI_LIBRARY
     31find_library(COIN_OSI_LIBRARY
    3232  NAMES Osi libOsi
    3333  HINTS ${COIN_ROOT_DIR}/lib/coin
    3434  HINTS ${COIN_ROOT_DIR}/lib
    3535)
    36 FIND_LIBRARY(COIN_OSI_CBC_LIBRARY
     36find_library(COIN_OSI_CBC_LIBRARY
    3737  NAMES OsiCbc libOsiCbc
    3838  HINTS ${COIN_ROOT_DIR}/lib/coin
    3939  HINTS ${COIN_ROOT_DIR}/lib
    4040)
    41 FIND_LIBRARY(COIN_OSI_CLP_LIBRARY
     41find_library(COIN_OSI_CLP_LIBRARY
    4242  NAMES OsiClp libOsiClp
    4343  HINTS ${COIN_ROOT_DIR}/lib/coin
    4444  HINTS ${COIN_ROOT_DIR}/lib
    4545)
    46 FIND_LIBRARY(COIN_OSI_VOL_LIBRARY
     46find_library(COIN_OSI_VOL_LIBRARY
    4747  NAMES OsiVol libOsiVol
    4848  HINTS ${COIN_ROOT_DIR}/lib/coin
    4949  HINTS ${COIN_ROOT_DIR}/lib
    5050)
    51 FIND_LIBRARY(COIN_VOL_LIBRARY
     51find_library(COIN_VOL_LIBRARY
    5252  NAMES Vol libVol
    5353  HINTS ${COIN_ROOT_DIR}/lib/coin
    5454  HINTS ${COIN_ROOT_DIR}/lib
    5555)
    5656
    57 FIND_LIBRARY(COIN_ZLIB_LIBRARY
     57find_library(COIN_ZLIB_LIBRARY
    5858  NAMES z libz
    5959  HINTS ${COIN_ROOT_DIR}/lib/coin
    6060  HINTS ${COIN_ROOT_DIR}/lib
    6161)
    62 FIND_LIBRARY(COIN_BZ2_LIBRARY
     62find_library(COIN_BZ2_LIBRARY
    6363  NAMES bz2 libbz2
    6464  HINTS ${COIN_ROOT_DIR}/lib/coin
    6565  HINTS ${COIN_ROOT_DIR}/lib
    6666)
    6767
    68 FIND_LIBRARY(COIN_PTHREADS_LIBRARY
     68find_library(COIN_PTHREADS_LIBRARY
    6969  NAMES pthreads libpthreads
    7070  HINTS ${COIN_ROOT_DIR}/lib/coin
    7171  HINTS ${COIN_ROOT_DIR}/lib
    7272)
    7373
    74 INCLUDE(FindPackageHandleStandardArgs)
     74include(FindPackageHandleStandardArgs)
    7575FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG
    7676  COIN_INCLUDE_DIR
    7777  COIN_CBC_LIBRARY
     
    8686  # COIN_VOL_LIBRARY
    8787)
    8888
    89 IF(COIN_FOUND)
    90   SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
    91   SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}")
    92   IF(COIN_ZLIB_LIBRARY)
    93     SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_ZLIB_LIBRARY}")
    94   ENDIF(COIN_ZLIB_LIBRARY)
    95    IF(COIN_BZ2_LIBRARY)
    96     SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_BZ2_LIBRARY}")
    97   ENDIF(COIN_BZ2_LIBRARY)
    98    IF(COIN_PTHREADS_LIBRARY)
    99     SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_PTHREADS_LIBRARY}")
    100   ENDIF(COIN_PTHREADS_LIBRARY)
    101   SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}")
    102   SET(COIN_LIBRARIES ${COIN_CBC_LIBRARIES})
    103 ENDIF(COIN_FOUND)
     89if(COIN_FOUND)
     90  set(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
     91  set(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}")
     92  if(COIN_ZLIB_LIBRARY)
     93    set(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_ZLIB_LIBRARY}")
     94  endif(COIN_ZLIB_LIBRARY)
     95   if(COIN_BZ2_LIBRARY)
     96    set(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_BZ2_LIBRARY}")
     97  endif(COIN_BZ2_LIBRARY)
     98   if(COIN_PTHREADS_LIBRARY)
     99    set(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_PTHREADS_LIBRARY}")
     100  endif(COIN_PTHREADS_LIBRARY)
     101  set(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}")
     102  set(COIN_LIBRARIES ${COIN_CBC_LIBRARIES})
     103endif(COIN_FOUND)
    104104
    105 MARK_AS_ADVANCED(
     105mark_as_advanced(
    106106  COIN_INCLUDE_DIR
    107107  COIN_CBC_LIBRARY
    108108  COIN_CBC_SOLVER_LIBRARY
  • cmake/FindGLPK.cmake

    diff --git a/cmake/FindGLPK.cmake b/cmake/FindGLPK.cmake
    a b  
    1 SET(GLPK_ROOT_DIR "" CACHE PATH "GLPK root directory")
     1set(GLPK_ROOT_DIR "" CACHE PATH "GLPK root directory")
    22
    3 SET(GLPK_REGKEY "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Glpk;InstallPath]")
    4 GET_FILENAME_COMPONENT(GLPK_ROOT_PATH ${GLPK_REGKEY} ABSOLUTE)
     3set(GLPK_REGKEY "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Glpk;InstallPath]")
     4get_filename_component(GLPK_ROOT_PATH ${GLPK_REGKEY} ABSOLUTE)
    55
    6 FIND_PATH(GLPK_INCLUDE_DIR
     6find_path(GLPK_INCLUDE_DIR
    77  glpk.h
    88  PATHS ${GLPK_REGKEY}/include
    99  HINTS ${GLPK_ROOT_DIR}/include
    1010)
    11 FIND_LIBRARY(GLPK_LIBRARY
     11find_library(GLPK_LIBRARY
    1212  glpk
    1313  PATHS ${GLPK_REGKEY}/lib
    1414  HINTS ${GLPK_ROOT_DIR}/lib
    1515)
    1616
    17 IF(GLPK_INCLUDE_DIR AND GLPK_LIBRARY)
    18   FILE(READ ${GLPK_INCLUDE_DIR}/glpk.h GLPK_GLPK_H)
     17if(GLPK_INCLUDE_DIR AND GLPK_LIBRARY)
     18  file(READ ${GLPK_INCLUDE_DIR}/glpk.h GLPK_GLPK_H)
    1919
    20   STRING(REGEX MATCH "define[ ]+GLP_MAJOR_VERSION[ ]+[0-9]+" GLPK_MAJOR_VERSION_LINE "${GLPK_GLPK_H}")
    21   STRING(REGEX REPLACE "define[ ]+GLP_MAJOR_VERSION[ ]+([0-9]+)" "\\1" GLPK_VERSION_MAJOR "${GLPK_MAJOR_VERSION_LINE}")
     20  string(REGEX MATCH "define[ ]+GLP_MAJOR_VERSION[ ]+[0-9]+" GLPK_MAJOR_VERSION_LINE "${GLPK_GLPK_H}")
     21  string(REGEX REPLACE "define[ ]+GLP_MAJOR_VERSION[ ]+([0-9]+)" "\\1" GLPK_VERSION_MAJOR "${GLPK_MAJOR_VERSION_LINE}")
    2222
    23   STRING(REGEX MATCH "define[ ]+GLP_MINOR_VERSION[ ]+[0-9]+" GLPK_MINOR_VERSION_LINE "${GLPK_GLPK_H}")
    24   STRING(REGEX REPLACE "define[ ]+GLP_MINOR_VERSION[ ]+([0-9]+)" "\\1" GLPK_VERSION_MINOR "${GLPK_MINOR_VERSION_LINE}")
     23  string(REGEX MATCH "define[ ]+GLP_MINOR_VERSION[ ]+[0-9]+" GLPK_MINOR_VERSION_LINE "${GLPK_GLPK_H}")
     24  string(REGEX REPLACE "define[ ]+GLP_MINOR_VERSION[ ]+([0-9]+)" "\\1" GLPK_VERSION_MINOR "${GLPK_MINOR_VERSION_LINE}")
    2525
    26   SET(GLPK_VERSION_STRING "${GLPK_VERSION_MAJOR}.${GLPK_VERSION_MINOR}")
     26  set(GLPK_VERSION_STRING "${GLPK_VERSION_MAJOR}.${GLPK_VERSION_MINOR}")
    2727
    28   IF(GLPK_FIND_VERSION)
    29     IF(GLPK_FIND_VERSION_COUNT GREATER 2)
    30       MESSAGE(SEND_ERROR "unexpected version string")
    31     ENDIF(GLPK_FIND_VERSION_COUNT GREATER 2)
     28  if(GLPK_FIND_VERSION)
     29    if(GLPK_FIND_VERSION_COUNT GREATER 2)
     30      message(SEND_ERROR "unexpected version string")
     31    endif(GLPK_FIND_VERSION_COUNT GREATER 2)
    3232
    33     MATH(EXPR GLPK_REQUESTED_VERSION "${GLPK_FIND_VERSION_MAJOR}*100 + ${GLPK_FIND_VERSION_MINOR}")
    34     MATH(EXPR GLPK_FOUND_VERSION "${GLPK_VERSION_MAJOR}*100 + ${GLPK_VERSION_MINOR}")
     33    math(EXPR GLPK_REQUESTED_VERSION "${GLPK_FIND_VERSION_MAJOR}*100 + ${GLPK_FIND_VERSION_MINOR}")
     34    math(EXPR GLPK_FOUND_VERSION "${GLPK_VERSION_MAJOR}*100 + ${GLPK_VERSION_MINOR}")
    3535
    36     IF(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION)
    37       SET(GLPK_PROPER_VERSION_FOUND FALSE)
    38     ELSE(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION)
    39       SET(GLPK_PROPER_VERSION_FOUND TRUE)
    40     ENDIF(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION)
    41   ELSE(GLPK_FIND_VERSION)
    42     SET(GLPK_PROPER_VERSION_FOUND TRUE)
    43   ENDIF(GLPK_FIND_VERSION)
    44 ENDIF(GLPK_INCLUDE_DIR AND GLPK_LIBRARY)
     36    if(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION)
     37      set(GLPK_PROPER_VERSION_FOUND FALSE)
     38    else(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION)
     39      set(GLPK_PROPER_VERSION_FOUND TRUE)
     40    endif(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION)
     41  else(GLPK_FIND_VERSION)
     42    set(GLPK_PROPER_VERSION_FOUND TRUE)
     43  endif(GLPK_FIND_VERSION)
     44endif(GLPK_INCLUDE_DIR AND GLPK_LIBRARY)
    4545
    46 INCLUDE(FindPackageHandleStandardArgs)
     46include(FindPackageHandleStandardArgs)
    4747FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLPK DEFAULT_MSG GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_PROPER_VERSION_FOUND)
    4848
    49 IF(GLPK_FOUND)
    50   SET(GLPK_INCLUDE_DIRS ${GLPK_INCLUDE_DIR})
    51   SET(GLPK_LIBRARIES ${GLPK_LIBRARY})
    52   SET(GLPK_BIN_DIR ${GLPK_ROOT_PATH}/bin)
    53 ENDIF(GLPK_FOUND)
     49if(GLPK_FOUND)
     50  set(GLPK_INCLUDE_DIRS ${GLPK_INCLUDE_DIR})
     51  set(GLPK_LIBRARIES ${GLPK_LIBRARY})
     52  set(GLPK_BIN_DIR ${GLPK_ROOT_PATH}/bin)
     53endif(GLPK_FOUND)
    5454
    55 MARK_AS_ADVANCED(GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_BIN_DIR)
     55mark_as_advanced(GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_BIN_DIR)
  • cmake/FindGhostscript.cmake

    diff --git a/cmake/FindGhostscript.cmake b/cmake/FindGhostscript.cmake
    a b  
    1 INCLUDE(FindPackageHandleStandardArgs)
     1include(FindPackageHandleStandardArgs)
    22
    3 FIND_PROGRAM(GHOSTSCRIPT_EXECUTABLE
     3find_program(GHOSTSCRIPT_EXECUTABLE
    44  NAMES gs gswin32c
    55  PATHS "$ENV{ProgramFiles}/gs"
    66  PATH_SUFFIXES gs8.61/bin gs8.62/bin gs8.63/bin gs8.64/bin gs8.65/bin
  • cmake/FindILOG.cmake

    diff --git a/cmake/FindILOG.cmake b/cmake/FindILOG.cmake
    a b  
    1 FIND_PATH(ILOG_ROOT_DIR
     1find_path(ILOG_ROOT_DIR
    22  NAMES cplex
    33  DOC "CPLEX STUDIO root directory"
    44  PATHS /opt/ibm/ILOG /usr/local/ibm/ILOG /usr/local/ILOG /usr/local/ilog
     
    1010  NO_DEFAULT_PATH
    1111)
    1212
    13 IF(WIN32)
    14   IF(MSVC_VERSION STREQUAL "1400")
    15     SET(ILOG_WIN_COMPILER "windows_vs2005")
    16   ELSEIF(MSVC_VERSION STREQUAL "1500")
    17     SET(ILOG_WIN_COMPILER "windows_vs2008")
    18   ELSEIF(MSVC_VERSION STREQUAL "1600")
    19     SET(ILOG_WIN_COMPILER "windows_vs2010")
    20   ELSE()
    21     SET(ILOG_WIN_COMPILER "windows_vs2008")
    22   ENDIF()
    23   IF(CMAKE_CL_64)
    24     SET(ILOG_WIN_COMPILER "x64_${ILOG_WIN_COMPILER}")
    25     SET(ILOG_WIN_PLATFORM "x64_win32")
    26   ELSE()
    27     SET(ILOG_WIN_COMPILER "x86_${ILOG_WIN_COMPILER}")
    28     SET(ILOG_WIN_PLATFORM "x86_win32")
    29   ENDIF()
    30 ENDIF()
     13if(WIN32)
     14  if(MSVC_VERSION STREQUAL "1400")
     15    set(ILOG_WIN_COMPILER "windows_vs2005")
     16  elseif(MSVC_VERSION STREQUAL "1500")
     17    set(ILOG_WIN_COMPILER "windows_vs2008")
     18  elseif(MSVC_VERSION STREQUAL "1600")
     19    set(ILOG_WIN_COMPILER "windows_vs2010")
     20  else()
     21    set(ILOG_WIN_COMPILER "windows_vs2008")
     22  endif()
     23  if(CMAKE_CL_64)
     24    set(ILOG_WIN_COMPILER "x64_${ILOG_WIN_COMPILER}")
     25    set(ILOG_WIN_PLATFORM "x64_win32")
     26  else()
     27    set(ILOG_WIN_COMPILER "x86_${ILOG_WIN_COMPILER}")
     28    set(ILOG_WIN_PLATFORM "x86_win32")
     29  endif()
     30endif()
    3131
    32 FIND_PATH(ILOG_CPLEX_ROOT_DIR
     32find_path(ILOG_CPLEX_ROOT_DIR
    3333  NAMES include/ilcplex
    3434  HINTS ${ILOG_ROOT_DIR}/cplex ${ILOG_ROOT_DIR}/cplex121
    3535  ${ILOG_ROOT_DIR}/cplex122 ${ILOG_ROOT_DIR}/cplex123
     
    3737  NO_DEFAULT_PATH
    3838)
    3939
    40 FIND_PATH(ILOG_CONCERT_ROOT_DIR
     40find_path(ILOG_CONCERT_ROOT_DIR
    4141  NAMES include/ilconcert
    4242  HINTS ${ILOG_ROOT_DIR}/concert ${ILOG_ROOT_DIR}/concert29
    4343  DOC "CONCERT root directory"
    4444  NO_DEFAULT_PATH
    4545)
    4646
    47 FIND_PATH(ILOG_CPLEX_INCLUDE_DIR
     47find_path(ILOG_CPLEX_INCLUDE_DIR
    4848  ilcplex/cplex.h
    4949  HINTS ${ILOG_CPLEX_ROOT_DIR}/include
    5050  NO_DEFAULT_PATH
    5151)
    5252
    53 FIND_PATH(ILOG_CONCERT_INCLUDE_DIR
     53find_path(ILOG_CONCERT_INCLUDE_DIR
    5454  ilconcert/ilobasic.h
    5555  HINTS ${ILOG_CONCERT_ROOT_DIR}/include
    5656  NO_DEFAULT_PATH
    5757)
    5858
    59 FIND_LIBRARY(ILOG_CPLEX_LIBRARY
     59find_library(ILOG_CPLEX_LIBRARY
    6060  cplex cplex121 cplex122 cplex123 cplex124
    6161  HINTS ${ILOG_CPLEX_ROOT_DIR}/lib/x86_sles10_4.1/static_pic
    6262  ${ILOG_CPLEX_ROOT_DIR}/lib/x86-64_sles10_4.1/static_pic
     
    6868  NO_DEFAULT_PATH
    6969  )
    7070
    71 FIND_LIBRARY(ILOG_CONCERT_LIBRARY
     71find_library(ILOG_CONCERT_LIBRARY
    7272  concert
    7373  HINTS ${ILOG_CONCERT_ROOT_DIR}/lib/x86_sles10_4.1/static_pic
    7474  ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_sles10_4.1/static_pic
     
    8080  NO_DEFAULT_PATH
    8181  )
    8282
    83 FIND_FILE(ILOG_CPLEX_DLL
     83find_file(ILOG_CPLEX_DLL
    8484  cplex121.dll cplex122.dll cplex123.dll cplex124.dll
    8585  HINTS ${ILOG_CPLEX_ROOT_DIR}/bin/${ILOG_WIN_PLATFORM}
    8686  NO_DEFAULT_PATH
    8787  )
    8888
    89 INCLUDE(FindPackageHandleStandardArgs)
     89include(FindPackageHandleStandardArgs)
    9090FIND_PACKAGE_HANDLE_STANDARD_ARGS(ILOG
    9191  DEFAULT_MSG ILOG_CPLEX_LIBRARY ILOG_CPLEX_INCLUDE_DIR
    9292  )
    9393
    94 IF(ILOG_FOUND)
    95   SET(ILOG_INCLUDE_DIRS ${ILOG_CPLEX_INCLUDE_DIR} ${ILOG_CONCERT_INCLUDE_DIR})
    96   SET(ILOG_LIBRARIES ${ILOG_CPLEX_LIBRARY} ${ILOG_CONCERT_LIBRARY})
    97   IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    98     # SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
    99     SET(ILOG_LIBRARIES ${ILOG_LIBRARIES} "m" "pthread" "dl")
    100   ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    101 ENDIF(ILOG_FOUND)
     94if(ILOG_FOUND)
     95  set(ILOG_INCLUDE_DIRS ${ILOG_CPLEX_INCLUDE_DIR} ${ILOG_CONCERT_INCLUDE_DIR})
     96  set(ILOG_LIBRARIES ${ILOG_CPLEX_LIBRARY} ${ILOG_CONCERT_LIBRARY})
     97  if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
     98    # set(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
     99    set(ILOG_LIBRARIES ${ILOG_LIBRARIES} "m" "pthread" "dl")
     100  endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
     101endif(ILOG_FOUND)
    102102
    103 MARK_AS_ADVANCED(
     103mark_as_advanced(
    104104  ILOG_CPLEX_LIBRARY ILOG_CPLEX_INCLUDE_DIR ILOG_CPLEX_DLL
    105105  ILOG_CONCERT_LIBRARY ILOG_CONCERT_INCLUDE_DIR ILOG_CONCERT_DLL
    106106  )
  • cmake/FindSOPLEX.cmake

    diff --git a/cmake/FindSOPLEX.cmake b/cmake/FindSOPLEX.cmake
    a b  
    1 SET(SOPLEX_ROOT_DIR "" CACHE PATH "SoPlex root directory")
     1set(SOPLEX_ROOT_DIR "" CACHE PATH "SoPlex root directory")
    22
    3 FIND_PATH(SOPLEX_INCLUDE_DIR
     3find_path(SOPLEX_INCLUDE_DIR
    44  soplex.h
    55  HINTS ${SOPLEX_ROOT_DIR}/src
    66)
    7 FIND_LIBRARY(SOPLEX_LIBRARY
     7find_library(SOPLEX_LIBRARY
    88  soplex
    99  HINTS ${SOPLEX_ROOT_DIR}/lib
    1010)
    1111
    12 INCLUDE(FindPackageHandleStandardArgs)
     12include(FindPackageHandleStandardArgs)
    1313FIND_PACKAGE_HANDLE_STANDARD_ARGS(SOPLEX DEFAULT_MSG SOPLEX_LIBRARY SOPLEX_INCLUDE_DIR)
    1414
    15 IF(SOPLEX_FOUND)
    16   SET(SOPLEX_INCLUDE_DIRS ${SOPLEX_INCLUDE_DIR})
    17   SET(SOPLEX_LIBRARIES ${SOPLEX_LIBRARY})
    18   IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    19     SET(SOPLEX_LIBRARIES "${SOPLEX_LIBRARIES};z")
    20   ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    21 ENDIF(SOPLEX_FOUND)
     15if(SOPLEX_FOUND)
     16  set(SOPLEX_INCLUDE_DIRS ${SOPLEX_INCLUDE_DIR})
     17  set(SOPLEX_LIBRARIES ${SOPLEX_LIBRARY})
     18  if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
     19    set(SOPLEX_LIBRARIES "${SOPLEX_LIBRARIES};z")
     20  endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
     21endif(SOPLEX_FOUND)
    2222
    23 MARK_AS_ADVANCED(SOPLEX_LIBRARY SOPLEX_INCLUDE_DIR)
     23mark_as_advanced(SOPLEX_LIBRARY SOPLEX_INCLUDE_DIR)
  • cmake/LEMONConfig.cmake.in

    diff --git a/cmake/LEMONConfig.cmake.in b/cmake/LEMONConfig.cmake.in
    a b  
    1 SET(LEMON_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include" CACHE PATH "LEMON include directory")
    2 SET(LEMON_INCLUDE_DIRS "${LEMON_INCLUDE_DIR}")
     1set(LEMON_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include" CACHE PATH "LEMON include directory")
     2set(LEMON_INCLUDE_DIRS "${LEMON_INCLUDE_DIR}")
    33
    4 IF(UNIX)
    5   SET(LEMON_LIB_NAME "libemon.a")
    6 ELSEIF(WIN32)
    7   SET(LEMON_LIB_NAME "lemon.lib")
    8 ENDIF(UNIX)
     4if(UNIX)
     5  set(LEMON_LIB_NAME "libemon.a")
     6elseif(WIN32)
     7  set(LEMON_LIB_NAME "lemon.lib")
     8endif(UNIX)
    99
    10 SET(LEMON_LIBRARY "@CMAKE_INSTALL_PREFIX@/lib/${LEMON_LIB_NAME}" CACHE FILEPATH "LEMON library")
    11 SET(LEMON_LIBRARIES "${LEMON_LIBRARY}")
     10set(LEMON_LIBRARY "@CMAKE_INSTALL_PREFIX@/lib/${LEMON_LIB_NAME}" CACHE FILEPATH "LEMON library")
     11set(LEMON_LIBRARIES "${LEMON_LIBRARY}")
    1212
    13 MARK_AS_ADVANCED(LEMON_LIBRARY LEMON_INCLUDE_DIR)
     13mark_as_advanced(LEMON_LIBRARY LEMON_INCLUDE_DIR)
  • cmake/version.cmake.in

    diff --git a/cmake/version.cmake.in b/cmake/version.cmake.in
    a b  
    1 SET(LEMON_VERSION "@LEMON_VERSION@" CACHE STRING "LEMON version string.")
     1set(LEMON_VERSION "@LEMON_VERSION@" CACHE STRING "LEMON version string.")
  • contrib/CMakeLists.txt

    diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt
    a b  
    1 INCLUDE_DIRECTORIES(
     1include_directories(
    22  ${PROJECT_SOURCE_DIR}
    33  ${PROJECT_BINARY_DIR}
    44)
    55
    6 LINK_DIRECTORIES(
     6link_directories(
    77  ${PROJECT_BINARY_DIR}/lemon
    88)
    99
     
    1414# whitespaces. Moreover, you can add multiple similar blocks if you
    1515# want to build more than one executables.
    1616
    17 # ADD_EXECUTABLE(myprog myprog-main.cc)
    18 # TARGET_LINK_LIBRARIES(myprog lemon)
     17# add_executable(myprog myprog-main.cc)
     18# target_link_libraries(myprog lemon)
    1919
  • demo/CMakeLists.txt

    diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt
    a b  
    1 INCLUDE_DIRECTORIES(
     1include_directories(
    22  ${PROJECT_SOURCE_DIR}
    33  ${PROJECT_BINARY_DIR}
    44)
    55
    6 LINK_DIRECTORIES(
     6link_directories(
    77  ${PROJECT_BINARY_DIR}/lemon
    88)
    99
    10 SET(DEMOS
     10set(DEMOS
    1111  arg_parser_demo
    1212  graph_to_eps_demo
    1313  lgf_demo
    1414)
    1515
    16 FOREACH(DEMO_NAME ${DEMOS})
    17   ADD_EXECUTABLE(${DEMO_NAME} ${DEMO_NAME}.cc)
    18   TARGET_LINK_LIBRARIES(${DEMO_NAME} lemon)
    19 ENDFOREACH()
     16foreach(DEMO_NAME ${DEMOS})
     17  add_executable(${DEMO_NAME} ${DEMO_NAME}.cc)
     18  target_link_libraries(${DEMO_NAME} lemon)
     19endforeach()
  • doc/CMakeLists.txt

    diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
    a b  
    1 SET(PACKAGE_NAME ${PROJECT_NAME})
    2 SET(PACKAGE_VERSION ${PROJECT_VERSION})
    3 SET(abs_top_srcdir ${PROJECT_SOURCE_DIR})
    4 SET(abs_top_builddir ${PROJECT_BINARY_DIR})
     1set(PACKAGE_NAME ${PROJECT_NAME})
     2set(PACKAGE_VERSION ${PROJECT_VERSION})
     3set(abs_top_srcdir ${PROJECT_SOURCE_DIR})
     4set(abs_top_builddir ${PROJECT_BINARY_DIR})
    55
    6 SET(LEMON_DOC_SOURCE_BROWSER "NO" CACHE STRING "Include source into the doc (YES/NO).")
    7 SET(LEMON_DOC_USE_MATHJAX "NO" CACHE STRING "Use MathJax to display math formulae (YES/NO).")
    8 SET(LEMON_DOC_MATHJAX_RELPATH "http://www.mathjax.org/mathjax" CACHE STRING "MathJax library location.")
     6set(LEMON_DOC_SOURCE_BROWSER "NO" CACHE STRING "Include source into the doc (YES/NO).")
     7set(LEMON_DOC_USE_MATHJAX "NO" CACHE STRING "Use MathJax to display math formulae (YES/NO).")
     8set(LEMON_DOC_MATHJAX_RELPATH "http://www.mathjax.org/mathjax" CACHE STRING "MathJax library location.")
    99
    10 SET(LEMON_DOC_LIBSTDC++_URL
     10set(LEMON_DOC_LIBSTDC++_URL
    1111  "http://gcc.gnu.org/onlinedocs/gcc-4.7.3/libstdc++/api"
    1212  CACHE STRING "GCC libstdc++ doxygen doc url.")
    1313
    1414
    15 CONFIGURE_FILE(
     15configure_file(
    1616  ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in
    1717  ${PROJECT_BINARY_DIR}/doc/Doxyfile
    1818  @ONLY
    1919)
    2020
    21 CONFIGURE_FILE(
     21configure_file(
    2222  ${PROJECT_SOURCE_DIR}/doc/mainpage.dox.in
    2323  ${PROJECT_BINARY_DIR}/doc/mainpage.dox
    2424  @ONLY
    2525)
    2626
    2727# Copy doc from source (if exists)
    28 IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/html AND
     28if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/html AND
    2929    NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/html/index.html)
    30   MESSAGE(STATUS "Copy doc from source tree")
    31   EXECUTE_PROCESS(
     30  message(STATUS "Copy doc from source tree")
     31  execute_process(
    3232    COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/html ${CMAKE_CURRENT_BINARY_DIR}/html
    3333    )
    34 ENDIF()
     34endif()
    3535
    36 IF(DOXYGEN_EXECUTABLE AND PYTHONINTERP_FOUND AND GHOSTSCRIPT_EXECUTABLE)
    37   FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/)
    38   SET(GHOSTSCRIPT_OPTIONS -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha)
    39   ADD_CUSTOM_TARGET(html
     36if(DOXYGEN_EXECUTABLE AND PYTHONINTERP_FOUND AND GHOSTSCRIPT_EXECUTABLE)
     37  file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/)
     38  set(GHOSTSCRIPT_OPTIONS -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha)
     39  add_custom_target(html
    4040    COMMAND ${CMAKE_COMMAND} -E remove_directory gen-images
    4141    COMMAND ${CMAKE_COMMAND} -E make_directory gen-images
    4242    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r20 -sOutputFile=gen-images/grid_graph.png ${CMAKE_CURRENT_SOURCE_DIR}/images/grid_graph.eps
     
    6060    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    6161  )
    6262
    63   SET_TARGET_PROPERTIES(html PROPERTIES PROJECT_LABEL BUILD_DOC)
     63  set_target_properties(html PROPERTIES PROJECT_LABEL BUILD_DOC)
    6464
    65   IF(UNIX)
    66     INSTALL(
     65  if(UNIX)
     66    install(
    6767      DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
    6868      DESTINATION share/doc/lemon/html
    6969      COMPONENT html_documentation
    7070    )
    71   ELSEIF(WIN32)
    72     INSTALL(
     71  elseif(WIN32)
     72    install(
    7373      DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
    7474      DESTINATION doc
    7575      COMPONENT html_documentation
    7676    )
    77   ENDIF()
     77  endif()
    7878
    79 ENDIF()
     79endif()
    8080
    81 IF(WGET_FOUND)
    82 ADD_CUSTOM_TARGET(update-external-tags
     81if(WGET_FOUND)
     82add_custom_target(update-external-tags
    8383  COMMAND ${WGET_EXECUTABLE} -N ${LEMON_DOC_LIBSTDC++_URL}/libstdc++.tag
    8484  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
    8585  )
    86 ENDIF()
     86endif()
  • lemon/CMakeLists.txt

    diff --git a/lemon/CMakeLists.txt b/lemon/CMakeLists.txt
    a b  
    1 INCLUDE_DIRECTORIES(
     1include_directories(
    22  ${PROJECT_SOURCE_DIR}
    33  ${PROJECT_BINARY_DIR}
    44)
    55
    6 CONFIGURE_FILE(
     6configure_file(
    77  ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
    88  ${CMAKE_CURRENT_BINARY_DIR}/config.h
    99)
    1010
    11 CONFIGURE_FILE(
     11configure_file(
    1212  ${CMAKE_CURRENT_SOURCE_DIR}/lemon.pc.in
    1313  ${CMAKE_CURRENT_BINARY_DIR}/lemon.pc
    1414  @ONLY
    1515)
    1616
    17 SET(LEMON_SOURCES
     17set(LEMON_SOURCES
    1818  arg_parser.cc
    1919  base.cc
    2020  color.cc
     
    2424  bits/windows.cc
    2525)
    2626
    27 IF(LEMON_HAVE_GLPK)
    28   SET(LEMON_SOURCES ${LEMON_SOURCES} glpk.cc)
    29   INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIRS})
    30   IF(WIN32)
    31     INSTALL(FILES ${GLPK_BIN_DIR}/glpk.dll DESTINATION bin)
    32     INSTALL(FILES ${GLPK_BIN_DIR}/libltdl3.dll DESTINATION bin)
    33     INSTALL(FILES ${GLPK_BIN_DIR}/zlib1.dll DESTINATION bin)
    34   ENDIF()
    35 ENDIF()
     27if(LEMON_HAVE_GLPK)
     28  set(LEMON_SOURCES ${LEMON_SOURCES} glpk.cc)
     29  include_directories(${GLPK_INCLUDE_DIRS})
     30  if(WIN32)
     31    install(FILES ${GLPK_BIN_DIR}/glpk.dll DESTINATION bin)
     32    install(FILES ${GLPK_BIN_DIR}/libltdl3.dll DESTINATION bin)
     33    install(FILES ${GLPK_BIN_DIR}/zlib1.dll DESTINATION bin)
     34  endif()
     35endif()
    3636
    37 IF(LEMON_HAVE_CPLEX)
    38   SET(LEMON_SOURCES ${LEMON_SOURCES} cplex.cc)
    39   INCLUDE_DIRECTORIES(${ILOG_INCLUDE_DIRS})
    40 ENDIF()
     37if(LEMON_HAVE_CPLEX)
     38  set(LEMON_SOURCES ${LEMON_SOURCES} cplex.cc)
     39  include_directories(${ILOG_INCLUDE_DIRS})
     40endif()
    4141
    42 IF(LEMON_HAVE_CLP)
    43   SET(LEMON_SOURCES ${LEMON_SOURCES} clp.cc)
    44   INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
    45 ENDIF()
     42if(LEMON_HAVE_CLP)
     43  set(LEMON_SOURCES ${LEMON_SOURCES} clp.cc)
     44  include_directories(${COIN_INCLUDE_DIRS})
     45endif()
    4646
    47 IF(LEMON_HAVE_CBC)
    48   SET(LEMON_SOURCES ${LEMON_SOURCES} cbc.cc)
    49   INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
    50 ENDIF()
     47if(LEMON_HAVE_CBC)
     48  set(LEMON_SOURCES ${LEMON_SOURCES} cbc.cc)
     49  include_directories(${COIN_INCLUDE_DIRS})
     50endif()
    5151
    52 IF(LEMON_HAVE_SOPLEX)
    53   SET(LEMON_SOURCES ${LEMON_SOURCES} soplex.cc)
    54   INCLUDE_DIRECTORIES(${SOPLEX_INCLUDE_DIRS})
    55 ENDIF()
     52if(LEMON_HAVE_SOPLEX)
     53  set(LEMON_SOURCES ${LEMON_SOURCES} soplex.cc)
     54  include_directories(${SOPLEX_INCLUDE_DIRS})
     55endif()
    5656
    57 ADD_LIBRARY(lemon ${LEMON_SOURCES})
     57add_library(lemon ${LEMON_SOURCES})
    5858
    59 TARGET_LINK_LIBRARIES(lemon
     59target_link_libraries(lemon
    6060  ${GLPK_LIBRARIES} ${COIN_LIBRARIES} ${ILOG_LIBRARIES} ${SOPLEX_LIBRARIES}
    6161  )
    6262
    63 IF(UNIX)
    64   SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon VERSION ${LEMON_VERSION} SOVERSION ${LEMON_VERSION})
    65 ENDIF()
     63if(UNIX)
     64  set_target_properties(lemon PROPERTIES OUTPUT_NAME emon VERSION ${LEMON_VERSION} SOVERSION ${LEMON_VERSION})
     65endif()
    6666
    67 INSTALL(
     67install(
    6868  TARGETS lemon
    6969  ARCHIVE DESTINATION lib
    7070  LIBRARY DESTINATION lib
    7171  COMPONENT library
    7272)
    7373
    74 INSTALL(
     74install(
    7575  DIRECTORY . bits concepts
    7676  DESTINATION include/lemon
    7777  COMPONENT headers
    7878  FILES_MATCHING PATTERN "*.h"
    7979)
    8080
    81 INSTALL(
     81install(
    8282  FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h
    8383  DESTINATION include/lemon
    8484  COMPONENT headers
    8585)
    8686
    87 INSTALL(
     87install(
    8888  FILES ${CMAKE_CURRENT_BINARY_DIR}/lemon.pc
    8989  DESTINATION lib/pkgconfig
    9090)
  • test/CMakeLists.txt

    diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
    a b  
    1 INCLUDE_DIRECTORIES(
     1include_directories(
    22  ${PROJECT_SOURCE_DIR}
    33  ${PROJECT_BINARY_DIR}
    44)
    55
    6 LINK_DIRECTORIES(
     6link_directories(
    77  ${PROJECT_BINARY_DIR}/lemon
    88)
    99
    10 SET(TEST_WITH_VALGRIND "NO" CACHE STRING
     10set(TEST_WITH_VALGRIND "NO" CACHE STRING
    1111  "Run the test with valgrind (YES/NO).")
    12 SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.")
     12set(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.")
    1313
    14 SET(TESTS
     14set(TESTS
    1515  adaptors_test
    1616  arc_look_up_test
    1717  bellman_ford_test
     
    5757  vf2_test
    5858)
    5959
    60 IF(LEMON_HAVE_LP)
    61   IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
    62     ADD_EXECUTABLE(lp_test lp_test.cc)
    63   ELSE()
    64     ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
    65   ENDIF()
     60if(LEMON_HAVE_LP)
     61  if(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     62    add_executable(lp_test lp_test.cc)
     63  else()
     64    add_executable(lp_test EXCLUDE_FROM_ALL lp_test.cc)
     65  endif()
    6666
    67   SET(LP_TEST_LIBS lemon)
     67  set(LP_TEST_LIBS lemon)
    6868
    69   IF(LEMON_HAVE_GLPK)
    70     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
    71   ENDIF()
    72   IF(LEMON_HAVE_CPLEX)
    73     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${ILOG_LIBRARIES})
    74   ENDIF()
    75   IF(LEMON_HAVE_CLP)
    76     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
    77   ENDIF()
    78   IF(LEMON_HAVE_SOPLEX)
    79     SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${SOPLEX_LIBRARIES})
    80   ENDIF()
     69  if(LEMON_HAVE_GLPK)
     70    set(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
     71  endif()
     72  if(LEMON_HAVE_CPLEX)
     73    set(LP_TEST_LIBS ${LP_TEST_LIBS} ${ILOG_LIBRARIES})
     74  endif()
     75  if(LEMON_HAVE_CLP)
     76    set(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
     77  endif()
     78  if(LEMON_HAVE_SOPLEX)
     79    set(LP_TEST_LIBS ${LP_TEST_LIBS} ${SOPLEX_LIBRARIES})
     80  endif()
    8181
    82   TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
    83   ADD_TEST(lp_test lp_test)
    84   ADD_DEPENDENCIES(check lp_test)
     82  target_link_libraries(lp_test ${LP_TEST_LIBS})
     83  add_test(lp_test lp_test)
     84  add_dependencies(check lp_test)
    8585
    86   IF(WIN32 AND LEMON_HAVE_GLPK)
    87     ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
     86  if(WIN32 AND LEMON_HAVE_GLPK)
     87    add_custom_command(TARGET lp_test POST_BUILD
    8888      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll $<TARGET_FILE_DIR:lp_test>
    8989      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll $<TARGET_FILE_DIR:lp_test>
    9090      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll $<TARGET_FILE_DIR:lp_test>
    9191    )
    92   ENDIF()
     92  endif()
    9393
    94   IF(WIN32 AND LEMON_HAVE_CPLEX)
    95     GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    96     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    97     ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
     94  if(WIN32 AND LEMON_HAVE_CPLEX)
     95    get_target_property(TARGET_LOC lp_test LOCATION)
     96    get_filename_component(TARGET_PATH ${TARGET_LOC} PATH)
     97    add_custom_command(TARGET lp_test POST_BUILD
    9898      COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH}
    9999    )
    100   ENDIF()
    101 ENDIF()
     100  endif()
     101endif()
    102102
    103 IF(LEMON_HAVE_MIP)
    104   IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
    105     ADD_EXECUTABLE(mip_test mip_test.cc)
    106   ELSE()
    107     ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
    108   ENDIF()
     103if(LEMON_HAVE_MIP)
     104  if(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     105    add_executable(mip_test mip_test.cc)
     106  else()
     107    add_executable(mip_test EXCLUDE_FROM_ALL mip_test.cc)
     108  endif()
    109109
    110   SET(MIP_TEST_LIBS lemon)
     110  set(MIP_TEST_LIBS lemon)
    111111
    112   IF(LEMON_HAVE_GLPK)
    113     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
    114   ENDIF()
    115   IF(LEMON_HAVE_CPLEX)
    116     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${ILOG_LIBRARIES})
    117   ENDIF()
    118   IF(LEMON_HAVE_CBC)
    119     SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
    120   ENDIF()
     112  if(LEMON_HAVE_GLPK)
     113    set(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
     114  endif()
     115  if(LEMON_HAVE_CPLEX)
     116    set(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${ILOG_LIBRARIES})
     117  endif()
     118  if(LEMON_HAVE_CBC)
     119    set(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
     120  endif()
    121121
    122   TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
    123   ADD_TEST(mip_test mip_test)
    124   ADD_DEPENDENCIES(check mip_test)
     122  target_link_libraries(mip_test ${MIP_TEST_LIBS})
     123  add_test(mip_test mip_test)
     124  add_dependencies(check mip_test)
    125125
    126   IF(WIN32 AND LEMON_HAVE_GLPK)
    127     GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
    128     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    129     ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
     126  if(WIN32 AND LEMON_HAVE_GLPK)
     127    get_target_property(TARGET_LOC mip_test LOCATION)
     128    get_filename_component(TARGET_PATH ${TARGET_LOC} PATH)
     129    add_custom_command(TARGET mip_test POST_BUILD
    130130      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    131131      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    132132      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    133133    )
    134   ENDIF()
     134  endif()
    135135
    136   IF(WIN32 AND LEMON_HAVE_CPLEX)
    137     GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
    138     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    139     ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
     136  if(WIN32 AND LEMON_HAVE_CPLEX)
     137    get_target_property(TARGET_LOC mip_test LOCATION)
     138    get_filename_component(TARGET_PATH ${TARGET_LOC} PATH)
     139    add_custom_command(TARGET mip_test POST_BUILD
    140140      COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH}
    141141    )
    142   ENDIF()
    143 ENDIF()
     142  endif()
     143endif()
    144144
    145 FOREACH(TEST_NAME ${TESTS})
    146   IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
    147     ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
    148   ELSE()
    149     ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
    150   ENDIF()
    151   TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
    152     IF(TEST_WITH_VALGRIND)
    153       ADD_TEST(${TEST_NAME}
     145foreach(TEST_NAME ${TESTS})
     146  if(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     147    add_executable(${TEST_NAME} ${TEST_NAME}.cc)
     148  else()
     149    add_executable(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
     150  endif()
     151  target_link_libraries(${TEST_NAME} lemon)
     152    if(TEST_WITH_VALGRIND)
     153      add_test(${TEST_NAME}
    154154        valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
    155155        ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
    156     ELSE()
    157       ADD_TEST(${TEST_NAME} ${TEST_NAME})
    158     ENDIF()
    159   ADD_DEPENDENCIES(check ${TEST_NAME})
    160 ENDFOREACH()
     156    else()
     157      add_test(${TEST_NAME} ${TEST_NAME})
     158    endif()
     159  add_dependencies(check ${TEST_NAME})
     160endforeach()
  • tools/CMakeLists.txt

    diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
    a b  
    1 INCLUDE_DIRECTORIES(
     1include_directories(
    22  ${PROJECT_SOURCE_DIR}
    33  ${PROJECT_BINARY_DIR}
    44)
    55
    6 LINK_DIRECTORIES(
     6link_directories(
    77  ${PROJECT_BINARY_DIR}/lemon
    88)
    99
    10 ADD_EXECUTABLE(lgf-gen lgf-gen.cc)
    11 TARGET_LINK_LIBRARIES(lgf-gen lemon)
     10add_executable(lgf-gen lgf-gen.cc)
     11target_link_libraries(lgf-gen lemon)
    1212
    13 ADD_EXECUTABLE(dimacs-to-lgf dimacs-to-lgf.cc)
    14 TARGET_LINK_LIBRARIES(dimacs-to-lgf lemon)
     13add_executable(dimacs-to-lgf dimacs-to-lgf.cc)
     14target_link_libraries(dimacs-to-lgf lemon)
    1515
    16 ADD_EXECUTABLE(dimacs-solver dimacs-solver.cc)
    17 TARGET_LINK_LIBRARIES(dimacs-solver lemon)
     16add_executable(dimacs-solver dimacs-solver.cc)
     17target_link_libraries(dimacs-solver lemon)
    1818
    19 INSTALL(
     19install(
    2020  TARGETS lgf-gen dimacs-to-lgf dimacs-solver
    2121  RUNTIME DESTINATION bin
    2222  COMPONENT bin
    2323)
    2424
    25 IF(NOT WIN32)
    26   INSTALL(
     25if(NOT WIN32)
     26  install(
    2727    PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/lemon-0.x-to-1.x.sh
    2828    DESTINATION bin
    2929    COMPONENT bin
    3030  )
    31 ENDIF()
     31endif()