CMakeLists.txt
changeset 6 b995b17cd52b
parent 4 6de89926e594
child 7 c941f748eaa8
equal deleted inserted replaced
4:2399dcaf95a9 5:6302ba4dbe66
    17 
    17 
    18 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
    18 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
    19 
    19 
    20 ## The next part looks for LEMON. Typically, you don't want to modify it.
    20 ## The next part looks for LEMON. Typically, you don't want to modify it.
    21 ##
    21 ##
    22 ## First, it checks if there exists a 'lemon' subdirectory which should contain
    22 ## First, it tries to use LEMON as a CMAKE subproject by looking for
    23 ## the LEMON source tree. If it is there, then it will compile it locally and
    23 ## it in the 'lemon' or 'deps/lemon' subdirectories or in directory
    24 ## use it as a subproject. If it isn't, then CMAKE will try to find an
    24 ## given by the LEMON_SOURCE_ROOT_DIR variable.
    25 ## installed version of LEMON. If it is installed to some non-standard place,
    25 ## If LEMON isn't there, then CMAKE will try to find an installed
    26 ## then you must tell its location to 'cmake-gui' in the LEMON_ROOT_DIR
    26 ## version of LEMON. If it is installed at some non-standard place,
    27 ## config variable. (Do not hard code it into your config! Others may keep
    27 ## then you must tell its location in the LEMON_ROOT_DIR CMAKE config
       
    28 ## variable. (Do not hard code it into your config! Others may keep
    28 ## LEMON at different places.)
    29 ## LEMON at different places.)
    29 
    30 
    30 IF(EXISTS ${CMAKE_SOURCE_DIR}/lemon)
    31 FIND_PATH(LEMON_SOURCE_ROOT_DIR CMakeLists.txt
    31   ADD_SUBDIRECTORY(lemon)
    32   PATHS ${CMAKE_SOURCE_DIR}/lemon ${CMAKE_SOURCE_DIR}/deps/lemon
       
    33   NO_DEFAULT_PATH
       
    34   DOC "Location of LEMON source as a CMAKE subproject")
       
    35 
       
    36 IF(EXISTS ${LEMON_SOURCE_ROOT_DIR})
       
    37   ADD_SUBDIRECTORY(${LEMON_SOURCE_ROOT_DIR} deps/lemon)
    32   SET(LEMON_INCLUDE_DIRS
    38   SET(LEMON_INCLUDE_DIRS
    33     ${CMAKE_SOURCE_DIR}/lemon
    39     ${LEMON_SOURCE_ROOT_DIR}
    34     ${CMAKE_BINARY_DIR}/lemon
    40     ${CMAKE_BINARY_DIR}/deps/lemon
    35   )
    41   )
    36   SET(LEMON_LIBRARIES lemon)
    42   SET(LEMON_LIBRARIES lemon)
       
    43   UNSET(LEMON_ROOT_DIR CACHE)
       
    44   UNSET(LEMON_DIR CACHE)
       
    45   UNSET(LEMON_INCLUDE_DIR CACHE)
       
    46   UNSET(LEMON_LIBRARY CACHE)
    37 ELSE()
    47 ELSE()
    38   FIND_PACKAGE(LEMON QUIET NO_MODULE)
    48   FIND_PACKAGE(LEMON QUIET NO_MODULE)
    39   FIND_PACKAGE(LEMON REQUIRED)
    49   FIND_PACKAGE(LEMON REQUIRED)
    40 ENDIF()
    50 ENDIF()
    41 
    51