COIN-OR::LEMON - Graph Library

Changeset 1035:d149eaf24638 in lemon


Ignore:
Timestamp:
03/04/11 10:40:44 (8 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
1.2
Parents:
1029:79fab87ee483 (diff), 1033:16d466589b54 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge CMAKE backports to branch 1.2

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r791 r1035  
    33SET(PROJECT_NAME "LEMON")
    44PROJECT(${PROJECT_NAME})
     5
     6INCLUDE(FindPythonInterp)
     7INCLUDE(FindWget)
    58
    69IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake)
     
    1013ELSE()
    1114  EXECUTE_PROCESS(
     15    COMMAND ${PYTHON_EXECUTABLE} ./scripts/chg-len.py
     16    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
     17    OUTPUT_VARIABLE HG_REVISION_PATH
     18    ERROR_QUIET
     19    OUTPUT_STRIP_TRAILING_WHITESPACE
     20  )
     21  EXECUTE_PROCESS(
    1222    COMMAND hg id -i
    1323    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
     
    1727  )
    1828  IF(HG_REVISION STREQUAL "")
    19     SET(HG_REVISION "hg-tip")
     29    SET(HG_REVISION_ID "hg-tip")
     30  ELSE()
     31    IF(HG_REVISION_PATH STREQUAL "")
     32      SET(HG_REVISION_ID ${HG_REVISION})
     33    ELSE()
     34      SET(HG_REVISION_ID ${HG_REVISION_PATH}.${HG_REVISION})
     35    ENDIF()
    2036  ENDIF()
    21   SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.")
     37  SET(LEMON_VERSION ${HG_REVISION_ID} CACHE STRING "LEMON version string.")
    2238ENDIF()
    2339
     
    3248FIND_PACKAGE(COIN)
    3349
     50IF(DEFINED ENV{LEMON_CXX_WARNING})
     51  SET(CXX_WARNING $ENV{LEMON_CXX_WARNING})
     52ELSE()
     53  IF(CMAKE_COMPILER_IS_GNUCXX)
     54    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")
     55    SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb")
     56    SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb")
     57  ELSEIF(MSVC)
     58    # This part is unnecessary 'casue the same is set by the lemon/core.h.
     59    # Still keep it as an example.
     60    SET(CXX_WARNING "/wd4250 /wd4355 /wd4503 /wd4800 /wd4996")
     61    # Suppressed warnings:
     62    # C4250: 'class1' : inherits 'class2::member' via dominance
     63    # C4355: 'this' : used in base member initializer list
     64    # C4503: 'function' : decorated name length exceeded, name was truncated
     65    # C4800: 'type' : forcing value to bool 'true' or 'false'
     66    #        (performance warning)
     67    # C4996: 'function': was declared deprecated
     68  ELSE()
     69    SET(CXX_WARNING "-Wall -W")
     70  ENDIF()
     71ENDIF()
     72SET(LEMON_CXX_WARNING_FLAGS ${CXX_WARNING} CACHE STRING "LEMON warning flags.")
     73
     74SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LEMON_CXX_WARNING_FLAGS}")
     75
     76SET( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb" CACHE STRING
     77    "Flags used by the C++ compiler during maintainer builds."
     78    FORCE )
     79SET( CMAKE_C_FLAGS_MAINTAINER "-Werror" CACHE STRING
     80    "Flags used by the C compiler during maintainer builds."
     81    FORCE )
     82SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER
     83    "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
     84    "Flags used for linking binaries during maintainer builds."
     85    FORCE )
     86SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER
     87    "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
     88    "Flags used by the shared libraries linker during maintainer builds."
     89    FORCE )
     90MARK_AS_ADVANCED(
     91    CMAKE_CXX_FLAGS_MAINTAINER
     92    CMAKE_C_FLAGS_MAINTAINER
     93    CMAKE_EXE_LINKER_FLAGS_MAINTAINER
     94    CMAKE_SHARED_LINKER_FLAGS_MAINTAINER )
     95
     96IF(CMAKE_CONFIGURATION_TYPES)
     97  LIST(APPEND CMAKE_CONFIGURATION_TYPES Maintainer)
     98  LIST(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
     99  SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
     100      "Add the configurations that we need"
     101      FORCE)
     102 endif()
     103
     104IF(NOT CMAKE_BUILD_TYPE)
     105  SET(CMAKE_BUILD_TYPE "Release")
     106ENDIF()
     107
     108SET( CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
     109    "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel Maintainer."
     110    FORCE )
     111
     112
    34113INCLUDE(CheckTypeSize)
    35114CHECK_TYPE_SIZE("long long" LONG_LONG)
     
    39118
    40119ENABLE_TESTING()
     120
     121IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     122  ADD_CUSTOM_TARGET(check ALL COMMAND ${CMAKE_CTEST_COMMAND})
     123ELSE()
     124  ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})
     125ENDIF()
    41126
    42127ADD_SUBDIRECTORY(lemon)
     
    65150ENDIF()
    66151
    67 IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR} AND WIN32)
     152IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
    68153  SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
    69154  SET(CPACK_PACKAGE_VENDOR "EGRES")
  • CMakeLists.txt

    r1033 r1035  
    115115SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
    116116
     117INCLUDE(FindPythonInterp)
     118
    117119ENABLE_TESTING()
    118120
  • doc/CMakeLists.txt

    r943 r1035  
    33SET(abs_top_srcdir ${PROJECT_SOURCE_DIR})
    44SET(abs_top_builddir ${PROJECT_BINARY_DIR})
     5
     6SET(LEMON_DOC_SOURCE_BROWSER "NO" CACHE STRING "Include source into the doc (YES/NO).")
    57
    68CONFIGURE_FILE(
     
    5355
    5456ENDIF()
     57
     58IF(WGET_FOUND)
     59ADD_CUSTOM_TARGET(update-external-tags
     60  COMMAND ${CMAKE_COMMAND} -E make_directory dl
     61  # COMMAND ${CMAKE_COMMAND} -E copy libstdc++.tag dl
     62  COMMAND ${WGET_EXECUTABLE} wget -P dl -N libstdc++.tag.tmp http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/libstdc++.tag
     63  COMMAND ${CMAKE_COMMAND} -E rename dl/libstdc++.tag libstdc++.tag
     64  COMMAND ${CMAKE_COMMAND} -E remove dl/libstdc++.tag
     65  COMMAND ${CMAKE_COMMAND} -E remove_directory dl
     66  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     67  )
     68ENDIF()
  • doc/CMakeLists.txt

    r1033 r1035  
    1212)
    1313
    14 IF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE)
     14IF(DOXYGEN_EXECUTABLE AND PYTHONINTERP_FOUND AND GHOSTSCRIPT_EXECUTABLE)
    1515  FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/)
    1616  SET(GHOSTSCRIPT_OPTIONS -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha)
     
    2323    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/edge_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/edge_biconnected_components.eps
    2424    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/grid_graph.png ${CMAKE_CURRENT_SOURCE_DIR}/images/grid_graph.eps
     25    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/matching.png ${CMAKE_CURRENT_SOURCE_DIR}/images/matching.eps
    2526    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/node_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/node_biconnected_components.eps
    2627    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_0.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_0.eps
     
    2930    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_3.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_3.eps
    3031    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_4.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_4.eps
     32    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/planar.png ${CMAKE_CURRENT_SOURCE_DIR}/images/planar.eps
    3133    COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/strongly_connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/strongly_connected_components.eps
    3234    COMMAND ${CMAKE_COMMAND} -E remove_directory html
     35    COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/bib2dox.py ${CMAKE_CURRENT_SOURCE_DIR}/references.bib >references.dox
    3336    COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
    3437    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  • doc/Doxyfile.in

    r803 r1035  
    7171SHOW_NAMESPACES        = YES
    7272FILE_VERSION_FILTER    =
    73 LAYOUT_FILE            = DoxygenLayout.xml
     73LAYOUT_FILE            = "@abs_top_srcdir@/doc/DoxygenLayout.xml"
    7474#---------------------------------------------------------------------------
    7575# configuration options related to warning and progress messages
     
    115115# configuration options related to source browsing
    116116#---------------------------------------------------------------------------
    117 SOURCE_BROWSER         = NO
     117SOURCE_BROWSER         = @LEMON_DOC_SOURCE_BROWSER@
    118118INLINE_SOURCES         = NO
    119119STRIP_CODE_COMMENTS    = YES
     
    226226# Options related to the search engine   
    227227#---------------------------------------------------------------------------
    228 TAGFILES               = "@abs_top_srcdir@/doc/libstdc++.tag = http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/  "
     228TAGFILES               = "@abs_top_builddir@/doc/libstdc++.tag = http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/  "
    229229GENERATE_TAGFILE       = html/lemon.tag
    230230ALLEXTERNALS           = NO
  • doc/Doxyfile.in

    r1033 r1035  
    9191                         "@abs_top_srcdir@/demo" \
    9292                         "@abs_top_srcdir@/tools" \
    93                          "@abs_top_srcdir@/test/test_tools.h"
     93                         "@abs_top_srcdir@/test/test_tools.h" \
     94                         "@abs_top_builddir@/doc/references.dox"
    9495INPUT_ENCODING         = UTF-8
    9596FILE_PATTERNS          = *.h \
  • test/CMakeLists.txt

    r953 r1035  
    4646
    4747IF(LEMON_HAVE_LP)
    48   ADD_EXECUTABLE(lp_test lp_test.cc)
     48  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     49    ADD_EXECUTABLE(lp_test lp_test.cc)
     50  ELSE()
     51    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
     52  ENDIF()
     53
    4954  SET(LP_TEST_LIBS lemon)
    5055
     
    8287
    8388IF(LEMON_HAVE_MIP)
    84   ADD_EXECUTABLE(mip_test mip_test.cc)
     89  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     90    ADD_EXECUTABLE(mip_test mip_test.cc)
     91  ELSE()
     92    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
     93  ENDIF()
     94
    8595  SET(MIP_TEST_LIBS lemon)
    8696
     
    118128
    119129FOREACH(TEST_NAME ${TESTS})
    120   ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
     130  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     131    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
     132  ELSE()
     133    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
     134  ENDIF()
    121135  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
    122136  ADD_TEST(${TEST_NAME} ${TEST_NAME})
     137  ADD_DEPENDENCIES(check ${TEST_NAME})
    123138ENDFOREACH()
  • test/CMakeLists.txt

    r1033 r1035  
    1010SET(TESTS
    1111  adaptors_test
     12  bellman_ford_test
    1213  bfs_test
    1314  circulation_test
     
    2122  error_test
    2223  euler_test
     24  fractional_matching_test
    2325  gomory_hu_test
    2426  graph_copy_test
     
    3234  min_cost_arborescence_test
    3335  min_cost_flow_test
     36  min_mean_cycle_test
    3437  path_test
     38  planarity_test
    3539  preflow_test
    3640  radix_sort_test
Note: See TracChangeset for help on using the changeset viewer.