ThomasMonkman / filewatch

File watcher in c++
MIT License
436 stars 73 forks source link

Improve cmake integration #47

Open arsdever opened 7 months ago

arsdever commented 7 months ago

In case the user wants to have your lib as a submodule, they need to add the folder in the include directories directly

target_include_directories(target PRIVATE path_to_filewatch)

which does work but looks a bit like a workaround.

Another approach commonly used (to my observation) is to create an imported target and use it

add_library(filewatch INTERFACE IMPORTED)
target_include_directories(filewatch PUBLIC path_to_filewatch)

and use it as the import target.

The PR implements something like the last one, but instead directly in the library, giving the user the ability to simply do the following

target_link_libraries(my_target PRIVATE filewatch::filewatch)
ThomasMonkman commented 6 months ago

Thank you for your work :) and I'm right in assuming this is backwards compatible?

arsdever commented 6 months ago

Thank you for your work :) and I'm right in assuming this is backwards compatible?

I don't see a reason for this to break backward compatibility.