Make it possible to use LEMON as a CMake subproject (#240)
authorAkos Ladanyi <ladanyi@tmit.bme.hu>
Mon, 16 Mar 2009 13:51:32 +0000
changeset 549ba659d676331
parent 548 94387da47f79
child 550 20e3acc1a757
Make it possible to use LEMON as a CMake subproject (#240)
CMakeLists.txt
demo/CMakeLists.txt
doc/CMakeLists.txt
lemon/CMakeLists.txt
test/CMakeLists.txt
tools/CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Thu Mar 05 10:13:20 2009 +0000
     1.2 +++ b/CMakeLists.txt	Mon Mar 16 13:51:32 2009 +0000
     1.3 @@ -9,7 +9,7 @@
     1.4  
     1.5  PROJECT(${PROJECT_NAME})
     1.6  
     1.7 -SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
     1.8 +SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
     1.9  
    1.10  INCLUDE(FindDoxygen)
    1.11  INCLUDE(FindGhostscript)
    1.12 @@ -38,10 +38,12 @@
    1.13  ENABLE_TESTING()
    1.14  
    1.15  ADD_SUBDIRECTORY(lemon)
    1.16 -ADD_SUBDIRECTORY(demo)
    1.17 -ADD_SUBDIRECTORY(tools)
    1.18 -ADD_SUBDIRECTORY(doc)
    1.19 -ADD_SUBDIRECTORY(test)
    1.20 +IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
    1.21 +  ADD_SUBDIRECTORY(demo)
    1.22 +  ADD_SUBDIRECTORY(tools)
    1.23 +  ADD_SUBDIRECTORY(doc)
    1.24 +  ADD_SUBDIRECTORY(test)
    1.25 +ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
    1.26  
    1.27  IF(WIN32)
    1.28    SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
     2.1 --- a/demo/CMakeLists.txt	Thu Mar 05 10:13:20 2009 +0000
     2.2 +++ b/demo/CMakeLists.txt	Mon Mar 16 13:51:32 2009 +0000
     2.3 @@ -1,9 +1,9 @@
     2.4  INCLUDE_DIRECTORIES(
     2.5 -  ${CMAKE_SOURCE_DIR}
     2.6 -  ${CMAKE_BINARY_DIR}
     2.7 +  ${PROJECT_SOURCE_DIR}
     2.8 +  ${PROJECT_BINARY_DIR}
     2.9  )
    2.10  
    2.11 -LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
    2.12 +LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
    2.13  
    2.14  SET(DEMOS
    2.15    arg_parser_demo
     3.1 --- a/doc/CMakeLists.txt	Thu Mar 05 10:13:20 2009 +0000
     3.2 +++ b/doc/CMakeLists.txt	Mon Mar 16 13:51:32 2009 +0000
     3.3 @@ -1,11 +1,11 @@
     3.4  SET(PACKAGE_NAME ${PROJECT_NAME})
     3.5  SET(PACKAGE_VERSION ${PROJECT_VERSION})
     3.6 -SET(abs_top_srcdir ${CMAKE_SOURCE_DIR})
     3.7 -SET(abs_top_builddir ${CMAKE_BINARY_DIR})
     3.8 +SET(abs_top_srcdir ${PROJECT_SOURCE_DIR})
     3.9 +SET(abs_top_builddir ${PROJECT_BINARY_DIR})
    3.10  
    3.11  CONFIGURE_FILE(
    3.12 -  ${CMAKE_SOURCE_DIR}/doc/Doxyfile.in
    3.13 -  ${CMAKE_BINARY_DIR}/doc/Doxyfile
    3.14 +  ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in
    3.15 +  ${PROJECT_BINARY_DIR}/doc/Doxyfile
    3.16    @ONLY)
    3.17  
    3.18  IF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE)
     4.1 --- a/lemon/CMakeLists.txt	Thu Mar 05 10:13:20 2009 +0000
     4.2 +++ b/lemon/CMakeLists.txt	Mon Mar 16 13:51:32 2009 +0000
     4.3 @@ -1,6 +1,6 @@
     4.4  INCLUDE_DIRECTORIES(
     4.5 -  ${CMAKE_SOURCE_DIR}
     4.6 -  ${CMAKE_BINARY_DIR}
     4.7 +  ${PROJECT_SOURCE_DIR}
     4.8 +  ${PROJECT_BINARY_DIR}
     4.9  )
    4.10  
    4.11  CONFIGURE_FILE(
     5.1 --- a/test/CMakeLists.txt	Thu Mar 05 10:13:20 2009 +0000
     5.2 +++ b/test/CMakeLists.txt	Mon Mar 16 13:51:32 2009 +0000
     5.3 @@ -1,13 +1,13 @@
     5.4  INCLUDE_DIRECTORIES(
     5.5 -  ${CMAKE_SOURCE_DIR}
     5.6 -  ${CMAKE_BINARY_DIR}
     5.7 +  ${PROJECT_SOURCE_DIR}
     5.8 +  ${PROJECT_BINARY_DIR}
     5.9  )
    5.10  
    5.11  IF(HAVE_GLPK)
    5.12    INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR})
    5.13  ENDIF(HAVE_GLPK)
    5.14  
    5.15 -LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
    5.16 +LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
    5.17  
    5.18  SET(TESTS
    5.19    adaptors_test
     6.1 --- a/tools/CMakeLists.txt	Thu Mar 05 10:13:20 2009 +0000
     6.2 +++ b/tools/CMakeLists.txt	Mon Mar 16 13:51:32 2009 +0000
     6.3 @@ -1,9 +1,9 @@
     6.4  INCLUDE_DIRECTORIES(
     6.5 -  ${CMAKE_SOURCE_DIR}
     6.6 -  ${CMAKE_BINARY_DIR}
     6.7 +  ${PROJECT_SOURCE_DIR}
     6.8 +  ${PROJECT_BINARY_DIR}
     6.9  )
    6.10  
    6.11 -LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
    6.12 +LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
    6.13  
    6.14  ADD_EXECUTABLE(lgf-gen lgf-gen.cc)
    6.15  TARGET_LINK_LIBRARIES(lgf-gen lemon)
    6.16 @@ -22,7 +22,7 @@
    6.17  
    6.18  IF(NOT WIN32)
    6.19    INSTALL(
    6.20 -    FILES ${CMAKE_CURRENT_SOURCE_DIR}/lemon-0.x-to-1.x.sh
    6.21 -    RUNTIME DESTINATION bin
    6.22 +    PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/lemon-0.x-to-1.x.sh
    6.23 +    DESTINATION bin
    6.24      COMPONENT bin)
    6.25  ENDIF(NOT WIN32)