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
andSET
). While not wrong, it is inconsistent. - Why do you have the users set an
EIGEN3_INCLUDE_DIR
, and alsofind_package
Eigen? If you can properly runfind_package
shouldn'tEIGEN_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.
Agreed with your comments. I have to remove that Eigen version requirement in order to compile
@jarvisschultz @paulyang1990
I've written a little patch. Is it OK?
I noticed two things:
- @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?
- 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