Le0nX / ModernRoboticsCpp

Modern Robotics: Mechanics, Planning, and Control C++ Library --- The primary purpose of the provided software is to be easy to read and educational, reinforcing the concepts in the book. The code is optimized neither for efficiency nor robustness. http://modernrobotics.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CMakeLists.txt issues

jarvisschultz opened this issue · comments

Just tried to compile on my Ubuntu 16.04 system, and there are a variety of issues that cause this not to compile:

  • Your cmake_minimum_required version is fairly new. Is there a reason for that? I'm guessing this project would work fine with an older CMake, and that would increase compatibility. Even Ubuntu 18.04 is only on 3.10
  • There are mixed capital letters and lowercase (e.g. set and SET). While not wrong, it is inconsistent.
  • Why do you have the users set an EIGEN3_INCLUDE_DIR, and also find_package Eigen? If you can properly run find_package shouldn't EIGEN_INCLUDE_DIRS already be set? Check out this CMakeLists.txt for a good example.
  • You specify a specific Eigen version, but I'm guessing you don't need that either. Also hurts compatibility.
  • Would probably be a good idea to compile the testing executable with CMake's add_test
  • You specify C++ 17, but you aren't using any C++17 features. C++17 requires a newer compiler, and hurts compatibility. I'd suggest specifying the minimum version you need.

Hope that helps out! Let me know if there are any questions.

commented

Agreed with your comments. I have to remove that Eigen version requirement in order to compile

commented

@jarvisschultz @paulyang1990
I've written a little patch. Is it OK?

commented

I noticed two things:

  1. @Le0nX you commit a new file "test.cpp" to my branch instead of yours but the function is identical to my google test framework, which should we keep?
  2. In this new test.cpp file I found you use #include <eigen3/Eigen/Dense> instead of #include <Eigen/Dense>.
    Generally it is good to just use #include <Eigen/Dense> and put "eigen3/" to include path
commented

@paulyang1990 Thank you for gtest support! I've merged your tests and deleted the old one in last commit.