gravatar
ladanyi@tmit.bme.hu
ladanyi@tmit.bme.hu
FindGLPK improvements (#256)
0 4 0
default
4 files changed with 8 insertions and 11 deletions:
↑ Collapse diff ↑
Ignore white space 64 line context
1 1
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 2

	
3 3
IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
4 4
  INCLUDE(${CMAKE_SOURCE_DIR}/cmake/version.cmake)
5 5
ELSE(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
6 6
  SET(PROJECT_NAME "LEMON")
7 7
  SET(PROJECT_VERSION "hg-tip" CACHE STRING "LEMON version string.")
8 8
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
9 9

	
10 10
PROJECT(${PROJECT_NAME})
11 11

	
12 12
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
13 13

	
14 14
INCLUDE(FindDoxygen)
15 15
INCLUDE(FindGhostscript)
16 16
FIND_PACKAGE(GLPK 4.33)
17 17

	
18 18
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
19 19

	
20 20
IF(MSVC)
21 21
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4800 /wd4996")
22 22
# Suppressed warnings:
23 23
# C4250: 'class1' : inherits 'class2::member' via dominance
24 24
# C4355: 'this' : used in base member initializer list
25 25
# C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
26 26
# C4996: 'function': was declared deprecated
27 27
ENDIF(MSVC)
28 28

	
29
IF(GLPK_FOUND)
30
  SET(HAVE_LP TRUE)
31
  SET(HAVE_MIP TRUE)
32
  SET(HAVE_GLPK TRUE)
33
ENDIF(GLPK_FOUND)
34

	
35 29
INCLUDE(CheckTypeSize)
36 30
CHECK_TYPE_SIZE("long long" LONG_LONG)
37 31

	
38 32
ENABLE_TESTING()
39 33

	
40 34
ADD_SUBDIRECTORY(lemon)
41 35
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
42 36
  ADD_SUBDIRECTORY(demo)
43 37
  ADD_SUBDIRECTORY(tools)
44 38
  ADD_SUBDIRECTORY(doc)
45 39
  ADD_SUBDIRECTORY(test)
46 40
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
47 41

	
48 42
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
49 43
  IF(WIN32)
50 44
    SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
51 45
    SET(CPACK_PACKAGE_VENDOR "EGRES")
52 46
    SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
53 47
      "LEMON - Library of Efficient Models and Optimization in Networks")
54 48
    SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
55 49

	
56 50
    SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
57 51

	
58 52
    SET(CPACK_PACKAGE_INSTALL_DIRECTORY
59 53
      "${PROJECT_NAME} ${PROJECT_VERSION}")
60 54
    SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
61 55
      "${PROJECT_NAME} ${PROJECT_VERSION}")
62 56

	
63 57
    SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
64 58

	
65 59
    SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
66 60
    SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
Ignore white space 64 line context
1 1
SET(GLPK_REGKEY "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Glpk;InstallPath]")
2 2
GET_FILENAME_COMPONENT(GLPK_ROOT_PATH ${GLPK_REGKEY} ABSOLUTE)
3 3

	
4 4
FIND_PATH(GLPK_INCLUDE_DIR
5 5
  glpk.h
6 6
  PATHS ${GLPK_REGKEY}/include)
7 7

	
8 8
FIND_LIBRARY(GLPK_LIBRARY
9 9
  NAMES glpk
10 10
  PATHS ${GLPK_REGKEY}/lib)
11 11

	
12 12
INCLUDE(FindPackageHandleStandardArgs)
13 13
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLPK DEFAULT_MSG GLPK_LIBRARY GLPK_INCLUDE_DIR)
14 14

	
15 15
IF(GLPK_FOUND)
16
  SET(GLPK_INCLUDE_DIRS ${GLPK_INCLUDE_DIR})
16 17
  SET(GLPK_LIBRARIES ${GLPK_LIBRARY})
17 18
  SET(GLPK_BIN_DIR ${GLPK_ROOT_PATH}/bin)
18 19
ENDIF(GLPK_FOUND)
19 20

	
20 21
MARK_AS_ADVANCED(GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_BIN_DIR)
22

	
23
IF(GLPK_FOUND)
24
  SET(HAVE_LP TRUE)
25
  SET(HAVE_MIP TRUE)
26
  SET(HAVE_GLPK TRUE)
27
ENDIF(GLPK_FOUND)
Ignore white space 64 line context
1 1
INCLUDE_DIRECTORIES(
2 2
  ${PROJECT_SOURCE_DIR}
3 3
  ${PROJECT_BINARY_DIR}
4 4
)
5 5

	
6 6
CONFIGURE_FILE(
7 7
  ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
8 8
  ${CMAKE_CURRENT_BINARY_DIR}/config.h
9 9
)
10 10

	
11 11
SET(LEMON_SOURCES
12 12
  arg_parser.cc
13 13
  base.cc
14 14
  color.cc
15 15
  lp_base.cc
16 16
  lp_skeleton.cc
17 17
  random.cc
18 18
  bits/windows.cc
19 19
)
20 20

	
21 21
IF(HAVE_GLPK)
22 22
  SET(LEMON_SOURCES ${LEMON_SOURCES} glpk.cc)
23
  INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR})
23
  INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIRS})
24 24
  IF(WIN32)
25 25
    INSTALL(FILES ${GLPK_BIN_DIR}/glpk.dll DESTINATION bin)
26 26
    INSTALL(FILES ${GLPK_BIN_DIR}/libltdl3.dll DESTINATION bin)
27 27
    INSTALL(FILES ${GLPK_BIN_DIR}/zlib1.dll DESTINATION bin)
28 28
  ENDIF(WIN32)
29 29
ENDIF(HAVE_GLPK)
30 30

	
31 31
ADD_LIBRARY(lemon ${LEMON_SOURCES})
32 32

	
33 33
INSTALL(
34 34
  TARGETS lemon
35 35
  ARCHIVE DESTINATION lib
36 36
  COMPONENT library)
37 37

	
38 38
INSTALL(
39 39
  DIRECTORY . bits concepts
40 40
  DESTINATION include/lemon
41 41
  COMPONENT headers
42 42
  FILES_MATCHING PATTERN "*.h")
Ignore white space 64 line context
1 1
INCLUDE_DIRECTORIES(
2 2
  ${PROJECT_SOURCE_DIR}
3 3
  ${PROJECT_BINARY_DIR}
4 4
)
5 5

	
6
IF(HAVE_GLPK)
7
  INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR})
8
ENDIF(HAVE_GLPK)
9

	
10 6
LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
11 7

	
12 8
SET(TESTS
13 9
  adaptors_test
14 10
  bfs_test
15 11
  circulation_test
16 12
  counter_test
17 13
  dfs_test
18 14
  digraph_test
19 15
  dijkstra_test
20 16
  dim_test
21 17
  edge_set_test
22 18
  error_test
23 19
  euler_test
24 20
  gomory_hu_test
25 21
  graph_copy_test
26 22
  graph_test
27 23
  graph_utils_test
28 24
  hao_orlin_test
29 25
  heap_test
30 26
  kruskal_test
31 27
  maps_test
32 28
  matching_test
33 29
  min_cost_arborescence_test
34 30
  min_cost_flow_test
35 31
  path_test
36 32
  preflow_test
37 33
  radix_sort_test
38 34
  random_test
39 35
  suurballe_test
40 36
  time_measure_test
41 37
  unionfind_test)
0 comments (0 inline)