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

Enable easier project inclusion with cmake #95

Closed rvaser closed 6 years ago

rvaser commented 6 years ago

Hi Martin, please consider using the following commands in order to include your library in other projects that use cmake (via the add_subdirectory(path) command) much easier:

target_include_directories(edlib PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/edlib/include>
    $<INSTALL_INTERFACE:include>)
target_include_directories(edlib_static PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/edlib/include>
    $<INSTALL_INTERFACE:include>)

They will add the right path of 'edlib.h' while compiling. Add them after library creation and remove the include_directories(edlib/include) command.

Best regards, Robert

Martinsos commented 6 years ago

Thanks @rvaser! I will take a look at it when I get more time. If you want you can also create a PR, that would be even better :).

Martinsos commented 6 years ago

Done with #97, thanks @rvaser!