Closed CvRXX closed 5 years ago
In the provided example:
To avoid confusion and potential errors add_subdirectory(deps/hwlib)
should be
include_directories(deps/hwlib)
since add_subdirectory can't include non-descendant folders.
I totaly agree with the comment on the example, if there are no other problems. @wovo can you merge?
@JulianvDoorn This is not correct actually, add_subdirectory
adds a folder where cmake will look for cmake files to find targets and libraries. include_directories
will find header files (like example.hpp
). So one should use add_subdirectory
.
This Cmake files makes it possible to add hwlib as a Cmake library. This could work as followed:
This will then take care of all the necessary includes and build steps.