<div dir="ltr">Hi again,<br><br>My CMakeLists.txt file for my shared library contains:<br><br>add_library(MyLib SHARED my_source.cpp etc.)<br>target_include_directories( MyLib PRIVATE ../MyHeaders)<br><br>The library builds ok, but there is no dependency on directory ../MyHeaders - touching a header file does not result in a re-compile of dependent source files.<br><br>There's a discussion here:<br><br><a href="https://stackoverflow.com/questions/13703647/how-to-properly-add-include-directories-with-cmake">https://stackoverflow.com/questions/13703647/how-to-properly-add-include-directories-with-cmake</a>  <br>Opinion seems divided over whether or not it is necessary to add the header files to the list of source files for the target, e.g.:<br><br>set(SOURCES file.cpp file2.cpp ${YOUR_DIRECTORY}/file1.h ${YOUR_DIRECTORY}/file2.h)<br>add_library(test ${SOURCES})<br><div><br></div><div>Please will you tell me what is the best practice?</div></div>