CMakeLists.txt 4.22 KB
 Thomas Moulard committed Oct 04, 2010 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 # Copyright 2010, Olivier Stasse, JRL, CNRS/AIST # # This file is part of jrl-walkgen. # jrl-walkgen 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. # # jrl-walkgen 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 # jrl-walkgen. If not, see .  Thomas Moulard committed Nov 08, 2010 16 17 # Requires at least CMake 2.6 to configure the package. CMAKE_MINIMUM_REQUIRED(VERSION 2.6)  Thomas Moulard committed Oct 04, 2010 18   olivier-stasse committed Nov 10, 2010 19 # Includes from jrl-cmaketools  Thomas Moulard committed Nov 08, 2010 20 INCLUDE(cmake/base.cmake)  Francois Bleibel committed Nov 09, 2010 21 INCLUDE(cmake/lapack.cmake)  olivier-stasse committed Nov 16, 2010 22 INCLUDE(cmake/cpack.cmake)  mnaveau committed Jan 30, 2014 23 INCLUDE(cmake/boost.cmake)  mnaveau committed Jan 20, 2014 24 INCLUDE(CMakeDependentOption)  Thomas Moulard committed Oct 04, 2010 25   olivier-stasse committed Nov 10, 2010 26 # Define properties of the project  Thomas Moulard committed Nov 08, 2010 27 28 29 SET(PROJECT_NAME jrl-walkgen) SET(PROJECT_DESCRIPTION "Walking pattern generator for Humanoids") SET(PROJECT_URL "")  Thomas Moulard committed Oct 04, 2010 30   Thomas Moulard committed Nov 08, 2010 31 SET(CXX_DISABLE_WERROR True)  Guilhem Saurel committed Aug 23, 2018 32 SET(DOXYGEN_USE_MATHJAX YES)  Thomas Moulard committed Oct 04, 2010 33   olivier-stasse committed Nov 10, 2010 34 # Initialize generic properties of the project  Thomas Moulard committed Nov 08, 2010 35 SETUP_PROJECT()  Thomas Moulard committed Oct 04, 2010 36   mnaveau committed Jan 10, 2014 37 # Handle OS specificities  Thomas Moulard committed Nov 08, 2010 38 39 INCLUDE(CheckIncludeFiles) CHECK_INCLUDE_FILES("sys/time.h" SYS_TIME_H)  Francois Keith committed Nov 09, 2010 40 41 42 IF(SYS_TIME_H) ADD_DEFINITIONS("-DHAVE_SYS_TIME_H") ENDIF(SYS_TIME_H)  Thomas Moulard committed Oct 04, 2010 43   olivier-stasse committed Nov 10, 2010 44 # Required dependencies  Olivier Stasse committed Mar 08, 2019 45 ADD_REQUIRED_DEPENDENCY("pinocchio >= 2.1.0")  student committed May 26, 2014 46   mnaveau committed Jan 30, 2014 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 # Search for Boost. # Boost.Test is used by the test suite. # Boost program_options is used by the embedfile utility, which is used # by metapod_robotbuilder # Boost filesystem and regex are used by metapod_robotbuilder. # Boost filesystem depends on Boost system. SET(BOOST_COMPONENTS filesystem system unit_test_framework program_options regex) SEARCH_FOR_BOOST() # If Boost is recent enough, we look for Boost timer which can be used by # by metapod_timer, which is in turn used by the benchmark. # Boost timer depends on Boost chrono and system. IF((BUILD_MULTI_MODEL_BENCHMARK OR BUILD_SINGLE_MODEL_BENCHMARKS) AND NOT Boost_VERSION LESS 104800) SET(BOOST_COMPONENTS ${BOOST_COMPONENTS} timer chrono system) SEARCH_FOR_BOOST() ENDIF()  Olivier Stasse committed Mar 08, 2019 65 66 SEARCH_FOR_LAPACK()  mnaveau committed Jan 20, 2014 67 # Search for Eigen.  mnaveau committed Apr 14, 2016 68 ADD_REQUIRED_DEPENDENCY("eigen3 >= 3.0.5")  mnaveau committed Jan 20, 2014 69 70 71 72 73 74 # Eigen (at least version 3.0.5) makes gcc report conversion warnings # when one assigns to a block. This floods the compilation results. # So we include Eigen headers as if they were system headers: the compiler # won't report warning coming from them. INCLUDE_DIRECTORIES(SYSTEM${EIGEN3_INCLUDE_DIRS})  Jory Lafaye committed Aug 19, 2011 75 # TODO kinda dirty patch to find lssol for now  mnaveau committed Jan 10, 2014 76 # using ADD_OPTIONAL_DEPENDENCY prevents the creation  Jory Lafaye committed Aug 19, 2011 77 78 79 80 # of classic variables such as ${PKG}_FOUND # hence we use ADD_REQUIRED_DEPENDENCY to get the data OPTION(USE_LSSOL "Do you want to use the solver lssol?" OFF) IF(USE_LSSOL)  mnaveau committed Oct 31, 2016 81  ADD_REQUIRED_DEPENDENCY("lssol >= 0.1.0")  Jory Lafaye committed Aug 19, 2011 82 83 ENDIF(USE_LSSOL)  mnaveau committed Oct 31, 2016 84 OPTION(USE_QUADPROG "Do you want to use the solver eigen-quadprog?" ON)  Olivier Stasse committed Jul 22, 2019 85 OPTION(BUILD_TESTING OFF)  Olivier Stasse committed Jul 22, 2019 86   mnaveau committed Oct 31, 2016 87 88 89 90 IF(USE_QUADPROG) ADD_REQUIRED_DEPENDENCY("eigen-quadprog >= 1.0.0") ENDIF(USE_QUADPROG)  Thomas Moulard committed Nov 08, 2010 91 # Add aggressive optimization flags in release mode.  olivier-stasse committed Mar 11, 2011 92 93 IF(CMAKE_COMPILER_IS_GNUCXX) SET (CMAKE_CXX_FLAGS_RELEASE  mnaveau committed Jan 25, 2016 94  "-O3 -DNDEBUG ")  Olivier Stasse committed Mar 17, 2018 95 96 # SET (CMAKE_CXX_FLAGS # "-std=c++0x")  olivier-stasse committed Mar 11, 2011 97 ENDIF(CMAKE_COMPILER_IS_GNUCXX)  Thomas Moulard committed Oct 04, 2010 98   olivier-stasse committed Nov 17, 2010 99 100 101 102 103 104 105 106 107 108 109 #IF(CMAKE_COMPILER_IS_GNUCXX) # SET (CMAKE_CXX_FLAGS_RELEASE # "-O3 -funroll-loops -frerun-loop-opt -fschedule-insns2") # SET (CMAKE_CXX_FLAGS_RELEASE # "${CMAKE_CXX_FLAGS_RELEASE} -frerun-cse-after-loop -falign-functions") # SET (CMAKE_CXX_FLAGS_RELEASE # "{CMAKE_CXX_FLAGS_RELEASE} -falign-labels -falign-loops -falign-jumps") # SET (CMAKE_CXX_FLAGS_RELEASE # "{CMAKE_CXX_FLAGS_RELEASE} -fexpensive-optimizations") #ENDIF(CMAKE_COMPILER_IS_GNUCXX)  olivier-stasse committed Nov 10, 2010 110 # Define the set of headers to be exported  Thomas Moulard committed Nov 08, 2010 111 112 113 SET(\${PROJECT_NAME}_HEADERS include/jrl/walkgen/patterngeneratorinterface.hh include/jrl/walkgen/pgtypes.hh  mnaveau committed Apr 14, 2016 114  include/jrl/walkgen/pinocchiorobot.hh  Thomas Moulard committed Nov 08, 2010 115 116 )  olivier-stasse committed Nov 10, 2010 117 # Define subdirectories to explore for cmake  Thomas Moulard committed Nov 08, 2010 118 ADD_SUBDIRECTORY(src)  Thomas Moulard committed Nov 08, 2010 119 ADD_SUBDIRECTORY(tests)  Thomas Moulard committed Oct 04, 2010 120   olivier-stasse committed Nov 10, 2010 121 122 123 124 # Generate dependency to jrl-walkgen in pc file PKG_CONFIG_APPEND_LIBS("jrl-walkgen") # Ask to generate the final steps.  Thomas Moulard committed Nov 08, 2010 125 SETUP_PROJECT_FINALIZE()  olivier-stasse committed Nov 16, 2010 126 SETUP_PROJECT_CPACK()