C Make Lists
C Make Lists
8)
if(${CMAKE_VERSION} VERSION_GREATER 2.8.3)
cmake_policy(SET CMP0017 NEW)
endif()
if(NOT ${CMAKE_VERSION} VERSION_LESS 3.0.0)
cmake_policy(SET CMP0042 OLD)
endif()
project(omplapp CXX C)
set(CMAKE_MODULE_PATH
"${CMAKE_MODULE_PATH}"
"${CMAKE_ROOT_DIR}/cmake/Modules"
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules"
"${CMAKE_CURRENT_SOURCE_DIR}/ompl/CMakeModules")
include(GNUInstallDirs)
include(CompilerSettings)
include(OMPLVersion)
include(OMPLUtils)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(OMPLAPP_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(OMPLAPP_RESOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/resources")
set(OMPL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ompl/src")
set(OMPL_DEMO_INSTALL_DIR "${CMAKE_INSTALL_DATAROOTDIR}/ompl/demos"
CACHE STRING "Relative path to directory where demos will be installed")
set(OMPL_CMAKE_UTIL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ompl/CMakeModules"
CACHE FILEPATH "Path to directory with auxiliary CMake scripts for OMPL")
set(OMPLAPP_MAJOR_VERSION ${OMPL_MAJOR_VERSION})
set(OMPLAPP_MINOR_VERSION ${OMPL_MINOR_VERSION})
set(OMPLAPP_PATCH_VERSION ${OMPL_PATCH_VERSION})
set(OMPLAPP_VERSION "${OMPLAPP_MAJOR_VERSION}.${OMPLAPP_MINOR_VERSION}.$
{OMPLAPP_PATCH_VERSION}")
set(OMPLAPP_ABI_VERSION ${OMPL_ABI_VERSION})
if(MSVC)
add_definitions(-DBOOST_ALL_NO_LIB)
add_definitions(-DBOOST_PROGRAM_OPTIONS_DYN_LINK)
endif(MSVC)
if(IS_ICPC)
set(Boost_USE_STATIC_LIBS ON CACHE STRING "Use statically linked Boost
libraries")
else(IS_ICPC)
# Ensure dynamic linking with boost unit_test_framework
add_definitions(-DBOOST_TEST_DYN_LINK)
endif(IS_ICPC)
find_package(OpenGL)
# This includes our own FindPython.cmake in ompl/CMakeModules. It defines,
# among other things, the find_python_module() function used below.
find_package(Python)
find_boost_python()
if(PYTHON_FOUND)
# PyPy is more than an order of magnitude faster in generating the Python
# bindings than CPython, so use it if available.
find_program(PYPY NAMES pypy${PYTHON_VERSION_MAJOR} pypy)
if(PYPY)
option(OMPL_USE_PYPY "Use PyPy for generating Python bindings" ON)
else()
option(OMPL_USE_PYPY "Use PyPy for generating Python bindings" OFF)
endif()
if(OMPL_USE_PYPY)
set(PYTHON_BINDING_EXEC "${PYPY}")
else()
set(PYTHON_BINDING_EXEC "${PYTHON_EXEC}")
endif()
endif()
find_python_module(PyQt5 QUIET)
find_python_module(PyQt4 QUIET)
find_python_module(PySide QUIET)
if(NOT (PY_PYQT5 OR PY_PYQT4 OR PY_PYSIDE))
message(WARNING "Either PyQt5, PyQt4 or PySide needs to be installed to use the
GUI.")
endif()
find_python_module(OpenGL)
if (NOT OPENGL_FOUND OR NOT PY_OPENGL)
message(WARNING "Both OpenGL and the Python OpenGL module need to be installed
to use the GUI")
endif()
# Eigen is needed for the InformedStateSampler
find_package(Eigen3 QUIET)
# If Triangle is installed, enable code for triangular decompositions
find_package(Triangle QUIET)
# If FLANN is installed, a wrapper for its nearest neighbor data structures can be
used
find_package(flann 1.8.3 QUIET)
# MORSE is only needed for Modular OpenRobots Simulation Engine bindings
find_package(MORSE QUIET)
# ODE is only needed for Open Dynamics Engine bindings
find_package(OpenDE QUIET)
# This library is included in the Open Dynamics source distribution and is used in
one demo only
find_package(Drawstuff QUIET)
# Assimp is need to load meshes
find_package(Assimp REQUIRED)
# We need FCL and its dependency CCD for collision checking
find_package(CCD REQUIRED)
find_package(FCL REQUIRED)
enable_testing()
include_directories(
"${OMPLAPP_INCLUDE_DIR}"
"${OMPL_INCLUDE_DIR}"
"${Boost_INCLUDE_DIR}"
"${FCL_INCLUDE_DIRS}"
"${CCD_INCLUDE_DIRS}"
"${ASSIMP_INCLUDE_DIRS}")
set(OMPLAPP_MODULE_LIBRARIES
${OPENGL_LIBRARIES}
${ASSIMP_LIBRARY}
${FCL_LIBRARIES})
set(OMPLAPP_LIBRARIES
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SERIALIZATION_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${OPENGL_LIBRARIES}
${ASSIMP_LIBRARIES}
${FCL_LIBRARIES}
${CCD_LIBRARIES})
link_directories(${ASSIMP_LIBRARY_DIRS} ${FCL_LIBRARY_DIRS} ${CCD_LIBRARY_DIRS})
if(OPENGL_INCLUDE_DIR)
include_directories("${OPENGL_INCLUDE_DIR}")
endif()
set(OMPL_EXTENSION_TRIANGLE ${TRIANGLE_FOUND})
if (TRIANGLE_FOUND)
include_directories(${TRIANGLE_INCLUDE_DIR})
endif()
if (EIGEN3_FOUND)
set(OMPL_HAVE_EIGEN3 1)
include_directories("${EIGEN3_INCLUDE_DIR}")
endif()
if (FLANN_FOUND)
set(OMPL_HAVE_FLANN 1)
include_directories("${FLANN_INCLUDE_DIRS}")
link_directories(${FLANN_LIBRARY_DIRS})
endif()
set(OMPL_EXTENSION_MORSE ${MORSE_FOUND})
set(OMPL_EXTENSION_OPENDE ${OPENDE_FOUND})
if (OPENDE_FOUND)
add_definitions(${OPENDE_DEFINITIONS})
include_directories("${OPENDE_INCLUDE_DIR}")
endif()
option(OMPLAPP_PQP "Enable support for the PQP collision checking library" ON)
if(OMPLAPP_PQP)
# If the PQP is installed, it is possible to use as the collision checker with
OMPL.app.
# (FCL is the default collision checker)
find_package(PQP QUIET)
if(PQP_FOUND)
include_directories("${PQP_INCLUDE_DIR}")
set(OMPLAPP_MODULE_LIBRARIES ${OMPLAPP_MODULE_LIBRARIES} ${PQP_LIBRARY})
set(OMPLAPP_LIBRARIES ${OMPLAPP_LIBRARIES} ${PQP_LIBRARY})
endif()
endif()
install(DIRECTORY resources
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ompl"
COMPONENT omplapp
PATTERN ".DS_Store" EXCLUDE)
install(DIRECTORY webapp
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ompl"
COMPONENT omplapp
PATTERN ".DS_Store" EXCLUDE)
find_python_module(flask)
find_python_module(celery)
find_program(CELERY celery)
if(PY_FLASK AND PY_CELERY AND CELERY)
install(PROGRAMS webapp/ompl_webapp
DESTINATION bin
RENAME ompl_webapp)
endif()
# HACK ALERT: just in case the version of OpenDE used for libdrawstuff is used for
libompl
if(TARGET drawstuff)
add_dependencies(ompl drawstuff)
endif()
if(NOT MSVC)
target_link_flags(ompl ompl_app_base ompl_app)
set(PKG_NAME "ompl")
set(PKG_DESC "The Open Motion Planning Library")
set(PKG_EXTERNAL_DEPS "${ompl_PKG_DEPS}")
set(PKG_OMPL_LIBS "-lompl -lompl_app_base -lompl_app ${ompl_LINK_FLAGS}")
set(pkg_conf_file "${CMAKE_CURRENT_SOURCE_DIR}/ompl/CMakeModules/ompl.pc")
configure_file("${pkg_conf_file}.in" "${pkg_conf_file}" @ONLY)
install(FILES "${pkg_conf_file}"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
COMPONENT ompl
RENAME "ompl.pc")
endif()
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/ompl/ompl.conf"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ompl"
COMPONENT ompl)
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/ompl/CMakeModules/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P "$
{CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
include(CPackSettings)