UseJava.cmake: fully use cmake_parse_arguments in add_jar

Modify add_jar to fully use named arguments, rather than cmake
variables, for specifying output names/directories, etc. For backward
compatibility, the old variables are still honored if set, although
named arguments will override them.
file: Add GENERATE command to produce files at generate time

The idea is to write to a temp file which contains generator
expressions, and at generate time, evaluate the generator expressions,
and write the result to a file.

Because executables on Windows are limited in the length of command line
it is possible to use, it is common to write command line arguments to a
file instead and specify the file as a source of arguments.

This new FILE(GENERATE) subcommand allows the use of generator
expressions to create such files so that they can be used with
add_custom_command for example.
Tests/CompileDefinitions: Avoid spaces in defines on VS 6

The VS 6 IDE does not like spaces in definition values so CMake drops
them and warns.  The Tests/CompileDefinitions test C code that looks for
the dropped definitions already knows to skip them, but CMake still
warns.  Silence the warnings by avoiding such values in the first place
on VS 6.
FindProtobuf: also find pthread

Modify FindProtobuf.cmake to find the pthread library on UNIX platforms,
and to add the same to PROTOBUF_LIBRARIES, as this is a link dependency
of libraries using the protobuf headers.
ExternalData: Do not re-stage staged object files

The ExternalData_LINK_CONTENT option tells ExternalData to convert real
data files it finds into content links and to "stage" the original
content in a ".ExternalData_<algo>_<hash>" file.  However, after a data
object has been staged it is possible that a user-provided pattern in
the "REGEX:" option will later match the staged object file.  We must
not process staged object files even when a user pattern matches them.

Fix the implementation to not match a staged object file as a normal
data file for conversion.  Extend the RunCMake.ExternalData test to
cover this case.
try_compile: Fix quoting of libraries in generated CMakeLists.txt

Since commit 236133e7 (Handle targets in the LINK_LIBRARIES of
try_compile, 2013-02-09) libraries passed to the new LINK_LIBRARIES
option of try_compile are not quoted inside the generated CMakeLists.txt
file.  Quote the library names so they re-parse correctly when loaded by
CMake to configure and generate the test project.

Reported-by: Bogdan Cristea <cristeab@gmail.com>
Merge topic 'use-java-use-parse-arguments'

81b5fb5 UseJava.cmake: fully use cmake_parse_arguments in add_jar
Merge topic 'genex-generate-file'

b983a58 file: Add GENERATE command to produce files at generate time
Merge topic 'silence-vs6-warnings'

015309f Tests/CompileDefinitions: Avoid spaces in defines on VS 6
Merge topic 'fix-protobuf-threads'

8961c4b FindProtobuf: also find pthread
Merge topic 'ExternalData-no-re-stage'

c35961b ExternalData: Do not re-stage staged object files
Merge topic 'fix-try_compile-library-spaces'

e65ef08 try_compile: Fix quoting of libraries in generated CMakeLists.txt