0
6
0
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 |
SET(CMAKE_MODULE_PATH ${ |
|
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 |
... | ... |
@@ -29,28 +29,30 @@ |
29 | 29 |
IF(GLPK_FOUND) |
30 | 30 |
SET(HAVE_LP TRUE) |
31 | 31 |
SET(HAVE_MIP TRUE) |
32 | 32 |
SET(HAVE_GLPK TRUE) |
33 | 33 |
ENDIF(GLPK_FOUND) |
34 | 34 |
|
35 | 35 |
INCLUDE(CheckTypeSize) |
36 | 36 |
CHECK_TYPE_SIZE("long long" LONG_LONG) |
37 | 37 |
|
38 | 38 |
ENABLE_TESTING() |
39 | 39 |
|
40 | 40 |
ADD_SUBDIRECTORY(lemon) |
41 |
ADD_SUBDIRECTORY(demo) |
|
42 |
ADD_SUBDIRECTORY(tools) |
|
43 |
ADD_SUBDIRECTORY(doc) |
|
44 |
ADD_SUBDIRECTORY(test) |
|
41 |
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) |
|
42 |
ADD_SUBDIRECTORY(demo) |
|
43 |
ADD_SUBDIRECTORY(tools) |
|
44 |
ADD_SUBDIRECTORY(doc) |
|
45 |
ADD_SUBDIRECTORY(test) |
|
46 |
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) |
|
45 | 47 |
|
46 | 48 |
IF(WIN32) |
47 | 49 |
SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) |
48 | 50 |
SET(CPACK_PACKAGE_VENDOR "EGRES") |
49 | 51 |
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY |
50 | 52 |
"LEMON - Library of Efficient Models and Optimization in Networks") |
51 | 53 |
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") |
52 | 54 |
|
53 | 55 |
SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) |
54 | 56 |
|
55 | 57 |
SET(CPACK_PACKAGE_INSTALL_DIRECTORY |
56 | 58 |
"${PROJECT_NAME} ${PROJECT_VERSION}") |
1 | 1 |
INCLUDE_DIRECTORIES( |
2 |
${CMAKE_SOURCE_DIR} |
|
3 |
${CMAKE_BINARY_DIR} |
|
2 |
${PROJECT_SOURCE_DIR} |
|
3 |
${PROJECT_BINARY_DIR} |
|
4 | 4 |
) |
5 | 5 |
|
6 |
LINK_DIRECTORIES(${ |
|
6 |
LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon) |
|
7 | 7 |
|
8 | 8 |
SET(DEMOS |
9 | 9 |
arg_parser_demo |
10 | 10 |
graph_to_eps_demo |
11 | 11 |
lgf_demo) |
12 | 12 |
|
13 | 13 |
FOREACH(DEMO_NAME ${DEMOS}) |
14 | 14 |
ADD_EXECUTABLE(${DEMO_NAME} ${DEMO_NAME}.cc) |
15 | 15 |
TARGET_LINK_LIBRARIES(${DEMO_NAME} lemon) |
16 | 16 |
ENDFOREACH(DEMO_NAME) |
1 | 1 |
SET(PACKAGE_NAME ${PROJECT_NAME}) |
2 | 2 |
SET(PACKAGE_VERSION ${PROJECT_VERSION}) |
3 |
SET(abs_top_srcdir ${CMAKE_SOURCE_DIR}) |
|
4 |
SET(abs_top_builddir ${CMAKE_BINARY_DIR}) |
|
3 |
SET(abs_top_srcdir ${PROJECT_SOURCE_DIR}) |
|
4 |
SET(abs_top_builddir ${PROJECT_BINARY_DIR}) |
|
5 | 5 |
|
6 | 6 |
CONFIGURE_FILE( |
7 |
${CMAKE_SOURCE_DIR}/doc/Doxyfile.in |
|
8 |
${CMAKE_BINARY_DIR}/doc/Doxyfile |
|
7 |
${PROJECT_SOURCE_DIR}/doc/Doxyfile.in |
|
8 |
${PROJECT_BINARY_DIR}/doc/Doxyfile |
|
9 | 9 |
@ONLY) |
10 | 10 |
|
11 | 11 |
IF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE) |
12 | 12 |
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/) |
13 | 13 |
IF(UNIX) |
14 | 14 |
ADD_CUSTOM_TARGET(html |
15 | 15 |
COMMAND rm -rf gen-images |
16 | 16 |
COMMAND mkdir gen-images |
17 | 17 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/grid_graph.png ${CMAKE_CURRENT_SOURCE_DIR}/images/grid_graph.eps |
18 | 18 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_0.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_0.eps |
19 | 19 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_1.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_1.eps |
20 | 20 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_2.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_2.eps |
1 | 1 |
INCLUDE_DIRECTORIES( |
2 |
${CMAKE_SOURCE_DIR} |
|
3 |
${CMAKE_BINARY_DIR} |
|
2 |
${PROJECT_SOURCE_DIR} |
|
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 |
1 | 1 |
INCLUDE_DIRECTORIES( |
2 |
${CMAKE_SOURCE_DIR} |
|
3 |
${CMAKE_BINARY_DIR} |
|
2 |
${PROJECT_SOURCE_DIR} |
|
3 |
${PROJECT_BINARY_DIR} |
|
4 | 4 |
) |
5 | 5 |
|
6 | 6 |
IF(HAVE_GLPK) |
7 | 7 |
INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR}) |
8 | 8 |
ENDIF(HAVE_GLPK) |
9 | 9 |
|
10 |
LINK_DIRECTORIES(${ |
|
10 |
LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon) |
|
11 | 11 |
|
12 | 12 |
SET(TESTS |
13 | 13 |
adaptors_test |
14 | 14 |
bfs_test |
15 | 15 |
circulation_test |
16 | 16 |
counter_test |
17 | 17 |
dfs_test |
18 | 18 |
digraph_test |
19 | 19 |
dijkstra_test |
20 | 20 |
dim_test |
21 | 21 |
edge_set_test |
22 | 22 |
error_test |
1 | 1 |
INCLUDE_DIRECTORIES( |
2 |
${CMAKE_SOURCE_DIR} |
|
3 |
${CMAKE_BINARY_DIR} |
|
2 |
${PROJECT_SOURCE_DIR} |
|
3 |
${PROJECT_BINARY_DIR} |
|
4 | 4 |
) |
5 | 5 |
|
6 |
LINK_DIRECTORIES(${ |
|
6 |
LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon) |
|
7 | 7 |
|
8 | 8 |
ADD_EXECUTABLE(lgf-gen lgf-gen.cc) |
9 | 9 |
TARGET_LINK_LIBRARIES(lgf-gen lemon) |
10 | 10 |
|
11 | 11 |
ADD_EXECUTABLE(dimacs-to-lgf dimacs-to-lgf.cc) |
12 | 12 |
TARGET_LINK_LIBRARIES(dimacs-to-lgf lemon) |
13 | 13 |
|
14 | 14 |
ADD_EXECUTABLE(dimacs-solver dimacs-solver.cc) |
15 | 15 |
TARGET_LINK_LIBRARIES(dimacs-solver lemon) |
16 | 16 |
|
17 | 17 |
INSTALL( |
18 | 18 |
TARGETS lgf-gen dimacs-to-lgf dimacs-solver |
19 | 19 |
RUNTIME DESTINATION bin |
20 | 20 |
COMPONENT bin |
21 | 21 |
) |
22 | 22 |
|
23 | 23 |
IF(NOT WIN32) |
24 | 24 |
INSTALL( |
25 |
FILES ${CMAKE_CURRENT_SOURCE_DIR}/lemon-0.x-to-1.x.sh |
|
26 |
RUNTIME DESTINATION bin |
|
25 |
PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/lemon-0.x-to-1.x.sh |
|
26 |
DESTINATION bin |
|
27 | 27 |
COMPONENT bin) |
28 | 28 |
ENDIF(NOT WIN32) |
0 comments (0 inline)