COIN-OR::LEMON - Graph Library

Ticket #390: 4bc24dc30565.patch

File 4bc24dc30565.patch, 2.1 KB (added by Alpar Juttner, 10 years ago)
  • CMakeLists.txt

    # HG changeset patch
    # User Alpar Juttner <alpar@cs.elte.hu>
    # Date 1284040500 -7200
    # Node ID 4bc24dc3056519699fc8cfa21024f7ee1a124a53
    # Parent  bba484e8f7426934216f45a488fd9fa030b3380f
    Make CMAKE config more consistent with configure.ac (#390)
    
    - CMAKE_BUILD_TYPE is Release by deafult
    - The same set of warnings are used when compiling with gcc
    
    diff --git a/CMakeLists.txt b/CMakeLists.txt
    a b  
    4646FIND_PACKAGE(CPLEX)
    4747FIND_PACKAGE(COIN)
    4848
     49IF(DEFINED ENV{LEMON_CXX_WARNING})
     50  SET(CXX_WARNING $ENV{LEMON_CXX_WARNING})
     51ELSE()
     52  IF(CMAKE_COMPILER_IS_GNUCXX)
     53    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 -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas")
     54    SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb")
     55    SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb")
     56  ELSEIF(MSVC)
     57    # This part is unnecessary 'casue the same is set by the lemon/core.h.
     58    # Still keep it as an example.
     59    SET(CXX_WARNING "/wd4250 /wd4355 /wd4503 /wd4800 /wd4996")
     60    # Suppressed warnings:
     61    # C4250: 'class1' : inherits 'class2::member' via dominance
     62    # C4355: 'this' : used in base member initializer list
     63    # C4503: 'function' : decorated name length exceeded, name was truncated
     64    # C4800: 'type' : forcing value to bool 'true' or 'false'
     65    #        (performance warning)
     66    # C4996: 'function': was declared deprecated
     67  ELSE()
     68    SET(CXX_WARNING "-Wall -W")
     69  ENDIF()
     70ENDIF()
     71SET(LEMON_CXX_WARNING_FLAGS ${CXX_WARNING} CACHE STRING "LEMON warning flags.")
     72
     73SET(CMAKE_CXX_FLAGS ${LEMON_CXX_WARNING_FLAGS})
     74
     75IF(NOT CMAKE_BUILD_TYPE)
     76  SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
     77ENDIF()
     78
     79
    4980INCLUDE(CheckTypeSize)
    5081CHECK_TYPE_SIZE("long long" LONG_LONG)
    5182SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})