COIN-OR::LEMON - Graph Library

Ticket #658: ef70d6e9d8b6.patch

File ef70d6e9d8b6.patch, 4.0 KB (added by Alpar Juttner, 3 years ago)
  • CMakeLists.txt

    # HG changeset patch
    # User Alpar Juttner <alpar@cs.elte.hu>
    # Date 1637680078 -3600
    #      Tue Nov 23 16:07:58 2021 +0100
    # Node ID ef70d6e9d8b63662d473d2a710c388ae1807f0d6
    # Parent  779318694d8bc7836940300b83705f5267d41cb0
    CMAKE Bugfixes and better build logic (#658)
    
    diff --git a/CMakeLists.txt b/CMakeLists.txt
    a b  
    8080option(LEMON_ENABLE_SOPLEX "Enable SoPlex solver backend." OFF)
    8181
    8282# Building + Testing
    83 option(LEMON_BUILD_TESTING "Enable unit tests" ON)
    84 option(LEMON_MAINTAINER "Enable Maintainer options." OFF)
     83option(LEMON_BUILD_TESTING "Enable unit tests" OFF)
     84option(LEMON_MAINTAINER_MODE "Enable Maintainer options." OFF)
    8585option(LEMON_BUILD_DOCS "Enable docs using doxygen and ghostcript" OFF)
    8686option(LEMON_BUILD_TOOLS "Enable project in tools directory" OFF)
    8787option(LEMON_BUILD_DEMO "Enable project in demo directory" OFF)
     
    106106# Add LEMON::LEMON target
    107107include(base)
    108108
    109 if(LEMON_MAINTAINER)
     109if(LEMON_MAINTAINER_MODE)
    110110  add_custom_target(check ALL COMMAND ${CMAKE_CTEST_COMMAND})
    111111else()
    112112  add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
    113113endif()
    114114
    115 if(LEMON_BUILD_TESTING)
    116   add_subdirectory(test)
    117 endif()
     115add_subdirectory(test)
    118116
    119117if(LEMON_BUILD_TOOLS)
    120118  add_subdirectory(tools)
  • .cmake.in

    diff --git a/cmake/version.cmake.in b/cmake/LEMONVersion.cmake.in
    rename from cmake/version.cmake.in
    rename to cmake/LEMONVersion.cmake.in
    old new  
    1 SET(LEMON_VERSION "@LEMON_VERSION@" CACHE STRING "LEMON version string.")
     1set(LEMON_VERSION "@LEMON_VERSION@" CACHE STRING "LEMON version string.")
  • cmake/base.cmake

    diff --git a/cmake/base.cmake b/cmake/base.cmake
    a b  
    143143# GLPK #
    144144if(LEMON_ENABLE_GLPK)
    145145  find_package(GLPK REQUIRED)
     146else()
     147  find_package(GLPK)
    146148endif()
    147 if(GLPK_FOUND)
     149if(LEMON_ENABLE_GLPK AND GLPK_FOUND)
    148150  set(LEMON_HAVE_LP ON)
    149151  set(LEMON_HAVE_MIP ON)
    150152  set(LEMON_HAVE_GLPK ON)
     
    153155# ILOG #
    154156if(LEMON_ENABLE_ILOG)
    155157  find_package(ILOG REQUIRED)
     158else()
     159  find_package(ILOG)
    156160endif()
    157 if(ILOG_FOUND)
     161if(LEMON_ENABLE_ILOG AND ILOG_FOUND)
    158162  set(LEMON_HAVE_LP ON)
    159163  set(LEMON_HAVE_MIP ON)
    160164  set(LEMON_HAVE_CPLEX ON)
     
    163167# COIN #
    164168if(LEMON_ENABLE_COIN)
    165169  find_package(COIN REQUIRED)
     170else()
     171  find_package(COIN)
    166172endif()
    167 if(COIN_FOUND)
     173if(LEMON_ENABLE_COIN AND COIN_FOUND)
    168174  set(LEMON_HAVE_LP ON)
    169175  set(LEMON_HAVE_MIP ON)
    170176  set(LEMON_HAVE_CLP ON)
     
    174180# SOPLEX #
    175181if(LEMON_ENABLE_SOPLEX)
    176182  find_package(SOPLEX REQUIRED)
     183else()
     184  find_package(SOPLEX)
    177185endif()
    178 if(SOPLEX_FOUND)
     186if(LEMON_ENABLE_SOPLEX AND SOPLEX_FOUND)
    179187  set(LEMON_HAVE_LP ON)
    180188  set(LEMON_HAVE_SOPLEX ON)
    181189endif()
  • test/CMakeLists.txt

    diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
    a b  
    5959    min_cost_arborescence_test
    6060    min_cost_flow_test
    6161    min_mean_cycle_test
    62     multicommodity_flow_test
    6362    nagamochi_ibaraki_test
    6463    path_test
    6564    planarity_test
     
    7271    vf2_test)
    7372
    7473if(LEMON_HAVE_LP)
    75   if(LEMON_MAINTAINER)
     74  if(LEMON_MAINTAINER_MODE)
    7675    add_executable(lp_test lp_test.cc)
    7776  else()
    7877    add_executable(lp_test EXCLUDE_FROM_ALL lp_test.cc)
     
    9594
    9695  target_link_libraries(lp_test ${LP_TEST_LIBS})
    9796  add_test(lp_test lp_test)
    98   # add_dependencies(check lp_test)
     97  add_dependencies(check lp_test)
    9998
    10099  if(WIN32 AND LEMON_HAVE_GLPK)
    101100    get_target_property(TARGET_LOC lp_test LOCATION)
     
    120119endif()
    121120
    122121if(LEMON_HAVE_MIP)
    123   if(LEMON_MAINTAINER)
     122  if(LEMON_MAINTAINER_MODE)
    124123    add_executable(mip_test mip_test.cc)
    125124  else()
    126125    add_executable(mip_test EXCLUDE_FROM_ALL mip_test.cc)
     
    165164endif()
    166165
    167166foreach(TEST_NAME ${TESTS})
    168   add_executable(${TEST_NAME} ${TEST_NAME}.cc)
     167  if(LEMON_MAINTAINER_MODE)
     168    add_executable(${TEST_NAME} ${TEST_NAME}.cc)
     169  else()
     170    add_executable(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
     171  endif()
    169172  target_link_libraries(${TEST_NAME} LEMON::LEMON)
    170173  target_include_directories(
    171174    ${TEST_NAME}