Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block. This is no longer the preferred style.
Run the following shell code:
for c in else endif endforeach endfunction endmacro endwhile; do
echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
All commands accepting file paths should normalize the slashes so that
the string-represented names can be compared reliably. The commands
add_library and add_executable have done this for years. We taught
add_custom_command to normalize its OUTPUT names in commit a75a0a14
(Normalize add_custom_command OUTPUT names, 2010-12-15). We handled a
special case of the DEPENDS option in commit 7befc007 (Handle trailing
slashes on add_custom_command DEPENDS, 2011-01-26).
Teach both add_custom_command and add_custom_target to normalize slashes
of DEPENDS files up front. This approach subsumes the above-mentioned
special case so remove the one line added for it but keep its test.
Extend the CustomCommand test to check that slash count mismatches
between custom command OUTPUT and DEPENDS can still be linked correctly.
4499d50 Mark CustomCommand test perconfig.out as SYMBOLIC
f0cdb60 Introduce "generator expression" syntax to custom commands (#11209)
4749e4c Record set of targets used in cmGeneratorExpression
ef9e9de Optionally suppress errors in cmGeneratorExpression
45e1953 Factor per-config sample targets out of 'Testing' test
4091bca Factor generator expression docs out of add_test
bfb7288 Record backtrace in cmCustomCommand
Evaluate in the COMMAND arguments of custom commands the generator
expression syntax introduced in commit d2e1f2b4 (Introduce "generator
expressions" to add_test, 2009-08-11). These expressions have a syntax
like $<TARGET_FILE:mytarget> and are evaluated during build system
generation. This syntax allows per-configuration target output files to
be referenced in custom command lines.
Previously the OUTPUT arguments of add_custom_command were not
slash-normalized but those of add_library and add_executable were.
This caused the example
add_custom_command(OUTPUT a//b.c ...)
add_library(... a//b.c ...)
to fail at build time with "no rule to make a/b.c". Fix this and modify
the CustomCommand test to try it.
A custom command may name a target created by add_custom_target in its
DEPENDS field. Treat this case as a target-level dependency only since
a custom target provides no standard file on which to add a file-level
dependency.
Test still failing on dash1.kitware. Give up on testing
the new arg on MSVC71. Test it with newer nmakes instead.
All other dashboards are fine with -DPATH=c:/posix/path
as the first arg, so keep it except when MSVC71 is true.
The new first arg in the test is the critical one
to prove that the new NMake specific code works.
The additional colons in the middle of the arg
stream work fine everywhere else, but not on
dash1.kitware with Visual Studio 7.1. Just avoid
the failure for now by removing the unnecessary
new args from the test.
The nightly dashboard showed that the following
platforms had difficulties dealing with "bin dir"
and/or "check command line" as directory and
file names:
AIX
Borland 5.5, 5.6 and 5.8
IRIX
NMake 6.0
OpenBSD
VS 7.1
Watcom
Re-visit later, after the release, to use spaces
in the bin dir and in the target name where possible.
The solution seems hackish, but it works: for
NMake only, prepend a no-op command before each
real command that begins with ".
This is really a work-around for an NMake problem.
When a command begins with ", nmake truncates the
first argument to the command after the first :
in that arg. It has a parsing problem.
Workaround..., hackish..., but it should solve
the issue for #9963 and its related friends.
Also, modify the CustomCommand test to replicate
the problem reported in issue #9963. Before the
NMake specific code change, the test failed.
Now, it passes. Ahhhhhh.
On Windows the KWSys System package generates escapes for command-line
arguments. This fix enables quoting of the empty string as an argument.
This also adds a test to pass an empty argument to a custom command.
This adds a SOURCES option to ADD_CUSTOM_TARGET, enabling users to
specify extra sources for inclusion in the target. Such sources may not
build, but will show up in the IDE project files for convenient editing.
See issue #5848.
As of CMake 2.6 a custom command output specified by relative path is
placed in the build tree. This adds a test to make sure other
references to the output are hooked up correctly, fixing a bug in CMake
2.6.1.
- Option was recently added but never released.
- Custom commands no longer depend on build.make so we do
not need the option.
- Rule hashes now take care of rebuilding when rules change
so the dependency is not needed.
- Allows make rules to be created with no dependencies.
- Such rules will not re-run even if the commands themselves change.
- Useful to create rules that run only if the output is missing.
add_custom_target() as COMMAND, and cmake will recognize them and replace
them with the actual output path of these executables. Also the dependency
will be added automatically. Test included.
ENH: moved TraceVSDependencies() to the end of GlobalGenerator::Configure(),
so it is done now in one central place
Alex