Skip to content

Commit

Permalink
Require YCM and newer YARP, bump CMake to 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Jun 19, 2018
1 parent 6246c67 commit bd042d3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 128 deletions.
40 changes: 30 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,48 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

# Define a project.
project(ROBOTICSLAB_INSTALLATION_GUIDES LANGUAGES NONE)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# Find dependencies
find_package(YCM 0.8 REQUIRED)

find_package(YARP REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${YARP_MODULE_PATH})
include(YarpInstallationHelpers)
# 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(roboticslab-installation-guides)

# Collect Markdown files. Globbing is evil, but we don't care. All we
# need CMake here for is to support superbuild-like repos through YCM.
file(GLOB md ${CMAKE_SOURCE_DIR}/*.md)
yarp_install(FILES ${md} DESTINATION ${ROBOTICSLAB-INSTALLATION-GUIDES_CONTEXTS_INSTALL_DIR})

# Install files, create a copy in the local build tree.
yarp_install(FILES ${md}
DESTINATION ${ROBOTICSLAB-INSTALLATION-GUIDES_CONTEXTS_INSTALL_DIR})

# Store this package in the user registry.
export(PACKAGE ${PROJECT_NAME})

# Define CMAKE_INSTALL_<dir> and CMAKE_INSTALL_FULL_<dir> variables.
include(GNUInstallDirs)

# Set installation path for CMake files.
if(WIN32 AND NOT CYGWIN)
set(_cmake_destination CMake)
else()
set(_cmake_destination ${CMAKE_INSTALL_LIBDIR}/cmake/ROBOTICSLAB_INSTALLATION_GUIDES)
set(_cmake_destination ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
endif()

export(PACKAGE ROBOTICSLAB_INSTALLATION_GUIDES)
# 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}/ROBOTICSLAB_INSTALLATION_GUIDESConfig.cmake "# Dummy CMake configuration export file.")
install(FILES ${CMAKE_BINARY_DIR}/ROBOTICSLAB_INSTALLATION_GUIDESConfig.cmake DESTINATION ${_cmake_destination})
# Install CMake configuration file.
install(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake
DESTINATION ${_cmake_destination})

# Add uninstall rule.
include(AddUninstallTarget)
70 changes: 0 additions & 70 deletions cmake/AddUninstallTarget.cmake

This file was deleted.

48 changes: 0 additions & 48 deletions cmake/Copyright.txt

This file was deleted.

0 comments on commit bd042d3

Please sign in to comment.