Martinsos / edlib

Lightweight, super fast C/C++ (& Python) library for sequence alignment using edit (Levenshtein) distance.
http://martinsos.github.io/edlib
MIT License
493 stars 162 forks source link

Updated CMakeLists for easier project integration #97

Closed rvaser closed 6 years ago

rvaser commented 6 years ago

TravisCI and AppVeyor builds passed.

Martinsos commented 6 years ago

Thanks @rvaser, seems like a nice improvement, it will be great if this makes usage of edlib easier in cmake projects!

I don't have that much experience with cmake: could you please explain a little bit how this makes it easier to use edlib in cmake projects? Actually, I think it would be great if you could add an example to the README -> example/explanation of how another cmake project can easily use edlib. It is best if you also make it a part of this PR.

I had a lot of rambling about c++11 in this comment but I removed it all since it was confusing, and left only comment in the code, check it out!

rvaser commented 6 years ago

Hi Martin, I just wanted to add target_include_directories to your CMakeLists, but happened to remove the macro as well as it seemed unnecessary. I am up for any solution, both setting the compiler flags and setting the standard work for me.

The command target_include_directories lets you specify include directories while compiling some target. For example, if you include edlib as a submodule into a new project with the command add_subdirectory(edlib) and link the static library (or shared), the target_include_directories will add edlib/include to the new project's include path automatically. I will update the usage section of README with a CMake example.

Martinsos commented 6 years ago

Got it, I think this is an awesome addition! Looking forward to seeing that section in README, as I will also learn from it how to use that feature of CMAKE :) -> I don't know much about nicely including other projects in it. Ok, I think you did a good job removing the macro, but let's just replace the setting of compiler of flags with this little bit more standard approach (which also brings additional restrictions/rules).

Martinsos commented 6 years ago

Awesome, that is it! Nice README explanation. I merged it into master, thanks :).