diff --git a/CMakeLists.txt b/CMakeLists.txt index 99e34746..32762dd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.12) project(omplapp VERSION 1.6.0 LANGUAGES CXX) set(OMPL_ABI_VERSION 17) @@ -15,26 +15,58 @@ endif() message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") -set(CMAKE_MODULE_PATH - "${CMAKE_MODULE_PATH}" +list(APPEND CMAKE_MODULE_PATH "${CMAKE_ROOT_DIR}/cmake/Modules" "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" "${CMAKE_CURRENT_SOURCE_DIR}/ompl/CMakeModules") include(GNUInstallDirs) include(FeatureSummary) -include(CompilerSettings) -include(OMPLUtils) +# include(CompilerSettings) +# include(OMPLUtils) + +option(USE_BUNDLED_OMPL "Use OMPL from subdirectory instead of system install" OFF) +if(NOT USE_BUNDLED_OMPL) + find_package(ompl CONFIG QUIET) + if(ompl_FOUND) + message(STATUS "Using installed OMPL") + else() + message(WARNING "OMPL not found. Falling back to bundled OMPL") + set(USE_BUNDLED_OMPL ON CACHE BOOL "Use bundled OMPL" FORCE) + endif() +endif() + +# Only include custom modules if OMPL is being built as subdirectory +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ompl/CMakeModules/CompilerSettings.cmake") + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/ompl/CMakeModules") + include(CompilerSettings) + include(OMPLUtils) +endif() set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") set(OMPLAPP_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src;${CMAKE_CURRENT_BINARY_DIR}/src") set(OMPLAPP_RESOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/resources") -set(OMPL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/ompl/src;${CMAKE_CURRENT_BINARY_DIR}/ompl/src") + +if(NOT USE_BUNDLED_OMPL) + # OMPL is installed, we use its targets + message(STATUS "Using installed OMPL") +else() + # OMPL is bundled, we include manually + # include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ompl/src") + set(OMPL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/ompl/src;${CMAKE_CURRENT_BINARY_DIR}/ompl/src") + set(OMPL_CMAKE_UTIL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ompl/CMakeModules" + CACHE FILEPATH "Path to directory with auxiliary CMake scripts for OMPL") +endif() + 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") + CACHE STRING "Relative path to directory where demos will be installed") + +# set(OMPL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/ompl/src;${CMAKE_CURRENT_BINARY_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") if(MSVC) add_definitions(-DBOOST_ALL_NO_LIB) @@ -49,8 +81,7 @@ set_package_properties(Boost PROPERTIES URL "http://boost.org" PURPOSE "Used throughout OMPL for data serialization, graphs, etc.") set(Boost_USE_MULTITHREADED ON) -set(Boost_NO_BOOST_CMAKE ON) -find_package(Boost 1.58 QUIET REQUIRED COMPONENTS serialization filesystem system program_options) +find_package(Boost 1.58 REQUIRED COMPONENTS serialization filesystem system program_options) # on macOS we need to check whether to use libc++ or libstdc++ with clang++ if(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$") @@ -80,7 +111,15 @@ set_package_properties(Python PROPERTIES # 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() +# find_boost_python() + +if(USE_BUNDLED_OMPL AND NOT TARGET docker) + include(OMPLUtils) + find_boost_python() + find_python_module(PyQt5 QUIET) +else() + message(STATUS "Skipping internal OMPL Python utilities when using external OMPL install") +endif() if(PYTHON_FOUND) set_package_properties(pypy PROPERTIES @@ -88,23 +127,45 @@ if(PYTHON_FOUND) PURPOSE "Used to speed up the generation of python bindings.") find_package(pypy QUIET) endif() -find_python_module(PyQt5 QUIET) -if(NOT PY_PYQT5) - find_python_module(PySide2 QUIET) - if(NOT PY_PYSIDE2) - find_python_module(PyQt4 QUIET) - if(NOT PY_PYQT4) - find_python_module(PySide QUIET) - if (NOT PY_PYSIDE) - message(WARNING "Either PyQt5, PySide2, PyQt4 or PySide needs to be installed to use the GUI.") + +if(USE_BUNDLED_OMPL) + find_python_module(PyQt5 QUIET) + if(NOT PY_PYQT5) + find_python_module(PySide2 QUIET) + if(NOT PY_PYSIDE2) + find_python_module(PyQt4 QUIET) + if(NOT PY_PYQT4) + find_python_module(PySide QUIET) + if(NOT PY_PYSIDE) + message(WARNING "Either PyQt5, PySide2, PyQt4 or PySide needs to be installed to use the GUI.") + endif() endif() endif() 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() 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() + +# find_python_module(PyQt5 QUIET) +# if(NOT PY_PYQT5) +# find_python_module(PySide2 QUIET) +# if(NOT PY_PYSIDE2) +# find_python_module(PyQt4 QUIET) +# if(NOT PY_PYQT4) +# find_python_module(PySide QUIET) +# if (NOT PY_PYSIDE) +# message(WARNING "Either PyQt5, PySide2, PyQt4 or PySide needs to be installed to use the GUI.") +# endif() +# endif() +# endif() +# 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() set_package_properties(Eigen3 PROPERTIES URL "http://eigen.tuxfamily.org" PURPOSE "A linear algebra library used throughout OMPL.") @@ -113,31 +174,39 @@ set_package_properties(Triangle PROPERTIES URL "http://www.cs.cmu.edu/~quake/triangle.html" PURPOSE "Used to create triangular decompositions of polygonal 2D environments.") find_package(Triangle QUIET) +set(OMPL_EXTENSION_TRIANGLE ${TRIANGLE_FOUND}) + set_package_properties(flann PROPERTIES URL "https://github.com/mariusmuja/flann" PURPOSE "If detetected, FLANN can be used for nearest neighbor queries by OMPL.") find_package(flann CONFIG 1.9.2 QUIET) +if (flann_FOUND) + set(OMPL_HAVE_FLANN 1) +endif() + set_package_properties(spot PROPERTIES URL "http://spot.lrde.epita.fr" PURPOSE "Used for constructing finite automata from LTL formulae.") find_package(spot) +if (spot_FOUND) + set(OMPL_HAVE_SPOT 1) +endif() + set_package_properties(assimp PROPERTIES URL "http://assimp.org" PURPOSE "Used in ompl_app for reading meshes representing robots and environments.") find_package(assimp REQUIRED) -set_package_properties(ccd PROPERTIES - URL "https://github.com/danfis/libccd" - PURPOSE "Collision detection library used by fcl.") -find_package(ccd REQUIRED) + set_package_properties(fcl PROPERTIES URL "https://github.com/flexible-collision-library/fcl" PURPOSE "The default collision checking library.") -find_package(octomap QUIET) find_package(fcl REQUIRED) + set_package_properties(Threads PROPERTIES URL "https://en.wikipedia.org/wiki/POSIX_Threads" PURPOSE "Pthreads is sometimes needed, depending on OS / compiler.") find_package(Threads QUIET) + set_package_properties(Doxygen PROPERTIES URL "http://doxygen.org" PURPOSE "Used to create the OMPL documentation (i.e., http://ompl.kavrakilab.org).") @@ -161,51 +230,44 @@ if(Boost_VERSION_STRING VERSION_LESS "1.63.0") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ompl/src/external") endif() -include_directories(SYSTEM "${Boost_INCLUDE_DIR}") -include_directories( - "${OMPLAPP_INCLUDE_DIRS}" - "${OMPL_INCLUDE_DIRS}" - "${EIGEN3_INCLUDE_DIR}" - "${FCL_INCLUDE_DIRS}" - "${ASSIMP_INCLUDE_DIRS}") - -# ROS installs fcl in /usr. In /usr/include/fcl/config.h it says octomap was -# enabled. Octomap is installed in /opt/ros/${ROS_DISTRO}/include (most -# likely), but fcl.pc doesn't have that information, so we just add it to the -# include path. -if(DEFINED ENV{ROS_DISTRO}) - include_directories("/opt/ros/$ENV{ROS_DISTRO}/include") +# include_directories( +# "${OMPLAPP_INCLUDE_DIRS}" +# "${OMPL_INCLUDE_DIRS}") + +if(OMPL_INCLUDE_DIRS) + include_directories("${OMPL_INCLUDE_DIRS}") endif() +include_directories("${OMPLAPP_INCLUDE_DIRS}") + + + set(OMPLAPP_MODULE_LIBRARIES ${OPENGL_LIBRARIES} - ${ASSIMP_LIBRARY} - ${FCL_LIBRARIES}) + assimp::assimp + fcl::fcl) set(OMPLAPP_LIBRARIES ${OPENGL_LIBRARIES} - ${ASSIMP_LIBRARIES} - ${FCL_LIBRARIES}) -link_directories(${ASSIMP_LIBRARY_DIRS} ${CCD_LIBRARY_DIRS} ${OCTOMAP_LIBRARY_DIRS} ${FCL_LIBRARY_DIRS}) + assimp::assimp + fcl) if (OPENGL_INCLUDE_DIR) include_directories("${OPENGL_INCLUDE_DIR}") endif() -set(OMPL_EXTENSION_TRIANGLE ${TRIANGLE_FOUND}) -if (OMPL_EXTENSION_TRIANGLE) - include_directories(${TRIANGLE_INCLUDE_DIR}) -endif() - -if (flann_FOUND) - set(OMPL_HAVE_FLANN 1) -endif() - -if (spot_FOUND) - set(OMPL_HAVE_SPOT 1) -endif() - # Numpy is used to convert Eigen matrices/vectors to numpy arrays -if(PYTHON_FOUND AND NOT Boost_VERSION_STRING VERSION_LESS "1.63.0") +# if(PYTHON_FOUND AND NOT Boost_VERSION_STRING VERSION_LESS "1.63.0") +# find_python_module(numpy) +# if (PY_NUMPY) +# find_boost_numpy() +# if(Boost_NUMPY_LIBRARY) +# set(OMPL_HAVE_NUMPY 1) +# include_directories("${PY_NUMPY}/core/include") +# endif() +# endif() +# endif() + +if(USE_BUNDLED_OMPL AND PYTHON_FOUND AND NOT Boost_VERSION_STRING VERSION_LESS "1.63.0") find_python_module(numpy) if (PY_NUMPY) find_boost_numpy() @@ -216,6 +278,7 @@ if(PYTHON_FOUND AND NOT Boost_VERSION_STRING VERSION_LESS "1.63.0") endif() endif() + set_package_properties(PQP PROPERTIES URL "http://gamma.cs.unc.edu/SSV/" PURPOSE "Used as an alternative, additional collision checking library (the default is FCL).") @@ -226,18 +289,53 @@ if(PQP_FOUND) set(OMPLAPP_LIBRARIES ${OMPLAPP_LIBRARIES} ${PQP_LIBRARY}) endif() -add_subdirectory(ompl/doc) -add_subdirectory(ompl/src) -add_subdirectory(ompl/py-bindings) -add_subdirectory(ompl/tests) -add_subdirectory(ompl/demos) -add_subdirectory(ompl/scripts) +# find_package(ompl CONFIG QUIET) + +if(NOT ompl_FOUND) + message(WARNING "Installed OMPL not found. Falling back to building bundled OMPL.") + + set(OMPL_BUILD_PYBINDINGS OFF CACHE BOOL "Disable Python bindings in OMPL") + add_subdirectory(ompl/doc) + add_subdirectory(ompl/src) + add_subdirectory(ompl/py-bindings) + add_subdirectory(ompl/tests) + add_subdirectory(ompl/demos) + add_subdirectory(ompl/scripts) + set(USE_BUNDLED_OMPL TRUE) +else() + set(USE_BUNDLED_OMPL FALSE) +endif() + +if(NOT USE_BUNDLED_OMPL) + function(install_python) + # No-op macro when using installed OMPL + endfunction() +endif() + +if(NOT USE_BUNDLED_OMPL) + function(target_link_flags) + # noop fallback for external OMPL installs + endfunction() +endif() + + +# add_subdirectory(ompl/doc) +# add_subdirectory(ompl/src) +# add_subdirectory(ompl/py-bindings) +# add_subdirectory(ompl/tests) +# add_subdirectory(ompl/demos) +# add_subdirectory(ompl/scripts) add_subdirectory(gui) add_subdirectory(doc) add_subdirectory(src) add_subdirectory(demos) add_subdirectory(benchmark) -add_subdirectory(py-bindings) +# add_subdirectory(py-bindings) + +if(USE_BUNDLED_OMPL) + add_subdirectory(py-bindings) +endif() + install(DIRECTORY resources DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ompl" @@ -264,11 +362,12 @@ if(OMPL_BUILD_PYBINDINGS) endif() endif() -if(OPENGL_FOUND AND NOT MSVC) +# if(OPENGL_FOUND AND NOT MSVC) +if(OPENGL_FOUND AND NOT MSVC AND USE_BUNDLED_OMPL) 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 "eigen3 ${ompl_PKG_DEPS}") + set(PKG_EXTERNAL_DEPS "${ompl_PKG_DEPS}") set(PKG_OMPL_LIBS "-lompl -lompl_app_base -lompl_app ${ompl_LINK_FLAGS}") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ompl/CMakeModules/ompl.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/ompl.pc" @ONLY) @@ -277,34 +376,54 @@ if(OPENGL_FOUND AND NOT MSVC) COMPONENT ompl) endif() -include(CMakePackageConfigHelpers) +# include(CMakePackageConfigHelpers) set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) set(LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}) -configure_package_config_file(ompl/omplConfig.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/omplConfig.cmake - INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ompl/cmake - PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR - NO_CHECK_REQUIRED_COMPONENTS_MACRO) -write_basic_package_version_file( - ${CMAKE_CURRENT_BINARY_DIR}/omplConfigVersion.cmake - VERSION ${PROJECT_VERSION} - COMPATIBILITY SameMajorVersion) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/omplConfig.cmake - ${CMAKE_CURRENT_BINARY_DIR}/omplConfigVersion.cmake - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ompl/cmake - COMPONENT ompl) +# configure_package_config_file(ompl/omplConfig.cmake.in +# ${CMAKE_CURRENT_BINARY_DIR}/omplConfig.cmake +# INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ompl/cmake +# PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR +# NO_CHECK_REQUIRED_COMPONENTS_MACRO) +# write_basic_package_version_file( +# ${CMAKE_CURRENT_BINARY_DIR}/omplConfigVersion.cmake +# VERSION ${PROJECT_VERSION} +# COMPATIBILITY SameMajorVersion) +# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/omplConfig.cmake +# ${CMAKE_CURRENT_BINARY_DIR}/omplConfigVersion.cmake +# DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ompl/cmake +# COMPONENT ompl) +# install(TARGETS ompl +# EXPORT omplExport +# DESTINATION ${CMAKE_INSTALL_LIBDIR} +# COMPONENT ompl) + +install(TARGETS ompl_app_base + EXPORT omplExport + DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT omplapp) +if(TARGET ompl_app) + install(TARGETS ompl_app + EXPORT omplExport + DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT omplapp) +endif() +# install(EXPORT omplExport +# NAMESPACE ompl:: +# DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ompl/cmake) +# export(EXPORT omplExport +# FILE "${CMAKE_CURRENT_BINARY_DIR}/omplExport.cmake") # script to install ompl on Ubuntu -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ompl/install-ompl-ubuntu.sh.in" - "${CMAKE_CURRENT_BINARY_DIR}/install-ompl-ubuntu.sh" @ONLY) +# configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ompl/install-ompl-ubuntu.sh.in" +# "${CMAKE_CURRENT_BINARY_DIR}/install-ompl-ubuntu.sh" @ONLY) # 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") +# 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) @@ -344,6 +463,58 @@ endif() # Create targets for building docker images # See ompl/CMakeModules/OMPLUtils.cmake and ompl/scripts/docker for details -add_docker_target(ompl ompl) -add_docker_target(plannerarena ompl/scripts) -add_docker_target(omplapp) +# add_docker_target(ompl ompl) +# add_docker_target(plannerarena ompl/scripts) +# add_docker_target(omplapp) +if(USE_BUNDLED_OMPL) + # Install script for Ubuntu + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ompl/install-ompl-ubuntu.sh.in" + "${CMAKE_CURRENT_BINARY_DIR}/install-ompl-ubuntu.sh" @ONLY) + + # 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") + + # .pc file for pkg-config + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ompl/CMakeModules/ompl.pc.in" + "${CMAKE_CURRENT_BINARY_DIR}/ompl.pc" @ONLY) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ompl.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" + COMPONENT ompl) + + # CMake config files + include(CMakePackageConfigHelpers) + configure_package_config_file( + ompl/omplConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/omplConfig.cmake + INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ompl/cmake + PATH_VARS INCLUDE_INSTALL_DIR LIB_INSTALL_DIR + NO_CHECK_REQUIRED_COMPONENTS_MACRO) + + write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/omplConfigVersion.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY SameMajorVersion) + + install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/omplConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/omplConfigVersion.cmake + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ompl/cmake + COMPONENT ompl) + + install(TARGETS ompl EXPORT omplExport DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ompl) + install(EXPORT omplExport + NAMESPACE ompl:: + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ompl/cmake) + export(EXPORT omplExport + FILE "${CMAKE_CURRENT_BINARY_DIR}/omplExport.cmake") + + # Docker targets + add_docker_target(ompl ompl) + add_docker_target(plannerarena ompl/scripts) + add_docker_target(omplapp) +endif() diff --git a/CMakeModules/Findccd.cmake b/CMakeModules/Findccd.cmake deleted file mode 100644 index 21a6bf20..00000000 --- a/CMakeModules/Findccd.cmake +++ /dev/null @@ -1,9 +0,0 @@ -include(FindPackageHandleStandardArgs) -find_package(PkgConfig) -if(PKGCONFIG_FOUND) - pkg_check_modules(CCD ccd>=2.0) - if(CCD_LIBRARIES AND NOT CCD_INCLUDE_DIRS) - set(CCD_INCLUDE_DIRS "/usr/include") - endif() -endif() -find_package_handle_standard_args(ccd DEFAULT_MSG CCD_LIBRARIES CCD_INCLUDE_DIRS) diff --git a/CMakeModules/Findfcl.cmake b/CMakeModules/Findfcl.cmake deleted file mode 100644 index f7961c29..00000000 --- a/CMakeModules/Findfcl.cmake +++ /dev/null @@ -1,18 +0,0 @@ -include(FindPackageHandleStandardArgs) - -# vcpkg and MacPorts install cmake config files for fcl -find_package(fcl QUIET CONFIG) -if(TARGET fcl) - get_target_property(FCL_INCLUDE_DIRS fcl INTERFACE_INCLUDE_DIRECTORIES) - set(FCL_LIBRARIES "fcl") -else() - find_package(PkgConfig) - if(PKGCONFIG_FOUND) - pkg_check_modules(FCL fcl>=0.3.1) - if(FCL_LIBRARIES AND NOT FCL_INCLUDE_DIRS) - set(FCL_INCLUDE_DIRS "/usr/include") - endif() - endif() -endif() - -find_package_handle_standard_args(fcl DEFAULT_MSG FCL_LIBRARIES FCL_INCLUDE_DIRS) diff --git a/README.md b/README.md index 34d5a2f3..e2045e08 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ detailed installation instructions. OMPL.app has the following required dependencies: * [Boost](https://www.boost.org) (version 1.58 or higher) -* [CMake](https://www.cmake.org) (version 3.5 or higher) +* [CMake](https://www.cmake.org) (version 3.12 or higher) * [Eigen](http://eigen.tuxfamily.org) (version 3.3 or higher) * [Assimp](http://assimp.org) (version 3.0.1270 or higher) * [FCL](https://github.com/flexible-collision-library/fcl) (version 0.3.1 or higher) diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index 7da2b7f5..1c7b0136 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -1,6 +1,6 @@ add_executable(ompl_benchmark CFGBenchmark.cpp BenchmarkOptions.cpp BenchmarkTypes.cpp benchmark.cpp) -target_link_libraries(ompl_benchmark ${OMPLAPP_LIBRARIES} ompl ompl_app_base ${Boost_PROGRAM_OPTIONS_LIBRARY}) +target_link_libraries(ompl_benchmark ${OMPLAPP_LIBRARIES} ompl ompl_app_base Boost::program_options) install(TARGETS ompl_benchmark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT omplapp diff --git a/ompl b/ompl index 1aed811a..af4d6d62 160000 --- a/ompl +++ b/ompl @@ -1 +1 @@ -Subproject commit 1aed811a0f23023246c576338aab1d45d2ebc517 +Subproject commit af4d6d625e15a4ed6d85255c718ce26bcd79e4cc diff --git a/py-bindings/CMakeLists.txt b/py-bindings/CMakeLists.txt index 698c94bd..dcfbab4f 100644 --- a/py-bindings/CMakeLists.txt +++ b/py-bindings/CMakeLists.txt @@ -1,24 +1,26 @@ -include(PythonBindingsUtils) +if(USE_BUNDLED_OMPL) + include(PythonBindingsUtils) -# copy app module __init__.py -execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_if_different - "${CMAKE_CURRENT_SOURCE_DIR}/app/__init__.py" - "${CMAKE_SOURCE_DIR}/ompl/py-bindings/ompl/app/__init__.py") + # copy app module __init__.py + execute_process(COMMAND "${CMAKE_COMMAND}" -E copy_if_different + "${CMAKE_CURRENT_SOURCE_DIR}/app/__init__.py" + "${CMAKE_SOURCE_DIR}/ompl/py-bindings/ompl/app/__init__.py") -if(OMPL_BUILD_PYBINDINGS) - if(PY_OMPL_GENERATE) - create_module_generation_targets(app) - add_dependencies(update_app_bindings update_geometric_bindings update_control_bindings) - endif(PY_OMPL_GENERATE) + if(OMPL_BUILD_PYBINDINGS) + if(PY_OMPL_GENERATE) + create_module_generation_targets(app) + add_dependencies(update_app_bindings update_geometric_bindings update_control_bindings) + endif() - if(PY_OMPL_COMPILE AND EXISTS "${CMAKE_CURRENT_BINARY_DIR}/bindings") - create_module_target(app - "${CMAKE_CURRENT_SOURCE_DIR}/../ompl/py-bindings/ompl" ompl_app) - endif() -endif(OMPL_BUILD_PYBINDINGS) + if(PY_OMPL_COMPILE AND EXISTS "${CMAKE_CURRENT_BINARY_DIR}/bindings") + create_module_target(app + "${CMAKE_CURRENT_SOURCE_DIR}/../ompl/py-bindings/ompl" ompl_app) + endif() + endif() -add_custom_target(clean_app_bindings - "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/bindings" - COMMAND "${CMAKE_COMMAND}" -E remove -f pyplusplus_app.{cache,log} - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}") -add_dependencies(clean_bindings clean_app_bindings) + add_custom_target(clean_app_bindings + "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/bindings" + COMMAND "${CMAKE_COMMAND}" -E remove -f pyplusplus_app.{cache,log} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}") + add_dependencies(clean_bindings clean_app_bindings) +endif() diff --git a/src/omplapp/CMakeLists.txt b/src/omplapp/CMakeLists.txt index 2d0c8e5c..951bb321 100644 --- a/src/omplapp/CMakeLists.txt +++ b/src/omplapp/CMakeLists.txt @@ -38,9 +38,6 @@ foreach(_target ${OMPLAPP_TARGETS}) set_target_properties(${_target} PROPERTIES VERSION "${PROJECT_VERSION}" SOVERSION "${OMPL_ABI_VERSION}") endif(WIN32) - install(TARGETS ${_target} - DESTINATION ${CMAKE_INSTALL_LIBDIR} - COMPONENT omplapp) if(NOT MSVC) add_custom_command(TARGET ${_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "$"