diff options
Diffstat (limited to 'Source/cmAddSubDirectoryCommand.cxx')
-rw-r--r-- | Source/cmAddSubDirectoryCommand.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 83d6306..6a2ab0b 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -26,6 +26,7 @@ bool cmAddSubDirectoryCommand(std::vector<std::string> const& args, std::string binArg; bool excludeFromAll = false; + bool system = false; // process the rest of the arguments looking for optional args for (std::string const& arg : cmMakeRange(args).advance(1)) { @@ -33,6 +34,10 @@ bool cmAddSubDirectoryCommand(std::vector<std::string> const& args, excludeFromAll = true; continue; } + if (arg == "SYSTEM") { + system = true; + continue; + } if (binArg.empty()) { binArg = arg; } else { @@ -40,6 +45,11 @@ bool cmAddSubDirectoryCommand(std::vector<std::string> const& args, return false; } } + // "SYSTEM" directory property should also affects targets in nested + // subdirectories. + if (mf.GetPropertyAsBool("SYSTEM")) { + system = true; + } // Compute the full path to the specified source directory. // Interpret a relative path with respect to the current source directory. @@ -102,7 +112,7 @@ bool cmAddSubDirectoryCommand(std::vector<std::string> const& args, binPath = cmSystemTools::CollapseFullPath(binPath); // Add the subdirectory using the computed full paths. - mf.AddSubDirectory(srcPath, binPath, excludeFromAll, true); + mf.AddSubDirectory(srcPath, binPath, excludeFromAll, true, system); return true; } |