pageldev / libOpenDRIVE

Small, lightweight C++ library for handling OpenDRIVE files
Apache License 2.0
388 stars 136 forks source link

fix: make compatible with FetchContent_Declare #82

Closed alexkutsan closed 1 year ago

alexkutsan commented 1 year ago

I was trying to use this lib and faced with issue setting up dependency with

include(FetchContent)
FetchContent_Declare(
    libOpenDRIVE
    GIT_REPOSITORY https://github.com/grepthat/libOpenDRIVE.git
)
FetchContent_MakeAvailable(libOpenDRIVE)/

This small patch fixes it.

pageldev commented 1 year ago

Can you add some further explanation what this changes and why it's necessary? I think this might break the build for other setups / people.

pageldev commented 1 year ago

Sry, I didn't know about what CMAKE_CURRENT_SOURCE_DIR vs CMAKE_SOURCE_DIR implies here. Your change also fixes using this library in other CMake projects via add_subdirectory.