COIN-OR::LEMON - Graph Library

Ticket #641: 641-736a341e604b.patch

File 641-736a341e604b.patch, 3.9 KB (added by Alpar Juttner, 3 months ago)
  • CMakeLists.txt

    # HG changeset patch
    # User Alpar Juttner <alpar@cs.elte.hu>
    # Date 1611214613 -3600
    #      Thu Jan 21 08:36:53 2021 +0100
    # Node ID 736a341e604b983e4ae9f4f47120fad0bef131c7
    # Parent  8c567e298d7f3fad82cc66754f2fb6c4a420366b
    Update CMakeLists.txt to match current CMAKE versions (#641)
    
    diff --git a/CMakeLists.txt b/CMakeLists.txt
    a b  
    55ENDIF(POLICY CMP0048)
    66
    77IF(POLICY CMP0043)
    8   CMAKE_POLICY(SET CMP0043 OLD)
     8  CMAKE_POLICY(SET CMP0043 NEW)
    99ENDIF(POLICY CMP0043)
    1010
    1111IF(POLICY CMP0026)
    1212  #This is for copying the dll's needed by glpk (in lp_test and mip_test)
    13   CMAKE_POLICY(SET CMP0026 OLD)
     13  CMAKE_POLICY(SET CMP0026 NEW)
    1414ENDIF(POLICY CMP0026)
    1515
    1616SET(PROJECT_NAME "LEMON")
     
    196196SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LEMON_CXX_WARNING_FLAGS}")
    197197
    198198IF(MSVC)
    199   SET(CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}")
     199  SET( CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}")
    200200  SET( CMAKE_CXX_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
    201     "Flags used by the C++ compiler during maintainer builds."
     201    "Flags used by the C++ compiler during maintainer builds." FORCE
    202202    )
    203203  SET( CMAKE_C_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
    204     "Flags used by the C compiler during maintainer builds."
     204    "Flags used by the C compiler during maintainer builds." FORCE
    205205    )
    206206  SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER
    207207    "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING
    208     "Flags used for linking binaries during maintainer builds."
     208    "Flags used for linking binaries during maintainer builds." FORCE
    209209    )
    210210  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."
     213     FORCE
    213214    )
    214215ELSE()
    215216  SET( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb -O0" CACHE STRING
    216     "Flags used by the C++ compiler during maintainer builds."
     217    "Flags used by the C++ compiler during maintainer builds." FORCE
    217218    )
    218219  SET( CMAKE_C_FLAGS_MAINTAINER "-Werror -O0" CACHE STRING
    219     "Flags used by the C compiler during maintainer builds."
     220    "Flags used by the C compiler during maintainer builds." FORCE
    220221    )
    221222  SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER
    222223    "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING
    223     "Flags used for linking binaries during maintainer builds."
     224    "Flags used for linking binaries during maintainer builds." FORCE
    224225    )
    225226  SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER
    226227    "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING
    227     "Flags used by the shared libraries linker during maintainer builds."
    228     )
     228    "Flags used by the shared libraries linker during maintainer builds." FORCE)
    229229ENDIF()
    230230
    231231MARK_AS_ADVANCED(
     
    251251    FORCE )
    252252
    253253SET_DIRECTORY_PROPERTIES(PROPERTIES
    254   COMPILE_DEFINITIONS_DEBUG "LEMON_ENABLE_DEBUG"
    255   COMPILE_DEFINITIONS_MAINTAINER "LEMON_ENABLE_DEBUG"
     254  COMPILE_DEFINITIONS
     255  $<$<OR:$<CONFIG:Debug>,$<CONFIG:Maintainer>>:LEMON_ENABLE_DEBUG>
    256256)
    257257
    258258INCLUDE(CheckTypeSize)
  • test/CMakeLists.txt

    diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
    a b  
    8484  ADD_DEPENDENCIES(check lp_test)
    8585
    8686  IF(WIN32 AND LEMON_HAVE_GLPK)
    87     GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    88     GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    8987    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    90       COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    91       COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    92       COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
     88      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll $<TARGET_FILE_DIR:lp_test>
     89      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll $<TARGET_FILE_DIR:lp_test>
     90      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll $<TARGET_FILE_DIR:lp_test>
    9391    )
    9492  ENDIF()
    9593