开发者

Ignoring a single file when using include_directories with CMake

开发者 https://www.devze.com 2023-03-02 21:46 出处:网络
is there anyway to tell CMake to ignore one specific header file when using includ开发者_高级运维e_directories ?

is there anyway to tell CMake to ignore one specific header file when using includ开发者_高级运维e_directories ?

Since the directories are not expanded into single files I can't just list(REMOVE_ITEM ..) the file out.

cheers Daniel


An include_directories call in CMakeLists does not result in a list of all available header-files. It simply passes those directories directly to the compiler as a search-dir for your "#include <...>" E.g. look at the documentation for the "-I" option of GCC 4.6.

In addition: I am not sure why you would want to exclude a single file. Very often you can work around a problematic header file, by creating your own header-file in your own project which includes everything except that single-file...

If you really, really want something like this and you insist on solving it with CMake, you will probably end up with file-globing all header-files, copying (without that one file of course) them manually to a new include-dir and then include that new dir.

0

精彩评论

暂无评论...
验证码 换一张
取 消