c++ - CMake dependency on defined (preprocessor) header file -
i have configuration file setup defines correct header files include components. later include file via preprocessor token. unfortunately cmake's dependency scanner ignores header file.
essentially comes down this:
#define header_file "somefile.h" #include header_file
cmake not add "somefile.h"
list of dependencies source file!
how can cmake recognize dependency correctly?
(i know can #if 0 blocks , include files, either includes many dependencides other sources, or defeats whole purpose in first place -- depending on how it)
you can add explicit dependency source file setting object_depends
property:
set_property(source source.cpp append property object_depends "somefile.h")
you'll have source file includes configuration file.
Comments
Post a Comment