diff options
author | Brad King <brad.king@kitware.com> | 2012-12-06 14:59:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-12-07 14:51:19 (GMT) |
commit | 711b63f7e095992d6ab84063af076d23a916b1f3 (patch) | |
tree | 416a696ab99e6cf27ec76607c73704e43049b44d /Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt | |
parent | d5ac791366595be307896e9894c66815c1e1eb2f (diff) | |
download | CMake-711b63f7e095992d6ab84063af076d23a916b1f3.zip CMake-711b63f7e095992d6ab84063af076d23a916b1f3.tar.gz CMake-711b63f7e095992d6ab84063af076d23a916b1f3.tar.bz2 |
Add policy CMP0019 to skip include/link variable re-expansion
Historically CMake has always expanded ${} variable references in the
values given to include_directories(), link_directories(), and
link_libraries(). This has been unnecessary since general ${}
evaluation syntax was added to the language a LONG time ago, but has
remained for compatibility with VERY early CMake versions.
For a long time the re-expansion was a lightweight operation because it
was only processed once at the directory level and the fast-path of
cmMakefile::ExpandVariablesInString was usually taken because values did
not have any '$' in them. Then commit d899eb71 (Call
ExpandVariablesInString for each target's INCLUDE_DIRECTORIES,
2012-02-22) made the operation a bit heavier because the expansion is
now needed on a per-target basis. In the future we will support
generator expressions in INCLUDE_DIRECTORIES with $<> syntax, so the
fast-path in cmMakefile::ExpandVariablesInString will no longer be taken
and re-expansion will be very expensive.
Add policy CMP0019 to skip the re-expansion altogether in NEW behavior.
In OLD behavior perform the expansion but improve the fast-path
heuristic to match ${} but not $<>. If the policy is not set then warn
if expansion actually does anything. We expect this to be encountered
very rarely in practice.
Diffstat (limited to 'Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt')
-rw-r--r-- | Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt b/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt new file mode 100644 index 0000000..03faef9 --- /dev/null +++ b/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt @@ -0,0 +1,40 @@ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0019 is not set: Do not re-expand variables in include and link + information. Run "cmake --help-policy CMP0019" for policy details. Use + the cmake_policy command to set the policy and suppress this warning. + + The following variable evaluations were encountered: + + Evaluated directory INCLUDE_DIRECTORIES + + /usr/include/\${VAR_INCLUDE};/usr/include/normal + + as + + /usr/include/VAL_INCLUDE;/usr/include/normal + + Evaluated target some_target INCLUDE_DIRECTORIES + + /usr/include/\${VAR_INCLUDE};/usr/include/normal + + as + + /usr/include/VAL_INCLUDE;/usr/include/normal + + Evaluated link directory + + /usr/lib/\${VAR_LINK_DIRS} + + as + + /usr/lib/VAL_LINK_DIRS + + Evaluated link library + + \${VAR_LINK_LIBS} + + as + + VAL_LINK_LIBS + +This warning is for project developers. Use -Wno-dev to suppress it.$ |