nimbuscontrols / EIPScanner

Free implementation of EtherNet/IP in C++
https://eipscanner.readthedocs.io/en/latest/
MIT License
244 stars 99 forks source link

CMake: Accommodate using add_subdirectory() #87

Closed JohannesKauffmann closed 2 years ago

JohannesKauffmann commented 2 years ago

When the library is included in other projects with add_subdirectory(), CMAKE_SOURCE_DIR does not point to our root anymore, but that of the superbuild. This causes incorrect include directories.

To fix this, use CMAKE_CURRENT_LIST_DIR, which always points to EIPScanner-root/src.

For consistency, purge the remaining usage of CMAKE_SOURCE_DIR. PROJECT_SOURCE_DIR always points to the EIPScanner-root.