Commit Graph

2851 Commits

Author SHA1 Message Date
Brad King e965cb12e2 Tests: Simplify CTest.BuildCommand.ProjectInSubdir configuration
Collect all ctest_configure options in a list to configure it into the
test script.  Drop the unused -DCMAKE_MAKE_PROGRAM argument to ctest.
2013-11-18 11:30:49 -05:00
Brad King 72bf2552f2 Tests: Pass --build-options to every test
Create a "build_options" variable whose value is passed to every
"ctest --build-and-test" call through the --build-options argument.
2013-11-18 11:30:49 -05:00
Brad King 4ac75fdfe6 Prefer CMAKE_MAKE_PROGRAM over CMAKE_BUILD_TOOL (#14548)
Historically these were both added for the Makefile and Visual Studio
generators, respectively.  Later the VS generators started using the
CMAKE_MAKE_PROGRAM cache entry to find the IDE build tool, and the
CMAKE_BUILD_TOOL was simply set as an alias.

Fix the documentation to explain that CMAKE_MAKE_PROGRAM is the modern
variable and that CMAKE_BUILD_TOOL is the compatibility alias, not the
other way around.  Replace uses of CMAKE_BUILD_TOOL with
CMAKE_MAKE_PROGRAM in CMake-provided modules.  Nothing needs to lookup
CMAKE_BUILD_TOOL in the cache, so simply set it as a normal variable.
2013-11-18 08:26:23 -05:00
Brad King cc23f92861 Tests: Split <test>_EXTRA_OPTIONS into <test>_(CTEST|BUILD)_OPTIONS
Some extra options are for "ctest --build-and-test" directly, and others
are values for "--build-options".  Split these two roles out into two
separate variables and update existing uses.
2013-11-18 08:26:23 -05:00
Brad King 20bac8f19e Tests: Simplify ExternalProjectUpdate test arguments
Drop the -DCMAKE_TEST_MAKEPROGRAM argument because the value is not
used inside the test script.
2013-11-18 08:26:23 -05:00
Brad King 4d85365307 Tests: Fix make capability selection for empty CMAKE_TEST_MAKEPROGRAM 2013-11-18 08:26:23 -05:00
Brad King 95b28eb763 Tests: Teach MakeClean to use "cmake --build"
Switch from "ctest --build-and-test" to "cmake --build" to drive the
clean target in the MakeClean test.
2013-11-18 08:26:23 -05:00
Brad King c85672634c Tests: Teach SimpleInstall to use "cmake --build"
Switch from "ctest --build-and-test" to "cmake --build" to drive the
install and package targets in the SimpleInstall test.
2013-11-18 08:26:22 -05:00
Brad King f2b1d653cf Tests: Launch CMake.Install test through 'cmake --build'
Use "cmake --build" to drive the "install" target from the CMake build
tree itself.  This avoids using the heavier "ctest --build-and-test"
just to run the native build tool to drive installation.
2013-11-18 08:26:22 -05:00
Brad King 8ee6b47630 Tests: Launch BootstrapTest through cmake instead of ctest
Run the bootstrap script through "cmake -P" instead of
"ctest --build-and-test" so that we do not need to abuse
the --build-makeprogram option of the latter.
2013-11-18 08:26:22 -05:00
Brad King 7fc7624af5 Tests: Move CMAKE_TEST_MAKEPROGRAM into Tests/CMakeLists.txt
Also drop the temporary MAKEPROGRAM variable and the DART_ROOT special
case.  We never run dashboard clients with Dart anymore.
2013-11-18 08:26:22 -05:00
Brad King 1f679b8d46 Tests: Drop remnants of unused ShellInstall test
The ShellInstall test has long been replaced by the CMake.Install test.
2013-11-18 08:26:21 -05:00
Brad King bca67c710f build_command: Return a "cmake --build" command-line
Re-implement the build_command() command to use "cmake --build" instead
of generating a native build tool invocation directly.  This command
will internally invoke the proper native build tool.

This avoids requiring cmGlobalGenerator::GenerateBuildCommand to produce
a string so that it can be later refactored to produce a vector with no
quoting or escaping.  It will also allow us to later teach CMake to
delay the decision about which build tool to invoke until after the
project build system is generated to disk.  For example, on Visual
Studio 10 and above the preferred command-line tool is MSBuild, but we
need to fall back to devenv if the .sln has Intel Fortran .vfproj files.
2013-11-15 14:38:18 -05:00
Brad King 15872a3c30 Merge topic 'set_emptyvar_PARENT_SCOPE'
bf755c7 set: Add unit tests for set/unset PARENT_SCOPE
bc280f1 set: Fix handling of empty value with PARENT_SCOPE
20afbd5 set: Handle value-less PARENT_SCOPE explicitly
2013-11-14 11:28:12 -05:00
Brad King 42eaf34168 Merge topic 'configure_file-drop-IMMEDIATE'
15610bb Drop use of configure_file IMMEDIATE option
2013-11-14 11:28:07 -05:00
Daniele E. Domenichelli bf755c7c38 set: Add unit tests for set/unset PARENT_SCOPE
Create a RunCMake.set test to cover set() command cases, starting with
PARENT_SCOPE.
2013-11-13 10:18:38 -05:00
Daniele E. Domenichelli 15610bb5b1 Drop use of configure_file IMMEDIATE option
Since commit 7d47c693 (Drop compatibility with CMake < 2.4, 2013-10-08)
we no longer need to use the configure_file IMMEDIATE option to support
compatibility modes less than 2.0.
2013-11-13 10:12:17 -05:00
Brad King 8eb20eeabe ExternalData: Allow local stores without any URL templates
Allow ExternalData_URL_TEMPLATES to be empty if a value for
ExternalData_OBJECT_STORES is provided.  Assume in this use case that
the object stores will already contain all needed objects.  Extend the
Module.ExternalData test to cover this case (all objects in stores).
Extend the RunCMake.ExternalData test to cover the non-failure message
case when stores are provided without URL templates.
2013-11-13 10:03:36 -05:00
Brad King 558a6f1f92 Merge topic 'cmake-copyright-year'
3bade75 Help: Parse Copyright.txt instead of using current year
2bbf6bd Copyright.txt: Add test to check year range
3ee67d0 Copyright.txt: Update year range to end in 2013
621ba1f cmake-gui: Parse Copyright.txt instead of duplicating notice
993b685 bootstrap: Parse Copyright.txt instead of duplicating notice
2013-11-13 09:59:12 -05:00
Brad King 978d796e8d Merge topic 'policy-summary-periods'
49cbca6 CMP0038: Add missing '.' to policy summary line
7390002 CMP0039: Add missing '.' to policy summary line
2013-11-13 09:58:50 -05:00
Brad King 3c4071bec4 Merge topic 'fix-INTERFACE-with-no-SHARED-libs'
64f73b0 add_library: Fix INTERFACE on platforms with no shared libs (#14561)
2013-11-13 09:57:20 -05:00
Brad King 2bbf6bd7f8 Copyright.txt: Add test to check year range
Add a CMake.Copyright test that, when the CMake version number knows the
year (as it does in development versions), checks that Copyright.txt has
been updated with the current version year.
2013-11-12 16:35:26 -05:00
Daniele E. Domenichelli 7390002964 CMP0039: Add missing '.' to policy summary line 2013-11-12 11:54:14 -05:00
Stephen Kelly 64f73b0fb6 add_library: Fix INTERFACE on platforms with no shared libs (#14561) 2013-11-12 09:07:10 -05:00
Brad King 298ef43329 Merge topic 'test-RunCMake.CMP0037-everywhere'
8c6c1f1 Enable RunCMake.CMP0037 test everywhere
2013-11-12 08:31:48 -05:00
Brad King 8c6c1f16c9 Enable RunCMake.CMP0037 test everywhere
Split the test cases covering spaces and colons into separate units.
Run the space cases everywhere.  Disable the colon cases where they
are known to fail.  This approach increases platform coverage for the
test and makes the known-failure logic as local as possible.

No Makefile generator on Windows can generate targets with ':'
in their name because the CMakeFiles/<target>.dir directory cannot
be created.  Skip this part of the test on all Windows Make tools.
2013-11-11 07:27:02 -05:00
Brad King 110f244601 Merge topic 'test-LINK_ONLY-expression'
53b10fd Genex: Add a test for the LINK_ONLY expression.
2013-11-08 10:33:18 -05:00
Brad King 2053e0cd51 Merge topic 'tll-target-policies'
596b2a8 Disallow linking to utility targets (#13902).
301bb5c Disallow link-to-self (#13947).
05f5fde Disallow invalid target names (#13140)
2013-11-08 10:33:14 -05:00
Stephen Kelly 596b2a8c08 Disallow linking to utility targets (#13902). 2013-11-07 11:06:40 +01:00
Stephen Kelly 301bb5cdda Disallow link-to-self (#13947). 2013-11-07 11:06:39 +01:00
Stephen Kelly 05f5fde0eb Disallow invalid target names (#13140)
Exclude Borland and NMake from the CMP0037 test. They do not accept
the colon in a target name.
2013-11-07 11:06:39 +01:00
Stephen Kelly 53b10fdad7 Genex: Add a test for the LINK_ONLY expression.
Commit 239b0c6b (Don't add invalid content to static lib
INTERFACE_LINK_LIBRARIES., 2013-10-20) extended a test which
excercised the logic of the LINK_ONLY generator expression.

Commit ef10b87c (CMP0022: Plain target_link_libraries must populate
link interface, 2013-11-02) removed the instance of LINK_ONLY which
was excercised by that test.

Add a new test which excercises the other instance of LINK_ONLY by
setting the CMP0022 policy to NEW and consuming the contents of the
INTERFACE_LINK_LIBRARIES target property.
2013-11-06 22:57:31 +01:00
Clinton Stimpson a5aadcd46d CFBundle test: Add isysroot argument when calling Rez. 2013-11-06 06:42:44 -07:00
Brad King e313d397cd Merge topic 'fix-automoc-compile-definitions'
a1b9465 Automoc: Add directory-level COMPILE_DEFINITIONS to command line (#14535)
2013-11-05 13:32:15 -05:00
Stephen Kelly a1b9465bf8 Automoc: Add directory-level COMPILE_DEFINITIONS to command line (#14535)
In commit 18412153 (Refactor cmTarget::GetCompileDefinitions...,
2013-06-06) cmQtAutomoc was refactored to get all compile definitions
from the target instead of separately asking the target and querying the
directory-level COMPILE_DEFINITIONS property value.  While the
generation process does integrate directory-level COMPILE_DEFINITIONS
into the target definitions, this did not happen until after Automoc
targets are constructed.  Therefore the commit regressed use of
directory-level definitions in Automoc targets.

Factor the definition finalization logic out from the
cmGlobalGenerator::CreateGeneratorTargets method into a new
cmGlobalGenerator::FinalizeTargetCompileDefinitions method and call it
before constructing Automoc targets.  This will place the
directory-level definitions into the target in time to use them for the
Automoc targets.

Extend the QtAutomoc test to cover this case.
2013-11-05 12:00:49 -05:00
Brad King d9600f9880 Merge topic 'test-Assembler-no-g'
f60797f Tests/Assembler: Drop -g when generating sample assembly source
2013-11-05 11:42:01 -05:00
Brad King b4a1f442bb Merge topic 'policy-CMP0022-fixes-for-master'
b51696f CMP0022: Update target_link_libraries plain signature documentation
25b7f87 Merge branch 'policy-CMP0022-fixes' into policy-CMP0022-fixes-for-master
0a561a0 CMP0022: Warn about a given target at most once
23d21b7 Do not export INTERFACE_LINK_LIBRARIES from non-linkable targets
ef10b87 CMP0022: Plain target_link_libraries must populate link interface
0e06788 CMP0022: Add test for target_link_libraries plain signature
c0f4a61 CMP0022: Add unit test for null pointer check and message.
4b0cfa7 Merge branch 'output-CMP0022-entries' into policy-CMP0022-fixes
2013-11-04 07:54:20 -05:00
Brad King ae57fb8ef6 Merge topic 'robust-ctest_empty_binary_directory'
35fbc10 CTest: more aggressive implementation of ctest_empty_binary_directory()
9d9f102 Tests: added test for ctest_empty_binary_directory()
2013-11-04 07:53:47 -05:00
Brad King f3698f7c4a Merge topic 'cpack-drag-n-drop-rez'
53d6ebb cpack: For DragNDrop generator, add sysroot option when calling Rez.
193029c cpack: For DragNDrop generator, add sysroot option when calling Rez.
2013-11-04 07:53:25 -05:00
Brad King 25b7f87eca Merge branch 'policy-CMP0022-fixes' into policy-CMP0022-fixes-for-master
Resolve conflict in Source/cmTarget.cxx by integrating the changes to
the internal copy constructor from both sides.  Also resolve a logical
conflict by dropping the special case for INTERFACE_LIBRARY targets.
Since cmTarget::SetMakefile already forces CMP0022 to NEW for such
targets we need no special handling.

Resolve conflict in Source/cmTargetLinkLibrariesCommand.h by dropping
the documentation change.  We will make the same change in the new
location of the same documentation in a separate commit.

Resolve conflicts in

 Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt
 Tests/RunCMake/CMP0022/RunCMakeTest.cmake

by taking the side from the 'policy-CMP0022-fixes' branch.
2013-11-03 09:20:47 -05:00
Brad King 0a561a0347 CMP0022: Warn about a given target at most once
Since cmTarget::ComputeLinkInterface is called separately for each
"head" target that links a target, the warning we produce when
CMP0022 is not set could be repeated.  Add explicit logic to allow
the warning to appear at most once.  Multiple copies of the warning
for the same target are almost always identical and therefore
redundant.  In the rare case that two copies of the warning are
different, the second can appear in a future run after the first
is fixed.
2013-11-03 09:14:54 -05:00
Brad King 23d21b78e1 Do not export INTERFACE_LINK_LIBRARIES from non-linkable targets
When cmExportFileGenerator::SetImportLinkInterface exports the old
LINK_INTERFACE_LIBRARIES property values it skips doing so for
non-linkable targets because target->GetLinkInterface returns NULL for
such targets.

Since cmExportFileGenerator::PopulateInterfaceLinkLibrariesProperty
looks at the INTERFACE_LINK_LIBRARIES property directly instead of using
the computed link interface, teach it to skip exporting the property if
target->IsLinkable returns false.

Extend the RunCMake.CMP0022 test with a case covering this.  Simply
export an executable target that links to a library that is not
exported.
2013-11-02 14:51:07 -04:00
Brad King ef10b87cc1 CMP0022: Plain target_link_libraries must populate link interface
The CMP0022 NEW behavior is that the INTERFACE_LINK_LIBRARIES property
exactly defines the link interface.  The plain target_link_libraries
signature says linking is transitive by default, so it should populate
the property.

Teach the target_link_libraries plain signature to populate the
INTERFACE_LINK_LIBRARIES regardless of the CMP0022 setting.  Refactor
the cmTarget::ComputeLinkInterface checks that warn when the policy is
not set to compare the new property to either the explicitly set old
link interface properties or the link implementation fallback for all
linkable target types, not just static libraries.

This fixes a regression in 2.8.12.0 that caused target_link_libraries to
not implement transitive linking in the plain signature once the policy
CMP0022 is set to NEW.
2013-11-02 12:55:17 -04:00
Stephen Kelly 0e06788c0a CMP0022: Add test for target_link_libraries plain signature 2013-11-02 12:48:48 -04:00
Stephen Kelly c0f4a61074 CMP0022: Add unit test for null pointer check and message. 2013-11-02 12:48:40 -04:00
Brad King 4b0cfa7004 Merge branch 'output-CMP0022-entries' into policy-CMP0022-fixes 2013-11-02 12:47:45 -04:00
Brad King f61bbf1b90 Merge topic 'ctest-p4'
1b54b1d ctest_update: Do not remove the p4 depot name
2013-11-02 10:54:42 -04:00
Brad King 872a9d6476 Merge topic 'object-library-no-TARGET_FILE'
d960589 Genex: Reject $<TARGET_FILE:...> for object libraries (#14532)
2013-11-02 10:54:23 -04:00
Brad King 53ac9b8d86 Merge topic 'object-library-missing-source'
5a2fc3d Check for OBJECT_LIBRARY source files at start of generation
2013-11-02 10:54:15 -04:00
Brad King 2043a86b6a Merge topic 'doc-rst-note-and-productionlist'
450b515 cmRST: Add support for the note and productionlist directives
2013-11-02 10:54:10 -04:00
Nils Gladitz 9d9f102f53 Tests: added test for ctest_empty_binary_directory() 2013-11-01 21:32:16 +01:00
Brad King 5a2fc3d696 Check for OBJECT_LIBRARY source files at start of generation
Teach cmGlobalGenerator::CheckTargets to include OBJECT_LIBRARY targets
in the check for source file existence.

Extend the RunCMake.ObjectLibrary test to cover this case.
2013-11-01 14:46:58 -04:00
Brad King f60797f75b Tests/Assembler: Drop -g when generating sample assembly source
Some compilers, such as Clang on OS X, do not want the -g flag for both
generating assembly code and assembling it.  Drop the -g flag from
generation of main.s in the Assembler test.
2013-11-01 10:55:58 -04:00
Brad King d960589778 Genex: Reject $<TARGET_FILE:...> for object libraries (#14532)
Teach the cmGeneratorExpressionEvaluator filesystem artifact logic
to reject OBJECT_LIBRARY targets since they have no main artifact.
Without the explicit rejection evaluation falls through to an
internal CMake error message in cmTarget::GetOutputInfo.

Extend the RunCMake.GeneratorExpression test to cover these cases.
2013-11-01 10:17:01 -04:00
Brad King e065decd43 Merge topic 'add-CMAKE_FIND_NO_INSTALL_PREFIX'
fe057ab Allow disabling adding the install prefix to the prefix search path.
2013-11-01 09:40:19 -04:00
Brad King a549b68d37 Merge topic 'cmake-syntax-recorded-brackets'
b54dbeb Test foreach/function/macro handling of bracket arguments
ccdf7e0 macro: Do not substitute for placeholders in bracket arguments
999abb9 macro: Add extra indentation to placeholder substitution code
2013-11-01 09:39:56 -04:00
Pedro Navarro 1b54b1d5b7 ctest_update: Do not remove the p4 depot name
Instead of removing the depot name, which causes problems when looking
at the file change list in CDash, make the Update test remove a given
prefix from the files retrieved from Update.xml.
2013-11-01 08:52:26 -04:00
Clinton Stimpson 193029c4aa cpack: For DragNDrop generator, add sysroot option when calling Rez.
Also adding overwrite option (-ov) in case multiple temporary
dmg files are being created.

Fixes bug #14536.
2013-10-31 20:25:12 -06:00
Stephen Kelly fe057ab3cd Allow disabling adding the install prefix to the prefix search path.
In certain scenarios, it is preferable to keep a 'dirty' install prefix
than to clear it, and to expect that content will not be found there.
Add a CMAKE_FIND_NO_INSTALL_PREFIX variable that can be set to disable
searching the install prefix.
2013-10-31 16:40:24 +01:00
Brad King d182a55adb Merge topic 'fix-ninja-launcher-errors-from-custom'
4fcb97e Tests: Add test for CTEST_USE_LAUNCHERS capture of custom commands
05c7042 Ninja: run custom commands through launcher if available
2013-10-31 09:39:54 -04:00
Nils Gladitz 4fcb97eaac Tests: Add test for CTEST_USE_LAUNCHERS capture of custom commands
This new test detects if custom command failures are detected with
launchers.
2013-10-31 09:29:55 -04:00
Brad King b54dbebf62 Test foreach/function/macro handling of bracket arguments
Bracket arguments recorded in command invocations inside foreach,
function, and macro blocks should not have any replacements done when
the arguments are replayed later.  Teach the RunCMake.Syntax test to
cover these cases.
2013-10-30 19:13:41 -04:00
Brad King 450b515ad0 cmRST: Add support for the note and productionlist directives
Simply print out the lines as normal paragraph text.  Teach the
CMakeLib.testRST test to cover this syntax.  Update the
cmake-developer.7 manual to document support for the directives.
2013-10-30 10:26:29 -04:00
Brad King 8640e52979 Add to RunCMake.Syntax test \-escape cases
Add an Escape1 test case covering \-escape cases inside bracket, quoted,
and unquoted arguments.  Also cover comments immediately after quoted
and unquoted arguments on lines containing \# escapes.
2013-10-29 10:21:50 -04:00
Brad King 144068e270 Add to RunCMake.Syntax test comments not separated by spaces
Extend the BracketComment5 test case to cover both bracket comments and
line comments starting immediately after a bracket comment closes.
2013-10-29 09:55:43 -04:00
Brad King 8f80eaf981 Merge topic 'fix-custom-source-with-flags-crash'
f037b9b Generators: don't append sources from utility targets to objectSources
2013-10-29 09:45:45 -04:00
Brad King fcbe435c23 Merge topic 'Qt-auto-generators'
9c87d9c Add automatic rcc invocation for Qt.
84218e1 Add automatic uic invocation for Qt.
94a0ca6 Record which files are skipped by automoc.
18fb758 Run the main executable created in the autogen tests.
e485ba1 Rename the QtAutomoc tests to QtAutogen.
7ce65c3 Add extra checks for the AUTOMOC target property.
32771fc Update output messages for generic use.
f371ab5 Rename RunAutomoc to RunAutogen.
85b3d6e Extract an SetupAutoMocTarget method.
ca124a1 Rename the AutomocInfo.cmake file to be more generic.
a342c9f Move some makefile definitions up away from moc-specific code.
98632ef Add the AUTOGEN_TARGETS_FOLDER and obsolete AUTOMOC_TARGETS_FOLDER.
63378ba Rename some variables to reflect broader scope.
97f1aa3 Rename method to reflect generic use.
4abb111 Rename local variable to reflect generic use.
03878c9 Move variable set to where it is used.
...
2013-10-28 15:23:09 -04:00
Nils Gladitz f037b9b726 Generators: don't append sources from utility targets to objectSources 2013-10-28 14:25:28 +01:00
Brad King 16df2456a4 Merge topic 'enable-language-require-compiler'
3e04946 Require CMAKE_<LANG>_COMPILER to be found as a full path
6007f7c CMakeDetermineCompilerId: Always use compiler detected from IDE
332771c CMakeDetermine*Compiler: Remove temporary cache entry
2013-10-28 08:39:29 -04:00
Brad King 3e04946f7b Require CMAKE_<LANG>_COMPILER to be found as a full path
All generators now support detection of the full path to the compiler, so
require it to be so.  This will allow CMake<LANG>Information.cmake and
other logic to assume the full path to the compiler tool is available.

The Makefile generators already rejected CMAKE_<LANG>_COMPILER values
that did not name an existing compiler.  Extend this error message to
all generators, make it occur as early as possible, and improve the
message with advice about how to set the compiler.  If the full path to
the compiler is not known, finish enabling languages with a fatal error
so configuration does not continue.

For now, allow the RC language compiler to not be a full path.  Later we
will need to detect the full path to "rc" under the VS IDE.

Add a RunCMake.CompilerNotFound test to cover failure cases.
Fix the RunCMake.CompilerChange test EmptyCompiler case to work
when configuration does not continue past enable_language.
2013-10-28 08:36:14 -04:00
Nils Gladitz 0655d0946e Tests: use string(TIMESTAMP) instead of system and locale specific date/time 2013-10-26 21:09:37 +02:00
Brad King 38fc334fd0 Merge topic 'ctest-fix-run-serial'
ff59365 CTest: fix dashboard issues associated with the ctest-fix-run-serial topic
7a665ae CTest: added test for RUN_SERIAL issue #14484
384beff CTest: added comments that describe the basic test sorting approach
adbe00d CTest: removed redundant copy of test dependency set
1b750cb CTest: perform cycle test early
6d4d7ca CTest: consider previously failed tests before all others
e809d8c CTest: prioritize tests by their depth in the dependency graph
44017a4 CTest: handle dependent and non dependent test requirements equally
2013-10-26 10:29:34 -04:00
Brad King ef13fc4dfc Merge topic 'ctest-p4'
970c823 ctest_update: Add support for Perforce p4 client
2013-10-26 10:29:28 -04:00
Brad King bd48b8a8ce Merge topic 'handle-CMP0024-in-tests'
310aef9 Make ExportLanguages a subtest of the ObjectLibrary test
30ff6cf Refactor the Plugin test.
2013-10-26 10:28:55 -04:00
Brad King cd553c34d6 Merge topic 'wix-fix-shortcut-ids'
fe7f8c9 CPackWiX: use safe IDs for generated start menu shortcuts
2013-10-26 10:28:50 -04:00
Brad King 4025013dd7 Merge topic 'compatible-interface-numbers'
ff6c401 cmTarget: Add interface for compatible numeric properties
e4e20c1 cmTarget: Add enumeration for consistency to expect from properties.
9877769 cmTarget: Assign consistent content back to the property being evaluated.
816b4a8 cmTarget: Make consistentProperty return consistent content.
030800a cmTarget: Add a template to create correct implied content.
2013-10-26 10:28:30 -04:00
Brad King bb21e17fb7 Merge topic 'remove-pre-2.4-compatibility'
7d47c69 Drop compatibility with CMake < 2.4
c7c44fc CTestTest*: Update minimum required CMake to 2.4
2013-10-26 10:28:09 -04:00
Brad King 1b21ac405f Merge topic 'fix-tll-static-private'
239b0c6 Don't add invalid content to static lib INTERFACE_LINK_LIBRARIES.
2013-10-26 10:28:02 -04:00
Brad King 0c46e55656 Merge topic 'remove-old-commands-by-policy'
4ea27bc Cygwin: Avoid legacy warnings in RunCMake.DisallowedCommands test
2013-10-26 10:27:49 -04:00
Pedro Navarro 970c82348b ctest_update: Add support for Perforce p4 client
Teach the ctest_update implementation to use the p4 command-line
client to perform updates and extract the list of changes.

Add a CTest.UpdateP4 test like those that exist already for the other
version control tools.  Make the test available when p4 and the p4d
server are found.  During the test launch p4d in the background to
serve a repository from the test directory.  Then direct the client
toward this server for the duration of the test.
2013-10-26 10:24:15 -04:00
Nils Gladitz fe7f8c99a4 CPackWiX: use safe IDs for generated start menu shortcuts 2013-10-26 10:15:19 -04:00
Stephen Kelly 239b0c6b0e Don't add invalid content to static lib INTERFACE_LINK_LIBRARIES.
Only valid target names or generator expressions may appear in
the target field of a LINK_ONLY expression.

Other content like link flags should still be added to that property
(wrapped in config-specific generator expressions), but not wrapped
in LINK_ONLY. Otherwise undue warnings would be issued for the
policy CMP0022.

The LINK_ONLY expression only has an effect for actual target
names anyway, so there is no logical deficit.
2013-10-26 10:10:20 -04:00
Nils Gladitz ff59365f8b CTest: fix dashboard issues associated with the ctest-fix-run-serial topic 2013-10-25 21:39:58 +02:00
Brad King 4ea27bcc4c Cygwin: Avoid legacy warnings in RunCMake.DisallowedCommands test
Set the minimum required version of CMake high enough to avoid the
warning for CMAKE_LEGACY_CYGWIN_WIN32.  The warning appears on stderr
and breaks the expected output matching.
2013-10-25 15:07:35 -04:00
Stephen Kelly 310aef959b Make ExportLanguages a subtest of the ObjectLibrary test
It was a subtest of the RunCMake.ObjectLibrary test. However, we need
to test a build with ExternalProject after running CMake, which RunCMake tests
do not do.
2013-10-24 19:05:34 +02:00
Stephen Kelly 30ff6cf9e9 Refactor the Plugin test.
Policy CMP0024 was introduced to disallow the include() of a file
generated by export().

Use ExternalProject to test the plugins after building.
2013-10-24 19:03:49 +02:00
Stephen Kelly 9c87d9cc3e Add automatic rcc invocation for Qt.
This replaces the need to invoke qt4_add_resources by allowing
adding the source .qrc file directly to the target sources.
2013-10-24 12:30:41 +02:00
Stephen Kelly 84218e1870 Add automatic uic invocation for Qt.
The source files are already processed by cmQtAutomoc to look for
moc includes, so extend that to also look for ui_ includes and
find corresponding .ui files to process.

This replaces the need to invoke qt4_wrap_ui().

As the ui files are not likely to be part of the SOURCES of the
target, store the options associated with them separately in the
cmMakefile for querying during the autogen run.
2013-10-24 12:30:38 +02:00
Stephen Kelly 18fb7588df Run the main executable created in the autogen tests.
Don't try to show the windows, which would require a gui capable test
machine, and that's not guaranteed.

Automatically link to qtmain.a on Windows to avoid a policy warning. Set
policy CMP0020 to NEW by increasing the required version.

Don't attempt to run the test when using Windows.
2013-10-24 11:50:58 +02:00
Stephen Kelly e485ba1219 Rename the QtAutomoc tests to QtAutogen. 2013-10-24 11:50:58 +02:00
Stephen Kelly ff6c401309 cmTarget: Add interface for compatible numeric properties
When using the boost MPL library, one can set a define to increase
the limit of how many variadic elements should be supported. The
default for BOOST_MPL_LIMIT_VECTOR_SIZE is 20:

 http://www.boost.org/doc/libs/1_36_0/libs/mpl/doc/refmanual/limit-vector-size.html

If the foo library requires that to be set to 30, and the independent
bar library requires it to be set to 40, consumers of both need to set
it to 40.

 add_library(foo INTERFACE)
 set_property(TARGET foo PROPERTY INTERFACE_boost_mpl_vector_size 30)
 set_property(TARGET foo PROPERTY COMPATIBLE_INTERFACE_NUMBER_MAX boost_mpl_vector_size)
 target_compile_definitions(foo INTERFACE BOOST_MPL_LIMIT_VECTOR_SIZE=$<TARGET_PROPERTY:boost_mpl_vector_size>)

 add_library(bar INTERFACE)
 set_property(TARGET bar PROPERTY INTERFACE_boost_mpl_vector_size 40)
 # Technically the next two lines are redundant, but as foo and bar are
 # independent, they both set these interfaces.
 set_property(TARGET bar PROPERTY COMPATIBLE_INTERFACE_NUMBER_MAX boost_mpl_vector_size)
 target_compile_definitions(bar INTERFACE BOOST_MPL_LIMIT_VECTOR_SIZE=$<TARGET_PROPERTY:boost_mpl_vector_size>)

 add_executable(user)
 target_link_libraries(user foo bar)

Because the TARGET_PROPERTY reads the boost_mpl_vector_size property
from the HEAD of the dependency graph (the user target), and because
that property appears in the COMPATIBLE_INTERFACE_NUMBER_MAX of
the dependencies of the user target, the maximum value for it is
chosen for the compile definition, ie, 40.

There are also use-cases for choosing the minimum value of a number.
In Qt, deprecated API can be disabled by version. Setting the
definition QT_DISABLE_DEPRECATED_BEFORE=0 disables no deprecated
API. Setting it to 0x501000 disables API which was deprecated before
Qt 5.1 etc.

If two dependencies require the use of API which was deprecated in
different Qt versions, then COMPATIBLE_INTERFACE_NUMBER_MIN can be
used to ensure that both can compile.
2013-10-24 08:42:05 +02:00
Brad King 2945814de2 cmRST: Teach cmake-module directive to scan bracket comments
When scanning CMake module files for .rst comments, recognize
bracket comments starting in ".rst:" too.  For example:

 #[[.rst:

Include the bracket comment content terminated by the closing bracket.
Exclude the line containing the bracket if it starts in "#".

Teach the CMakeLib.testRST test to cover multiple bracket lengths
and ending brackets on lines with and without "#".

Update the cmake-developer.7 manual to document the bracket-comment
syntax for .rst documentation.
2013-10-23 09:36:00 -04:00
Brad King efcf318f8d Add \-continuation to CMake language quoted arguments
Teach the CMake language lexer to treat the \-LF pair terminating a
line ending in an odd number of backslashes inside a quoted argument
as a continuation.  Drop the pair from the returned quoted argument
token text.  This will allow long lines inside quoted argument
strings to be divided across multiple lines in the source file.
It will also allow quoted argument text to start on the line after
the opening quote.  For example, the code:

 set(x "\
 ...")

sets variable "x" to the value "..." with no opening newline.

Previously an odd number of backslashes at the end of a line inside
a quoted argument would put a \-LF pair (or a \-CR pair) literally
in the argument.  Then the command-argument evaluator would complain
that the \-escape sequence is invalid.  Therefore this syntax is
available to use without changing behavior of valid existing code.

Teach the RunCMake.Syntax test to cover cases of quoted arguments
with lines ending in \, \\, and \\\.  Odd counts are continuations.
2013-10-23 09:02:07 -04:00
Brad King 7d47c69365 Drop compatibility with CMake < 2.4
Drop all behavior activated by setting CMAKE_BACKWARDS_COMPATIBILITY to
a value lower than 2.4, and generate an error when projects or the user
attempt to do so.  In the error suggest using a CMake 2.8.x release.

Teach cmake_minimum_required to warn about projects that do not require
at least CMake 2.4.  They are not supported by CMake >= 3.0.

Replace the documentation of CMAKE_BACKWARDS_COMPATIBILITY with a
reference to policy CMP0001.
2013-10-23 08:54:31 -04:00
Brad King c7c44fc7f4 CTestTest*: Update minimum required CMake to 2.4
We will soon deprecate support for compatibility with CMake < 2.4.
2013-10-23 08:54:31 -04:00
Brad King d67286ff9b Merge topic 'output-CMP0022-entries'
0b3b336 CMP0022: Output link interface mismatch for static library warning
2013-10-23 08:20:14 -04:00
Brad King 8855bf5395 Merge topic 'remove-old-commands-by-policy'
6c91944 Add policy CMP0036 to disallow build_name
3969bb2 Add policy CMP0035 to disallow variable_requires
178b9af Add policy CMP0034 to disallow utility_source
248d1dc Add policy CMP0033 to disallow export_library_dependencies
6865c8f Add policy CMP0032 to disallow output_required_files
aa76518 Add policy CMP0031 to disallow load_command
97268cf Add policy CMP0030 to disallow use_mangled_mesa
9f64fbf Add policy CMP0029 to disallow subdir_depends
882c0f0 Add infrastructure for policies that disallow commands
2013-10-23 08:19:57 -04:00
Brad King 6403a53f0e Merge topic 'CheckTypeSize_CXX'
e6cec64 CheckTypeSize: Add unit tests
07a2342 CheckTypeSize: Add support for C++
2013-10-23 08:19:46 -04:00
Stephen Kelly 0b3b3368fb CMP0022: Output link interface mismatch for static library warning
Other warnings for the same policy already have similar output since
commit 81d2793e (Add differing target property content to policy CMP0022
warning, 2013-09-11).
2013-10-23 08:18:02 -04:00
Brad King 6c9194488a Add policy CMP0036 to disallow build_name 2013-10-22 09:09:53 -04:00
Brad King 3969bb23aa Add policy CMP0035 to disallow variable_requires 2013-10-22 09:09:52 -04:00
Brad King 178b9af186 Add policy CMP0034 to disallow utility_source 2013-10-22 09:09:52 -04:00
Brad King 248d1dc057 Add policy CMP0033 to disallow export_library_dependencies 2013-10-22 09:09:52 -04:00
Brad King 6865c8fe05 Add policy CMP0032 to disallow output_required_files 2013-10-22 09:09:52 -04:00
Brad King aa76518f8b Add policy CMP0031 to disallow load_command 2013-10-22 09:09:52 -04:00
Brad King 97268cf5b7 Add policy CMP0030 to disallow use_mangled_mesa 2013-10-22 09:09:51 -04:00
Brad King 9f64fbf5b5 Add policy CMP0029 to disallow subdir_depends 2013-10-22 09:09:51 -04:00
Brad King 882c0f0b69 Add infrastructure for policies that disallow commands
Add cmCommand::Disallowed helper to check the setting of a policy that
disallows the command.  Add a RunCMake.DisallowedCommands test
placeholder.  Add a Help/policy/DISALLOWED_COMMAND.txt file for
inclusion by each policy document to avoid duplication of the common
text.
2013-10-22 09:09:51 -04:00
Brad King ddef8a7cff Merge topic 'rst-literal-blocks'
2d0287d cmRST: Process literal blocks after paragraphs ending in '::'
7b9ae40 cmRST: Do not process inline markup in code-block literals
2013-10-22 09:08:38 -04:00
Brad King 7809adb814 Merge topic 'string-CONCAT-command'
4e184a2 string: Add CONCAT sub-command
2013-10-22 09:08:15 -04:00
Brad King 0d9e8b1ab9 Merge topic 'double-colon-is-imported'
f063c45 Consider targets with double colons to be IMPORTED or ALIAS targets.
2013-10-22 09:07:40 -04:00
Brad King 6384f1683a Merge topic 'remove-cmake-i-wizard'
a8226e9 cmake: Drop support for "-i" wizard mode
2013-10-22 09:07:14 -04:00
Nils Gladitz 7a665ae7e3 CTest: added test for RUN_SERIAL issue #14484 2013-10-21 22:13:22 +02:00
Brad King 2d0287dd5e cmRST: Process literal blocks after paragraphs ending in '::'
Teach cmRST to recognize non-markup lines ending in '::' followed by a
blank line as starting a literal block.  Record the whole block as if it
were a literal block directive and print it just like a code block.
Extend the CMakeLib.testRST test to cover such cases.
2013-10-21 15:40:26 -04:00
Brad King 7b9ae406f3 cmRST: Do not process inline markup in code-block literals
Move the ProcessDirectiveParsedLiteral and ProcessDirectiveCodeBlock
method internals into an OutputMarkupLines helper.  Pass through it a
new "inlineMarkup" parameter and teach OutputLine to understand it.
When false, do not process inline markup.  Extend the CMakeLib.testRST
test to cover the two cases.
2013-10-21 14:56:26 -04:00
Brad King 4e184a21be string: Add CONCAT sub-command
Add a string(CONCAT) command to simply concatenate input arguments
together.  This will be useful for combining strings from different
quoting syntaxes.  Add a RunCMake.string test covering these cases.
2013-10-21 12:54:20 -04:00
Daniele E. Domenichelli e6cec64820 CheckTypeSize: Add unit tests 2013-10-21 16:39:04 +02:00
Stephen Kelly f063c45589 Consider targets with double colons to be IMPORTED or ALIAS targets.
Introduce a policy to control the behavior.

The AliasTargets unit test already tests that using a
double-semicolon in the name is not an error. Change the ExportImport
test to use a namespace with a double-semicolon too.
2013-10-21 15:56:31 +02:00
Brad King bf02e75079 Merge topic 'INTERFACE_LIBRARY-build-targets'
b04f3b9 Create make rules for INTERFACE_LIBRARY targets.
dba4962 Makefile: Always create clean target command
2013-10-21 09:48:04 -04:00
Stephen Kelly b04f3b9a2a Create make rules for INTERFACE_LIBRARY targets.
The result is that the depends of the target are created.

So,

 add_library(somelib foo.cpp)
 add_library(anotherlib EXCLUDE_FROM_ALL foo.cpp)
 add_library(extra EXCLUDE_FROM_ALL foo.cpp)
 target_link_libraries(anotherlib extra)

 add_library(iface INTERFACE)
 target_link_libraries(iface INTERFACE anotherlib)

Executing 'make iface' will result in the anotherlib and extra targets
being made.

Adding a regular executable to the INTERFACE of an INTERFACE_LIBRARY
will not result in the executable being built with 'make iface' because
of the logic in cmComputeTargetDepends::AddTargetDepend.

So far, this is implemented only for the Makefile generator. Other
generators will follow if this feature is possible for them.

Make INTERFACE_LIBRARY targets part of the all target by default.
Test this by building the all target and making the expected library
EXCLUDE_FROM_ALL.
2013-10-21 09:46:27 -04:00
Brad King 9fb65d7090 Merge topic 'cmake-syntax-updates'
daa0f6f Add Lua-style long brackets and long comments to CMake language
a8c6523 cmListFileLexer: Convert CRLF -> LF newlines explicitly
dbd9333 cmListFileLexer: Allow a leading UTF-8 Byte-Order-Mark (#11137)
5645783 cmListFileLexer: Allow command names with one letter (#14181)
2013-10-21 09:02:00 -04:00
Brad King 936dec32e5 Merge topic 'target-LOCATION-policy'
abfebef Cygwin: Avoid legacy warnings in RunCMake.CMP0026 test
2013-10-20 07:37:48 -04:00
Brad King abfebefbb9 Cygwin: Avoid legacy warnings in RunCMake.CMP0026 test
Set the minimum required version of CMake high enough to avoid the
warning for CMAKE_LEGACY_CYGWIN_WIN32.  The warning appears on stderr
and breaks the expected output matching.
2013-10-19 06:47:12 -04:00
Brad King a8226e91d7 cmake: Drop support for "-i" wizard mode
Tell users to pass cache values with the -D option on the command line
or use cmake-gui or ccmake.
2013-10-18 13:32:39 -04:00
Stephen Kelly 70ae6dfd92 Handle genexes when evaluating INTERFACE_INCLUDE_DIRECTORIES errors. 2013-10-18 10:11:49 -04:00
Stephen Kelly dede273193 target_link_libraries: Allow repeated use of LINK_{PRIVATE,PUBLIC} keywords.
This has not been allowed since they were introduced in
commit 91438222 (target_link_libraries: Add LINK_(PUBLIC|PRIVATE)
options, 2011-10-07), but allowing this form makes it more compatible
with the newer PUBLIC and PRIVATE keywords.
2013-10-17 17:37:20 +02:00
Brad King daa0f6f98d Add Lua-style long brackets and long comments to CMake language
Teach the CMake language parser to recognize Lua-style "long bracket"
arguments.  These start with two '[' separated by zero or more '='
characters e.g. "[[" or "[=[" or "[==[".  They end with two ']'
separated by the same number of '=' as the opening bracket.  There is no
nesting of brackets of the same level (number of '=').  No escapes,
variable expansion, or other processing is performed on the content
between such brackets so they always represent exactly one argument.

Also teach CMake to parse and ignore "long comment" syntax.  A long
comment starts with "#" immediately followed by an opening long bracket.
It ends at the matching close long bracket.

Teach the RunCMake.Syntax test to cover long bracket and long comment
cases.
2013-10-17 09:07:00 -04:00
Brad King a8c652342f cmListFileLexer: Convert CRLF -> LF newlines explicitly
Read input files in binary mode instead of text mode and convert CRLF
newlines to LF newlines explicitly in our own buffer.  This is necessary
to read CMake source files with CRLF newlines on platforms whose C
runtime libraries do not transform newlines in text mode.  For example,
a Cygwin or Linux binary may not transform CRLF -> LF in files read from
a Windows filesystem.  Perform the conversion ourselves to ensure that
multi-line string literals in CMake source files have LF newlines
everywhere.
2013-10-17 09:07:00 -04:00
Brad King dbd933365e cmListFileLexer: Allow a leading UTF-8 Byte-Order-Mark (#11137)
Teach the lexer to read a UTF-8, UTF-16 BE/LE, or UTF-32 BE/LE
Byte-Order-Mark from the start of a file if any is present.  Report an
error on files using UTF-16 or UTF-32 and accept a UTF-8 or missing BOM.
2013-10-17 09:06:59 -04:00
Brad King 56457837e2 cmListFileLexer: Allow command names with one letter (#14181)
Teach the lexer to treat a single letter as an identifier instead of an
unquoted argument.  Outside of a command invocation, the parser treats
an identifier as a command name and an unquoted argument as an error.
Inside of a command invocation, the parser treats an identifier as an
unquoted argument.  Therefore this change to the lexer will make what
was previously an error case work with no other behavioral change.
2013-10-17 09:06:59 -04:00
Stephen Kelly 4fd60241c8 CMP0022: Add unit test for null pointer check and message. 2013-10-16 10:45:55 -04:00
Brad King 6035c0458e get_property: Drop test for builtin property documentation
Property documentation is no longer builtin, so the get_property command
will be unable to return the documentation.  Drop the test for it.
2013-10-16 09:22:36 -04:00
Brad King 25f2877eef Add class cmRST to do basic reStructuredText processing
Create a cmRST class to perform just enough reStructuredText processing
to support display of Help documents in human-readable text format.
This will be used to implement --help-* command-line options.

Support directives "include", "replace", "parsed-literal", "toctree"
(Sphinx), and "cmake-module" (CMake Sphinx Extension to scan .cmake
modules).  Support inline CMake Sphinx Domain roles to convert
cross-references to corresponding title text.  Support inline
substitutions defined by the "replace" directive, but keep it simple by
requiring replacements to be defined before use.

Add a CMakeLib "testRST" case to cover processing of supported
constructs and compare results against expected output.
2013-10-16 09:22:35 -04:00
Brad King 277bd1db98 Drop CMAKE_STRICT mode
With our modern development workflow it is less likely a property will
be added to C++ code without documentation.  This mode only existed to
support the DocTest which had very limited coverage of the properties
anyway.
2013-10-15 10:47:38 -04:00
Brad King b31ca93ba2 Merge topic 'target-LOCATION-policy'
e4e5b28 cmTarget: Deprecate the LOCATION target property with a policy.
2013-10-15 09:33:05 -04:00
Brad King 06491955eb Merge topic 'export-at-generate-time'
a4263c9 export(): Handle multiple dependent export sets.
66b290e export(): Process the export() command at generate time.
5fe5c32 export(): Set a Makefile on the cmExportBuildFileGenerator.
e383555 cmExportInstallFileGenerator: Fix comment to match reality.
2013-10-15 09:32:36 -04:00
Brad King ebffbda447 Merge topic 'fix-CMP0024-multiple-directories'
af1f698 CMP0024: Store the fact of included export in global generator.
2013-10-15 09:32:32 -04:00
Brad King 29b1e59115 Merge topic 'bump-required-cmake-version'
920ffbf Require CMake 2.8.4 or greater to build CMake
2013-10-15 09:32:12 -04:00
Stephen Kelly 920ffbf50f Require CMake 2.8.4 or greater to build CMake
This allows the use of the $<TARGET_FILE:...> generator expression as a
replacement for the use of the LOCATION target property.  The use of the
LOCATION target property is now deprecated for in-build targets.

Also drop other checks for older CMake versions:

* Simplify cmake_set_target_folder macro.
* Use find_package(LibArchive) unconditionally.
* Simplify condition for running testVisualStudioSlnParser test.
* Convert two macros to functions.
* Unconditionally run the CTestTestRerunFailed test.
2013-10-15 09:22:56 -04:00
Stephen Kelly e4e5b28c27 cmTarget: Deprecate the LOCATION target property with a policy.
The final location and name of a build-target is not determined
until generate-time. However, reading the LOCATION property from
a target is currently allowed at configure time. Apart from creating
possibly-erroneous results, this has an impact on the implementation
of cmake itself, and prevents some major cleanups from being made.

Disallow reading LOCATION from build-targets with a policy. Port some
existing uses of it in CMake itself to use the TARGET_FILE generator
expression.
2013-10-11 21:17:27 +02:00
Stephen Kelly 66b290e7e2 export(): Process the export() command at generate time.
Make the API for adding targets string based so that it can easily
use cmGeneratorTarget.

Teach the cmIncludeCommand to generate the exported file at
configure-time instead if it is to be include()d.

The RunCMake.ExportWithoutLanguage test now needs a dummy header.h
file as expected error from export() is now reported after the
missing file error.
2013-10-11 12:46:10 +02:00
Stephen Kelly af1f698757 CMP0024: Store the fact of included export in global generator.
Storing it in the makefile means that the policy does not trigger
when include and export are in differing directories.
2013-10-10 12:01:39 +02:00
Stephen Kelly 617ee7c567 Add a test for SYSTEM headers in INTERFACE libraries. 2013-10-10 00:33:33 +02:00
Brad King 7e4910fe47 Merge topic 'xcode-5-no-BuildDepends-help'
7f459a6 Xcode: Teach BuildDepends test that Xcode >= 5 needs no help
2013-10-09 10:25:09 -04:00
Brad King be9d289fce Merge topic 'deprecation-message'
f973737 GenerateExportHeader: Port to use message(DEPRECATION)
f69606d Qt4Macros: Port to use message(DEPRECATION)
509c142 message: Add a DEPRECATION mode
2013-10-09 10:24:16 -04:00
Brad King e5f17214a5 Merge topic 'FindGTK2-targets'
7efef02 FindGTK2: Add tests for components and targets in gtk and gtkmm modules
95fc47a FindGTK2: Make pangocairo and cairo optional dependencies
26f790f FindGTK2: Change extra includes -> optional
24e0272 FindGTK2: do not skip target creation if optional dependencies are not found
d5f130c FindGTK2: Refactor _GTK2_ADJUST_LIB_VARS into _GTK2_ADD_TARGET
fffbd72 FindGTK2: Do not add freetype includes if they are not found
b69720d FindGTK2: Add libraries to the GTK2_LIBRARIES variable only when found
425ec40 FindGTK2: Do not link libfreetype
e9f46df FindGTK2: Add config directories only if different from include ones
56a79e1 FindGTK2: Set INTERFACE_COMPILE_DEFINITIONS target property only if not empty
4b47586 FindGTK2: Add check to ensure that target exists
61242cc FindGTK2: Fix gmodule, glibmm, pangoft2, and pangoxft targets
4b876de FindGTK2: Link freetype libs to targets including freetype includes
67e761f FindGTK2: Small cleanup
682eea3 FindGTK2: Do not require the GTK_ prefix in all the internal functions
0bc3763 FindGTK2: Better handling of include directories
...
2013-10-09 10:23:31 -04:00
Brad King e81b6742f7 Merge topic 'haiku-updates'
54ef2be Haiku: Include files cleanup in cmCTest
38d5555 Haiku: Remove outdated preprocessor checks
1dc61f8 Haiku: Remove use of B_COMMON_DIRECTORY
7ebc1cb Haiku: Several fixes to platform module
2013-10-09 10:23:04 -04:00
Brad King 8424d569f0 Merge topic 'unset-PARENT_SCOPE'
261c248 unset: Add PARENT_SCOPE option
2013-10-09 10:22:10 -04:00
Brad King 12a7e2b10c Merge topic 'apple-clang-id'
1763c31 Set policy CMP0025 to NEW while building CMake itself
aa53ee5 Add policy CMP0025 for Apple Clang compiler id compatibility
ab65862 Clang: Add separate "AppleClang" compiler id
2013-10-09 10:21:28 -04:00
Brad King 7f459a664c Xcode: Teach BuildDepends test that Xcode >= 5 needs no help
Drop the HELP_XCODE workarounds needed on older Xcode versions when
using Xcode >= 5.  We now expect builds and rebuilds to work using
proper dependencies with no special help.
2013-10-08 14:21:25 -04:00
Stephen Kelly f69606d335 Qt4Macros: Port to use message(DEPRECATION) 2013-10-08 18:23:42 +02:00
Stephen Kelly 509c142a3f message: Add a DEPRECATION mode
By default, the message is not issued. If CMAKE_ERROR_DEPRECATED
is on, the message is fatal. If CMAKE_WARN_DEPRECATED is on, the
message is a warning.
2013-10-08 18:11:22 +02:00
Brad King 40c84683aa Merge topic 'export-policy'
904ff9f export: Add policy CMP0024 to disallow include() of export files
2013-10-08 10:59:07 -04:00
Brad King f8241136b4 Merge topic 'INTERFACE_LIBRARY-target-type'
ce0c303 install: Teach EXPORT option to handle INTERFACE_LIBRARY targets
435c912 export: Add support for INTERFACE_LIBRARY targets
fe73226 Add the INTERFACE_LIBRARY target type.
2013-10-08 10:58:40 -04:00
Daniele E. Domenichelli 7efef02df2 FindGTK2: Add tests for components and targets in gtk and gtkmm modules 2013-10-08 10:47:06 -04:00
Adrien Destugues 7ebc1cb2ff Haiku: Several fixes to platform module
* Do not define BEOS anymore (this includes workarounds which we don't
  need most of the time in Haiku, so we prefer opt-in IF(HAIKU) in the
  cmake files instead).
* On the other hand, do define UNIX (we are trying to be compliant) and
  HAIKU (there is still a number of things we don't do like the
  average UNIX clone)
* Do not use UnixPaths, as our filesystem hierarchy isn't anything like
  what it expects.
* Do not use -nostart, which the compiler doesn't know about anymore.
  This used to be an Haiku extension to gcc, and is equivalent to
  -shared which is the default gcc option.
* While "dl" functions are provided in libroot, this is always
  implicitly linked so there is no need to tell cmake about it.
* Forcing position-independent code is not needed, so remove it.
* On the other hand, include appropriate linker options for executables
  and shared libraries.
* Support for the two available compilers in Haiku (gcc2 and gcc4) and
  pick the right headers and libraries according to the currently
  selected one.
* With the adoption of the package manager, the directory layout was
  changed. Tell cmake where to look for header files and libraries.
* As we don't define BEOS anymore, enable the workaround we still need
  for HAIKU as well. This is the lack of a libm (it is part of the
  implicitly linked in libroot)

Applied-by: Rolf Eike Beer <eike@sf-mail.de>
2013-10-08 09:54:46 -04:00
Brad King 4340507207 Merge topic 'CheckStructHasMember_CXX'
73d28d2 CheckStructHasMember: Add support for C++
2013-10-08 09:53:37 -04:00
Brad King 2ba45f5285 Merge topic 'Add-coverage.py-Coverage'
d0ec3a0 Adding support for the Python coverage.py tool.
2013-10-08 09:53:25 -04:00
Brad King 5bf7102505 Merge topic 'ctest_rerun_failed'
eb2decc ctest: Add --rerun-failed option
2013-10-08 09:53:17 -04:00
Daniele E. Domenichelli 73d28d2177 CheckStructHasMember: Add support for C++
Previously if headers required to check if a struct has a member can be
compiled with C++ compiler only, the check would fail because the C
compiler fails.  As a consequence, the result variable would be set to
false, even if the struct has that particular member.

Teach CHECK_STRUCT_HAS_MEMBER to accept a new optional argument LANGUAGE
that allows one to explicitly set the compiler to use.  The new
signature is therefore:

  CHECK_STRUCT_HAS_MEMBER (<struct> <member> <header> <variable>
                           [LANGUAGE <language>])
2013-10-08 09:43:06 -04:00
Patrick Reynolds d0ec3a01a6 Adding support for the Python coverage.py tool.
This assumes that coverage.py has been run in such a way to produce its
standard XML output. This uses the Cobertura schema and should be somewhat
generalizable.
2013-10-08 09:20:30 -04:00
Zack Galbreath eb2decc02d ctest: Add --rerun-failed option
Add a new command line argument to ctest.  This allows users to
rerun tests that failed during the previous call to ctest.  This
is accomplished by analyzing the most recently modified file named
"^LastTestsFailed*" in the Testing/Temporary subdirectory of the
project's binary directory.
2013-10-08 09:18:13 -04:00
Brad King 261c248254 unset: Add PARENT_SCOPE option
Add an unset() command option to remove a variable from the calling
scope, just like the set() command's PARENT_SCOPE option.  Teach the
Unset test to cover such cases.
2013-10-08 08:37:50 -04:00
Brad King 1763c31c3b Set policy CMP0025 to NEW while building CMake itself
CMake is aware of the policy's NEW behavior and the AppleClang compiler
id.  Set the policy to NEW explicitly to avoid the warning and get the
NEW behavior.

Also teach the RunCMake test infrastructure to build tests with
-DCMAKE_POLICY_DEFAULT_CMP0025=NEW to avoid the policy warning
in test output that must match specific regular expressions.
2013-10-07 20:12:46 -04:00
Brad King ab65862417 Clang: Add separate "AppleClang" compiler id
Apple distributes their own Clang build with their own version numbers
that differ from upstream Clang.  Use the __apple_build_version__ symbol
to identify the Apple Clang compiler and report the Apple Build Version
as the fourth version component in CMAKE_<LANG>_COMPILER_VERSION.  Add
Compiler/AppleClang-<lang> and Platform/Darwin-AppleClang-<lang> modules
that simply include the upstream equivalents.

Fix comparisons of CMAKE_<LANG>_COMPILER_ID to Clang in CMake's own
source and tests to account for AppleClang.
2013-10-07 20:12:46 -04:00
Stephen Kelly ce0c303d62 install: Teach EXPORT option to handle INTERFACE_LIBRARY targets 2013-10-07 20:07:27 -04:00
Stephen Kelly 435c912848 export: Add support for INTERFACE_LIBRARY targets 2013-10-07 20:07:27 -04:00
Stephen Kelly 904ff9fe59 export: Add policy CMP0024 to disallow include() of export files
Currently, export() is executed at configure-time.

One problem with this is that certain exported properties like
the link interface may not be complete at the point the export() is
encountered leading to an incorrect or incomplete exported
representation. Additionally, the generated IMPORTED_LOCATION
property may even be incorrect if commands following the export()
have an effect on it.

Another problem is that it requires the C++ implementation of cmake
to be capable of computing the exported information at configure time.
This is a limitation on the cleanup and maintenance of the code. At
some point in the future, this limitation will be dropped and more
implementation will be moved from cmTarget to cmGeneratorTarget.
2013-10-07 19:57:06 -04:00
Stephen Kelly fe732264e9 Add the INTERFACE_LIBRARY target type.
This target type only contains INTERFACE_* properties, so it can be
used as a structural node. The target-specific commands enforce
that they may only be used with the INTERFACE keyword when used
with INTERFACE_LIBRARY targets. The old-style target properties
matching LINK_INTERFACE_LIBRARIES_<CONFIG> are always ignored for
this target type.

The name of the INTERFACE_LIBRARY must match a validity generator
expression. The validity is similar to that of an ALIAS target,
but with the additional restriction that it may not contain
double colons. Double colons will carry the meaning of IMPORTED
or ALIAS targets in CMake 2.8.13.

An ALIAS target may be created for an INTERFACE library.

At this point it can not be exported and does not appear in the
buildsystem and project files are not created for them. That may
be added as a feature in a later commit.

The generators need some changes to handle the INTERFACE_LIBRARY
targets returned by cmComputeLinkInterface::GetItems. The Ninja
generator does not use that API, so it doesn't require changes
related to that.
2013-10-07 19:56:31 -04:00
Brad King b41f2dd7d2 Merge topic 'test-Qt4-quiet'
a3170c8 Tests: Make find_package(Qt4) QUIET
2013-10-07 15:45:11 -04:00
Brad King 4e1368c1a0 Merge topic 'IMPORTED-target-SYSTEM-includes'
a63fcbc Always consider includes from IMPORTED targets to be SYSTEM.
2013-10-07 15:45:05 -04:00
Brad King 9939c99bc6 Merge topic 'test-property-genex'
6a47c37 add_test: Mention generator expressions in old-style add_test docs
d331292 cmTestGenerator: Evaluate generator expressions in test properties
6fe5c4a cmTestGenerator: Separate test properties for each configuration
2013-10-07 15:44:23 -04:00
Brad King e25dabb3d5 Merge topic 'RunCMake-ignore-valgrind-lines'
4953330 Tests/RunCMake: Tolerate valgrind lines in CMake output
2013-10-07 15:43:41 -04:00
Brad King 64064c6616 Merge topic 'cleanup-CTestTestMemcheck'
e8e67ae CTestTestMemcheck: Fix matching of malloc debug messages
8ea62fd CTestTestMemcheck: Tolerate trailing "==..." lines from valgrind
f169f48 CTestTestMemcheck: Refactor output expectation regex generation
2013-10-07 15:43:36 -04:00
Brad King 6494cf56dc Merge topic 'fix-genex-preprocessing-incomplete-test'
2aafacc genex: Test preprocessing incomplete expressions.
2013-10-07 15:43:29 -04:00
Brad King 5a4ec661cf Merge topic 'add-policy-version-test'
b494722 Tests: Verify policies are introduced only in "official" versions
2013-10-07 15:42:06 -04:00
Brad King 25b35ed38a Merge topic 'update_trilinos_contract_test'
5a4a584 update Trilinos contract test
2013-10-07 15:42:02 -04:00
Brad King 058af7a6ce Merge topic 'PLATFORM_ID-genex'
dcc00ec Genex: Add the PLATFORM_ID expression.
2013-10-07 15:41:39 -04:00
Brad King ea3bb7ed9a Merge topic 'automoc-gadget'
d4937da Search for the Q_GADGET macro for running automoc too.
2013-10-07 15:41:33 -04:00
Brad King f4acef500b Merge topic 'ADDITIONAL_MAKE_CLEAN_FILES-genex'
d26594f Genex: Evaluate genexes for additional make clean files.
2013-10-07 15:41:29 -04:00
Brad King 7f5961f935 Merge topic 'no-duplicate-find-tests'
796c618 blacklist tests with their own test in Tests/Module from AllFindModules test
2013-10-07 15:41:06 -04:00
Stephen Kelly 6f98f4ac92 Genex: Fix processing multiple include directories for relative paths
Re-insert the semicolon which was removed during splitting.

Commit d777b8e7 (Genex: Allow relative paths in INSTALL_INTERFACE.,
2013-07-25) introduced the prefixItems method to allow relative paths
in the argument of the INSTALL_INTERFACE expression. That method was
buggy in that it did not re-introduce the semicolon separator in
the result.

This bug also affects paths which are already absolute in user code.
2013-10-07 08:17:12 -04:00
Brad King a3170c8b0c Tests: Make find_package(Qt4) QUIET
The lack of Qt4 on a system should silently skip the corresponding tests
with no other messages.  This is already the case for other find_package
calls in Tests/CMakeLists.txt.
2013-10-03 13:12:07 -04:00
Brad King 118032247c Xcode: Teach Tests/BuildDepends to allow LINK_DEPENDS_NO_SHARED failure
Xcode 5.0 now relinks targets when their shared libraries dependencies
are modified, and there seems to be no way to stop it.  Report this as a
known limitation in the test output and do not fail.
2013-10-02 12:49:09 -04:00
Brad King 765b46d1e1 Xcode: Fix test architecture selection for Xcode >= 5
In Tests/Architecture and Tests/BuildDepends/Project we select a set of
OS X cpu architectures to use for the test.  Prior to Xcode 4 we always
used i386 and ppc.  Starting with Xcode 4, the tools do not support ppc
but do support x86_64, so we switch to that.  Fix the version check to
recognize Xcode >= 5 as at least Xcode 4 and use the new architectures.
2013-10-02 12:48:20 -04:00
Stephen Kelly a63fcbcb9f Always consider includes from IMPORTED targets to be SYSTEM.
Introduce a target property to control this behavior variable
to set the default value for the target property.

This does not affect try_compile runs.
2013-09-24 20:00:31 +02:00
Ben Boeckel d331292c12 cmTestGenerator: Evaluate generator expressions in test properties
This is useful for cases like:

  add_test(NAME mytest COMMAND mydriver $<TARGET_FILE:myexe>)
  set_tests_properties(mytest PROPERTIES
    REQUIRED_FILES "$<TARGET_FILE:myexe>"
    WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>"
    )

In this example we require the actual test executable to exist to
run the test in addition to the test driver at argv[0].  Also the
$<CONFIGURATION> expression improves over \${CTEST_CONFIGURATION_TYPE}
because the latter is not normalized for case-sensitive filesystems.
2013-09-20 08:18:22 -04:00
Brad King 49533303a5 Tests/RunCMake: Tolerate valgrind lines in CMake output
When RunCMake tests run during dynamic analysis, valgrind may add lines
of the form "==[0-9]+==..." to the output.  Remove such lines from the
actual output before matching it against the expected output.
2013-09-16 09:59:52 -04:00
Brad King e8e67aed22 CTestTestMemcheck: Fix matching of malloc debug messages
In commit 10bc50ea (Tests: ignore Guard Malloc messages in MemChecker
tests, 2013-05-13) we forgot to escape backslashes in the CMake language
to get them into the regex.  Add them now.
2013-09-13 16:47:47 -04:00
Stephen Kelly 2aafaccc5e genex: Test preprocessing incomplete expressions. 2013-09-13 20:10:41 +02:00
Stephen Kelly 81d2793e92 Add differing target property content to policy CMP0022 warning
List the contents of the INTERFACE_LINK_LIBRARIES and the old-style
property.
2013-09-11 22:28:32 +02:00
David Cole b494722642 Tests: Verify policies are introduced only in "official" versions
Add the CMake.PolicyCheck test.

This test uses "git grep" to look for policies added in a "dated"
version of CMake. It will fail if a policy is added as of,
for example, CMake 2.8.11.20130828.

The intent is to prevent such constructs from making it into an
"official" release. Three instances actually appeared in the first
attempted release candidate for 2.8.12.

This test may sometimes yield false positives. After all, it's just
using a regular expression to detect this condition, and something
in a comment could possibly match it. As of right now, that's not
true, but it's easy to imagine such a comment being added.

The new test may also not catch all future problems of this sort.
However, it will catch problems of this sort for all code that follows
the present layout style in Source/cmPolicies.cxx.
2013-08-28 17:22:49 -04:00
Zack Galbreath 5a4a5841d4 update Trilinos contract test
The old version encountered a compile error on newer versions of GCC.
Update to the latest supported release of Trilinos, remove the version
number from the name of the Contract, and some other minor tweaks to
get the test passing once more.
2013-08-28 15:28:14 -04:00
Stephen Kelly dcc00ece4b Genex: Add the PLATFORM_ID expression. 2013-08-28 10:23:20 +02:00
Stephen Kelly d4937da71b Search for the Q_GADGET macro for running automoc too. 2013-08-28 10:18:11 +02:00
Stephen Kelly d26594f390 Genex: Evaluate genexes for additional make clean files.
This is necessary because custom commands and targets may create
custom files whose names are determined by generator expressions.

For example, clang should be using $<TARGET_FILE> and $<TARGET_FILE_DIR>
instead of reverse engineering the output file name:

 http://thread.gmane.org/gmane.comp.compilers.clang.scm/80523

However, that can only be done when ADDITIONAL_MAKE_CLEAN_FILES
also accepts and evaluates generator expressions.

Similarly, KDE uses the LOCATION property where $<TARGET_FILE>
would also be better in KDE4_HANDLE_RPATH_FOR_EXECUTABLE but
also appends the result to ADDITIONAL_MAKE_CLEAN_FILES.

After this patch, both can be ported to generator expressions.
2013-08-28 00:49:29 +02:00
Brad King ae4630fb1d Merge topic 'fix-RunCMake.Configure-FailCopyFileABI-newlines'
2dce48f Fix RunCMake.Configure test expectation newline matching
2013-08-26 13:14:16 -04:00
Brad King c5baca7804 Merge topic 'find-IMPORTED-targets-for-try_compile'
cc8f796 try_compile: Extract IMPORTED targets from INTERFACE_LINK_LIBRARIES
fd4fb9e try_compile: Extract IMPORTED targets from LINK_DEPENDENT_LIBRARIES
2013-08-26 11:39:08 -04:00
Stephen Kelly cc8f79670e try_compile: Extract IMPORTED targets from INTERFACE_LINK_LIBRARIES 2013-08-26 11:37:00 -04:00
Stephen Kelly fd4fb9ef04 try_compile: Extract IMPORTED targets from LINK_DEPENDENT_LIBRARIES 2013-08-26 11:36:57 -04:00