Commit Graph

588 Commits

Author SHA1 Message Date
Brad King ddfd3b85df Merge topic 'cppcheck-fixes'
a20c819 cmake: Fix resource leak reported by cppcheck
c8adab9 cmcurl: Fix resource leak reported by cppcheck
499531c libarchive: Fix free() order to avoid accessing freed memory
3b849a7 ccmake: Add missing initializers reported by cppcheck
2013-07-16 13:59:30 -04:00
Brad King a20c819f63 cmake: Fix resource leak reported by cppcheck
Return early in cmake::ReportUndefinedPropertyAccesses if there is no
global generator instead of opening a file and leaking the descriptor.

Reported-by: Ömer Fadıl USTA <omerusta@gmail.com>
2013-07-15 10:20:00 -04:00
Stephen Kelly f1fcbe3fde Add Target API to determine if an include is a system include.
The implementation can be modified later so that system includes
can be determined on a per-target basis.
2013-07-02 16:40:02 +02:00
Brad King 8a08ab051a Merge topic 'vs12-generator'
9a76d83 VS12: Find proper MSBuild for VSProjectInSubdir test
4e5cb39 Merge branch 'master' into vs12-generator
78fdbbc FindBoost: Add -vc120 mangling for VS 12
e99d7b1 VS12: Generate flag tables from MSBuild v120 tool files
77ac9b8 VS12: Add Visual Studio 12 generator (#14251)
2013-07-01 09:27:33 -04:00
Brad King 4e5cb398ae Merge branch 'master' into vs12-generator
Resolve conflicts in Tests/Preprocess/CMakeLists.txt by keeping
the side from 'master'.
2013-06-28 18:29:54 -04:00
Brad King 77ac9b8b9c VS12: Add Visual Studio 12 generator (#14251)
Copy cmGlobalVisualStudio11Generator to cmGlobalVisualStudio12Generator
and update version numbers accordingly.  Add the VS12 enumeration value.
Add module CMakeVS12FindMake to find MSBuild.  Look for MSBuild in its
now-dedicated Windows Registry entry.  Teach the platform module
Windows-MSVC to set MSVC12 and document the variable.  Teach module
InstallRequiredSystemLibraries to look for the VS 12 runtime libraries.

Teach tests CheckCompilerRelatedVariables, Preprocess, VSExternalInclude,
and RunCMake.GeneratorToolset to treat VS 12 as they do VS 10 and 11.

Inspired-by: Minmin Gong <minmin.gong@gmail.com>
2013-06-28 18:13:14 -04:00
Alex Neundorf ba0e06f250 automoc: add a global AUTOMOC_TARGETS_FOLDER property
This has been requested, along with a patch, by Shaun Williams
 in http://public.kitware.com/Bug/view.php?id=13788 .
It adds a global property AUTOMOC_TARGETS_FOLDER, which can
be used to group the automoc targets together in a folder e.g.
in Visual Studio.

Alex
2013-06-28 21:40:16 +02:00
Brad King 0bd82cb1a7 Merge topic 'config-dependent-CMAKE_AUTOMOC'
ea4d784 QtAutomoc: Use config-dependent compile definitions and includes.
67f6ceb QtAutomoc: Fix handling of list separator for compile definitions.
2013-06-24 08:47:03 -04:00
Brad King 059be4ba3b Merge topic 'add-whitespace'
2331b57 Add whitespace after colons in error messages.
2013-06-24 08:38:12 -04:00
Brad King c5c94269b6 Merge topic 'doc-E-tar-zip'
ae06f80 cmake: Document "-E tar" support for .zip (#14225)
2013-06-24 08:37:42 -04:00
Stephen Kelly 2331b57bec Add whitespace after colons in error messages. 2013-06-21 16:21:44 +02:00
Brad King ae06f80716 cmake: Document "-E tar" support for .zip (#14225)
Through use of libarchive internally we support .zip files as well as
.tar format.  The ExternalProject module makes use of this feature.
Document support officially.
2013-06-19 10:05:44 -04:00
Brad King b9f4383f69 Split cmBootstrapCommands.cxx into two sources
The single translation unit has grown too large for some compilers.
Split it into cmBootstrapCommands1.cxx and cmBootstrapCommands2.cxx.
2013-06-14 08:35:52 -04:00
Stephen Kelly ea4d7848e5 QtAutomoc: Use config-dependent compile definitions and includes.
Instead of always using the includes and defines which are not
config-specific, ensure that the config specific ones can be used.

Task-number: #13589
2013-06-12 12:53:25 +02:00
Stephen Kelly 273ecab96d CLI: Suppress the unused warning if the key value pair is cached.
It is common to specify a CMAKE_TOOLCHAIN_FILE and get a warning
for using it despite it not being used.

The WarnUnusedCliUnused test relies on the warning being emitted
each time cmake is run on an existing build. That behavior is changed
by this patch to warn only on the first invokation of CMake, and not
on subsequent invokations (because the variable is in the cache with
the same value). For that test, a clean target is added which clears
the cache and cause the warning to be emitted each time.

As the Ninja generator does not support the feature needed to test
this, it is not tested with that generator.
2013-06-04 12:38:56 +02:00
Andreas Mohr bf019d765d Fix spelling and typos (non-binary) 2013-05-07 08:39:19 -04:00
Andreas Mohr ddac8d3d2d Fix spelling and typos (affecting binary data / module messages) 2013-05-07 08:39:19 -04:00
Andreas Mohr 86832cecd5 Fix spelling and typos (affecting users) 2013-05-07 08:39:19 -04:00
Brad King 71b217ecc9 Merge topic 'sublime-text-2-generator'
f616ff2 Update generator to use new cmGeneratorTarget api.
674bd6e Merge branch 'master' into sublime-text-2-generator
4760ead Remove ability to generate sublime clang files.
da0898e Correct missing parameter to CMP0018Flags call.
badb40d Merge branch 'master' into sublime-text-2-generator
b3ae61f Merge branch 'master' into sublime-text-2-generator
089d9cc SublimeText 2 Gen: Set the sublimeclang_options_script property.
44c2eee Merge branch 'master' into sublime-text-2-generator
304b885 Sublime Text 2 Gen: Per-source Compile flags are now saved in a separate file.
5b2aa3d SublimeText2 Gen: Fixed the issue where include directory flags used -D
90bcb77 SublimeText2 Gen: Improved use of define, include flags from CMAKE_C(XX)_FLAGS
cc84072 Merge branch 'master' into sublime-text-2-generator
8670cbe Define flags in CMAKE_C(XX)_FLAGS are now included in SublimeClang settings.
d022d4e Merge branch 'master' into sublime-text-2-generator
9cd3e70 Fixed Sublime Text project generation for in-source builds
44f35f7 Added a CMAKE_SUBLIMECLANG_DISABLED variable that disables SublimeClang.
...
2013-02-19 14:58:42 -05:00
Robert Maynard 674bd6e778 Merge branch 'master' into sublime-text-2-generator 2013-02-19 14:44:57 -05:00
Robert Maynard badb40d0f8 Merge branch 'master' into sublime-text-2-generator
Resolve conflict in Source/cmDocumentVariables.cxx by adding both
variables.
2013-02-19 14:42:00 -05:00
Brad King 5698d9b865 Merge topic 'vs-atomic-generated-stamp'
2dc17f8 VS: Replace generation timestamp file atomically
2013-02-15 13:13:14 -05:00
Brad King 2dc17f88dd VS: Replace generation timestamp file atomically
Since commit 34c882a9 (Allow VS 7 project Rebuild and Solution Rebuild to
work, 2007-11-10) we use a "CMakeFiles/generated.stamp" and some
associated files in the build tree to avoid re-running CMake when the
inputs have not changed but VS has cleaned the outputs it knows about.

When we do not really need to re-run we restore the generated.stamp file.
The non-re-run case can happen in multiple targets in parallel in VS >= 10
so we must restore the file atomically to avoid races.  Write the stamp
file to a random temporary name and then atomically rename it to the real
stamp file.
2013-02-12 13:55:53 -05:00
Brad King ccfeefae35 Fix crash on empty CMAKE_<lang>_COMPILER value (#13901)
Since commit fd33bf93 (fix for bug 6102, allow users to change the
compiler, 2007-12-13) we keep an internal ;-list of language compiler
variable and value pairs.  Preserve empty values on expansion to ensure
that the key/value pairing remains consistent.
2013-02-08 16:33:52 -05:00
Brad King c0debb1f89 Merge branch 'master' into generator-toolset
We need the latest Tests/CMakeLists.txt so we can refactor all tests.
2013-02-07 11:09:01 -05:00
Brad King 4fd5342956 CMake: Add -T option to choose a generator toolset
Reject the option by default.  It will be implemented on a per-generator
basis.  Pass the setting into try_compile project generation.  Add cache
entry CMAKE_GENERATOR_TOOLSET and associated variable documentation to
hold the value persistently.

Add a RunCMake.GeneratorToolset test to cover basic "-T" option cases.
Verify that CMAKE_GENERATOR_TOOLSET is empty without -T, that -T is
rejected when the generator doesn't support it, and that two -T options
are always rejected.
2013-02-07 10:53:19 -05:00
Stephen Kelly 6063fef226 Output include directories as LOG messages, not warnings. 2013-01-21 09:12:22 +01:00
Brad King 0dce5bc2f2 Merge topic 'compatible-INTERFACE-user-properties'
7171fd0 Add a way to check INTERFACE user property compatibility.
2013-01-15 14:34:24 -05:00
Stephen Kelly 7171fd0a90 Add a way to check INTERFACE user property compatibility. 2013-01-15 14:33:45 -05:00
Brad King 8ff1d4714f CMake: Skip empty link.txt lines (#13845)
In the implementation of "cmake -E cmake_link_script", skip lines from
the input file that are empty or contain only whitespace.  Do not try to
run a child with no command line.
2013-01-11 10:57:39 -05:00
Stephen Kelly 310455cc18 Fix some warnings from -Wundef
Other warnings come from kwsys, so the flag can't be enabled.
2012-12-22 12:47:54 +01:00
Patrick Gansterer dce54b103a Add command to generate environment for a Windows CE SDK 2012-11-30 07:59:25 -05:00
Morné Chamberlain b3ae61f833 Merge branch 'master' into sublime-text-2-generator 2012-11-24 20:23:55 +02: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
Patrick Gansterer 75ebebc39c VS: Remove platform specific generator files
Move the whole logic into the base class and the factory.
2012-11-19 14:56:29 -05:00
Patrick Gansterer 04ff866ca8 Allow a GeneratorFactory handling of more than one generator
Pass the name of the requested generator to the generator factory,
which is now responsible to check if it can create a matching
generator for the name. This allows us to add more logic to the
factory in a next step, so that not every possible generator needs
to get registered explicit in cmake::AddDefaultGenerators().
2012-11-19 12:54:35 -05:00
Patrick Gansterer 984ebc3350 Search generator in cmake::ExtraGenerators before in cmake::Generators
Since ExtraGenerators does not contain items, which are in Generators
too, there is not change in behaviour. The benefit of this change is,
that the lookup in the Generators map is now only done once.
2012-11-19 12:54:34 -05:00
Patrick Gansterer 30a695021c Add cmGlobalGeneratorFactory::GetGenerators()
This allows cmGlobalGeneratorFactory to create more than
one type of cmGlobalGenerator in a next step.
2012-11-19 12:54:34 -05:00
Patrick Gansterer e8f841473b Introduce the abstract class cmGlobalGeneratorFactory
This new abstract class allows us move some logic from the
cmGlobalGenerator into its own layer in a next step.
2012-11-19 12:54:30 -05:00
Morné Chamberlain b8457ad18b Added a generator for Sublime Text 2 project files.
The generator adds all list and source files for each defined
project. The generated project files also include build_system
entries that run the platform-specific make on the generated
Makefiles. A build_system entry is created for each target
that was defined in the CMakeLists.txt files.

At the moment this has only been tested with C/C++ projects.
2012-10-13 09:47:50 +02:00
Peter Kümmel 8d674e7844 Ninja: move -LIBPATH behind -link option
Don' pass linker option to the compile
2012-10-01 17:06:38 -04:00
Bill Hoffman dbd99d6fbb Revert "Ninja: don't expand any rsp files"
This reverts commit 5598d9b2a0.

Since commit f1670ab1 (Ninja: don't confuse ninja's rsp files with
nmake's, 2012-09-26) Ninja generator response files are placed in
CMakeFiles/ so the previously existing check already avoids expanding
them.
2012-10-01 17:06:37 -04:00
David Cole 3f3b731961 Merge topic 'use-generator-target'
879fd35 Revert "Move GenerateTargetManifest to cmGeneratorTarget."
6674583 Fix compiler warning with initialization order.
5285458 Add convenience for getting a cmGeneratorTarget to use.
c31f3d9 Add a wrapper for accessing config-specific compile-definitions.
d1446ca Append the COMPILE_DEFINITIONS from the Makefile to all targets.
290e92a Move GetIncludeDirectories to cmGeneratorTarget.
f9146f6 Port cmLocalGenerator::GetTargetFlags to cmGeneratorTarget.
9facfd1 Move GetCreateRuleVariable to cmGeneratorTarget.
78bfee3 Make cmLocalGenerator::AddArchitectureFlags take a cmGeneratorTarget.
4f5384e Move GetLinkInformation to cmGeneratorTarget
987e12e Move GenerateTargetManifest to cmGeneratorTarget.
14bf778 Store cmGeneratorTargets with the makefile.
f428ca2 Add more forwarding API to cmGeneratorTarget.
2012-09-25 15:18:34 -04:00
Brad King 8fc88b7eb0 Merge topic 'vs-link-rsp'
5598d9b Ninja: don't expand any rsp files
2012-09-19 13:58:12 -04:00
Peter Kuemmel 5598d9b2a0 Ninja: don't expand any rsp files 2012-09-19 11:40:47 -04:00
Stephen Kelly f9146f6b90 Port cmLocalGenerator::GetTargetFlags to cmGeneratorTarget. 2012-09-19 15:31:39 +02:00
Brad King e17f3458ce VS11: Detect VS 2012 Express for default generator (#13348)
Add WDExpress to the list of registry search locations.  Add VS 11 to
the list of VS versions and corresponding generator names.  Fix the
search logic to use the most recent version found under any registry
entry.

Inspired-by: Peter Kümmel <syntheticpp@gmx.net>
2012-09-18 14:02:01 -04:00
Brad King 907019b338 Merge topic 'ErrorIfCTEST_USE_LAUNCHERSSetButLauncherRuleNotSet'
95e502e error out if CTEST_USE_LAUNCHERS is TRUE but RULE_LAUNCH_* are not set
2012-08-30 11:54:13 -04:00
Brad King 7195aca54f Make platform information files specific to the CMake version
At the top of a build tree we configure inside the CMakeFiles directory
files such as "CMakeSystem.cmake" and "CMake<lang>Compiler.cmake" to
save information detected about the system and compilers in use.  The
method of detection and the exact results store varies across CMake
versions as things improve.  This leads to problems when loading files
configured by a different version of CMake.  Previously we ignored such
existing files only if the major.minor part of the CMake version
component changed, and depended on the CMakeCache.txt to tell us the
last version of CMake that wrote the files.  This led to problems if the
user deletes the CMakeCache.txt or we add required information to the
files in a patch-level release of CMake (still a "feature point" release
by modern CMake versioning convention).

Ensure that we always have version-consistent platform information files
by storing them in a subdirectory named with the CMake version.  Every
version of CMake will do its own system and compiler identification
checks even when a build tree has already been configured by another
version of CMake.  Stored results will not clobber those from other
versions of CMake which may be run again on the same tree in the future.
Loaded results will match what the system and language modules expect.

Rename the undocumented variable CMAKE_PLATFORM_ROOT_BIN to
CMAKE_PLATFORM_INFO_DIR to clarify its purpose.  The new variable points
at the version-specific directory while the old variable did not.
2012-08-24 10:52:23 -04:00
Alex Neundorf 95e502ee7c error out if CTEST_USE_LAUNCHERS is TRUE but RULE_LAUNCH_* are not set
Otherwise, CTEST_USE_LAUNCHERS can be set to true in a driving ctest
script, and everything looks like it would work and reports 0 build errors,
but actually there can be any amount of errors and they are just not reported.
By adding this check cmake now errors out if CTEST_USE_LAUNCHERS is enabled, but
the RULE properties are not set, which would lead to a not-working ctest run.

Alex
2012-08-20 23:19:44 +02:00