# HG changeset patch
# User Akos Ladanyi <ladanyi@tmit.bme.hu>
# Date 1237211492 0
# Node ID ba659d676331942fad3d346499583b34a701de0d
# Parent 94387da47f7967d81fd70ad05e038d96a637c934
Make it possible to use LEMON as a CMake subproject (#240)
diff --git a/CMakeLists.txt b/CMakeLists.txt
a
|
b
|
|
9 | 9 | |
10 | 10 | PROJECT(${PROJECT_NAME}) |
11 | 11 | |
12 | | SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) |
| 12 | SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) |
13 | 13 | |
14 | 14 | INCLUDE(FindDoxygen) |
15 | 15 | INCLUDE(FindGhostscript) |
… |
… |
|
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}) |
diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt
a
|
b
|
|
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(${CMAKE_BINARY_DIR}/lemon) |
| 6 | LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon) |
7 | 7 | |
8 | 8 | SET(DEMOS |
9 | 9 | arg_parser_demo |
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
a
|
b
|
|
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) |
diff --git a/lemon/CMakeLists.txt b/lemon/CMakeLists.txt
a
|
b
|
|
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( |
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
a
|
b
|
|
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(${CMAKE_BINARY_DIR}/lemon) |
| 10 | LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon) |
11 | 11 | |
12 | 12 | SET(TESTS |
13 | 13 | adaptors_test |
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
a
|
b
|
|
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(${CMAKE_BINARY_DIR}/lemon) |
| 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) |
… |
… |
|
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) |