COIN-OR::LEMON - Graph Library

Changeset 5:723af8fef529 in lemon-benchmark


Ignore:
Timestamp:
11/26/10 17:59:31 (14 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Configurable LEMON source dir location (when used as a subproject)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r4 r5  
    2020## The next part looks for LEMON. Typically, you don't want to modify it.
    2121##
    22 ## First, it checks if there exists a 'lemon' subdirectory which should contain
    23 ## the LEMON source tree. If it is there, then it will compile it locally and
    24 ## use it as a subproject. If it isn't, then CMAKE will try to find an
    25 ## installed version of LEMON. If it is installed to some non-standard place,
    26 ## then you must tell its location to 'cmake-gui' in the LEMON_ROOT_DIR
    27 ## config variable. (Do not hard code it into your config! Others may keep
     22## First, it tries to use LEMON as a CMAKE subproject by looking for
     23## it in the 'lemon' or 'deps/lemon' subdirectories or in directory
     24## given by the LEMON_SOURCE_ROOT_DIR variable.
     25## If LEMON isn't there, then CMAKE will try to find an installed
     26## version of LEMON. If it is installed at some non-standard place,
     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
    2829## LEMON at different places.)
    2930
    30 IF(EXISTS ${CMAKE_SOURCE_DIR}/lemon)
    31   ADD_SUBDIRECTORY(lemon)
     31FIND_PATH(LEMON_SOURCE_ROOT_DIR CMakeLists.txt
     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
     36IF(EXISTS ${LEMON_SOURCE_ROOT_DIR})
     37  ADD_SUBDIRECTORY(${LEMON_SOURCE_ROOT_DIR} deps/lemon)
    3238  SET(LEMON_INCLUDE_DIRS
    33     ${CMAKE_SOURCE_DIR}/lemon
    34     ${CMAKE_BINARY_DIR}/lemon
     39    ${LEMON_SOURCE_ROOT_DIR}
     40    ${CMAKE_BINARY_DIR}/deps/lemon
    3541  )
    3642  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)
    3747ELSE()
    3848  FIND_PACKAGE(LEMON QUIET NO_MODULE)
Note: See TracChangeset for help on using the changeset viewer.