7378792 if: Add test for IS_DIRECTORY
4ab10e0 Merge branch 'master' into fix-FileIsDirectory-SEGV
045d6ae KWSys: Fix SystemTools::FileIsDirectory with long paths (#14176)
Extract upstream KWSys using the following shell commands.
$ git archive --prefix=upstream-kwsys/ 725e541e | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' f4928d44..725e541e
Brad King (1):
9fd64779 SystemTools: Fix FileIsDirectory with long paths
Rolf Eike Beer (3):
e8269442 Tests: fix a warning with acc
87abd647 SystemInformation: fix truncation warnings
039d9598 fix warnings about sizeof() return value truncation
Change-Id: I1c459346a622610eac62dfcd3abd0e73c5a83494
Add a RunCMake.if test to cover if() command behavior. Start with a
test for IS_DIRECTORY cases with an existing directory and a long path,
both with a trailing slash.
Allocate a buffer large enough to hold the input path when removing a
trailing slash. Use a local stack buffer when it is large enough and
fall back to heap allocation otherwise.
Since commit 0d46e9a0 (Store includes from the same include_directories
call together., 2013-01-20) we accidentally use such entries. Fix the
code to drop them instead. Update the IncludeDirectories test to cover
this case.
Reported-by: Christophe Giboudeaux <cgiboudeaux@gmx.com>
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>
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.
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.
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.
The variables in this module are used to configure a header file
with defines whose name depends on the name of the target.
As valid names of targets may be invalid for use as defines, convert
the names of the defines used to C identifiers first. This is already
done in C++ code for the DEFINE_SYMBOL property.
This is not as simple as ensuring that the BASE_NAME is a C identifier,
because most of the define names are configurable, and because use of
a BASE_NAME which is not a C identifier, such as 4square can become a
C identifier by specifying a prefix in the generate_export_header
macro.
They can't be used when evaluating link libraries, but they can be
used for include directories and compile definitions. Later they can
be used for compile options.
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.
The significant issue with MODULEs is that on Windows, the exported
symbols must be dllexported and they are not imported.
In other export macro implementations this is done by defining an
export macro outside of any ifdef which depends on definitions set
on the command line. However, with cmake we already expect the
DEFINE_SYMBOL to be defined, so the regular EXPORT macro can be
used by such plugins.
The parent commit added a empty_entry_test shared library to the
IncludeDirectories test. Some toolchains fail to create a shared
library with no user-defined symbols, so provide a dummy symbol.
Since commit c519bb2b (XCode: Also qoute [] as needed to set
build-configurations, 2011-04-05) we escape "[]" conditions for
XCODE_ATTRIBUTE_ settings. However, we need to handle the "variant"
condition with a special case to map it only into the settings for the
matching configuration.
a7ba452 Add the JOIN generator expression.
96ec314 Make it possible for any genex to have arbitrary content at the end.
bd638ee Rename the method determining if a genex accepts arbitrary content.
dc742fe Extract the ProcessArbitraryContent method.