Commit 8a2b5602 authored by Florent Lamiraux's avatar Florent Lamiraux Committed by Florent Lamiraux florent@laas.fr
Browse files

Use cmake submodule.

parent 8cd88bf2
[submodule "cmake"]
path = cmake
url = git://github.com/jrl-umi3218/jrl-cmakemodules.git
#
# Copyright 2010 CNRS-LAAS
# Author: Florent Lamiraux
# Copyright (c) 2010, 2011 CNRS
# Authors: Florent Lamiraux
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(PROJECT_NAME hppCore)
project(${PROJECT_NAME})
SET(PROJECT_VERSION 1.14.0.99)
SET(CMAKE_VERBOSE_MAKEFILE true)
IF(WIN32)
SET(LIBDIR_KW "/LIBPATH:")
SET(LIBINCL_KW "")
SET(LIB_EXT ".lib")
ENDIF(WIN32)
IF(UNIX)
SET(LIBDIR_KW "-L")
SET(LIBINCL_KW "-l")
SET(LIB_EXT "")
ENDIF(UNIX)
#
# Look for dependencies
# This file is part of hpp-core
# hpp-core is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
#
# hpp-core is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Lesser Public License for more details. You should have
# received a copy of the GNU Lesser General Public License along with
# hpp-core If not, see
# <http://www.gnu.org/licenses/>.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
# Load Pkgconfig macros
INCLUDE(FindPkgConfig)
SET(PACKAGE_REQUIREMENTS "")
SET(CXX_DISABLE_WERROR TRUE)
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/cpack.cmake)
#
# Dependency to package kwsPlus
#
SET(KWSPLUS_FOUND 0)
SET(KWSPLUS_REQUIRED "kwsPlus >= 1.8")
PKG_CHECK_MODULES(KWSPLUS REQUIRED ${KWSPLUS_REQUIRED})
EXEC_PROGRAM(${PKG_CONFIG_EXECUTABLE} ARGS --variable=docdir kwsPlus
OUTPUT_VARIABLE KWSPLUS_DOCDIR)
MESSAGE(STATUS "pkg-config: ${PKG_CONFIG_EXECUTABLE}")
MESSAGE(STATUS "KWSPLUS_DOCDIR=${KWSPLUS_DOCDIR}")
SET(KWSPLUS_FOUND 1)
SET(PROJECT_NAME hpp-core)
SET(PROJECT_DESCRIPTION
"Implement basic classes used as interfaces with KineoPathPlanner"
)
SET(PROJECT_URL "")
IF(NOT ${KWSPLUS_FOUND})
MESSAGE(FATAL_ERROR "Check that package kwsPlus is installed in a directory pointed out by PKG_CONFIG_PATH.")
ENDIF(NOT ${KWSPLUS_FOUND})
# Where to compile shared objects
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
IF(PACKAGE_REQUIREMENTS STREQUAL "")
SET(PACKAGE_REQUIREMENTS ${KWSPLUS_REQUIRED})
ELSE(PACKAGE_REQUIREMENTS STREQUAL "")
SET(PACKAGE_REQUIREMENTS "${PACKAGE_REQUIREMENTS}, ${KWSPLUS_REQUIRED}")
ENDIF(PACKAGE_REQUIREMENTS STREQUAL "")
SETUP_PROJECT()
# Activate hpp-util logging if requested
IF (HPP_DEBUG)
MESSAGE(STATUS "Activate hpp-util logging.")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHPP_DEBUG")
ENDIF()
#
# Optional Dependency to package hppModel
#
IF (NOT DEFINED ENABLE_BODY)
SET(ENABLE_BODY NO)
ENDIF(NOT DEFINED ENABLE_BODY)
MESSAGE (STATUS "ENABLE_BODY "${ENABLE_BODY})
IF(${ENABLE_BODY} STREQUAL YES)
IF(ENABLE_BODY)
MESSAGE(STATUS "using internal implementation of ChppBody")
SET(BODY_CFLAGS "IMPLEMENT_BODY=1")
SET(BODY_HEADER_PATH="hppModel")
ELSE(${ENABLE_BODY} STREQUAL YES)
MESSAGE(STATUS "using external implementation of ChppBody")
SET(HPPMODEL_FOUND 0)
SET(HPPMODEL_REQUIRED "hppModel >= 1.7.6")
PKG_CHECK_MODULES(HPPMODEL REQUIRED ${HPPMODEL_REQUIRED})
EXEC_PROGRAM(${PKG_CONFIG_EXECUTABLE} ARGS --variable=docdir hppModel
OUTPUT_VARIABLE HPPMODEL_DOCDIR)
MESSAGE(STATUS "pkg-config: ${PKG_CONFIG_EXECUTABLE}")
MESSAGE(STATUS "HPPMODEL_DOCDIR=${HPPMODEL_DOCDIR}")
SET(HPPMODEL_FOUND 1)
IF(NOT ${HPPMODEL_FOUND})
MESSAGE(FATAL_ERROR "Check that package hppModel is installed in a directory pointed out by PKG_CONFIG_PATH.")
ENDIF(NOT ${HPPMODEL_FOUND})
IF(PACKAGE_REQUIREMENTS STREQUAL "")
SET(PACKAGE_REQUIREMENTS ${HPPMODEL_REQUIRED})
ELSE(PACKAGE_REQUIREMENTS STREQUAL "")
SET(PACKAGE_REQUIREMENTS "${PACKAGE_REQUIREMENTS}, ${HPPMODEL_REQUIRED}")
ENDIF(PACKAGE_REQUIREMENTS STREQUAL "")
ENDIF(${ENABLE_BODY} STREQUAL YES)
#
# pkg-config file
#
SET(install_pkg_prefix "\${prefix}")
SET(install_pkg_exec_prefix "\${exec_prefix}")
SET(install_pkg_libdir "\${libdir}")
SET(install_pkg_datarootdir "\${datarootdir}")
SET(install_pkg_include_dir "\${includedir}")
IF(UNIX)
SET (${PROJECT_NAME}_LDFLAGS "-Wl,-R${install_pkg_libdir} ${LIBINCL_KW}${PROJECT_NAME}${LIB_EXT} ${${PROJECT_NAME}_LDFLAGS}")
ENDIF(UNIX)
IF(WIN32)
SET (${PROJECT_NAME}_LDFLAGS "${LIBINCL_KW}${PROJECT_NAME}${LIB_EXT} ${${PROJECT_NAME}_LDFLAGS}")
ENDIF(WIN32)
# Install the file in the appropriate place.
SET(install_libdir_pkgconfig lib/pkgconfig)
SET(BODY_HEADER_PATH="hpp-model")
# install hpp/model/body.hh
INSTALL(FILES include/hpp-model/hpp/model/body.hh
DESTINATION include/hpp/model
)
ELSE(ENABLE_BODY)
MESSAGE(STATUS "using external implementation of hpp::model::Body")
ADD_REQUIRED_DEPENDENCY("hpp-model >= 2.0")
ENDIF(ENABLE_BODY)
# Declare Headers
SET(${PROJECT_NAME}_HEADERS
include/hpp/core/collision-pair.hh
include/hpp/core/planner.hh
include/hpp/core/problem.hh
)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc)
ADD_REQUIRED_DEPENDENCY("kwsPlus >= 1.8")
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
DESTINATION ${install_libdir_pkgconfig}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE)
# Add dependency toward hpp-model library in pkg-config file.
PKG_CONFIG_APPEND_LIBS("hpp-core")
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(include)
#
# Documentation produced by doxygen
#
INCLUDE(FindDoxygen)
IF(DOXYGEN_FOUND)
add_subdirectory(doc)
ENDIF(DOXYGEN_FOUND)
#
# Uninstall target
#
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
IMMEDIATE )
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
#
# Package
#
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "hppCore")
set(CPACK_PACKAGE_VENDOR "Your laboratory")
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Your name")
set(CPACK_GENERATOR DEB)
set(
CPACK_SOURCE_PACKAGE_FILE_NAME
"hppCore-${PROJECT_VERSION}"
CACHE INTERNAL "tarball basename"
)
set(CPACK_SOURCE_GENERATOR TGZ)
set(CPACK_SOURCE_IGNORE_FILES
"~$""^${PROJECT_SOURCE_DIR}/build/"
"^${PROJECT_SOURCE_DIR}/.git/"
)
include(CPack)
SETUP_PROJECT_FINALIZE()
SETUP_PROJECT_CPACK()
hppCore implements basic classes used as interfaces with KineoPathPlanner.
The main classes are:
* hpp::core::Device: implement a humanoid robot with a dynamical model.
* hpp::core::Problem: define a canonical path planning problem.
* hpp::core::Planner: contains a vector of above path planning problems to
implement iterative planning algorithms that use several instaciations of
a robot.
This package and depending packages implementing algorithms can be used
with or without GUI, depending on whether we are developing and debugging
new algorithms or we want to run the algorithms on-board a robot.
Upon some events (a problem is added in hpp::core::Planner object, a path has
been planned, ...), notifications are sent.
* When working with the GUI, these notification are caught by the
interface and objects are added in the view,
* when working without interface, the notification have no effet.
Subproject commit 538cd1cad80aa60e19e9c0dc117245b5ea8d243b
#
# Copyright 2010 CNRS-LAAS
# Author: Florent Lamiraux
#
#----------------------------------------------------
# Install new style header files
#----------------------------------------------------
#
# Copyright (c) 2010, 2011 CNRS
# Authors: Florent Lamiraux
#
#
# This file is part of hpp-core
# hpp-core is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
#
# hpp-core is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Lesser Public License for more details. You should have
# received a copy of the GNU Lesser General Public License along with
# hpp-core If not, see
# <http://www.gnu.org/licenses/>.
SET(${PROJECT_NAME}_HEADERS
hpp/core/planner.hh
......
#
# Copyright 2010 CNRS-LAAS
# Author: Florent Lamiraux
# Copyright (c) 2010, 2011 CNRS
# Authors: Florent Lamiraux
#
#
# This file is part of hpp-core
# hpp-core is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
#
# hpp-core is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Lesser Public License for more details. You should have
# received a copy of the GNU Lesser General Public License along with
# hpp-core If not, see
# <http://www.gnu.org/licenses/>.
SET(LIBRARY_NAME ${PROJECT_NAME})
# provide path to library libkwsPlus.so
LINK_DIRECTORIES(${KWSPLUS_LIBRARY_DIRS})
# provide path to library libhppModel.so
LINK_DIRECTORIES(${HPPMODEL_LIBRARY_DIRS})
SET(${LIBRARY_NAME}_SOURCE_FILES
SET(${LIBRARY_NAME}_SOURCES
collision-pair.cc
planner.cc
problem.cc
)
SET(${LIBRARY_NAME}_LINK_LIBRARIES "")
# Add kwsPlus compilation flags and link to library libkwsPlus.so
ADD_DEFINITIONS(${KWSPLUS_CFLAGS})
IF(UNIX)
SET(${LIBRARY_NAME}_LINK_LIBRARIES
${${LIBRARY_NAME}_LINK_LIBRARIES} ${KWSPLUS_LIBRARIES})
ENDIF(UNIX)
IF(WIN32)
FOREACH(dlink ${KWSPLUS_LDFLAGS})
SET ( ${PROJECT_NAME}_src_LDFLAGS "${${PROJECT_NAME}_src_LDFLAGS} ${dlink}")
ENDFOREACH(dlink)
ENDIF(WIN32)
)
IF(${ENABLE_BODY} STREQUAL YES)
IF (ENABLE_BODY)
SET(${LIBRARY_NAME}_SOURCES
${${LIBRARY_NAME}_SOURCES}
body.cc
)
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/include/hpp-model)
ADD_LIBRARY(${LIBRARY_NAME}
SHARED
${LIBRARY_NAME}_SOURCES
)
SET(${LIBRARY_NAME}_SOURCE_FILES
${${LIBRARY_NAME}_SOURCE_FILES}
body.cc)
......@@ -42,52 +43,4 @@ ELSE(${ENABLE_BODY} STREQUAL YES)
# Add hppModel compilation flags and link to library libhppModel.so
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/include)
ADD_DEFINITIONS(${HPPMODEL_CFLAGS})
SET(${LIBRARY_NAME}_SOURCE_FILES
${${LIBRARY_NAME}_SOURCE_FILES}
parser.cc
joint.cc
joint.hh
freeflyer-joint.hh
rotation-joint.hh
translation-joint.hh
humanoid-robot.hh
humanoid-robot.cc
)
IF(UNIX)
SET(${LIBRARY_NAME}_LINK_LIBRARIES
${${LIBRARY_NAME}_LINK_LIBRARIES} ${HPPMODEL_LIBRARIES})
ENDIF(UNIX)
IF(WIN32)
foreach(dlink ${HPPMODEL_LDFLAGS})
SET ( ${PROJECT_NAME}_src_LDFLAGS "${${PROJECT_NAME}_src_LDFLAGS} ${dlink}")
endforeach(dlink)
ENDIF(WIN32)
ENDIF(${ENABLE_BODY} STREQUAL YES)
MESSAGE(STATUS "sources: "${${LIBRARY_NAME}_SOURCE_FILES})
ADD_LIBRARY(${LIBRARY_NAME}
SHARED
${${LIBRARY_NAME}_SOURCE_FILES}
)
SET_TARGET_PROPERTIES(${LIBRARY_NAME}
PROPERTIES
SOVERSION ${PROJECT_VERSION}
INSTALL_RPATH lib)
SET_TARGET_PROPERTIES(${PROJECT_NAME_LIB}
PROPERTIES
COMPILE_FLAGS ${${PROJECT_NAME}_src_CXXFLAGS}
LINK_FLAGS ${${PROJECT_NAME}_src_LDFLAGS}
)
SET_TARGET_PROPERTIES(${LIBRARY_NAME}
PROPERTIES
LINK_FLAGS "${${PROJECT_NAME}_src_LDFLAGS}"
)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${${LIBRARY_NAME}_LINK_LIBRARIES})
INSTALL(TARGETS ${LIBRARY_NAME}
DESTINATION lib)
ENDIF()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment