icub-tech-iit / ergocub-gazebo-simulations

Repository containing the models and the simulations for ergoCub
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Explicitly pass LANGUAGES NONE to CMake's project invocation #30

Closed traversaro closed 2 years ago

traversaro commented 2 years ago

To test https://github.com/icub-tech-iit/ergocub-gazebo-simulations/issues/29 I was installing the project in a context without any C++ compiler installed (as it commonly happens to a system used by a mechanical engineer or electronic engineer) and the cmake . failed with error:

(ergocubgazebosim) C:\src\ergocub-gazebo-simulations\build>cmake -GNinja -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library .
.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:8 (project):
  No CMAKE_C_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:8 (project):
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!

However, no C++ compiler is actually necessary in this project, so we can simply tell CMake that no languages are used in the project (as opposed to the default C and C++) so it can be used also in a system with no C++ compilers.

Nicogene commented 2 years ago

Merged, thanks!