Commit Graph

477 Commits

Author SHA1 Message Date
Brad King 45d2966dcc VS: Avoid leaking child process output back to IDE (#14266)
The VS IDE sets the environment variable VS_UNICODE_OUTPUT when
executing build rules in order to tell MS tools to report output through
a back door instead of through stdout/stderr.  Unset this variable so
that CMake can capture or properly redirect all output from processes it
runs even when running inside a VS IDE build environment.

This generalizes the special cases fixed by commit 80d045b0 (When
GetPrerequisites.cmake runs dumpbin while running inside the VS IDE...,
2008-05-01) and commit 44aff73d (ExternalProject: Avoid bleed-through
output when logging, 2011-01-06), so drop special handling of
VS_UNICODE_OUTPUT in those instances.
2013-07-16 13:48:10 -04:00
Brad King 357db89d27 Merge topic 'make-depends-collapse-paths'
551d334 cmDependsC: Collapse relative include paths
2013-07-02 09:03:52 -04:00
Pavel Shramov 551d3343cd cmDependsC: Collapse relative include paths
While calculating dependencies collapse sequences such as

 ../../../a/b/c/../../d/e/../../e/f

to avoid total path lengths over the Windows path length limit as much
as possible.
2013-06-26 10:14:31 -04:00
Brad King c1631efa0e Merge topic 'version-compare-genex'
e605528 Add generator expressions for version comparision.
48bb48e De-duplicate version comparison code.
2013-06-26 09:02:49 -04:00
Stephen Kelly 2331b57bec Add whitespace after colons in error messages. 2013-06-21 16:21:44 +02:00
Stephen Kelly 48bb48e114 De-duplicate version comparison code.
Extend the VersionCompare in cmSystemTools to handle 8 components,
and port the if command to use that.
2013-06-12 14:09:36 +02:00
Clinton Stimpson ff01f8b600 OS X: Improvements for getting install name of dylib.
In the case of a multi-arch dylib where none of the architectures
is the host architecture, otool -D returned multiple install names.
2013-06-05 21:31:11 -06:00
Clinton Stimpson 94e7fef226 OS X: Add RPATH support for Mac.
RPATH support is activated on targets that have the MACOSX_RPATH
property turned on.
For install time, it is also useful to set INSTALL_RPATH to help
find dependent libraries with an @rpath in their install name.

Also adding detection of rpath conflicts when using frameworks.
2013-06-03 09:42:05 -04:00
Petr Kmoch 674f918a1a cmSystemTools: Generalize TrimWhitespace to all whitespace
Modify cmSystemTools::TrimWhitespace() to remove all leading and
trailing whitespace, not just spaces.
2013-03-27 08:46:55 -04:00
Brad King 59b568e5e8 Fix cmSystemTools::RenameFile race on Windows
Since commit d46d8df0 (Re-implemented cmGeneratedFileStream to look like a
real stream and replace the destination file atomically, 2004-11-03) our
RenameFile implementation tries to deal with MoveFile not replacing
read-only files.  In order to avoid the Get/SetFileAttributes pair we used
stat to test for existence of the destination file.  This has a race in
which the destination could be created between the test for existence and
the MoveFile call.

Remove the stat call and use GetFileAttributes to detect whether the file
exists.  This shortens the race but does not eliminate it.  Use a loop to
try multiple times in case we lose the race.  While at it, drop Win9x
support and always use MoveFileEx.
2013-02-04 15:15:21 -05:00
Brad King 4046fc0104 Merge topic 'use-cmsys-auto_ptr'
ddc0520 Always use the auto_ptr from cmsys.
2012-11-27 13:34:25 -05:00
David Cole 37c34d7d7b CMake: Fix infinite loop untarring corrupt tar file
Suggested-by: Robert Maynard <robert.maynard@kitware.com>
2012-11-26 11:54:38 -05:00
Stephen Kelly ddc052052b Always use the auto_ptr from cmsys.
This is for consistency throughout cmake. The cmsys version exists
becaues uses of auto_ptr types as return types does not work with
some implementations in ancient compilers.
2012-11-21 00:56:36 +01:00
David Cole c75f404065 Merge topic 'kwsys-environ-cleanup'
e48796b KWSys: Fix SystemTools environment memory handling (#13156)
b10c5cb CTest: Simplify environment save/restore
2012-05-01 14:09:12 -04:00
David Cole fd1788294d Merge topic 'mac_environ'
a90d478 [OSX] Fixed undefined symbol when linking CMakeLib into shared library
2012-04-25 14:00:22 -04:00
Brad King b10c5cbb87 CTest: Simplify environment save/restore
Replace use of AppendEnv/RestoreEnv pairs with instances of
SaveRestoreEnvironment.  Simplify the signature of AppendEnv and use it
in place of similar loops elsewhere.  Move the RestoreEnv implementation
inside the SaveRestoreEnvironment destructor which is the only place
left that calls it.
2012-04-24 16:56:14 -04:00
Konstantin Tokarev a90d47890f [OSX] Fixed undefined symbol when linking CMakeLib into shared library 2012-03-03 19:33:35 +04:00
David Cole bada88e8e4 Merge branch 'target-include-directories' into ninja-generator 2012-02-22 16:21:48 -05:00
David Cole e65f39a59e Merge topic 'interrupt-bug-12649'
131eed6 cmake-gui: Improve interrupt granularity to fix bug 12649.
2012-02-14 16:14:35 -05:00
Peter Collingbourne 2cd36550b0 Add cmSystemTools::TrimWhitespace function 2012-02-02 23:04:38 +00:00
Clinton Stimpson 131eed6607 cmake-gui: Improve interrupt granularity to fix bug 12649.
Instead of enabling interrupt only when a progress or message callback is called, add a new callback specifically for
interrupt.  This new callback is called from GetFatalErrorOccured() so cmake-gui can immediately report interrupt status
instead of calling queuing a call to cmSystemTools::SetFatalErrorOccured() and waiting for the progress or message
callback to be called to process that queued call.
2012-01-02 11:07:43 -07:00
Brad King ffdb37a4f7 Handle libarchive API change in archive_read_data_block
The offset argument type depends on the libarchive version.
2011-12-22 10:52:03 -05:00
Brad King ed7cef5634 Factor Compute(File|String)MD5 into cmCryptoHash helper
Define an abstract API around the backend hash algorithm.  Expose
ifstream errors to HashFile callers.  Always try opening the file.
Succeed only if the end of file is reached without error.
2011-11-16 10:14:53 -05:00
Brad King a343bc1c76 RunSingleCommand: Avoid assignment in condition
Several compilers warn about this case even when an extra layer of
parenthesis surrounds the assignment.  Make the condition explicit.
2011-07-28 10:43:11 -04:00
Johan Björk 642f10066a RunSingleCommand: Add a OUTPUT_NORMAL flag.
OUTPUT_NORMAL does no processing of the output streams, it just passes
them through the same streams as they were received on.
2011-07-28 10:43:09 -04:00
Johan Björk 856a9e499f RunSingleCommand: Replace verbose boolean with enum
No behaviour change, this prepares for adding a flag to skip the merging
of output streams.
2011-07-28 10:42:03 -04:00
Brad King 4096066723 RunSingleCommand: Fix indentation 2011-07-28 10:28:52 -04:00
Brad King acd2f84cc0 cmSystemTools: Remove trailing whitespace 2011-07-28 10:23:13 -04:00
Brad King 98dc13e513 Merge topic 'xcode-source_groups-folders-issue-10039'
f09ba0f Fix style errors added by parent and grandparent
eeeeca1 XCode: Support target folders on XCode.
59ed84e Xcode: Support multiple level nesting of XCode folders (#10039)
d0a403f CMake: Move tokenize to cmSystemTools
2011-06-08 15:44:44 -04:00
Johan Björk d0a403fd99 CMake: Move tokenize to cmSystemTools 2011-06-07 10:18:54 -04:00
Brad King 3232136fc8 Merge topic 'dont-compress-memcheck-output'
0e591ed Fix type conversion warning
9c3a0b9 We will actually compress memcheck output if the server supports it.
8024c53 Dynamic analysis test output should not be compressed.
2011-06-02 11:29:09 -04:00
Zach Mullen 9c3a0b9f14 We will actually compress memcheck output if the server supports it.
This change won't be functional until the next release of CDash due to the
version comparison.
2011-05-26 14:50:07 -04:00
Brad King e51bbc14f6 Merge topic 'output-compile-lines'
cdc2b41 Fix CompileCommandOutput test build on Windows
7039d1f Fix CompileCommandOutput test for Make tools not supporting spaces
4268e3d run_compile_commands: Cast istream::get() result to char
c45c60b run_compile_commands: Avoid extra stl vector conversion
7c5be51 run_compile_commands: Avoid shadow in std::map<>::at workaround
169bb05 Provide std::map<>::at for use in run_compile_commands
4e2185c Make std::map usage more portable in language=>flags/defines maps
a7e7a04 Fix run_compile_commands build on Apple GCC 3.3
c9174c0 Fix signed/unsigned comparison in EscapeJSON
8346a28 Only offer the compile command output feature on unix systems
0e6b05f Adds a test for the compile command line output.
5674844 make compile command output optional
fe07b05 implement cxx command output
65c0c24 cache flags and defines
3f064ef refactor flags and defines
2011-05-24 14:48:14 -04:00
Brad King 3d92c8c827 Explicitly cast time value in cmSystemTools::RandomSeed
Use static_cast to avoid warnings like

 conversion to ‘unsigned int’ from ‘__time_t’ may alter its value
 conversion to ‘unsigned int’ from ‘__suseconds_t’ may alter its value

We do not care if the value is truncated because we are looking for just
32 bits anyway.
2011-05-19 07:56:04 -04:00
Brad King eb6f461fc1 VS 6: Define _WIN32_WINNT to load wincrypt.h correctly 2011-05-18 10:09:23 -04:00
Brad King c45c60b24f run_compile_commands: Avoid extra stl vector conversion
The Sun compiler does not provide the proper vector constructor to
initialize it from an iterator pair of a non-matching type.  Extend the
ParseUnixCommandLine API to provide a vector of the proper type so no
conversion is needed.
2011-05-18 09:44:28 -04:00
Brad King e1b0a11dd4 Improve string(RANDOM) default seed
The naive time(0) seed is unique only within one second.  Instead try to
read a real source of entropy and otherwise fall back to a combination
of the process id and high-resolution time.
2011-05-17 10:07:26 -04:00
Brad King f306a357b2 Merge topic 'style-line-length'
9d21281 Fix line-too-long style errors
86025d3 file(DOWNLOAD): Fix error message formatting
2010-09-14 13:19:53 -04:00
Brad King 9d21281b7d Fix line-too-long style errors 2010-09-10 14:42:09 -04:00
David Cole 666f328858 Preserve timestamps on files on tar extract.
Conversion to libarchive changed the behavior of
cmake -E tar xzf. This commit fixes that oversight.
2010-09-09 12:57:14 -04:00
Eric NOULARD 40dc97dc73 CPack Backward-compatibly enforce DESTDIR for DEB and RPM 2010-08-23 16:14:40 +02:00
Brad King cb9ea2647f Remove cmSystemTools::EscapeSpaces method
The last remaining call to this method exists only for compatibility.
Remove the method and put its implementation inline in place of the last
call.
2010-08-18 10:26:05 -04:00
Eric NOULARD b50c15915a Add ZIP archive format and LZMA compress support to libarchive-wrapper
This will be needed to use cmArchiveWrire in cmCPackArchiveGenerator
with the same feature set as before. Note that adding zip
support to libarchive-wrapper would also makes it easy to add
a new -E zip command to cmake commands.
2010-08-13 17:49:47 +02:00
Brad King 1b5b2ed3b2 Include entries for directories in tarballs (#11020)
Use libarchive through class cmArchiveWrite to implement the method
cmSystemTools::CreateTar.  The class includes entries for directories by
automatically traversing the tree on disk.
2010-08-06 11:38:14 -04:00
Brad King 3296e6ad90 Include headers from chosen libarchive (#10923)
When CMAKE_USE_SYSTEM_LIBARCHIVE is on we must include the system
libarchive headers to match the library that will be linked.
2010-08-05 17:06:10 -04:00
Brad King ff1f8d0b53 Fix or cast more integer conversions in cmake
These were revealed by GCC's -Wconversion option.  Fix types where it is
easy to do so.  Cast in cases we know the integer will not be truncated.
2010-06-29 09:52:12 -04:00
Brad King 6fc4cd8680 Fix or cast integer conversions in cmake
These were revealed by GCC's -Wconversion option.  Fix types where it is
easy to do so.  Cast in cases we know the integer will not be truncated.
2010-06-25 09:05:15 -04:00
Brad King fdb5f78705 CPack: Try harder to remove temporary dir (#10793)
Windows filesystems sometimes lock files temporarily.  Try removing the
CPack temp install folder multiple times before giving up.
2010-06-04 14:32:08 -04:00
Brad King ea62d6973b Do not list file names during 'cmake -E tar xz'
Since commit "Switch to using libarchive from libtar" (2009-10-30) the
the implementation of "tar xz" has printed all paths from the tarball as
a single line with no separator.  This fixes the logic to extract
silently as expected.
2010-05-05 14:44:36 -04:00
David Cole 10a4abddfd Add missing archive_read_finish calls to fix some of the presently reported valgrind memory leaks. 2009-12-28 13:15:19 -05:00