Skip to content
Snippets Groups Projects
Commit 0835c922 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

[CMake] update cmake submodule use

parent 0c886551
No related branches found
No related tags found
No related merge requests found
...@@ -2,15 +2,13 @@ cmake_minimum_required(VERSION 2.6) ...@@ -2,15 +2,13 @@ cmake_minimum_required(VERSION 2.6)
INCLUDE(cmake/base.cmake) INCLUDE(cmake/base.cmake)
INCLUDE(cmake/python.cmake) INCLUDE(cmake/python.cmake)
INCLUDE(cmake/test.cmake) INCLUDE(cmake/test.cmake)
INCLUDE(cmake/hpp.cmake)
SET(PROJECT_ORG stonneau)
SET(PROJECT_NAME hpp-bezier-com-traj) SET(PROJECT_NAME hpp-bezier-com-traj)
SET(PROJECT_DESCRIPTION SET(PROJECT_DESCRIPTION
"Multi contact trajectory generation for the COM using Bezier curves" "Multi contact trajectory generation for the COM using Bezier curves"
) )
SET(PROJECT_URL "https://gitlab.com/${PROJECT_ORG}/${PROJECT_NAME}")
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/;${PROJECT_SOURCE_DIR}/cmake2/")
SET(CUSTOM_HEADER_DIR "hpp/bezier-com-traj") SET(CUSTOM_HEADER_DIR "hpp/bezier-com-traj")
...@@ -42,9 +40,10 @@ ADD_REQUIRED_DEPENDENCY(eigen3) ...@@ -42,9 +40,10 @@ ADD_REQUIRED_DEPENDENCY(eigen3)
ADD_REQUIRED_DEPENDENCY(hpp-centroidal-dynamics) ADD_REQUIRED_DEPENDENCY(hpp-centroidal-dynamics)
ADD_REQUIRED_DEPENDENCY(hpp-spline) ADD_REQUIRED_DEPENDENCY(hpp-spline)
IF(USE_GLPK) IF(USE_GLPK)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/find-external/glpk")
find_package (glpk REQUIRED) find_package (glpk REQUIRED)
add_definitions ( -DUSE_GLPK_SOLVER=1) add_definitions ( -DUSE_GLPK_SOLVER=1)
INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${glpk_INCLUDE_DIR})
ENDIF(USE_GLPK) ENDIF(USE_GLPK)
add_subdirectory(include/${CUSTOM_HEADER_DIR}) add_subdirectory(include/${CUSTOM_HEADER_DIR})
......
Subproject commit 320c636960b03b3bad7c7a08bd2e104951f42bc3 Subproject commit ecaf20c28c8ce33de312fbd812f88037cf995b73
# - Try to find libcdd
# Once done this will define
# CDD_FOUND - System has CDD
# CDD_INCLUDE_DIRS - The CDD include directories
# CDD_LIBRARIES - The libraries needed to use CDD
# CDD_DEFINITIONS - Compiler switches required for using CDD
find_path(CDD_INCLUDE_DIR cdd/cdd.h
HINTS ${CDD_INCLUDEDIR} /usr/include
PATH_SUFFIXES CDD )
find_library(CDD_LIBRARY NAMES libcdd.so
HINTS ${CDD_LIBDIR} ${CDD_LIBRARY_DIRS} /usr/lib/libcdd.so )
set(CDD_LIBRARIES ${CDD_LIBRARY} )
set(CDD_INCLUDE_DIRS ${CDD_INCLUDE_DIR} )
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set CDD_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(CDD DEFAULT_MSG
CDD_LIBRARY CDD_INCLUDE_DIR)
mark_as_advanced(CDD_INCLUDE_DIR CDD_LIBRARY )
# - Try to find Eigen2 lib
#
# This module supports requiring a minimum version, e.g. you can do
# find_package(Eigen2 2.0.3)
# to require version 2.0.3 to newer of Eigen2.
#
# Once done this will define
#
# EIGEN2_FOUND - system has eigen lib with correct version
# EIGEN2_INCLUDE_DIR - the eigen include directory
# EIGEN2_VERSION - eigen version
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
# Redistribution and use is allowed according to the terms of the BSD license.
if(NOT Eigen2_FIND_VERSION)
if(NOT Eigen2_FIND_VERSION_MAJOR)
set(Eigen2_FIND_VERSION_MAJOR 2)
endif(NOT Eigen2_FIND_VERSION_MAJOR)
if(NOT Eigen2_FIND_VERSION_MINOR)
set(Eigen2_FIND_VERSION_MINOR 0)
endif(NOT Eigen2_FIND_VERSION_MINOR)
if(NOT Eigen2_FIND_VERSION_PATCH)
set(Eigen2_FIND_VERSION_PATCH 0)
endif(NOT Eigen2_FIND_VERSION_PATCH)
set(Eigen2_FIND_VERSION "${Eigen2_FIND_VERSION_MAJOR}.${Eigen2_FIND_VERSION_MINOR}.${Eigen2_FIND_VERSION_PATCH}")
endif(NOT Eigen2_FIND_VERSION)
macro(_eigen2_check_version)
file(READ "${EIGEN2_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen2_version_header)
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen2_world_version_match "${_eigen2_version_header}")
set(EIGEN2_WORLD_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen2_major_version_match "${_eigen2_version_header}")
set(EIGEN2_MAJOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen2_minor_version_match "${_eigen2_version_header}")
set(EIGEN2_MINOR_VERSION "${CMAKE_MATCH_1}")
set(EIGEN2_VERSION ${EIGEN2_WORLD_VERSION}.${EIGEN2_MAJOR_VERSION}.${EIGEN2_MINOR_VERSION})
if((${EIGEN2_WORLD_VERSION} NOTEQUAL 2) OR (${EIGEN2_MAJOR_VERSION} GREATER 10) OR (${EIGEN2_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION}))
set(EIGEN2_VERSION_OK FALSE)
else()
set(EIGEN2_VERSION_OK TRUE)
endif()
if(NOT EIGEN2_VERSION_OK)
message(STATUS "Eigen2 version ${EIGEN2_VERSION} found in ${EIGEN2_INCLUDE_DIR}, "
"but at least version ${Eigen2_FIND_VERSION} is required")
endif(NOT EIGEN2_VERSION_OK)
endmacro(_eigen2_check_version)
if (EIGEN2_INCLUDE_DIR)
# in cache already
_eigen2_check_version()
set(EIGEN2_FOUND ${EIGEN2_VERSION_OK})
else (EIGEN2_INCLUDE_DIR)
find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core
PATHS
${INCLUDE_INSTALL_DIR}
${KDE4_INCLUDE_DIR}
PATH_SUFFIXES eigen2
)
if(EIGEN2_INCLUDE_DIR)
_eigen2_check_version()
endif(EIGEN2_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Eigen2 DEFAULT_MSG EIGEN2_INCLUDE_DIR EIGEN2_VERSION_OK)
mark_as_advanced(EIGEN2_INCLUDE_DIR)
endif(EIGEN2_INCLUDE_DIR)
# - Try to find Eigen3 lib
#
# This module supports requiring a minimum version, e.g. you can do
# find_package(Eigen3 3.1.2)
# to require version 3.1.2 or newer of Eigen3.
#
# Once done this will define
#
# EIGEN3_FOUND - system has eigen lib with correct version
# EIGEN3_INCLUDE_DIR - the eigen include directory
# EIGEN3_VERSION - eigen version
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
if(NOT Eigen3_FIND_VERSION)
if(NOT Eigen3_FIND_VERSION_MAJOR)
set(Eigen3_FIND_VERSION_MAJOR 2)
endif(NOT Eigen3_FIND_VERSION_MAJOR)
if(NOT Eigen3_FIND_VERSION_MINOR)
set(Eigen3_FIND_VERSION_MINOR 91)
endif(NOT Eigen3_FIND_VERSION_MINOR)
if(NOT Eigen3_FIND_VERSION_PATCH)
set(Eigen3_FIND_VERSION_PATCH 0)
endif(NOT Eigen3_FIND_VERSION_PATCH)
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
endif(NOT Eigen3_FIND_VERSION)
macro(_eigen3_check_version)
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
set(EIGEN3_VERSION_OK FALSE)
else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
set(EIGEN3_VERSION_OK TRUE)
endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
if(NOT EIGEN3_VERSION_OK)
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
"but at least version ${Eigen3_FIND_VERSION} is required")
endif(NOT EIGEN3_VERSION_OK)
endmacro(_eigen3_check_version)
if (EIGEN3_INCLUDE_DIR)
# in cache already
_eigen3_check_version()
set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
else (EIGEN3_INCLUDE_DIR)
find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
PATHS
${CMAKE_INSTALL_PREFIX}/include
${KDE4_INCLUDE_DIR}
PATH_SUFFIXES eigen3 eigen
)
if(EIGEN3_INCLUDE_DIR)
_eigen3_check_version()
endif(EIGEN3_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
mark_as_advanced(EIGEN3_INCLUDE_DIR)
endif(EIGEN3_INCLUDE_DIR)
# - Try to find spline
# Once done this will define
# SPLINE_FOUND - System has SPLINE
# SPLINE_INCLUDE_DIRS - The SPLINE include directories
# SPLINE_DEFINITIONS - Compiler switches required for using SPLINE
# /usr/include/coin, /usr/lib/libSPLINE.so
find_path(SPLINE_INCLUDE_DIR spline/bezier_curve.h
HINTS ${SPLINE_INCLUDEDIR}
PATH_SUFFIXES SPLINE )
#~ find_library(SPLINE_LIBRARY NAMES libSPLINE.so
#~ HINTS ${SPLINE_LIBDIR} ${SPLINE_LIBRARY_DIRS} )
set(SPLINE_INCLUDE_DIRS ${SPLINE_INCLUDE_DIR} )
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set CDD_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(SPLINE DEFAULT_MSG
SPLINE_INCLUDE_DIR)
mark_as_advanced(SPLINE_INCLUDE_DIR)
################################################################################
# Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
# copied verbatim in the file "LICENSE" #
################################################################################
# - Try to find GLPK instalation
# Once done this will define
#
MESSAGE(STATUS "Looking for GLPK ...")
FIND_PATH(GLPK_INCLUDE_DIR NAMES glpk.h PATHS
HINTS ${GLPK_INCLUDE_DIR} /usr/local/include
NO_DEFAULT_PATH
)
FIND_PATH(GLPK_LIB_DIR NAMES libglpk.so PATHS
${SIMPATH}/basics/glpk/lib
${SIMPATH}/local/lib
${SIMPATH}/local/lib
/usr/local/lib
/usr/lib/x86_64-linux-gnu/
NO_DEFAULT_PATH
)
find_library(GLPK_LIB NAMES libglpk.so
HINTS ${GLPK_LIB_DIR} /usr/lib/libglpk.so )
if (GLPK_INCLUDE_DIR AND GLPK_LIB_DIR)
set(GLPK_FOUND TRUE)
endif (GLPK_INCLUDE_DIR AND GLPK_LIB_DIR)
if (GLPK_FOUND)
if (NOT GLPK_FOUND_QUIETLY)
MESSAGE(STATUS "Looking for GLPK... - found ${GLPK_LIB_DIR}")
# message(STATUS "Found PLUTO: ${PLUTO_LIBRARY_DIR}")
SET(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${GLPK_LIB_DIR})
endif (NOT GLPK_FOUND_QUIETLY)
else (GLPK_FOUND)
if (GLPK_FOUND_REQUIRED)
message(FATAL_ERROR "Looking for GLPK... - Not found")
endif (GLPK_FOUND_REQUIRED)
endif (GLPK_FOUND)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment