Support building LEMON as a subproject
authorAkos Ladanyi <ladanyi@tmit.bme.hu>
Tue, 02 Jun 2009 14:55:23 +0100
changeset 14721c71fdbfc
parent 0 368136e07d23
child 2 76d160eba8d4
Support building LEMON as a subproject
CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Tue May 26 16:18:51 2009 +0100
     1.2 +++ b/CMakeLists.txt	Tue Jun 02 14:55:23 2009 +0100
     1.3 @@ -8,7 +8,18 @@
     1.4  
     1.5  SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
     1.6  
     1.7 -FIND_PACKAGE(LEMON REQUIRED)
     1.8 +IF(EXISTS ${CMAKE_SOURCE_DIR}/lemon)
     1.9 +  ADD_SUBDIRECTORY(lemon)
    1.10 +  SET(LEMON_INCLUDE_DIRS
    1.11 +    ${CMAKE_SOURCE_DIR}/lemon
    1.12 +    ${CMAKE_BINARY_DIR}/lemon
    1.13 +  )
    1.14 +  SET(LEMON_LIBRARIES lemon)
    1.15 +ELSE()
    1.16 +  FIND_PACKAGE(LEMON QUIET NO_MODULE)
    1.17 +  FIND_PACKAGE(LEMON REQUIRED)
    1.18 +ENDIF()
    1.19 +
    1.20  FIND_PACKAGE(Doxygen)
    1.21  
    1.22  INCLUDE_DIRECTORIES(
    1.23 @@ -17,8 +28,6 @@
    1.24    ${LEMON_INCLUDE_DIRS}
    1.25  )
    1.26  
    1.27 -LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
    1.28 -
    1.29  ADD_EXECUTABLE(lemon-project main.cc)
    1.30  TARGET_LINK_LIBRARIES(lemon-project ${LEMON_LIBRARIES})
    1.31  INSTALL(