00001 # - Try to find the OMPL library 00002 # Once done this will define: 00003 # 00004 # OMPL_FOUND - OMPL was found 00005 # OMPL_LIBRARY - The OMPL library 00006 # OMPLAPP_LIBRARY - The OMPL.app library 00007 # OMPL_LIBRARIES - The OMPL library and (if found) the OMPL.app library 00008 # OMPL_INCLUDE_DIR - The OMPL include directory 00009 00010 include(FindPackageHandleStandardArgs) 00011 00012 # user can set OMPL_PREFIX to specify the prefix path of the OMPL library 00013 # and include directory, either as an environment variable or as an 00014 # argument to cmake ("cmake -DOMPL_PREFIX=...") 00015 if (NOT OMPL_PREFIX) 00016 set(OMPL_PREFIX $ENV{OMPL_PREFIX}) 00017 endif() 00018 00019 # user can set OMPL_LIB_PATH to specify the path for the OMPL library 00020 # (analogous to OMPL_PREFIX) 00021 if (NOT OMPL_LIB_PATH) 00022 set(OMPL_LIB_PATH $ENV{OMPL_LIB_PATH}) 00023 if (NOT OMPL_LIB_PATH) 00024 set(OMPL_LIB_PATH ${OMPL_PREFIX}) 00025 endif() 00026 endif() 00027 00028 # user can set OMPL_INCLUDE_PATH to specify the path for the OMPL include 00029 # directory (analogous to OMPL_PREFIX) 00030 if (NOT OMPL_INCLUDE_PATH) 00031 set(OMPL_INCLUDE_PATH $ENV{OMPL_INCLUDE_PATH}) 00032 if (NOT OMPL_INCLUDE_PATH) 00033 set(OMPL_INCLUDE_PATH ${OMPL_PREFIX}) 00034 endif() 00035 endif() 00036 00037 00038 # find the OMPL library 00039 find_library(OMPL_LIBRARY ompl 00040 PATHS ${OMPL_LIB_PATH} 00041 PATH_SUFFIXES lib build/lib) 00042 # find the OMPL library 00043 find_library(OMPLAPP_LIBRARY ompl_app 00044 PATHS ${OMPL_LIB_PATH} 00045 PATH_SUFFIXES lib build/lib) 00046 set(OMPL_LIBRARIES "${OMPL_LIBRARY}" "${OMPLAPP_LIBRARY}") 00047 00048 # find include path 00049 find_path(OMPL_INCLUDE_DIR SpaceInformation.h 00050 PATHS ${OMPL_INCLUDE_PATH} 00051 PATH_SUFFIXES base ompl/base include/ompl/base src/ompl/base) 00052 if (OMPL_INCLUDE_DIR) 00053 string(REGEX REPLACE "/ompl/base$" "" OMPL_INCLUDE_DIR ${OMPL_INCLUDE_DIR}) 00054 else() 00055 set(OMPL_INCLUDE_DIR "") 00056 endif() 00057 00058 find_package_handle_standard_args(OMPL DEFAULT_MSG OMPL_LIBRARY OMPL_INCLUDE_DIR)