Is Cmake set variable recursive?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to modify compiler flags for all the directories below a certain directory (i.e. for all the current directories subdirectories and all their subdirectories recursively). So I found here there is two ways: add_directory ( dir1 ) # ... add_directory ( dirN ) add_compile_options ( flag1 flag2 ...) # or for CMake versions The man page for add_compile_options is very clear in stating that the effect will be "current directory and below" (which is what I want) but for set(CMAKE_CXX_FLAGS ...) I am not so sure. Is Cmake set