mayataka/robotoc

CMake version must be newer than 3.11

ssr-yuki opened this issue · 1 comments

Hi. I found that this software requires CMake newer than 3.11 for the python binding.

As shown below, in building the python binding, CMake uses FetchContent module.

include(FetchContent)
FetchContent_GetProperties(pybind11)
if(NOT pybind11_POPULATED)
FetchContent_Populate(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11.git
GIT_TAG master
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/pybind11
SUBBUILD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/pybind11-build)
endif()

While this FetchContent module appears after version 3.11 (please see the 5th content of the CMake 3.11 Release Notes / Modules), the version requirement is still >=3.1.

cmake_minimum_required(VERSION 3.1)

I recommend you to set the minimum required version to 3.11 or higher


In my environment (Ubuntu 18.04 + default CMake (3.10.2)), a CMake error occurs (the error message is shown below), and updating CMake to the latest (3.22.2) resolves it.

$ cmake .. -DCMAKE_BUILD_TYPE=Release -DOPTIMIZE_FOR_NATIVE=ON
-- pinocchio FOUND. pinocchio at /opt/openrobots/lib/libpinocchio.so
-- boost_filesystem FOUND. boost_filesystem at /usr/lib/x86_64-linux-gnu/libboost_filesystem.so
-- boost_serialization FOUND. boost_serialization at /usr/lib/x86_64-linux-gnu/libboost_serialization.so
-- boost_system FOUND. boost_system at /usr/lib/x86_64-linux-gnu/libboost_system.so
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   filesystem
--   serialization
--   system
-- hpp-fcl FOUND. hpp-fcl at /opt/openrobots/lib/libhpp-fcl.so
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   chrono
--   serialization
--   system
-- Default C++ standard: 201402
-- C++ standard sufficient: Minimal required 11, currently defined: 11
-- C++ standard sufficient: Minimal required 11, currently defined: 11
-- Found OpenMP_CXX: -fopenmp  
-- Found OpenMP: TRUE   
CMake Error at bindings/python/CMakeLists.txt:1 (include):
  include could not find load file:
    FetchContent

CMake Error at bindings/python/CMakeLists.txt:2 (FetchContent_GetProperties):
  Unknown CMake command "FetchContent_GetProperties".

-- Configuring incomplete, errors occurred!

References: CMake error "include could not find load file: FetchContent" - stackoverflow

Thank you for reporting the issue.
It is a title a bit curious for me because CI for Ubuntu 18.04 passes with python bindings. (CMake is installed with build-essentials. Perhaps it is newer than the default CMake version for Ubuntu 18.04.)
Anyway, I'll consider replacing FetchContent with submodule of pybind11.