For custom commands in VS2010 Fortran projects the INTDIR variable
is different than in the rest of the solution because Intel
fortran still uses the old VS project files even in VS2010. So,
we replace $(Configuration) directly in the project files. I have also
added a FortranOnly test that tests this feature and is run on any
generator that has Fortran abilities.
We already use GetSystemTimeAsFileTime() and gettimeofday()
unconditionally on supported Windows and non-Windows platforms,
respectively. Remove outdated portability complexity.
This deterministic ordering makes it easier for a developer
comparing the ctest output of two test runs to see what changed
from run to run.
Thanks to Fraser Hutchison for the patch.
e2e8c0a Also put builtin include dirs into CodeBlocks project file
92c0dc5 Remove useless line of code
a5683f8 Patch by Campbell Barton: puts definitions into C::B project file
b62349c FeatureSummary.cmake: update documentation
f366cf8 FeatureSummary.cmake: cosmetics
f407bb5 FeatureSummary.cmake: only higher TYPEs can override previous TYPEs
02d47ab FeatureSummary.cmake: error out when a REQUIRED package is missing
91a1527 FeatureSummary.cmake: add INCLUDE_QUIET_PACKAGES keyword
0671a02 FeatureSummary.cmake: remove "comment" field
aae13f4 Extend FeatureSummary: add PURPOSE of package and TYPE
Refactor code from CMakeFindEclipseCDT4.cmake so it can be used
alkso for CodeBlocks, and move it into new file
CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake.
Alex
This macro can be used to generate basic version files which can be
installed along a Config.cmake file to provide versioning support.
This (3rd try) is implemented using a macro, which maps
the COMPATIBILITY mode to a filename and configure_file()s the
resulting file.
Alex
Since commit 85c0a69a (Cygwin: Do not define 'WIN32', 2010-12-17) WIN32
is not defined on Cygwin. Update documentation of the WIN32 variable
accordingly.
Fix NSIS template to more thoroughly use CPACK_PACKAGE_INSTALL_REGISTRY_KEY.
This allows different versions of software to have a separate sections in the
registry to keep track of things (installed components, and uninstall stuff).
Change default of CPACK_PACKAGE_INSTALL_REGISTRY_KEY to follow the value of
CPACK_PACKAGE_INSTALL_DIRECTORY so if an installation overwrites another installation,
the proper registry entries are more likely to be overwritten.
Fix CPack/NSIS generator to not insert code in the NSIS template to skip installation
of already installed components. This enables a repair like behavior and also enables
installing patch releases on top of an older installation.
Thanks to Pau Garcia i Quiles for the inspiration for the patch.
I've tweaked it a bit compared to what's in the bug tracker: this
commit does not allow empty global variable names.
I also added usage of the new feature to an existing test. Although
it has no effect on the resulting Visual Studio projects, you can
verify that the VSResource test produces a non-empty globals section
in the generated .vcproj(x) files.
4a50b5f Add a basic test for CMAKE_DISABLE_FIND_PACKAGE_<package>
a66df08 Add documentation for the CMAKE_DISABLE_FIND_PACKAGE_<Name> switch
6e1d3ed Add a switch to disable a find_package() call completely
Now found packages are not stored in ENABLED/DISABLED_FEATURES
anymore, but always in PACKAGES_FOUND/NOT_FOUND.
ENABLED/DISABLED_FEATURES is now only used via
ADD_FEATURE_INFO(), e.g. for stuff set via option().
Alex
set_property() has APPEND, which creates a list. E.g. when
appending to COMPILE_FLAGS a string is needed, not a list.
With the APPEND_STRING option the value is append as string,
not as list.
Alex
In find-package mode, cmake executes Modules/CMakeFindPackage.cmake,
which calls find_package(), and this is then evaluated in cmake.cxx,
which prints an appropriate message to stdout, so it can be used
e.g. in a normal Makefile:
$ /opt/cmake-HEAD/bin/cmake --find-package -DNAME=JPEG
-DCOMPILER_ID=GNU -DLANGUAGE=C -DMODE=EXIST
JPEG found.
$ /opt/cmake-HEAD/bin/cmake --find-package -DNAME=JPEG
-DCOMPILER_ID=GNU -DLANGUAGE=C -DMODE=COMPILE
$ /opt/cmake-HEAD/bin/cmake --find-package -DNAME=JPEG
-DCOMPILER_ID=GNU -DLANGUAGE=C -DMODE=LINK
-rdynamic -ljpeg
Alex
A common mistake when using custom commands is to list the output of a
command in multiple targets that may build in parallel. Warn against
this case in the documentation and suggest a better approach.
Update cm_sha2.[hc] from sha2.[hc] in "sha2-1.1-ALPHA.tgz" downloaded
today from
http://www.aarongifford.com/computers/sha.html
with trivial whitespace cleanup. This adds SHA-224 support.
Copy cm_sha2.[hc] from sha2.[hc] in "sha2-1.0.tar.gz" downloaded today
from
http://www.aarongifford.com/computers/sha.html
with trivial whitespace cleanup. Also fix #include to account for
rename.
8555c2b Look for VCExpress as a possible build tool as well as devenv.
ed0075b Use relative paths for custom command inputs.
38368d5 Revert "With very long file names, VS 2010 was unable to compile files."
8cd66dc Use devenv instead of msbuild for vs2010.
For source files we use full paths. This allows for longer directory
names with VS2010. However, the use of full paths causes the GUI
to not display the custom commands.
As discussed, this adds a switch CMAKE_DISABLE_FIND_PACKAGE_<name>,
which, when set to TRUE, keeps the find_package() command from executing.
When the package is REQUIRED at the same time, an error is generated.
Alex
The workaround added by commit 7e92f0b4 (Hack to make echo command work
properly in mingw32-make, 2006-10-05) and updated by commit 69356d8a
(Juse use cmake -E echo instead of the native echo, 2006-10-13) no
longer seems necessary with modern mingw32-make. Furthermore it slows
performance due to the time spent loading a cmake process instead of
plain echo.
Do not require the C language to be enabled to do lib->lib64 conversion.
The check was originally added by commit a5825cd1 (check in new find
stuff, 2006-03-02) to ensure that CMAKE_SIZEOF_VOID_P is set. Since
commit 3fdf1411 (FIND_LIBRARY should not require CMAKE_SIZEOF_VOID_P,
2008-02-11) the code following the check does not fail when the variable
is not set, so just remove the original check. This allows conversion
for any language that is enabled so long as the address size is known.
Reported-by: Christoph Höger <choeger@cs.tu-berlin.de>
1ed19bc multiarch: Set CMAKE_LIBRARY_ARCHITECTURE_REGEX for Linux|Hurd|kFreeBSD
52a6ed2 Test find_package multiarch support (#12037)
b41ad3b Teach find_(library|package) about Linux multiarch (#12037)
When add_test(NAME) is called without the CONFIGURATIONS argument then
the test is intended to run in any configuration. In multi-config
generators like the VS IDE and Xcode tests created by add_test(NAME) can
only be run when testing a known configuration (otherwise there is no
way to generate the test command line). If no test command line is
known for a particular configuration, or if no configuration is given to
ctest, report the test as not run instead of silently skipping it.
Also fix CMake's own TestsWorkingDirectory test invocation to correct a
previously silent failure exposed by this change.
When generating per-config blocks in test and install scripts replace
the form
IF()
# config == A
ENDIF()
IF()
# config == B
ENDIF()
with
IF()
# config == A
ELSEIF()
# config == B
ELSE()
# no config matches
ENDIF()
for clarity and to support the else() case cleanly.
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
Implement support for multiarch as specified here:
http://wiki.debian.org/Multiarchhttps://wiki.ubuntu.com/MultiarchSpec
Detect the <arch> part of <prefix>/lib/<arch> from the implicit library
search path from each compiler to set CMAKE_<lang>_LIBRARY_ARCHITECTURE.
Define CMAKE_LIBRARY_ARCHITECTURE using one of these values (they should
all be the same). Teach the find_library and find_package commands to
search <prefix>/lib/<arch> whenever they would search <prefix>/lib.
27aa446 One more try. Use full path by default, and relative on broken compilers.
2dfc121 Use bin tree for inclues to avoid -I with spaces in the path.
6d29b4b Append and do not clobber CMAKE_CXX_FLAGS in the test.
7815e90 Fix for bug#10798. VS10 did not append -I flags with COMPILE_FLAGS prop.
In cmMakefile.cxx GetCMakeCFGInitDirectory is replaced with
GetCMakeFilesDirectory for .rule files. In some cases with
external projects, that directory will not exist. With vs10
the .rule files must exist or the rule will run with every build.
This fix creates the path that the .rule file is in. In addition,
it is now a CMake error if the .rule file can not be created.
A post-build phase of each target invokes the XCODE_DEPEND_HELPER.make
file to erase any targets that link to it. Narrow the set of targets
tested by each post-build phase to those that depend on the newly
completed target. This avoids removing files from partially built
unrelated targets that happen to be building in parallel.
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.
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
7ff98b7 Fix forced-seed argument type in string(RANDOM)
3d92c8c Explicitly cast time value in cmSystemTools::RandomSeed
eb6f461 VS 6: Define _WIN32_WINNT to load wincrypt.h correctly
e1b0a11 Improve string(RANDOM) default seed
Clang points out that local variable 'seed' needs to be "unsigned int":
Source/cmStringCommand.cxx:828:21: warning: operands of ? are integers
of different signs: 'int' and 'unsigned int' [-Wsign-compare]
srand(force_seed? seed : 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.
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.
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.
Older versions of GCC, the HP compiler, and the SGI MIPSpro compiler do
not like the use of make_pair in this case and the conversions it
requires:
a value of type "const char *" cannot be used to initialize an entity
of type "char [1]"
/usr/include/g++-3/stl_pair.h:68: assignment of read-only location
Instead use a map lookup pattern already used throughout the rest of our
source tree.
Under Windows "locationURI" must be used for virtual folders, while
"location" must be used only for linked folders. Under Linux it doesn't
seem to matter.
Alex
08b9397 find_package: Fix system package registry test path conversion
93021ad find_package: Test system package registry when possible
b95f3ca find_package: Check both 32-bit and 64-bit registry views
a0d76c1 find_package: Search a "system package registry"
549458f find_package: Document user package registry locations
c9563db find_package: Cleanup user package registry less aggressively
4df1197 find_package: Rename implementation of user package registry
08fa5dd Also generate dependers-graphviz files.
4f96a76 GRAPHVIZ_IGNORE_TARGETS is now a list of regular expressions
5698ad2 Make it possible to exlude external libs from dot files
The system package registry is under HKEY_LOCAL_MACHINE\SOFTWARE which
has separate views for 32-bit and 64-bit applications. Look in both
views, but prefer the architecture matching the build target platform.
Generalize the "user package registry" created by commit ed0650f6 (Teach
find_package to search a "package registry", 2009-09-01). Define a
corresponding "system" registry key under HKEY_LOCAL_MACHINE. This
gives package installers a place to create a registry value that points
at the right location for find_package() to locate the package.
Delete only REG_SZ entries that are specifically detected to point to
invalid paths. This will allow future versions to add other value types
for different purposes.
This file has not been used in KWSys since commit "Moved test for large
file support into kwsysPlatformCxxTests.cxx", 2006-08-25. CMake 2.6.0
and above come with a copy of this module anyway, and KWSys has required
CMake 2.6.3 since commit "KWSys: Require at least CMake 2.6.3",
2011-03-01.
234bae7 VS10: Fix exit code of custom commands with setlocal/endlocal (#11938)
b98fdd5 VS: Use setlocal/endlocal only in VS 10 custom commands
06fcbc4 VS10: Fix working directory of consecutive custom commands (#11938)
Use the pattern
setlocal
...
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
in custom commands to preserve the %errorlevel% from inside the
setlocal/endlocal block.
The setlocal/endlocal and errorlevel pattern added by commit 06fcbc47
(VS10: Fix working directory of consecutive custom commands, 2011-04-08)
does not work well in VS 7.1. Restore the original behavior for VS
versions that do not need the new behavior.
Copy the files specified in CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA to the right
directory when packaging components. This fixes#12061.
Signed-off-by: Eric NOULARD <eric.noulard@gmail.com>
The parent commit assumed that "cd /d" would work in all Windows shells.
While all modern versions of windows have shells that support it, the
shells used by NMake and Borland make do not. Borland make does not
seem to even support changing drive letters with "d:". Just revert the
feature for all make tools except MinGW where the shell is known to
support this feature.
Teach cmLocalUnixMakefileGenerator3::CreateCDCommand to change working
directories for make tools using a Windows shell using "cd /d" instead
of just "cd". This tells the shell to change the current drive letter
as well as the working directory on that drive.
Commit abaa0267 (When the working directory for a custom command is on
another drive..., 2007-12-17) fixed the same problem for VS IDE
generators as reported by issue #6150.
The VS 10 msbuild tool uses a single command shell to invoke all the
custom command scripts in a project. Isolate the environment and
working directory of custom commands using setlocal/endlocal. The
form of each command is
set errlev=
setlocal
cd c:\work\dir
if %errorlevel% neq 0 goto :cmEnd
c:
if %errorlevel% neq 0 goto :cmEnd
command1 ...
if %errorlevel% neq 0 goto :cmEnd
...
commandN ...
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & set errlev=%errorlevel%
if %errlev% neq 0 goto :VCEnd
so that all changes to the environment and working directory are
isolated within the script and the return code is preserved.
Some find modules call find_package recursively to locate a package
configuration file for the package instead of searching for individual
pieces. Commit 79e9b755 (Help recursive find_package calls in modules,
2008-10-03) taught find_package to forward the version number and EXACT
arguments through the recursive call automatically. Do the same for the
component list.
When reading archive entries from disk strip any xattr and acl entry
headers that may have been loaded from the filesystem (e.g. selinux).
These fields are only useful for backup tools and not for packaging and
distribution of software. Furthermore, the GNU tar 1.15.1 on at least
one Linux distribution treats unknown entry headers as an error rather
than a warning. Therefore avoiding such fields is necessary for archive
portability.
Suggested-by: Tim Kientzle <tim@kientzle.com>
3e32db7 cmCTestUploadCommand::CheckArgumentKeyword should return false if not FILES
6b6f309 Add the FILES keyword to ctest_upload command
28cdd0a Don't tar/gz ctest_upload() files
fbe4356 Change 'Files' tag to 'Upload' in Upload.xml
350546d Implement ctest_upload command
For VS2010 if a precompiled .obj file was the output of a custom commad,
it was used as part of the build. If it was not, then VS did not
use it as part of the build. This commit updates the test to check
for this issue, and fixes the problem. This fixes bugs #0011891 and
Also allow generators to override the default packaging method.
Add a ONE_PER_GROUP option so that method can be specified by the user without relying on defaults.
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.
A search-and-replace in commit 8d32d229 (make commands lower case by
default, 2007-10-10) accidentally changed the variable reference
CMAKE_INCLUDE_DIRECTORIES_BEFORE to CMAKE_include_directories_BEFORE.
Change it back.
The curses dialog (ccmake) allows variables to be specified on the
command line. If any of these variables is used during any configure
iteration or during generate we must not warn about it.
The Qt dialog (cmake-gui) allows variables to be added and removed in
the GUI interactively. If a variable is added, removed, and then added
again we must still warn if it is unused.
Set target property RUNTIME_OUTPUT_DIRECTORY explicitly on ProcessFwd9x
and EncodeExecutable so that we know exactly where the executables will
exist on disk.
At some point in the past VS 2010 failed some tests with custom commands when
relative paths were not used. It seems that those problems have been fixed.
However, the relative paths apparently are appended to the current working
directoy before vs accesses the file. So, with a long path, relative paths
cause it to create a combined path that is too long.
86cb17b Pass include directories with response files to GNU on Windows
9a0b9bc Optionally pass include directories with response files
6e8a67f Generate target-wide flags before individual build rules
d099546 Factor old-style -D flags out from -I flag generation
Some samples of things that got unnoticed by our nightly builds:
$ JAVA_HOME= mvn
Warning: JAVA_HOME environment variable is not set.
...
$ mvn
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
...
Create platform option CMAKE_<lang>_USE_RESPONSE_FILE_FOR_INCLUDES to
enable use of response files for passing the list of include directories
to compiler command lines.
This switches the internal generation order but does not affect the
results. The new order ensures that any internal state changed by
generating target-wide flags is known when the individual rules that use
those flags are generated.
Move the GetDefineFlags call from cmLocalGenerator::GetIncludeFlags to
all call sites so that the method exclusively constructs a string of
include search path flags.
Avoid GCC warning
warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
added by commit c6a8e4c7 (The link interface of MODULE libraries is
empty, 2011-03-09).
Several major Linux distributions still do not provide Git >= 1.6.5.0 in
their stable package lists. Prior to commit 1173cc4a (Update Git
submodules with --recursive, 2011-02-22) CTest was able to use older Git
versions but simply silently failed to update submodules recursively.
Instead of failing with older Git versions preserve the status quo and
add a warning in the update log. Users testing projects with recursive
submodules may simply update to a Git new enough to support them.
MODULE libraries cannot be linked into other libraries and executables
(just like executables without ENABLE_EXPORTS). Set the MODULE target
link interface to be empty. This allows such targets to be installed in
an EXPORT set without including all their private implementation
dependencies.
Commit afd7d4ca (Add target property LINK_SEARCH_END_STATIC, 2008-01-31)
defined a property to ensure that static runtime libraries get selected.
Add a property to specify that all libraries whose type is unknown, such
as "-lm", should be assumed static. Furthermore it assumes that an
option such as "-static" is also used so that no initial -Bstatic is
needed.
1a8eed1 Merge branch 'add-STRING-subcommand-FIND-issue-11795' into fix-2828-more-info-in-script-mode
006124b Avoid direct use of std::stringstream
8a8da36 Merge branch 'fix-2828-more-info-in-script-mode' into add-STRING-subcommand-FIND-issue-11795
1462561 Add a string(FIND) sub-command (#11795)
79e13af Add XML escaping for directory name in Eclipse projects (#11658)
8074bca Fix XML escaping for target names in Eclipse project files (#11658)
cb94587 Fix XML escaping for the project() name in Eclipse projects (#11658)
Using sort results in a possibly-modified sorting
when all elements are "tied" - use stable_sort instead
to preserve the original ordering of tied elements.
The Clang compiler warns about extra parenthesis in the code
if ((form->curpage == field->page))
~ ^ ~
because the idiom is commonly used when an assignment is intended
instead of a comparison. Remove the extra enclosing layer.
Since CMake 2.6.3 add_custom_target() has a SOURCES option, this was not
yet considered in the C::B generator.
Also, now GENERATED files are not added to the project.
Alex
Now a virtual folder "Subprojects" is created, and in this virtual folder
is a linked resource for each project().
This can be considered a fix for #11657
Alex
The Intel Fortran plugin forgets to create the output directory into
which it will write a DLL's import library. Utilize the fix added by
commit f4b3bdc6 (Create an exe's implib output dir for VS, 2009-06-15)
and generalized by commit 764ac980 (Generalize exe implib dir creation
for VS, 2009-06-16). Create a pre-link rule to make the directory.
To avoid name clashes.
Before this commit, name clashes can occur when invoking gcov on a
project that uses the same file name in different directories. The
--preserve-paths flag ensures all file names have a complete path,
avoiding name clashes.
Thanks to "McBen <viertelvor12@gmx.net>" for the patch.
(Did not preserve original commit author information because
we have a push check for first and last name, and do not
accept authors with only an alias...)
Make it clear that list subcommands that modify the list
do so in the current CMake variable scope, regardless of
the original scope of the list variable involved.
RPM cannot easily 'merge' differents directory into a single RPM
with shared prefix. So more flexibility has been added to generic
CPackGenerator in order to let the specific generator chose the
local installation directory for each component.
With this commit, the --graphviz option now also generates dot files
which show which other targets depend on some target.
So, now there is
* a global dot-file which shows all targets and dependencies
* a dot file which shows on what a target Foo depends
* a dot file which shows which other targets depend on Foo
Alex
This is similar e.g. to CTEST_CUSTOM_WARNING_EXCEPTION from ctest.
GRAPHVIZ_TARGET_IGNORE_REGEX is not supported anymore.
I hope this is ok, since this was 100% undocumented and can't
break a build.
Alex
Patch from Christian Ehrlicher.
By setting GRAPHVIZ_EXTERNAL_LIBS to TRUE in CMakeGraphVizOptions.cmake
you can now exclude external libraries from the produced dot file.
I.e. then you see only the dependencies within your project.
Alex
008d116 VSResource: Avoid windres /D with quoted spaces (#11695)
8f9919d Avoid space in rc /D values for VS6 and Cygwin (#11695)
78fe97f Fix line too long KWStyle issue (#11695)
6627560 VS10: Escape double quote chars in defines for rc files (#11695)
dd2f814 Merge branch 'dev/add_test-working-directory' into dev/strict-mode
949d32c Unwatch manual variables upon removal in cmake-gui
3939032 Unwatch manual variables upon removal in ccmake
8354413 Add method to unwatch a manual variable
8ed3c85 Give a better message for unused variables
729db48 Fix ArgumentExpansion test expected results
89c2544 Checking for a definition is a usage
5625dee Don't output to stderr in the GUI
ad25a96 Merge branch 'ImprovedDotSupport2' into dev/strict-mode
c128abe Merge branch 'AddCMAKE_CURRENT_LIST_DIR' into dev/strict-mode
9bcaff0 Merge branch 'cmake-guiRememberAdvancedCheckbox' into dev/strict-mode
544d0c3 Fix expected output for WarnUninitialized test
4e3bea4 Update expected messages to new format
8e8c9e4 Don't check at destruction for usage
668e005 Use cmake::IssueMessage for warnings
88cd4c1 Use 'CMake Warning' versus 'warning' for CDash
3c3b98d Initialize the class before setting warn flags
cf8b15a Ignore files under the CMakeFiles directory
fd50f06 Don't check for unused vars at configure time
447a04c Don't warn during configure when doing everything
b97ee21 Check for unused variables at the end of generate
c18c977 When checking for variables, specify a reason
3f1121f Use a long int since Line is a long as well
2507f93 Change the failure case string to 'Unexpected'
fe390a2 Add 'ArgumentExpansion' test
8dbb209 Wrong boolean value for CLI warnings
d4ee998 Hard-code the --no-warn-unused-cli flag
a267b99 Fix line lengths
82ed104 Flag that the directories have been set
5aa535b Add argument to arg parsing to not set directories
367e5c3 Revert "Revert "When calling CMake, set the args and the cache""
ab5d4e4 Revert "When calling CMake, set the args and the cache"
9b90040 When calling CMake, set the args and the cache
fe56002 Fix long lines for KWStyle
5d30cfc Set a watch on variables added through the gui
33c63b1 Add a method to put a watch for variables
535253f Initialize the warning variables earlier
cbb286c Fix the path detection to work for top-level
62be1f7 Initialize the usage stack earlier
c6e7fab Factor out the checks for unused variables
5e41ba8 When using the API, check for Add vs. Remove
dee1976 Fix typo in VariableUnusedViaUnset test
f231ce5 Remove old false positive avoidance code
a117e02 Revert "Add test for unused warnings at the end of scope"
2c82f2b Exempt CMAKE(CURRENT|PARENT)_LIST_FILE from usage
6d7d449 Ignore CLI warnings for ABI determination
7740a73 Only return local keys that are defined
bef3aee Use the API so that warnings can be tracked
05cb0f4 Check for unused variables in the dtor
91c4c99 Add test for unused warnings at the end of scope
ca90f67 Fix detection of unused variables when setting
f7438ca Add test for unused detection via setting it
995cfb0 Don't warn if the variable wasn't defined
aefc91d Add test for usage checks via unset
a8e97f8 Remove VarRemoved code since it's been superceded
59463ef Rework CheckVariableForUnused usage
f117423 Fix line lengths to be no more than 78
e49a935 Improve unused warning logic
e01e40c Mark ARGC, ARGV*, and ARGN as used
a17aff7 Ignore CMAKE_MATCH_* variables for usage
02a114d Add method to allow variables to be marked as used
a0b0d23 CMAKE_DO_TRY_COMPILE is no longer used
ae3eff3 Fix the path used for ignoring system warnings
056b441 Fix missing case for usage of a variable
980e048 Factor out checks for unused variables
83acb0a Remove now unused variables
3801463 Use built-ins for readability and maintainability
8b52015 Push the initialize and unused states when copying
439877f Be consistent with single and double quotes
4cf1706 Add documentation for check-system-vars
b74777f Fix the spelling of the flag for warn-unused-vars
b948120 Change logic of flag to turn off cli unused checks
f047a17 Add test for uninitialized variables
75bda38 Add tests for unused command line variables
300fc15 Fix detection of system files
d784e6a Run the unused variables check on the final pass
9efc057 VariableWatch is not available when bootstrapping
2e78224 Add a missing comma to the warning message
7499700 Add a flag to warn about system files
fff9f6d Rename flags again and use variablewatch for cli
786e269 Add warn-unused to the Qt interface
636e6c4 Default to marking things as used
4ff0340 Rename find-unused to warn-unused
d7999e9 Rename strict-mode to warn-uninitialized
e141bc9 Detect unused variables
d3e8eb5 Add flags to detect unused variables
f332e14 Complete strict-mode checks for uninitialized vars
52f9637 Add method to get the local scope variables
f794d58 Make --strict-mode option, and integrate with cmake-gui
48b5b85 Add a warning when variables are used uninitialized.
cd626ea For macros make sure the FilePath points to a valid pointer in the args.
d94f9c6 Only set the property if the property was given
b6c302b Default the working dir to the current binary dir
0594287 Add more tests for WorkingDirectory for tests
To get rc defines to work in the VS10 IDE requires \" when
constructing PreprocessorDefinitions strings. This is different
than defines for cl.
Also, per-file rc defines were not being generated. Fix that, too.
During a try_compile cmGlobalGenerator::EnableLanguage uses results from
the outer project. Reject attempts to enable languages in the test
project that are not "ready" in the outer project. Mark a language as
"ready" when all its information has been loaded and we are ready to
generate build rules.
This also avoids infinite recursion introduced by commit 295b5b60 (Honor
CMAKE_USER_MAKE_RULES_OVERRIDE in try_compile, 2010-06-29) for projects
that set CMAKE_USER_MAKE_RULES_OVERRIDE to a file that uses try_compile.
The file is loaded along with the information for a given langauge so
the language is not yet "ready".
If CMAKE_MAKE_PROGRAM is set to devenv, then GenerateBuildCommand
uses it just like we used to do for VS8 and VS9. Otherwise, it
still uses MSBuild.
This will let us run the CMake test suite through devenv and make
sure all the solution and project files we generate are load-able
and build-able by the VS 2010 IDE, not just MSBuild.
Inspired-By: Robert Lenhardt
WriteCLSources should skip source files with "obj" extensions
since WriteObjSources has already written them into the vcxproj
file. Likewise, WriteGroupSources should skip source files with
"obj" extensions to avoid receiving "item ... already exists under
the filter" project-load-time error messages from Visual Studio.
If the source-file form of try_compile is given a file name with
multiple '.' characters such as "a.b.c" use only the shortest extension
to check the language. This is the expected behavior and is consistent
with normal language extension determination in the method
cmSourceFileLocation::UpdateExtension.
Set CMAKE_RUNTIME_OUTPUT_DIRECTORY explicitly in try_compile projects so
that the COPY_FILE feature knows where to look. This makes the feature
robust against CMAKE_USER_MAKE_RULES_OVERRIDE files that set variables
like CMAKE_RUNTIME_OUTPUT_DIRECTORY or EXECUTABLE_OUTPUT_PATH.
This variable was introduced to help authors override CMake's default
platform information before any of it is cached. State this clearly in
the documentation. Explicitly discourage use for other purposes.
Previously this was used only in multi-configuration generators to
choose the configuration of try_compile and try_run at their build time.
Teach CMake to honor the variable in single-configuration generators as
the CMAKE_BUILD_TYPE.
Factor out generation of SccProjectName, SccLocalPath, and SccProvider
from cmLocalVisualStudio7Generator::WriteProjectStart and call it from
cmLocalVisualStudio7Generator::WriteProjectStartFortran too.
On Windows platforms source files may contain '\' in include directives:
#include "a\b.h"
Normalize these while scanning to use forward slashes. CMake will
convert from forward slashes to the direction preferred by the native
build tools when writing the path to 'depend.make' files.
Show "<variable|string>" explicitly in if() case documentation whenever
auto-dereferencing occurs. Reference its presence from the explanation
at the bottom.
The signature of get_test_property uses argument order
test property VAR
not
test VAR property
Also document the actual behavior when the property is not found.
Some values simply cannot be escaped properly in all contexts for all
native build tools. Document known limitations after the disclaimer
that states so.
Previously the error message for code like
add_executable(myexe does_not_exist/mysrc.c)
mentioned only that "mysrc.c" is not found. Report the directory too.
Remove the example explained by the misleading phrase "CMake will treat
it as if you wrote". This was originally added by commit a73071ca
(modified the if command to address bug 9123 some, 2009-06-12). Later
related information elsewhere in the documentation was corrected and
made precise by commit cb185d93 (Fix if() command and CMP0012 OLD/NEW
behavior, 2009-10-27) but the misleading example was not corrected.
Replace the example with a correct one that more directly covers the
case that typically surprises newcomers. Avoid recommending a "correct"
way to write code because this behavior is always specific to each case.
Also update the main documentation of the behavior to be more explicit.
Previously the Xcode generator would rerun CMake only if input file
dependencies in the top-level directory changed. Teach it to depend on
input files from all directories. Other generators already do this.
Reported-by: Johan Björk <phb@spotify.com>
Explicitly state up front that the source-file form of the command links
an executable and expects a 'main' to be defined. While at it, update
the command signature documentation to use a syntax more consistent with
other commands. Also tweak some wording.
Teach the ArgumentExpansion test to expect flattened lists as has always
been the case in the CMake language. Now that the test should pass
enable the failure regex even when CMAKE_STRICT is not on. Replace the
reference to the old ArgumentExpansion test behavior in the workaround
comment in cmMakefile::TryCompile with a full inline explanation.
ce28737 Remove usage of CMAKE_CURRENT_LIST_DIR now that we have CMP0017
7db8db5 Improve documentation and messages for the new CMP0017
db44848 Prefer files from CMAKE_ROOT when including from CMAKE_ROOT
1e69c6f Merge branch 'user-policy-defaults' into policy-CMP0017
65a0a2a Merge branch 'include-command-whitespace' into policy-CMP0017
e33cbda VSMidl Test: Use correct include_directories with VS6 (#11461)
262da91 Prohibit space in HOME value for VSMidl test.
13caaa3 VS10: Finish Midl support (#11461)
Although the LOCATION property is for compatibility with CMake 2.4, the
LOCATION_<CONFIG> property is modern. However, if a project reads it
and sets location-altering properties later the behavior is undefined.
See parent commit for details.
Reading the LOCATION target property currently locks down the result and
ignores any later changes to properties that affect it. This may or may
not be expected and may or may not be the behavior in earlier versions
of CMake. The property is documented as provided only for compatibility
with CMake 2.4 and alternative interfaces are now available for all
originally envisioned use cases. We want to discourage its use without
outright deprecating it. Add documentation to explicitly state that
reading the property before other properties are set is undefined.
Previously, only strings containing "http:" qualified as
URLs when found in CPACK_NSIS_MENU_LINKS. Now, we use a
regex to detect strings beginning with any of the following:
ftp://
ftps://
http://
https://
news://
mailto:
This commit also moves the caller of CreateMenuLinks outside
the "if (cpackPackageExecutables)" block, allowing clients to
use CPACK_NSIS_MENU_LINKS without also having CPACK_PACKAGE_EXECUTABLES
defined. That bit of this commit fixes the remainder of the
issue described in http://public.kitware.com/Bug/view.php?id=7828
Also, added a set(CPACK_NSIS_MENU_LINKS ...) to the CPackComponents
test to enable verifying that all of this actually works.
CMake fails to find any registry paths on Windows 2000: according to regmon
it fails with an access denied error. I double checked all the access rights
and they are fine. After checking the access modes on MSDN I found that it
says KEY_WOW64_32KEY / KEY_WOW64_64KEY are not supported on Windows 2000.
CMake does not check if the current system supports Wow64 before applying
these flags.
This commit adds a check for IsWow64Process in kernel32.dll before adding
these flags.
Author: Axel Gembe <ago@bastart.eu.org>
Signed-off-by: Axel Gembe <ago@bastart.eu.org>
MUI_FINISHPAGE_RUN is frequently used with NSIS and provides a checkbox
on the finish page of an installer which specifies whether the specified
executable should be run when the installer exits. This commit adds support
for this setting in CPack.
NSIS installers default to assuming the executables exist in a
directory named "bin" under the installation directory. As this
isn't usual for Windows programs, the addition of this variable
allows the customization of this directory and links still to be
created correctly.
Previously both CPACK_NSIS_MUI_ICON and CPACK_NSIS_MUI_UNIICON
needed to be set for either to take effect. This commit allows
either to be set rather than requiring both as users may well
want to e.g. use a default uninstall icon but a custom install
icon.
This commit addresses all of the following:
http://public.kitware.com/Bug/view.php?id=8165http://public.kitware.com/Bug/view.php?id=10687http://public.kitware.com/Bug/view.php?id=11311http://public.kitware.com/Bug/view.php?id=11461
With this commit, the midl support for VS10 is as
complete as midl support ever was for VS9 and earlier.
The VSMidl test should run on all Visual Studio
generator based dashboards.
CMake no longer sends C++ compiler /D flag values
to the midl compiler in Visual Studio generated
projects. I think if we want to add that in the
future, we should add a way to pass midl compiler
specific flags and perhaps an optional way to add
in the C++ definitions, too. For now, not sending
them along gets past the immediate problem wherein
idl files in a CMake VS generated project just didn't
work at all.
The VSMidl test added in this commit was inspired by
the patch attached to 8165.
The test had to be modified such that it will run in
a directory whose name contains no spaces. There is an
existing bug filed against VS10's midl asking Microsoft
to fix that problem. But for now, the test added in this
commit works by copying the source directory to a location
that avoids spaces in the directory names.
Inspired-By: Robert Lenhardt
971692c Build enable_language command during bootstrap
960ace1 Add testing for windows resources for mingw/msys/cygwin and remove for watcom.
060d6e8 Add support for windres to cygwin.
b2f308c Add support for windows resources with mingw/msys.
8c7b19d Only run resource test for MSVC compilers.
753e208 Disable incremental testing for this test, it crashes vs9 linker.
16e7d4b Add flags to resource builds on vs 2010 with a test.
Since commit e4beefeb (CTest: Do not munge UTF-8 output in XML files,
2009-12-08) we validate UTF-8 encoding of build and test output as it is
written to XML files. However, in cmCTestTestHandler::CleanTestOutput
we still processed test output one byte at a time and did not recognize
multi-byte UTF-8 characters. Presence of such characters caused early
truncation.
Teach CleanTestOutput to truncate test output at the limit but without
cutting it in the middle of a multi-byte encoding. Also, stop avoiding
truncation in the middle of an XML tag like "<MyElement>" because the
'<' and '>' will be properly escaped in the generated XML anyway.
This patch makes include() and find_package() prefer cmake files
located in CMAKE_ROOT over those in CMAKE_MODULE_PATH.
This makes sure that the including file gets that file included
which it expects, i.e. the one from cmake with which it was tested.
It only changes behaviour when such an included file exists both
in CMAKE_MODULE_PATH and in CMAKE_ROOT.
This comes together with a new policy CMP0017, with default
behaviour it behaves as it always did, but warns.
With NEW behaviour it includes the file from CMAKE_ROOT
instead from CMAKE_MODULE_PATH. This fixes (if CMP0017 is set)
building KDE 4.5 with cmake >= 2.8.3.
Also a basic test for this policy in included.
Check CMAKE_POLICY_DEFAULT_CMP<NNNN> for a default when policy CMP<NNNN>
would otherwise be left unset. This allows users to set policies on the
command line when the project does not set them. One may do this to
quiet warnings or test whether a project will build with new behavior
without modifying code. There may also be cases when users want to
build an existing project release using new behavior for policies
unknown to the project at the time of the release.
The header was included only under "#ifdef __linux", but not all Linux
distributions provide the header. SystemInformation uses no symbols
from this header, so do not include it.
Commit 060d6e88 (Add support for windres to cygwin, 2010-12-23) and
commit b2f308c8 (Add support for windows resources with mingw/msys,
2010-12-22) introduced enable_language(RC) for the first time in a
platform file processed by a bootstrap-built cmake.
667a90a Fix sentence break in add_test documentation
96309fc Make TestsWorkingDirectory test a C file
a4a5e37 Use iostream to make Borland happy
cfe53cd Fully specify the path to old-signature add_test
017d4e9 Group adding tests with its properties
561cc33 Only test the default cwd with Makefiles
d87bae7 Simplify the _default_cwd derivation
992c74f Use --><-- markers to denote the path
5249551 Flip slashes around on Windows
0a014da Add ctype.h include for toupper()
af12f83 Fix header includes for C++ and Visual Studio
5597aa2 Rename the project to match the test
9bf4165 Add tests for WORKING_DIRECTORY arg to add_test
42de5d0 Add WORKING_DIRECTORY argument to add_test
7679f9f Rename WorkingDirectory test
d95f817 Add the WORKING_DIRECTORY property to tests
Pass the lpClass argument of RegCreateKeyEx as a real char[] instead of
a string literal. At least one platform declares the argument as char*
instead of "const char*".
Commit 42de5d02 (Add WORKING_DIRECTORY argument to add_test, 2010-12-16)
added a new sentence to a paragraph without separating it by " " from
the previous sentence. Add the missing spaces.
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
In vs2010 a bad project file could be generated if a .c or .cxx file
was marked with HEADER_FILE_ONLY, if it was in a library that contained
both c and c++ code. This fixes the error in the code, and adds a test
for this case.
If a .sln file refers to a project file with a leading ".\", as in
".\foo.vcxproj" instead of just "foo.vcxproj" or a full path then
msbuild behaves strangely. Whenever target foo is built as a dependency
of another target, msbuild brings multiple configurations up to date
instead of just the requested configuration!
Avoid a leading ".\" in project file references to avoid this behavior.
This alternative fix to that attempted by commit 57e71533 (Avoid msbuild
idiosyncrasy that builds multiple configs, 2010-12-10) avoids use of
full path project file references which vcbuild does not support.
This reverts commit 57e71533f4.
While "msbuild" can handle full paths to project files in solutions,
the old "vcbuild" used for VS < 10 cannot. We will need another
way to fix issue #11594.
For prior versions of Visual Studio we would intentionally pass
"/nologo-" for "verbose makefiles" (CMAKE_VERBOSE_MAKEFILE ON)
when the caller did not already explicitly specify either /nologo
or /nologo-. And we still do. For the prior versions.
This had the side effect of always passing /nologo- for try_compile
operations because try_compile generates projects that have verbose
makefiles on.
However, starting with Visual Studio 10, the compiler emits
"cl ... warning D9035: option 'nologo-' has been deprecated"
when passed "/nologo-".
Therefore, this commit removes setting "/nologo-" for verbose
makefiles in the Visual Studio 10 case to avoid emitting a
warning for every single invocation of the compiler in a given
build.
With Visual Studio 10, we do not set this flag either way
and therefore, the generated project has no value for this
setting and gets Visual Studio's default value, which is
of course "/nologo", which does not produce a warning.
With Visual Studio 10, a caller can still force "/nologo-"
if desired by adding it explicitly to CMAKE_C_FLAGS or
CMAKE_CXX_FLAGS.
One of Cygwin's goals is to build projects using the POSIX API with no
Windows awareness. Many CMake-built projects have been written to test
for UNIX and WIN32 but not CYGWIN. The preferred behavior under Cygwin
in such projects is to take the UNIX path but not the WIN32 path.
Unfortunately this change is BACKWARDS INCOMPATIBLE for Cygwin-aware
CMake projects! Some projects that previously built under Cygwin and
are Cygwin-aware when they test for WIN32 may now behave differently.
Eventually these projects will need to be updated, but to help users
build them in the meantime we print a warning about the change in
behavior. Furthermore, one may set CMAKE_LEGACY_CYGWIN_WIN32 to request
old behavior during the transition.
Normally we avoid backwards incompatible changes, but we make an
exception in this case for a few reasons:
(1) This behavior is preferred by Cygwin's design goals.
(2) A warning provides a clear path forward for everyone who may see
incompatible behavior, and CMAKE_LEGACY_CYGWIN_WIN32 provides a
compatibility option. The warning and compatibility option both
disappear when the minimum required version of CMake in a project is
sufficiently new, so this issue will simply go away over time as
projects are updated to account for the change.
(3) The fixes required to update projects are fairly insignificant.
Furthermore, the Cygwin distribution has no releases itself so project
versions that predate said fixes tend to be difficult to build anyway.
(4) This change enables many CMake-built projects that did not
previously build under Cygwin to work out-of-the-box. From bug #10122:
"I have built over 120 different source packages with (my patched)
CMake, including most of KDE4, and have found that NOT defining
WIN32 on Cygwin is much more accurate." -- Yaakov Selkowitz
A fully compatible change would require patches on top of these project
releases for Cygwin even though they otherwise need not be aware of it.
(5) Yaakov has been maintaining a fork of CMake with this change for the
Cygwin Ports distribution. It works well in practice. By accepting the
change in upstream CMake we avoid confusion between the versions.
CMake itself builds without WIN32 defined on Cygwin. Simply disable
CMAKE_LEGACY_CYGWIN_WIN32 explicitly in our own CMakeLists.txt file.
Previously, we would search in the Windows registry for the path
to makensis, and fail immediately if we could not read the registry
value, assuming that it was simply not installed.
This change looks for makensis in the PATH even if the registry value
is not there, enabling the scenario where makensis is installed without
admin privileges and never even touches HKEY_LOCAL_MACHINE during the
non-admin install.
In VS9 and previous versions, :VCReportError is the goto label
to jump to after a failed custom command. It stops the build
before it tries to go any further.
In VS10, :VCEnd is the correct label to use.
Create a method in the VS generators to provide the correct
line of script to use for each version of Visual Studio.
For more internal details, search for VCEnd in the
C:\Program Files\MSBuild directory.
The KWSys SystemTools::GetMaximumFilePathLength method is poorly
conceived and should not be used. The cmDepends code honors its own
MaxPath buffer size. Just hard-code it.
The first instinct of a lot of users is to use file(GLOB) to assemble
lists of sources. Add a warning to the help text stating that it should
not be used for this purpose and briefly explain why.
Suggested-By: Ryan Pavlik
A cycle exists when the DFS returns to the root node, not just when
multiple paths lead to the same node.
Inspired-By: Alexander Esilevich <aesilevich@pathscale.com>
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.
The target_link_libraries command requires its first argument to be a
target in the current directory. Document this and update the error
message to be more specific. While at it, format the error message with
a call stack.
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.
This method replaces '//' with '/' to make the paths look nicer.
Originally it correctly skipped a leading '//' in a UNC path as the
comment says. However, commit "Removed extra variable initializations"
(2005-04-15) accidentally removed the "pos=1" initializer. It was then
incorrectly restored by commit "Added missing variable initialization"
(2005-04-15) as just "pos=0". Restore the proper initializer.
The test for this added by commit "better coverage" (2006-07-31)
included incorrect output for a sample UNC-like path. Fix it.
Pass the full version to cmake_minimum_required(VERSION) in generated
CMake files for try_compile projects. This tells CMake not to use any
backward compatibility behavior while processing code it generates.
27ee50a Add ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT as a ADVANCED cache variable (#9631)
50d21d4 Add cache var CMAKE_ECLIPSE_MAKE_ARGUMENTS when using the Eclipse generator
10f01ae Remove unused parameter "root" in some VS generator methods
57e7153 Avoid msbuild idiosyncrasy that builds multiple configs (#11594)
7728172 Remove unused variable "rootdir" in VS generators
Remove a boolean parameter of cmGlobalGenerator::CreateGlobalTarget that
is never set to true anymore. Remove global target "consolidation" loop
because no global targets exist before it runs anymore.
Commit e01cce28 (Allow add_dependencies() on imported targets,
2010-11-19) started using cmMakefile::FindTargetToUse to follow
dependencies, including those of GLOBAL_TARGETs like INSTALL and
PACKAGE. Since global targets exist in every directory, dependencies
between them must be traced within each directory too.
Teach FindTargetToUse to check the current directory before checking
globally. For global targets this will find the local copy. For for
normal targets this will be a no-op because they are globally unique.
This variable can be set to command line arguments which will be passed
to make when eclipse invokes make, e.g. you can enter "-j8" to get
8 parallel builds (#9930)
Alex
This authorize more control because one can set
CPACK_ARCHIVE_COMPONENT_INSTALL to ON globally
and then set it selectively to OFF inside
a CPack project config file.
Sidenote: GetOption ought to be a 'const' method.
If a .sln file refers to a project file with a leading ".\", as in
".\foo.vcxproj" instead of just "foo.vcxproj" or a full path then
msbuild behaves strangely. Whenever target foo is built as a dependency
of another target, msbuild brings multiple configurations up to date
instead of just the requested configuration!
Refer to all project files by full path to avoid this behavior.
The soname generation code was compile-time selected instead of runtime
selected. The result is that a Mac-compiled cmake used to cross-compile
Mac -> Unix generates an soname of the form libfoo.x.y.so instead of
libfoo.so.x.y as expected. Instead do a runtime check based on the
target platform.
Inspired-By: George Staikos <staikos@kde.org>
Avoid tracing dependencies of GLOBAL_TARGET targets. The build system
generators are not designed to handle any dependencies that may be
discovered. Global targets are only generated by CMake and never have
commands that reference targets built in the project anyway.
The exception is when building CMake itself there is a special case to
use the just-built "cmake" binary in the "install" target so that CMake
can replace itself on Windows. Even in this special case we do not want
to let the "install" target depend on the "cmake" target. Doing so
breaks cases like "make -j4 install".
Commit "merge in changes for beos support" (2006-12-04) added a realpath
call for every directory parsed out of a PATH-style environment
variable. No reason was given in the commit message or comments.
The call incorrectly resolves symlinks in referenced paths. Remove it.
If BeOS support really needs it then it can be restored for that
platform with a full explanation.
The cmCustomCommandGenerator::GetCommand method completely replaces the
purpose of this method. Re-implement GetRealLocation inline at the only
remaining call site and remove it.
The Makefile, VS, and Xcode generators previously duplicated some custom
command line generation code. Factor this out into a separate class
cmCustomCommandGenerator shared by all generators.
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.
Imported targets do not themselves build, but we can follow dependencies
through them to find real targets. This allows imported targets to
depend on custom targets that provide the underlying files at build
time.
Commit 60cd72d0 (Cleaned up generation of symbolic rules, 2006-02-15)
incorrectly made these Makefile targets .PHONY even though the build
rule touches an actual file. Correct it so that the copy_f90_mod and
touch steps do not happen on every "make".
Commit 34e1ac24 (Create Fortran info variables for .mod behavior,
2010-11-12) incorrectly taught GetFortranModuleDirectory to return a
relative path. We really want to use "." as the module directory only
as a workaround for compilers that do not do so by default. Therefore
we need this default only when generating the compiler command line and
not when scanning dependencies.
Revert the previous change to GetFortranModuleDirectory and apply the
change only at one of its call sites.
Commit 3827991e (...fix...not being able to remove try compile code,
2008-03-26) introduced a loop of RemoveFile attempts to overcome
anti-virus locks on recently created try_compile executables. Fix the
logic in this loop to work when the file is already missing.
The Express Edition does not come with 64-bit tools, but one can install
the "Microsoft Windows SDK v7.1" to get them. Detect this case and
check for the SDK. If found, set PlatformToolset to use the SDK tools.
Otherwise, fail with a concise and informative error.
Commit 1a0c166 (Store direct dependencies in solutions for VS >= 8,
2010-08-20) disabled use of VS-specific global dependency analysis.
Avoid perfoming the analysis at all when it is not needed. This also
prevents creation of bogus and unused '_UTILITY' targets since they are
not needed for dependencies.
Previously the command
find_path(VAR DOC "")
would crash because the argument pre-processing removed the DOC ""
arguments but the rest of the parsing assumes at least 2 arguments.
Reject the call with an error instead.
8b143fa Condense parsing of cache entries
122ebf1 Support manual cache entries
90abc3a Use cmCacheManager to load entries from the cache
6fe8624 Fix parsing of cache variables without a type
e01cce2 Allow add_dependencies() on imported targets (#10395)
bc7395c Merge branch 'vs-target-dependencies' into imported-target-dependencies
fd614e6 Use modern global dependency graph for VS < 8 deps
605f4bc Record edge type in global dependency graph
82596fc Merge branch 'vs8-direct-depends' into vs-target-dependencies
78c86f4 Exclude targets from the graphviz file based on a regex
5ea1e4c Collect targets and libs on demand instead of in the ctor
2a5790a Use std::cout instead of fprintf
7ba2d36 Enable/disable generating graphs depending on the target type
84ce612 Move the code for generating dot-files into separate class cmGraphVizWriter
a60b099 Generate separate dot files for each target, and a big one with everything.
487bd57 Properly insert all targets, also those which don't link to anything.
de2b2bf Move the code for collecting targets and libraries into separate functions
f7d56df Remove trailing whitespace and minor formatting changes for the dot-code
These mainly come from the command line or manual entries in the
CMakeCache.txt file. We want to stop at the first '=' because this is
what is most likely to have been meant. The variable can be quoted if
the '=' is intended.
Caveat: What if one wants both '"' and '=' in a variable name?
Imported targets do not themselves build, but we can follow dependencies
through them to find real targets. This allows imported targets to
depend on custom targets that provide the underlying files at build
time.
VS 7.1 and below have 2 behaviors that make the cmComputeTargetDepends
result difficult to use for solution-level dependencies. Update the
method cmGlobalVisualStudioGenerator::ComputeTargetDepends to document
the behaviors and work around them. Commit 1a0c166a (Store direct
dependencies in solutions for VS >= 8, 2010-08-20) isolated VS >= 8 from
this computation so those versions should be unaffected.
This change removes the last use of cmTarget::GetLinkLibraries for
purposes other than backward compatibility with legacy interfaces
(export_library_dependencies, VS 6 custom .dsp templates). Now the
cmComputeTargetDepends results are used for all generators so global
target dependency computation is fully centralized.
In cmComputeLinkInformation we match library names with a regular
expression, possibly extracting the 'lib' prefix. The regex component
to match the prefix always allows an empty prefix to be matched, as in
"(lib|)". Avoid every adding an empty prefix option earlier in the
regex, as in "(|lib|)", because it will be preferred and 'lib' will
never match.
156ae39 Don't disable colors in the CodeBlocks generator and minor cleanup.
e547fa7 Remove the "early alpha stage" comments about Eclipse and C::B
a02987a Don't enforce VERBOSE makefiles for the CodeBlocks generator
7b1421b Remove trailing whitespace
This commit adds support for a GRAPHVIZ_TARGET_IGNORE_REGEX variable
which can be set() in CMakeGraphVizOptions.cmake.
Targets matching this regex will be skipped when generating the graphviz
graphs.
Alex
In CMakeGraphVizOptions.cmake you can now set GRAPHVIZ_EXECUTABLES,
GRAPHVIZ_STATIC_LIBS, GRAPHVIZ_SHARED_LIBS and GRAPHVIZ_MODULE_LIBS
to TRUE or FALSE depending on whether you want graphs for the
targets of the respective types.
Alex
Delay computation of the command documentation until it is needed.
It is wasteful to do it in the constructor on every call.
Inspired-By: Christian Ehrlicher <Ch.Ehrlicher@gmx.de>
Define CMAKE_Fortran_MODDIR_DEFAULT and CMAKE_Fortran_MODOUT_FLAG
variables to help some Fortran compilers generate .mod files in the
current working directory.
Instead of enforcing verbose makefile, now the generated build command
includes "VERBOSE=1" so the output will be verbose when building in
C::B.
Also removed the now unused setForceVerboseMakefiles().
Alex
Look for the "/threads", "/libs:dll", and "/dbglibs" flags and convert
them to the proper RuntimeLibrary attribute value in the IDE. This is
a 3-to-1 flag mapping and such needs special handling in the parser.
The SubSystem attribute value must be "subSystemConsole" or
"subSystemWindows", not "1" or "2". Commit 20f49730 (Reset
platform/compiler info status for each language, 2010-09-28) exposed
this bug by (correctly) passing the /libs:dll flag to the compiler,
which chokes the linker if a value for "/subsystem:" is not given.
The behavior of add_custom_command when no DEPENDS option is specified
matches that of standard Make behavior, but it does not hurt to describe
it explicitly.
The big all-in-one file is basically unusable for e.g. kdelibs, it contains
around 1000 nodes and the created image is huuuuge !
Too big actually to be displayable or viewable or comprehensable.
Alex
This fixes bugs #0011355 and 0008342.
The merged patch is a contribution from Michael Lasmanis and Petri Hodju
with some extra documentation added by the merger.
Restore CMake 2.6 behavoir where the dart processing apparently was run from within the tests directory instead of the root of the build tree. This addresses issue reported on the VTK Dashboard where the Testing/Temporary directory is defined as ../../../Testing/Temporary but the DartProcessing is run with respect to the root of the build tree. This causes the regression/difference images to not be located by ctest and thus not uploaded to the dashboard.
BundleUtilities is better supported and allows including
shared Qt libs on other platforms. Also removed limitation
of static Qt for windows build of cmake-gui.
96a335f XCode generation should fail if lang isn't known
d3a8943 Fix which string is checked for in the test
220c5dc Add test that CMake errors with empty libs
The CodeBlocks generator used to omit files that were in siblings directories.
Though that filters out a few files that could be argued aren't of interest
to the user, it also potentialy hides files that are relevant to the user.
Patch by Daniel Teske.
Alex
See: http://bugreports.qt.nokia.com/browse/QTCREATORBUG-2250 for an example.
Visual Studio Express editions do not support solution folders,
so default behavior should be as if USE_FOLDERS global property
is OFF.
Also, allow folder names to be the same as target names: internally,
use a prefix to distinguish folder GUIDs from target GUIDs. Add
a target and folder with the same name in the ExternalProject
test to exercise this code.
For CMake itself, provide a new option CMAKE_USE_FOLDERS that
defaults to ON so that Visual Studio users get a nicely organized
CMake project. Express edition users will have to turn off the
CMAKE_USE_FOLDERS option in order to build CMake in the VS Express
IDE.
VS10 uses MSBuild underneath. The <Message></Message> CDATA are just
appended to "echo" and executed as a single command. Encode the message
such that it can be passed to echo. Convert newlines to tabs since they
cannot be printed this way.
In targets with no non-header files the linker language cannot be
determined. Since the target project file cannot be generated at all in
this case, give up as soon as it is detected. Otherwise the generation
code may try to run with uninitialized information.
Reverting abandoned topic xcode_source_group_fix_7932 left this source
slightly different due to trailing whitespace removal on some lines.
Remove all trailing whitespace from the file to make it consistent.
The original implementation of this generator accidentally used
"$(Configuration)/" for source-specific object file names. Correct it
to use "$(IntDir)/" just like the generators for all previous VS
versions. The target-wide output directory is "$(IntDir)/" already.
a798bb7 Avoid CustomCommand test failure on VS71 (#9963)
9b4ab06 Avoid CustomCommand test failure on VS71 (#9963)
9d2e648 No extra spaces in CustomCommand test (#9963)
269a4b8 Enable calling commands with : in argv[1] (#9963)
OK, on windows 7 after we untar some files,
sometimes we can not rename the directory after
the untar is done. This breaks the external project
untar and rename code. So, by default we will wait
1/10th of a second after the untar. If CMAKE_UNTAR_DELAY
is set in the env, its value will be used instead of 100.
With CMAKE_OSX_ARCHITECTURE settings such as $(ARCHS_STANDARD_32BIT),
the space inserted by the for loop would confuse Xcode if quoted. In
this particular example, what would be output would be:
ARCHS = "$(ARCHS_STANDARD_32BIT) ";
The Xcode UI does not recognize this as the built-in "Standards 32-bit"
architecture setting unless the space is removed.
From email explaining existence in the first place:
This is from before when the used checks throwing false
positives about unused due to changing the definition without
checking whether it *had* a value to begin with and me not
realizing they were false positives. I was thinking that it was
warning from ARGC et. al. not being used since the previous
macro or function call and the new value warning about
overwriting the old value.
Commit 7a18dd8e (Add searching of variables, 2003-03-07) added method
cmCursesMainForm::JumpToCacheEntry to search for cache entries whose
names match a given search string. The method also had a useless
argument "int idx" probably left from earlier development iterations and
hard-coded in all calls to the value '-1'. The method compared this
argument to the "NumberOfVisibleEntries" member which at the time was of
type "int" also.
Commit ff1f8d0b (Fix or cast more integer conversions in cmake,
2010-06-29) changed the type of "NumberOfVisibleEntries" to size_t to
fix other integer conversion warnings. An unsigned type makes sense
given the purpose of the member. However, this caused the '-1' signed
value to be converted to a large unsigned value in the above-mentioned
comparison, leading to incorrect behavior.
Fix the problem by removing the useless argument and the comparison.
eccc7d5 Merge branch 'allow_upper_case_cpp_and_others' into resolve/fix_target_name_with_dot_vs10/allow_upper_case_cpp_and_others
ed37fc3 VS2010: Set IntDir for utility and global targets.
e79e412 VS2010: Honor PROJECT_LABEL target property (#10611)
530ade6 Fix targets with . in the name for VS 10 IDE.
VS2010 uses IntDir as the location for writing log files for
what happens during custom build steps. With no IntDir settings,
all ExternalProject usage within the same CMakeLists.txt file
would result in multiple utility targets all trying to use the
same custom build log files.
With parallel builds, they would try to use them simultaneously
and result in file access errors, preventing the builds from
completing successfully.
Now each utility target has its own IntDir setting, and so, its
own custom build rule log files.
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.
The SetError method automatically starts the message with the name of
the command. Fix up calls to it so that we get "file DOWNLOAD..."
instead of "file FILE(DOWNLOAD ...". Also reduce length of long lines
containing these calls.
Since commit bc43b0f2 (Do not link library dependencies in VS solutions,
2009-10-20) CMake disables for VS >= 8 linking of a target to libraries
that happen to be listed as solution-level dependencies. Therefore we
can list the direct dependencies of each target in the solution file and
let VS handle transitive dependencies automatically.
Factor out reading of CMAKE_CONFIGURATION_TYPES and CMAKE_BUILD_TYPE
into cmMakefile::GetConfigurations. Read the former only in
multi-config generators.
5cdfc9c Improve wording of the error message of find_package() in config-mode
4969c3b Improve version notice in the generated message
e8ae504 Add option CONFIG_MODE to FPHSA()
b4b8f96 Don't create an empty element at the end of Foo_CONSIDERED_CONFIGS/VERSIONS
cc955a0 Small cleanup of FindPackageHandleStandardArgs.cmake
0367245 Replace the two vector<string,string> with one vector<struct{string,string}>
130b0e2 Improve error message in Config-mode when no appropriate version was found
dfe9c95 Record all considered Config files and their versions.
This work was started from a patch by Thomas Schiffer.
Thanks, Thomas!
See the newly added documentation of the FOLDER target
property for details.
Also added global properties, USE_FOLDERS and
PREDEFINED_TARGETS_FOLDER. See new docs here, too.
By default, the FOLDER target property is used to organize
targets into folders in IDEs that have support for such
organization.
This commit adds "solution folder" support to the Visual
Studio generators. Currently works with versions 7 through
10.
Also, use the new FOLDER property in the ExternalProject
test and in the CMake project itself.
As suggested by Brad, this improves the wording of the error message
in config-mode when config-files were found, but no suitable version.
The patch also contains the small loop-optimization suggested by Brad.
Alex
6acc71c New CMP0016 for deciding whether an unknown target in TLL() is an error.
da033b1 Remove trailing whitespace
6aef6d8 Just warn in case of a bad target as only argument for t_l_l()
c786635 Make target_link_libraries() complain if bad target name is used
43f96ea Remove trailing whitespace
a99f620 Fix unused parameter warning in VS 7.1 generator
79a88c3 Refactor VS <= 7.1 utility-depends workaround
325bdb2 Factor out duplicate VS target dependency code
6bea843 Factor out global generator ComputeTargetDepends method
ef4394d VS: Add ArchitectureId to VS 8 and 9 generators
4fec681 VS: Map /ENTRY linker option to EntryPointSymbol
be49129 VS: Add more TargetMachine option values
807fca4 VS: Convert PlatformName member to a virtual method
88e6447 Add macro ADD_FEATURE_INFO() and improve docs.
b353524 Improve wording of the documentation.
6fc88b2 Improve documentation.
3333878 Log the required package version and major improvement to FeatureSummary
3178767 Merge 'CPack-FixDESTDIR-Issue7000' from github.com:TheErk/CMake
6a521f8 CPack Enable better handling of absolute installed files
40dc97d CPack Backward-compatibly enforce DESTDIR for DEB and RPM
This command allows a user to quickly see the list of all available
test labels. The labels are also printed in verbose show only mode,
alongside their corresponding tests.
Before this patch there were two separate vectors, and the code made sure
they always had the same size.
With this patch the code doesn't have to ensure this anymore, there is only
one vector now.
Alex
If in config-mode config files have been found by find_package(), but their
version didn't match the requested version, now all considered files
and their versions are printed (instead of saying "didn't find config file)
Alex
As suggested on cmake-devel, find_package in Config-mode now records
all considered config-files and their versions in
<package>_CONSIDERED_CONFIGS and <package>_CONSIDERED_VERSIONS respectively.
Alex
The proposed solution is to avoid to CopyIfDifferent any links
found in CPACK_INSTALLED_DIRECTORIES but memorize them instead
then at the end of the processing for each dir do re-create the
link in the installed tree.
Current patch should work if the link are "local" to the directory.
When set to OLD, target_link_libraries() silently accepts if it is called
with only one argument and this one argument is not a target.
When set to NEW, this is an error. By default it is a warning now.
Alex
Document explicitly that the first component always exists. Fix the
documentation of SplitPathRootComponent to note that home directory
roots (~/ and ~u/) always have a trailing slash.
The cmGlobalVisualStudio71Generator::WriteProjectDepends method no
longer uses its 'dspname' parameter. Leave off the name to avoid the
unused parameter warning. Later we should refactor the method to avoid
passing the argument altogether.
As discussed on cmake-devel, if target_link_libraries() is called with
only one argument, and this one argument is not a valid target, just
print a warning but don't fail, since otherwise probably some existing
code somewhere might stop building.
Alex
target_link_libraries() did not complain if there was only one argument,
and this one (first) argument wasn't a valid target name, e.g.
add_executable(hello main.cpp)
target_link_libraries(-static-intel)
Here the target "hello" was forgotten in the tll() call, but cmake didn't
complain. With this commit it does.
Alex
Strong dependencies (created by add_dependencies) must be honored when
linearizing a strongly-connected component of the target dependency
graph. The initial graph edges have strong/weak labels and can contain
cycles that do not consist exclusively of strong edges. The final graph
never contains cycles so all edges can be strong.
Utility dependencies are "strong" because they must be enforced to
generate a working build. Link dependencies are "weak" because they can
be broken in the case of a static library cycle.
Commit 438a7e2f (Fix utility dependencies for static libraries in VS
generators, 2007-04-04) implemented utility-only dependencies between
linkable targets by introducing an intermediate non-linkable target.
We convert a dependency of the form
foo -> bar
to the form
foo -> bar_UTILITY -> bar
to prevent foo from including bar on its link line. Previously we added
the extra "_UTILITY" targets explicitly among the project targets before
dependency analysis was performed. Now we generate them separately at
the last moment so that cmGlobalGenerator need not be aware of them.
Compute VS target dependencies in cmGlobalVisualStudioGenerator when the
main global dependency analysis is done. Use these results in each of
the VS generators instead of duplicating the analysis.
find_package() now also stores the required version automatically, so it
can be used by FeatureSummary.cmake.
This was one of the requested features for setting up nightly builds
for KDE, since with this functionality it will be possible to write
a file at the end of each project which lists all required packages
and their versions. This file could then be compared for equality
with an older one and if something has changed the build maintainer
can be emailed.
In FeatureSummary.cmake there is now a new function feature_summary(),
which also allows to print the log to a file or into a variable.
It also allows to specify whether to append to a file or to write a new
one, and what information to log.
Docs are still missing.
Alex
The idea of the patch is to let the install generator define
CPACK_ABSOLUTE_INSTALL_FILES then when CMake is installing
project he will concatenate the list of files and give
it to specific CPack Generator by defining CPACK_ABSOLUTE_INSTALL_FILES
to be the list of ALL files that were installed using absolute destination.
An example of use has been applied to RPM generator which now
tries to automatically build a relocatable package.
When none of the options /Z7, /Zi and /ZI are specified in the cmake
project settings, the project will open in the editor with "Program
Database" as the default debug information format, ending up always
generating PDBs regardless of project configuration.
Modify the output project file so that if the debug information format
is not specified in the cmake project settings it will default to no PDB
generated, just like all the previous other Visual Studio versions.
This problem comes from the fact that Microsoft changed the default
setting of the debug information format to be "Program Database" instead
of "Disabled".
Refactor how cmCTestMemCheckHandler computes the memory tester command
line options to avoid encoding them in a single string just to parse
them again. The EscapeSpaces uses backslahes to escape spaces on UNIX
platforms, so replace other calls to it in CTest that are used to create
human-readable strings with simple double-quoting.
fb41da4 Add Compress compress support to libarchive-wrapper
1a3ad5c Add XZ compress support to libarchive-wrapper
b50c159 Add ZIP archive format and LZMA compress support to libarchive-wrapper
4663356 cmArchiveWrite: Fix signed/unsigned again
bd510fe CPack: Avoid member shadowing after API refactor (part2)
31a313d CPack: Avoid member shadowing after API refactor
cd7b8a0 CPack: Refactor API in order to handle multi-file packages
Add platform configuration variable CMAKE_SYSTEM_IGNORE_PATH and user
configuration variable CMAKE_IGNORE_PATH. These specify a set of
directories that will be ignored by all the find commands. Update
FindPackageTest so that several cases will fail without a functioning
CMAKE_IGNORE_PATH.
This is not needed but it does not cost much to do it for all
potentially supported format in libarchive. XZ and LZMA are not
builtin libarchive and require external lib but if
CMAKE_USE_SYSTEM_LIBARCHIVE is ON then we may get it for free.
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.
The multi-argument CompressFiles(...) method has been replace by the
no-argument PackageFiles() method and 3 more member variables. This
will enable implemention of multi-package generators. Now each specific
generator (which overloads PackageFiles()) may decide to change the name
and/or the number of generated package files.
Some stream libraries return size_t from gcount() and some return
ssize_t. Add an explicit cast to ios::streamsize for its return value.
Also refactor use of nnext to reduce the use of casts.
aef6723 cmArchiveWrite: Fix signed/unsigned compare/convert
1b5b2ed Include entries for directories in tarballs (#11020)
c7c9009 Create class cmArchiveWrite to wrap libarchive (#11020)
ac26737 Merge branch 'system-libarchive-include' into libarchive-wrapper
3296e6a Include headers from chosen libarchive (#10923)
The libarchive interface accepts size_t but returns ssize_t. The std
streams interface wants streamsize, which is typically ssize_t. Since
no one type for our variable matches without conversions, make the
conversions explicit to avoid -Wsign-conversion and -Wsign-compare
warnings.
Use libarchive through class cmArchiveWrite to implement the method
cmSystemTools::CreateTar. The class includes entries for directories by
automatically traversing the tree on disk.
a7319cf ctest_update: Run 'git submodule' at top level
7bf8dc1 ctest_update: Support ".git file" work trees
65cb72f ctest_update: Abort if Git FETCH_HEAD has no candidates
The git submodule porcelain must be executed from the top level of the
work tree. Use 'git rev-parse --show-cdup' to find the top level
relative to the source tree. This is better than searching up the tree
for .git ourselves because it will always work the same way Git does and
thus honors settings like GIT_DISCOVERY_ACROSS_FILESYSTEM.
Commit c3781efb (Support Git upstream branch rewrites, 2010-06-08)
assumed that ".git/FETCH_HEAD" exists inside the source tree. Fix the
implementation to handle a work tree using a ".git file" to link to its
repository. Use "git rev-parse --git-dir" to locate the real .git dir.
If .git/FETCH_HEAD provides no merge candidate do not attempt to update.
Also log FETCH_HEAD lines as we parse them since they are essentially
output from the git fetch command.
38c762c Merge 'remove-CTestTest3' into ctest-file-checksum
46df0b4 Activate retry code on any curl submit failure.
8705497 Checksum test should use CMAKE_TESTS_CDASH_SERVER
d0d1cdd Mock checksum failure output for old CDash versions
af5ef0c Testing for CTest checksum
86e81b5 CTest should resubmit in the checksum failed case
d6b7107 Fix subscript out of range crash
082c87e Cross-platform fixes for checksum/retry code
e525649 Checksums on CTest submit files, and retry timed out submissions.
Previously, we were only going into the retry block
for time out conditions. But a "could not connect"
response, or really any sort of curl failure, is
also a condition where we should retry the submit
if the user has requested a retry.
Fix niggly in ExternalProject that would inadvertently
create a log file of output when a command was explicitly
set to the empty string.
Also, increase the default value for showing context
around build errors to 10 lines, up from 6. Also add
the ability to customize this setting so that users
can put it back to 6 or even lower if they want, or
show more if they want.
Clang is smart enough to recognize that "*(int*)0=0" invokes undefined
behavior, warns, and produces an "undefined instruction". The message
in commit "Avoid Clang optimizer bug in testProcess-[45]" (2010-07-02)
is incorrect; this is not a Clang bug. It really is undefined
behavior. Use "*(int*)1=0" to produce a crash instead.
Clang's optimizer, as of clang version 2.8 (trunk 107463), produces the
undefined instruction 'ud2' for the code "*(int*)0=0" on OS X x86_64.
It causes our crash tests to fail because the child process exits with
an invalid instruction instead of a segmentation fault. Work around the
bug by using "*(int*)1=0" in this case.
Add option KWSYS_TEST_BOGUS_FAILURES that can be set by a containing
project or in the CMake cache to list tests known to fail consistently
on a buggy system.
Commit ff1f8d0b (Fix or cast more integer conversions in cmake) changed
a member type from int to size_t. Update the types of variables
compared to these values to be unsigned also.
Both possible result values need to be convertible to the same type.
Some compilers fail to recognize that they can construct std::string
from the empty string literal, so state it explicitly.
Since commit "Provide unix-sytle command line parsing" (2009-07-13) the
reference to KWSYS_C_HAS_PTRDIFF_T in System.c has been meaningless
because the macro was never passed to the compiler!
Separation by ',' only works in VS 2008 and below and does not work in
the PlayStation3 VS plugin. Separation by ';' works in VS 10 and all
prior versions.
Change types of local variables, or casting, or re-arrange
expressions to get rid of "conversion may alter value" warnings
as seen on recent dashboard submissions from londinium.kitware.
I naively assumed in my previous commit that the Convert call
would correctly convert a relative path file name correctly
relative to the makefile's current output directory. It actually
converts it relative to the process's current working directory.
So it would be different depending on how you launched cmake-gui.
This commit ensures that the generated files are always the same
by starting with a full path to begin with, based on the makefile
GetCurrentOutputDirectory method.
Git's diff-tree format has no '\n'-terminated blank line at the end of
its commit message body block if there are no diff lines. Instead the
message body is terminated by '\0' and there is no diff section. Teach
CTest to parse the format in this case.
This is especially important for the Visual Studio 10
generator and its quirky current working directory
behavior.
Also, emit more information about exactly what files are
out of date when cmakeCheckStampFile returns false.
Commit 02f7cfbc (Need to remove the MAKEFLAGS when cmake starts,
2003-05-13) removed the MAKEFLAGS environment variable when CMake starts
to prevent try_compile() from inheriting "make -i". This is unnecessary
in script mode (cmake -P). Instead remove the variable only when
configuring a project.
Tru64's make(1) resolves relative paths in "include" directives with
respect to the includer. This is inconsistent with all other known make
tools. Note that this make tool treats the path literally so we cannot
use our standard FULL path code which escapes spaces. Instead qualify
the paths with $(CMAKE_BINARY_DIR) to avoid the problem.
GCC places the vtable in the object implementing the first non-pure,
non-inline virtual method. Since the symbol is not weak on Tru64, make
the location unique by putting the destructor in a single object file.
The DynamicLoader::LibPrefix and DynamicLoader::LibExtension methods
previously hard-coded the module name components for each platform. Set
them from the CMAKE_SHARED_MODULE_PREFIX and CMAKE_SHARED_MODULE_SUFFIX
CMake variables instead. This ensures consistency in a program that
uses these methods to construct the file names for its own modules.
Use 'git fetch' followed by 'git reset' to update the source tree. This
is better than 'git pull' because it can handle a rewritten upstream
branch and does not leave local modifications. After fetch, parse
FETCH_HEAD to find the merge head that 'git pull' would choose to track
the upstream branch. Then reset to the selected head.
In the normal fast-forward case the behavior remains unchanged.
However, now local modifications and commits will be erased, and
upstream rewrites are handled smoothly. This ensures that the upstream
branch is tested as expected.
Commit 67277bac (Teach ctest_update about Git submodules, 2010-05-04)
accidentally logged "git submodule update" with the prefixes "pull-out"
and "pull-err". Fix it to use "submodule-out" and "submodule-err"
instead.
The CopyFileIfDifferent, CopyFileAlways, CopyAFile and CopyADirectory
methods should always copy permissions. The special cases in which a
caller would pass copyPermissions=false should be handled at the call
site. The parameter needlessly complicates the interface and semantics
of these methods.
If there is a .bat or .cmd file used as a custom command
then the Borland Makefiles generator (specifically) requires
using the "call " syntax before the name of the .bat or .cmd
file. This fix applies to all Makefile based generators where
WindowsShell is true.
On Windows 7 the file size reported by 'stat' on a new file sometimes
reports zero even though the real size is correct. This causes our
CopyFileAlways method to falsely detect copy failure. Work around the
problem by trusting the state of ofstream after writing the file.
Commit 0fafdb7e (Do not copy permissions of files when making the copy
in an install rule, 2008-12-18) added special behavior to KWSys file
copy methods for this special case. Use a local solution to avoid use
of the special behavior so it can be removed later.
Commit 8d0161c8 (Trust umask for file permissions, 2010-01-12) taught
these commands to set permissions to 0666 explicitly. The intention was
to let the open() call inside ofstream handle permsisions so that umask
would be honored. Now we set permissions only when we need to preserve
those on an existing file. New files will be created with umask-based
permissions.
The LINK_FLAGS property is defined only for targets that really link.
These include executables and shared libraries. For static libraries we
define the STATIC_LIBRARY_FLAGS property. Teach the Xcode generator to
make this distinction.
Improve FILE(DOWNLOAD ...):
- Add percent complete progress output to the FILE DOWNLOAD
command. This progress output is off by default to
preserve existing behavior. To turn it on, pass
SHOW_PROGRESS as an argument.
- Add EXPECTED_MD5 argument. Verify that the downloaded
file has the expected md5 sum after download is complete.
- Add documentation for SHOW_PROGRESS and EXPECTED_MD5.
When the destination file exists already and has the
expected md5 sum, then do not bother re-downloading
the file. ("Short circuit" return.)
Also, add a test that checks for the status output
indicating that the short circuit behavior is actually
occurring. Use a binary file for the test so that the
md5 sum is guaranteed to be the same on all platforms
regardless of "shifting text file line ending" issues.
Improve ExternalProject:
- Add argument URL_MD5.
- Add verify step that compares md5 sum of .tar.gz file
before extracting it.
- Add md5 check to download step, too, to prevent
unnecessary downloads.
- Emit a warning message when a file is not verified.
Indicate that the file may be corrupt or that no
checksum was specified.
Only generate .filters files if they are different than the last time
they were generated. This should prevent the unnecessary reloads
being triggered with Visual Studio 2010 builds.
kFreeBSD and Hurd have the same userland as Linux. This change is
necessary to enable kwsysProcessKill() to kill child processes on
kFreeBSD. The bug was detected by CTestTestTimeout test.
Patch from "Modestas Vainius <modestas@vainius.eu>".
See issue #10432.