From 611f9ad0ea5f0937a27aafd21ccb421bc4dfe161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20=C5=81ukawski?= Date: Mon, 18 Jun 2018 21:07:35 +0200 Subject: [PATCH] Require YCM and newer YARP, bump to CMake 3.5 * https://github.com/roboticslab-uc3m/questions-and-answers/issues/55 * https://github.com/roboticslab-uc3m/questions-and-answers/issues/65 --- CMakeLists.txt | 43 +++++++++++++----- cmake/AddUninstallTarget.cmake | 70 ------------------------------ cmake/Copyright.txt | 48 -------------------- doc/teo-openrave-models-install.md | 6 +-- openrave/CMakeLists.txt | 21 --------- 5 files changed, 36 insertions(+), 152 deletions(-) delete mode 100644 cmake/AddUninstallTarget.cmake delete mode 100644 cmake/Copyright.txt delete mode 100644 openrave/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a13429..54c87cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,25 +2,48 @@ # Authors: Raul Fernandez-Fernandez, Juan G. Victores # CopyPolicy: Released under the terms of the GNU GPL v2.0. -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.5 FATAL_ERROR) -project(TEO_OPENRAVE_MODELS) +# Define a project. +project(TEO_OPENRAVE_MODELS LANGUAGES NONE) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) +# Find dependencies. +find_package(YCM 0.8 REQUIRED) -add_subdirectory(openrave) +# https://github.com/roboticslab-uc3m/questions-and-answers/issues/65 +find_package(YARP 3.0 QUIET) +if(NOT YARP_FOUND) + find_package(YARP 2.3.70 REQUIRED) +endif() + +# Set some useful variables - paths relative to the installation prefix. +yarp_configure_external_installation(teo-openrave-models) + +# Configure install rule, copy models to the build directory. +yarp_install(DIRECTORY openrave + DESTINATION ${TEO-OPENRAVE-MODELS_CONTEXTS_INSTALL_DIR}) +# Store this package in the user registry. +export(PACKAGE ${PROJECT_NAME}) + +# Define CMAKE_INSTALL_ and CMAKE_INSTALL_FULL_ variables. include(GNUInstallDirs) -if(WIN32 AND NOT CYGWIN) - set(_cmake_destination CMake) +# Set installation path for CMake files. +if(WIN32) + set(${PROJECT_NAME}_CMAKE_DESTINATION "CMake") else() - set(_cmake_destination ${CMAKE_INSTALL_LIBDIR}/cmake/TEO_OPENRAVE_MODELS) + set(${PROJECT_NAME}_CMAKE_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") endif() -export(PACKAGE TEO_OPENRAVE_MODELS) +# Create dummy CMake configuration export file. +file(WRITE ${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake + "# Dummy CMake configuration export file.") -file(WRITE ${CMAKE_BINARY_DIR}/TEO_OPENRAVE_MODELSConfig.cmake "# Dummy CMake configuration export file.") -install(FILES ${CMAKE_BINARY_DIR}/TEO_OPENRAVE_MODELSConfig.cmake DESTINATION ${_cmake_destination}) +# Install CMake configuration file. +install(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake + DESTINATION ${${PROJECT_NAME}_CMAKE_DESTINATION}) +# Add uninstall rule. include(AddUninstallTarget) + diff --git a/cmake/AddUninstallTarget.cmake b/cmake/AddUninstallTarget.cmake deleted file mode 100644 index fefef2d..0000000 --- a/cmake/AddUninstallTarget.cmake +++ /dev/null @@ -1,70 +0,0 @@ -#.rst: -# AddUninstallTarget -# ------------------ -# -# Add the "uninstall" target for your project:: -# -# include(AddUninstallTarget) -# -# -# will create a file cmake_uninstall.cmake in the build directory and add a -# custom target uninstall that will remove the files installed by your package -# (using install_manifest.txt) - -#============================================================================= -# Copyright 2008-2013 Kitware, Inc. -# Copyright 2013 Istituto Italiano di Tecnologia (IIT) -# Authors: Daniele E. Domenichelli -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - - -if(DEFINED __ADD_UNINSTALL_TARGET_INCLUDED) - return() -endif() -set(__ADD_UNINSTALL_TARGET_INCLUDED TRUE) - - -set(_filename ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) - -file(WRITE ${_filename} -"if(NOT EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt\") - message(WARNING \"Cannot find install manifest: \\\"${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt\\\"\") - return() -endif() - -file(READ \"${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt\" files) -string(STRIP \"\${files}\" files) -string(REGEX REPLACE \"\\n\" \";\" files \"\${files}\") -list(REVERSE files) -foreach(file \${files}) - message(STATUS \"Uninstalling: \$ENV{DESTDIR}\${file}\") - if(EXISTS \"\$ENV{DESTDIR}\${file}\") - execute_process( - COMMAND \${CMAKE_COMMAND} -E remove \"\$ENV{DESTDIR}\${file}\" - OUTPUT_VARIABLE rm_out - RESULT_VARIABLE rm_retval) - if(NOT \"\${rm_retval}\" EQUAL 0) - message(FATAL_ERROR \"Problem when removing \\\"\$ENV{DESTDIR}\${file}\\\"\") - endif() - else() - message(STATUS \"File \\\"\$ENV{DESTDIR}\${file}\\\" does not exist.\") - endif() -endforeach(file) -") - -if("${CMAKE_GENERATOR}" MATCHES "^(Visual Studio|Xcode)") - set(_uninstall "UNINSTALL") -else() - set(_uninstall "uninstall") -endif() -add_custom_target(${_uninstall} COMMAND "${CMAKE_COMMAND}" -P "${_filename}") -set_property(TARGET ${_uninstall} PROPERTY FOLDER "CMakePredefinedTargets") diff --git a/cmake/Copyright.txt b/cmake/Copyright.txt deleted file mode 100644 index b18e0aa..0000000 --- a/cmake/Copyright.txt +++ /dev/null @@ -1,48 +0,0 @@ -YCM - Extra CMake Modules for YARP and friends -Copyright 2013-2014 Istituto Italiano di Tecnologia (IIT) -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -* Neither the names of Istituto Italiano di Tecnologia (IIT), - nor the names of their contributors may be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------------------- - -The above copyright and license notice applies to distributions of -YCM in source and binary form. Some source files contain additional -notices of original copyright by their contributors; see each source -for details. Third-party software packages supplied with YCM under -compatible licenses provide their own copyright notices documented in -corresponding subdirectories. - ------------------------------------------------------------------------------- - -YCM is being developed by the iCub Facility, Istituto Italiano di -Tecnologia. - -Additional support to YCM was received from the FP7 EU project -WALK-MAN (http://walk-man.eu/) diff --git a/doc/teo-openrave-models-install.md b/doc/teo-openrave-models-install.md index 6a4432a..9237de9 100644 --- a/doc/teo-openrave-models-install.md +++ b/doc/teo-openrave-models-install.md @@ -1,10 +1,10 @@ ## teo-openrave-models: Installation from Source Code First install the dependencies: -- [Install CMake](https://github.com/roboticslab-uc3m/installation-guides/blob/master/install-cmake.md) -- [Install OpenRAVE](https://github.com/roboticslab-uc3m/installation-guides/blob/master/install-openrave.md) -Additionally, this project depends on YCM to download and build external packages. Although this process is intended to run automatically during the CMake configuration phase, you may still want to install YCM and said packages by yourself. In that respect, refer to [Install YCM](https://github.com/roboticslab-uc3m/installation-guides/blob/master/install-ycm.md). +- [Install CMake 3.5+](https://github.com/roboticslab-uc3m/installation-guides/blob/master/install-cmake.md) +- [Install YCM 0.8+](https://github.com/roboticslab-uc3m/installation-guides/blob/master/install-ycm.md) +- [Install YARP 2.3.70+](https://github.com/roboticslab-uc3m/installation-guides/blob/master/install-yarp.md) ### Install the Models diff --git a/openrave/CMakeLists.txt b/openrave/CMakeLists.txt deleted file mode 100644 index ec88c13..0000000 --- a/openrave/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright: 2017 UC3M -# Author: Juan G Victores & Raúl de Santos Rico -# CopyPolicy: Released under the terms of the GNU GPL v2.0. - -set(appname openrave) - -find_package(YARP REQUIRED) - -list(APPEND CMAKE_MODULE_PATH ${YARP_MODULE_PATH}) -include(YarpInstallationHelpers) -yarp_configure_external_installation(teo-openrave-models) - -#yarp_install(FILES ymanager.ini DESTINATION ${TEO_OPENRAVE_MODELS_DATA_INSTALL_DIR}) # Cleaner than ${TEO_OPENRAVE_MODELS_ROBOTS_INSTALL_DIR}/../ or similar. - -file(GLOB teo ${CMAKE_CURRENT_SOURCE_DIR}/teo/*.xml) -file(GLOB teo/models ${CMAKE_CURRENT_SOURCE_DIR}/teo/models/*.wrl) -#file(GLOB teo/ik ${CMAKE_CURRENT_SOURCE_DIR}/teo/ik/*.so) - -yarp_install(FILES ${teo} DESTINATION ${TEO-OPENRAVE-MODELS_CONTEXTS_INSTALL_DIR}/${appname}/teo) -yarp_install(FILES ${teo/models} DESTINATION ${TEO-OPENRAVE-MODELS_CONTEXTS_INSTALL_DIR}/${appname}/teo/models) -#yarp_install(FILES ${teo/ik} DESTINATION ${TEO-OPENRAVE-MODELS_CONTEXTS_INSTALL_DIR}/${appname}/teo/ik)