Commit Graph

2505 Commits

Author SHA1 Message Date
Ben Boeckel 5837f19690 export: Error when exporting a target without a language
First, it prevents a NULL dereference and second it reiterates that
targets without languages are not supported by CMake.

Add a RunCMake.ExportWithoutLanguage test exporting a library without a
languages.
2013-07-25 08:44:57 -04:00
Ben Boeckel c80a4f92ce Tests/RunCMake: Document stripping of expected output
Document that trailing newlines are stripped from the -stdout.txt
and -stderr.txt content before using as a regular expression.
2013-07-25 08:38:53 -04:00
Brad King 2f8dace125 Merge topic 'tll-new-signatures'
b655865 target_link_libraries: Add PUBLIC/PRIVATE/INTERFACE keyword signature
2013-07-25 08:37:16 -04:00
Brad King 9f8fcdd2d8 Merge topic 'compile-defs-debugging'
a43e5e0 Test COMPILE_DEFINITIONS target property get/set/get round-trip
2013-07-25 08:37:13 -04:00
Stephen Kelly d777b8e716 Genex: Allow relative paths in INSTALL_INTERFACE.
These paths can be prepended with the ${_IMPORT_PREFIX} generated
in the export file.

Such relative paths were previously an error.
2013-07-25 14:31:22 +02:00
Brad King a43e5e0ad5 Test COMPILE_DEFINITIONS target property get/set/get round-trip
Teach the Preprocess test to get, set, and then get the same value for
the COMPILE_DEFINITIONS target property and verify that the value is not
changed.  This ensures the internal structured storage of the property
value can reproduce the original string value.
2013-07-24 13:25:47 -04:00
Stephen Kelly b655865bbf target_link_libraries: Add PUBLIC/PRIVATE/INTERFACE keyword signature
Add a new signature to help populate INTERFACE_LINK_LIBRARIES and
LINK_LIBRARIES cleanly in a single call.  Add policy CMP0023 to control
whether the keyword signatures can be mixed with uses of the plain
signatures on the same target.
2013-07-24 11:52:44 -04:00
Brad King 828ddb6813 Merge topic 'framework-interface-includes'
f5ca872 Use linked frameworks as a source of include directories.
2013-07-24 11:50:49 -04:00
Stephen Kelly f5ca872e8b Use linked frameworks as a source of include directories. 2013-07-24 11:49:06 -04:00
Stephen Kelly 650e61f833 Add a convenient way to add the includes install dir to the INTERFACE.
Export the INCLUDES DESTINATION without appending to the
INTERFACE_INCLUDE_DIRECTORIES of the target itself. That way, a target
can be exported multiple times with different INCLUDES DESTINATION
without unintended cross-pollution of export sets.
2013-07-24 17:32:58 +02:00
Brad King e31c4bd9a6 Merge topic 'dev/property-append-with-empty-string'
31bd83e set_property: Do not remove a property when APPENDing nothing
2013-07-24 11:02:44 -04:00
Brad King 571d050415 Merge topic 'fix-mapped-config-genex'
10a069b Genex: Fix $<CONFIG> with IMPORTED targets and multiple locations.
2013-07-24 11:02:19 -04:00
Brad King 6077847edc Merge topic 'remove-LINK_LANGUAGE-genex'
4f6bd70 Remove the LINK_LANGUAGE generator expression.
2013-07-24 11:02:14 -04:00
Ben Boeckel 31bd83e9fc set_property: Do not remove a property when APPENDing nothing 2013-07-24 10:50:15 -04:00
Stephen Kelly 10a069b504 Genex: Fix $<CONFIG> with IMPORTED targets and multiple locations.
The old code checked only that there was a LOCATION for the
specified config, but did not check whether the config actually
mapped.

Task-number: 14292
2013-07-24 10:43:02 -04:00
Stephen Kelly 4f6bd7022b Remove the LINK_LANGUAGE generator expression.
It accepted an optional argument to test for equality, but no way
to get the linker language of a particular target.

TARGET_PROPERTY provides this flexibility and STREQUAL provides
the necessary API for equality test.

Extend the CompileDefinitions test to cover accessing the
property of another target.
2013-07-24 10:40:00 -04:00
Brad King 8521a909ba Merge topic 'rpath-on-mac'
603bc59 OS X: Fix regression handling frameworks for Ninja
e645ff0 OS X: Enable rpath support on Mac OS X when find_library() is used.
2013-07-22 09:48:44 -04:00
Brad King fd8746d038 Merge topic 'SelectLibraryConfigurations'
04d4dc3 SelectLibraryConfigurations: Use -NOTFOUND instead of copying the vars
07b44e7 SelectLibraryConfigurations: Do not cache the _LIBRARY variable
2013-07-22 09:48:39 -04:00
Brad King 29859c09af Merge topic 'cpack-wix'
bf23891 CPackWIX: Add support for custom WiX templates
155bb01 CMakeCPack: Provide an upgrade guid for WiX
bfa2e29 CPackWIX: Add option to specify the language(s) of the installer
6e51ea9 CPackWIX: Handle multiple shortcuts in the start menu
6d77e1a CPackWIX: Fix MSI package layout regression from parent
8c0e325 CPackWIX: Handle CPACK_PACKAGE_EXECUTABLES (#13967)
2013-07-22 09:48:32 -04:00
Daniele E. Domenichelli 04d4dc3374 SelectLibraryConfigurations: Use -NOTFOUND instead of copying the vars
If one of the libraries (_DEBUG or _RELEASE) is not set, the value is
set to the value of the other one.  FindQt4, from which the macro is
extracted, sets the values to XXX_LIBRARY_{DEBUG,RELEASE}-NOTFOUND
instead.  In both cases the XXX_LIBRARY is correct, but using NOTFOUND
makes it easier to understand which one is missing.

Update Tests/CMakeOnly/SelectLibraryConfigurations with the new logic.
2013-07-22 09:37:33 -04:00
Fredrik Axelsson 8c0e32550c CPackWIX: Handle CPACK_PACKAGE_EXECUTABLES (#13967)
Add start menu items including an uninstall shortcut.  Add variable
CPACK_WIX_PROGRAM_MENU_FOLDER to configure folder name.
2013-07-19 10:49:00 -04:00
Brad King 4dc4018553 Teach compiler ABI check to tolerate try_compile COPY_FILE failure
In CMakeDetermineCompilerABI we use try_compile with the COPY_FILE
option to get a copy of the compiled binary used to detect the ABI
information.  We already tolerate the case when compilation fails.
However, when compilation appears to succeed but does not produce the
expected executable the try_compile command immediately reports an error
because the COPY_FILE fails.

Tolerate COPY_FILE failure without stopping the overall configuration
process by using the try_compile COPY_FILE_ERROR option to capture the
error message.  Log the full error to CMakeError.log and simply report
failure to detect the ABI as if compilation had failed.

Teach the RunCMake.Configure test to cover this case and verify that the
messages show up as expected both in stdout and in CMakeError.log.
2013-07-17 15:40:44 -04:00
Brad King f82c751d7b Merge topic 'INTERFACE_LINK_LIBRARIES-prop'
295a42c Fix ExportImport test cmp0022NEW build on Watcom
2013-07-17 08:47:30 -04:00
Brad King 295a42c96c Fix ExportImport test cmp0022NEW build on Watcom
The test uses generate_export_header(cmp0022OLD ...) to generate the
cmp0022_export.h header used by both cmp0022OLD and cmp0022NEW.  In
the latter the _EXPORTS symbol does not match what the header expects
so the library does not export anything.  The Watcom linker does not
like to create shared libraries that do not export any symbols.

Fix this by setting the DEFINE_SYMBOL property on cmp0022NEW to match
that of cmp0022OLD as the header expects.
2013-07-16 14:08:50 -04:00
Brad King 9c119b829d Merge topic 'obsolete-qt4-macros'
cb7f32f Mark qt4_use_modules and qt4_automoc as obsolete.
2013-07-16 13:59:22 -04:00
Brad King 41a2fb5ba0 Merge topic 'tid-system-argument'
9cf3547 Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property.
1925cff Add a SYSTEM parameter to target_include_directories (#14180)
286f227 Extend the cmTargetPropCommandBase interface property handling.
83498d4 Store system include directories in the cmTarget.
f1fcbe3 Add Target API to determine if an include is a system include.
2679a34 Remove unused variable.
2013-07-16 13:59:07 -04:00
Stephen Kelly 9cf3547e1c Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property.
Unlike other target properties, this does not have a corresponding
non-INTERFACE variant.

This allows propagation of system attribute on include directories
from link dependents.
2013-07-16 13:44:57 -04:00
Clinton Stimpson e645ff0b10 OS X: Enable rpath support on Mac OS X when find_library() is used. 2013-07-15 22:39:08 -06:00
Brad King fa6106ec56 Merge topic 'target-policies'
484bb88 Genex: Make CMP0021 and CMP0022 usable with TARGET_POLICY
2013-07-15 09:33:47 -04:00
Brad King b6e0972262 Merge topic 'INTERFACE_LINK_LIBRARIES-prop'
3e30d9e TLL: Don't populate old link interface if CMP0022 is NEW.
574fec9 Export: Generate INTERFACE_LINK_LIBRARIES property on targets.
d0a76ea Introduce the INTERFACE_LINK_LIBRARIES property.
ddde61c Introduce the LINK_ONLY generator expression.
5aa9731 GenexEval: Add abstracted access to link interface for a target.
2013-07-15 09:33:42 -04:00
Brad King f6024ef420 Merge topic 'try_compile-COPY_FILE_ERROR'
c28715b try_compile: Add COPY_FILE_ERROR option to capture failure
2013-07-15 09:33:32 -04:00
Brad King c0fe24e539 Merge topic 'cmake-error-advice'
18e1bfb cmake: On configure error suggest looking at CMake*.log files
2013-07-15 09:31:18 -04:00
Brad King 88f4ec0dd5 Merge topic 'try_compile-escape-flags'
290857b try_compile: Escape CMAKE_<lang>_FLAGS in test projects (#14268)
2013-07-15 09:31:01 -04:00
Brad King aa0b9fa311 Merge topic 'IMPORTED-build-dependencies'
4f7ceb5 Test non-IMPORTED libraries in the INTERFACE of IMPORTED libraries.
3405351 Add entire link interface transitive closure as target depends.
2013-07-15 09:30:34 -04:00
Brad King c28715b16c try_compile: Add COPY_FILE_ERROR option to capture failure
When the COPY_FILE operation fails optionally capture the error message
with a COPY_FILE_ERROR option instead of reporting the error
immediately.  This gives callers a chance to do something else or report
the error.

Teach the RunCMake.try_compile test to cover bad argument combinations
involving COPY_FILE_ERROR.  Teach the TryCompile test to cover the case
of a COPY_FILE error message captured by COPY_FILE_ERROR.
2013-07-15 09:16:36 -04:00
Brad King 290857bb03 try_compile: Escape CMAKE_<lang>_FLAGS in test projects (#14268)
If CMAKE_<lang>_FLAGS contains quotes or other CMake language characters
they must be escaped when written into the generated CMakeLists.txt file
so that the test project parses them properly.

Teach the TryCompile test to cover this case by adding a flag with
quotes into CMAKE_C_FLAGS during a C language try_compile.
2013-07-15 09:14:56 -04:00
Stephen Kelly cb7f32f5b8 Mark qt4_use_modules and qt4_automoc as obsolete.
The QT_QMAKE_EXECUTABLE has to be passed through the cmake calls because
the executable may not be in the PATH.
2013-07-14 10:05:04 +02:00
Stephen Kelly 484bb888a0 Genex: Make CMP0021 and CMP0022 usable with TARGET_POLICY
Use preprocessor loops and add a unit test for the appropriate
policies. All policies whose value is recorded at target creation
time should be part of this list.
2013-07-11 11:56:14 +02:00
Brad King 18e1bfbb3c cmake: On configure error suggest looking at CMake*.log files
When CMake reports failure to configure a project, especially when the
toolchain does not initialize properly, the true reason may be clear
from reading the CMakeFiles/CMake(Output|Error).log files.  Advise users
to look at these files if they exist when configuration fails.

Add RunCMake.Configure test to check that the log files are mentioned
when configuration fails.
2013-07-09 15:00:39 -04:00
Stephen Kelly 3e30d9ed67 TLL: Don't populate old link interface if CMP0022 is NEW.
Always populate the INTERFACE_LINK_LIBRARIES for interface
entries. Don't populate the old interface properties
matching (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?
if CMP0022 is NEW.

Because the INTERFACE_LINK_LIBRARIES property is now populated by
the target_link_libraries when operating on a static library,
make an equivalent change which populates the property with
the same value when the old link_libraries() command is used. This
silences the policy warning in that case.
2013-07-08 22:39:58 +02:00
Stephen Kelly 574fec97fd Export: Generate INTERFACE_LINK_LIBRARIES property on targets.
This property is generated only for targets which have recorded
policy CMP0022 as NEW, and a compatibility mode is added to
additionally export the old interfaces in that case too.

If the old interfaces are not exported, the generated export files
require CMake 2.8.12. Because the unit tests use a version which
is not yet called 2.8.12, temporarily require a lower version.
2013-07-08 22:39:57 +02:00
Stephen Kelly d0a76ea07c Introduce the INTERFACE_LINK_LIBRARIES property.
This property replaces the properties which
match (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?, and is enabled
for IMPORTED targets, and for non-IMPORTED targets only with a policy.

For static libraries, the INTERFACE_LINK_LIBRARIES property is
also used as the source of transitive usage requirements content.
Static libraries still require users to link to all entries in
their LINK_LIBRARIES, but usage requirements such as INCLUDE_DIRECTORIES
COMPILE_DEFINITIONS and COMPILE_OPTIONS can be restricted to only
certain interface libraries.

Because the INTERFACE_LINK_LIBRARIES property is populated unconditionally,
we need to compare the evaluated result of it with the link implementation
to determine whether to issue the policy warning for static libraries. For
shared libraries, the policy warning is issued if the contents of
the INTERFACE_LINK_LIBRARIES property differs from the contents of the
relevant config-specific old LINK_INTERFACE_LIBRARIES property.
2013-07-08 22:39:09 +02:00
Stephen Kelly 4f7ceb56d1 Test non-IMPORTED libraries in the INTERFACE of IMPORTED libraries.
If a non-IMPORTED library is added to the INTERFACE_LINK_LIBRARIES
of a IMPORTED target, the non-IMPORTED target needs to become a
target dependency and link dependency of the consuming target.

This is already the case since commit 30962029 (Make targets depend
on the link interface of their dependees, 2012-12-26), and fixed in
the parent commit, so test that it works.
2013-07-02 17:03:53 +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 be9a80a088 Merge topic 'vs-windows-forms'
6c9712c VS: Add Resx configuration to the vcxproj file
2013-07-01 09:18:06 -04:00
Brad King c46142bcae Merge topic 'split-GeneratorExpression-test'
cacb938 Split the GeneratorExpression test into a third part.
2013-07-01 09:16:09 -04:00
Brad King 62428f5e72 Merge topic 'ninja_phony_targets'
539356f Ninja: Custom Command file depends don't need to exist before building
874e171 Ninja: GlobalNinjaGenerator WriteBuild and WritePhonyBuild non static
88d27ad Add a test to expose a bug with add_custom_command and ninja.
2013-07-01 09:15:09 -04:00
Brad King 9a76d83f6d VS12: Find proper MSBuild for VSProjectInSubdir test
If the CTest make program is not msbuild we find the msbuild
corresponding to the current test generator.  In the case of
VS 12 search for the msbuild it provides.
2013-06-28 19:38:44 -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
Jonas Andersen 6c9712c47b VS: Add Resx configuration to the vcxproj file
In my project group we are using CMake to generate c++/cli winform
projects and I noticed the work done in commit 79ec7868 (VS: Add Windows
Forms Support, 2013-04-29) was in the right direction for solving some
of the problems we were facing.

The changes as submitted was breaking some functionality in our
projects, so I made some changes that fixes our problems and I believe
that it will also work for others.

* Resx files did not link correctly with the winform h-file so I added
  the Resx configuration to the vcxproj file.

* I removed the functionality for setting <CLRSupport> true for the
  project based on if an resx-file is pressent.  This is preventing
  us from using native cpp code.  Also this do not address that some
  projects will need to set other options like clr:pure, clr:safe.
  This could be implemented as a cmake option, so it is possible to
  specify exactly what is needed.  Existing VSWindowsFormsResx Test
  project is updated so it will be working with my changes.
2013-06-28 09:23:41 -04:00
Stephen Kelly cacb938d31 Split the GeneratorExpression test into a third part.
Avoid command lines beyond NMake limits.

 http://open.cdash.org/testDetails.php?test=196577461&build=2949683
 expanded command line '...' too long
2013-06-28 14:58:09 +02:00
Stephen Kelly 47a8db5bcd Add generator expressions for compiler versions.
New generator expressions allow retrieval of the version per language,
as well as equality comparison.
2013-06-28 14:32:58 +02:00
Brad King b6385cabec Escape target flags taken from COMPILE_OPTIONS
Factor appending of individual flags out into an AppendFlagEscape method
in cmLocalGenerator and teach it to use EscapeForShell.  Update all
COMPILE_OPTIONS handling to use AppendFlagEscape.

Override the method in the Xcode generator to use its custom escape
implementation.

Teach the CompileOptions test to add an option that requires escaping
everywhere instead of just with the GNU tools.
2013-06-27 12:57:32 -04:00
Brad King bef7c0251e Merge topic 'dag-LINKER_LANGUAGE'
ff015ee Genex: Report error if a target file is needed to evaluate link libraries.
b58aff9 Genex: Extend EvaluatingLinkLibraries to also check the top target name.
b1c19ce Genex: Make LINK_LANGUAGE report an error when evaluating link libraries.
0e1cb07 Add missing return after error report.
2013-06-26 09:03:05 -04:00
Brad King c1631efa0e Merge topic 'version-compare-genex'
e605528 Add generator expressions for version comparision.
48bb48e De-duplicate version comparison code.
2013-06-26 09:02:49 -04:00
Brad King 22fbeaa14b Merge topic 'export-COMPILE_OPTIONS-property'
77ff352 Generate INTERFACE_COMPILE_OPTIONS on export.
2013-06-26 09:02:10 -04:00
Robert Maynard 88d27ad014 Add a test to expose a bug with add_custom_command and ninja.
Ninja Generator is unable to handle an add_custom_command having
a dependency that is generated at build time by a previous target.
2013-06-25 14:43:47 -04:00
Stephen Kelly ff015ee11e Genex: Report error if a target file is needed to evaluate link libraries.
Constructs such as

 target_link_libraries(foo $<$<STREQUAL:$<TARGET_FILE:foo>,foo.so>:bar>)

segfault before this patch.
2013-06-24 16:22:15 +02:00
Stephen Kelly b1c19ce383 Genex: Make LINK_LANGUAGE report an error when evaluating link libraries. 2013-06-24 16:21:53 +02: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 bd2e3c7766 Merge topic 'add-cmake_host_system_information-command'
bb71a3a Add cmake_host_system_information command
2013-06-24 08:37:37 -04:00
Brad King 7bf42bf9cc Merge topic 'add-try_compile-options'
482f112 try_compile: Add signature to allow multiple SOURCES
2013-06-24 08:37:30 -04:00
Stephen Kelly 2331b57bec Add whitespace after colons in error messages. 2013-06-21 16:21:44 +02:00
Nils Gladitz bb71a3a0df Add cmake_host_system_information command
Expose the internal system information API to the CMake language.  For
example, it is useful to see how much memory the system has available to
estimate an upper limit of tests that can run in parallel.
2013-06-19 08:46:37 -04:00
Brad King ed2f59e614 Merge topic 'suppress-unused-cli-with-value-in-cache'
6a6cda5 Don't run the WarnUnusedCliUnused test on Windows.
2013-06-14 09:00:39 -04:00
Stephen Kelly 6a6cda5b4a Don't run the WarnUnusedCliUnused test on Windows.
Even with the NMake Makefiles generator, it is not able to properly
clean up after the test.

 http://open.cdash.org/testDetails.php?test=193424220&build=2934501

 Internal cmake changing into directory: C:/Dashboards/My Tests/CMake-nmake10-x64-continuous/Tests/WarnUnusedCliUnused
 Error: cmake execution failed
 CMake Error: Error: generator : NMake Makefiles
 Does not match the generator used previously: Visual Studio 10
 Either remove the CMakeCache.txt file or choose a different binary directory.
2013-06-12 17:21:10 +02:00
Stephen Kelly e6055284b3 Add generator expressions for version comparision. 2013-06-12 14:09:36 +02:00
Stephen Kelly 77ff352aa7 Generate INTERFACE_COMPILE_OPTIONS on export.
This was missing from commit 80ca9c4b (Add COMPILE_OPTIONS target
property., 2013-05-16).
2013-06-10 16:50:20 +02:00
Brad King 482f1122ad try_compile: Add signature to allow multiple SOURCES
Extend the signature

 try_compile(RESULT_VAR <bindir> <srcfile> ...)

to allow multiple sources as

 try_compile(RESULT_VAR <bindir> SOURCES <srcfile>... ...)

Process the sources to generate a CMakeLists.txt that enables all needed
languages.

Teach the TryCompile test to try cases with two sources of the same
language and of mixed languages.  Teach RunCMake.try_compile to cover
error cases for the signature.
2013-06-06 14:35:20 -04:00
Brad King d3c8688ecd Merge topic 'fix-genex-HEAD-target'
5b22235 Genex: Fix the HEAD target used for evaluated expressions
2013-06-05 09:54:20 -04:00
Brad King c02f01b039 Merge topic 'fix-path-root-dot-dot'
d26800b get_filename_component: Test ABSOLUTE of .. after root component
2013-06-05 09:39:48 -04:00
Brad King 21b1026541 Merge topic 'suppress-unused-cli-with-value-in-cache'
273ecab CLI: Suppress the unused warning if the key value pair is cached.
2013-06-05 09:39:18 -04:00
Brad King 93317839b0 Merge topic 'add_compile_options-command'
a984f32 Introduce add_compile_options command.
2013-06-05 09:39:05 -04:00
Brad King ff8917fdd2 Merge topic 'VISIBILITY_PRESET-property'
cd1fa53 Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property.
0e9f4bc Introduce target property <LANG>_VISIBILITY_PRESET
2013-06-05 09:38:59 -04:00
Stephen Kelly 5b222354de Genex: Fix the HEAD target used for evaluated expressions
If the expression $<TARGET_PROPERTY:prop> appears in the content
of a target property, the target that prop is read from is
the 'head target' of the expression. In contexts such as evaluating
the content of a target property during generation, such
as INCLUDE_DIRECTORIES, the 'head target' is the one on which the
initial request was made.

If evaluating a generator expression which is not a target property
content, the target must be explicitly specified. Such contexts
include add_custom_command and file(GENERATE). The content might
then look like

 $<TARGET_PROPERTY:tgt,prop>

However, as there is no HeadTarget set, any generator expressions
evaluated as part of reading prop from tgt which do not specify
the tgt directly report an error.

Modify the logic of the TARGET_PROPERTY generator expression so
that in such contexts, the 'head target' is set to the appropriate
target which was first encountered.
2013-06-05 09:05:00 -04:00
Brad King d26800bc40 get_filename_component: Test ABSOLUTE of .. after root component
Teach the RunCMake.get_filename_component test to verify that ".." does
not remove the root filename component.
2013-06-04 09:09:22 -04:00
Brad King d3971ee603 Merge topic 'fix-variable_watch-cases'
647745b variable_watch: Print accesses as "CMake Debug Log" messages
515f9af variable_watch: Remove leftover debugging code (#14187)
c63d300 variable_watch: Add test for MODIFIED_ACCESS report
3d5bb38 variable_watch: Add missing string enumeration entry (#14188)
2013-06-04 09:03:00 -04:00
Brad King 05e47f2122 Merge topic 'cfbundle-location'
483e208 OS X:  Fix getting of CFBundle LOCATION property.
2013-06-04 09:02:46 -04:00
Brad King b418327d1b Merge topic 'qt4-macros-TARGET-arg'
9ce60ff Qt4Macros: Allow specifying a TARGET in invokations of macros.
2013-06-04 09:02:37 -04: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
Stephen Kelly a984f3257e Introduce add_compile_options command.
This command is similar to add_definitions, in that it affects
the compile options of all targets which follow it. The implementation
is similar to the implementation of the include_directories command,
in that it is based on populating a COMPILE_OPTIONS directory property
and using that to initialize the same property on targets.

Unlike the include_directories command however, the add_compile_options
command does not affect previously defined targets. That is, in
the following code, foo will not be compiled with -Wall, but bar
will be:

 add_library(foo ...)
 add_compile_options(-Wall)
 add_library(bar ...)
2013-06-04 11:36:55 +02:00
Brad King c9be17c860 Merge topic 'escape-regex-specials-in-path'
e4e0921 Merge branch 'master' into escape-regex-specials-in-path
c9b75dc Fix test failures caused by regexp-sensitive characters in the build paths
2013-06-03 13:51:31 -04:00
Rolf Eike Beer e4e09212c5 Merge branch 'master' into escape-regex-specials-in-path
Resolve conflicts in Tests/CTestTestMemcheck/CMakeLists.txt by combining
changes from both sides.
2013-06-03 13:43:52 -04:00
Brad King 647745b3ee variable_watch: Print accesses as "CMake Debug Log" messages
Use makefile->IssueMessage() to print the unprocessed watch message in a
format consistent with other CMake messages and with a more complete
call stack for the access.
2013-06-03 13:19:59 -04:00
Brad King 515f9af0d4 variable_watch: Remove leftover debugging code (#14187)
When a watch does not specify a command to call then variable_watch
prints out a message to stderr.  Remove code after that which collects
all variable values to construct a message that is never printed.
Otherwise such code causes a READ_ACCESS watch to trigger on all
variables in the currents scope.

Reported-by: Yichao Yu <yyc1992@gmail.com>
2013-06-03 13:13:07 -04:00
Modestas Vainius c9b75dcd73 Fix test failures caused by regexp-sensitive characters in the build paths
Checkout [1] as an example of the test failures. In that particular cases, the
failures is caused by the plus sign in the path being pass unescaped
(buildd-cmake_2.8.9-1~bpo60+1-armel-3Lvkef) to the regexp.

In addition to failures in the log, the following new tests also fail in 2.8.11:

  243 - CTestTestMemcheckUnknown (Failed)
  244 - CTestTestMemcheckUnknownQuoted (Failed)
  248 - CTestTestMemcheckDummyValgrindFailPre (Failed)
  249 - CTestTestMemcheckDummyValgrindFailPost (Failed)
  250 - CTestTestMemcheckDummyPurify (Failed)
  251 - CTestTestMemcheckDummyBC (Failed)
  253 - CMake.List (Failed)

[1] https://buildd.debian.org/status/fetch.php?pkg=cmake&arch=armel&ver=2.8.9-1~bpo60%2B1&stamp=1369243896
2013-06-03 16:51:21 +02:00
Brad King c63d30048b variable_watch: Add test for MODIFIED_ACCESS report
Add a RunCMake.variable_watch watch test to cover the basic use case.
2013-06-03 10:20:31 -04:00
Brad King d114fc373c Merge topic 'useless-MATCHES'
cd4451d replace string(... MATCHES "^const$) with string(... STREQUAL "const")
2013-06-03 09:57:53 -04:00
Brad King e57b6a2521 Merge topic 'target-COMPILE_OPTIONS'
24466f2 Add target_compile_options command.
80ca9c4 Add COMPILE_OPTIONS target property.
7cb2308 cmTarget: Rename LinkInterfaceIncludeDirectoriesEntries
47f80d9 cmTarget: Rename struct to be more re-usable.
1319a14 Add <LANG>_COMPILER_ID generator expressions.
3549676 Add cmLocalGenerator::GetCompileOptions.
f3ad863 VS6: Rename some variables to correspond to config values.
2013-06-03 09:57:44 -04:00
Brad King bcc29c56a5 Merge topic 'refactor-try_compile-argument-processing'
d06db7e try_compile: Refactor argument processing
b680824 try_compile: Add test for bad call error cases
2013-06-03 09:57:39 -04:00
Brad King 6d4e79e2c3 Merge topic 'qt4-qt5-CMAKE_AUTOMOC'
fa55751 QtAutomoc: Get the Qt version through the target link interface
f776316 Use the qt5::moc imported target instead of a variable.
2013-06-03 09:57:01 -04:00
Brad King 3caf565d07 Merge topic 'rpath-on-mac'
dc1d025 OS X: Add test for rpaths on Mac.
8576b3f OS X: Add support for @rpath in export files.
00d71bd Xcode: Add rpath support in Xcode generator.
94e7fef OS X: Add RPATH support for Mac.
2013-06-03 09:56:44 -04:00
Brad King b0759da303 Merge topic 'framework-refactor'
373faae Refactor how bundles and frameworks are supported.
2013-06-03 09:56:32 -04:00
Clinton Stimpson dc1d025197 OS X: Add test for rpaths on Mac.
This also tests rpaths through export/import.
2013-06-03 09:42:06 -04:00
Clinton Stimpson 483e208482 OS X: Fix getting of CFBundle LOCATION property.
This fixes bug #13797.
The kinds of changes applied in 373faae5 for frameworks are now
applied to CFBundle.  The prefix and suffix for CFBundles are
now handled in cmTarget::GetFullNameInternal.
2013-06-03 06:29:33 -06:00
Stephen Kelly 9ce60ff509 Qt4Macros: Allow specifying a TARGET in invokations of macros.
That will allow things like this:

 find_package(Qt4)

 qt4_generate_moc(myfile.h moc_myfile.cpp TARGET foo) # Note, foo target doesn't
                                                      # exist until below.

 add_library(foo ...)

The qt4_generate_moc call would use the INCLUDE_DIRECTORIES from
the foo target using generator expressions. Currently it reads
the INCLUDE_DIRECTORIES directory property, meaning that include_directories()
is required.

Support for the TARGET is also added to qt4_wrap_cpp, but not qt4_automoc,
as that is deprecated in favor of the AUTOMOC target property.

The moc tool reports failure if the Q_INTERFACES macro is used with
an argument which has not appeared with Q_DECLARE_INTERFACE, so that is
the basis of the unit test.

The command line arguments are now always written to a file, which is
passed to moc as the @atfile. This was already the case on Windows, but
now it is used everywhere. The reason for that is that it is not currently
possible to expand the list of includes from a target directly in
a add_custom_command invokation (though that may become possible in the
future). There is not a big disadvantage to using the file anyway on
unix, so having one code path instead of two is also a motivation.
2013-06-03 10:07:02 +02:00
Rolf Eike Beer cd4451d1e7 replace string(... MATCHES "^const$) with string(... STREQUAL "const") 2013-06-02 22:18:19 +02:00
Stephen Kelly cd1fa537a0 Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property.
This corresponds to the g++ and clang++
option -fvisibility-inlines-hidden on linux. On Windows with MinGW,
this corresponds to -fno-keep-inline-dllexport. That option is
not supported by clang currently.
2013-06-02 12:00:51 +02:00
Stephen Kelly 0e9f4bc00c Introduce target property <LANG>_VISIBILITY_PRESET
This is initialized by CMAKE_<LANG>_VISIBILITY_PRESET. The target
property is used as the operand to the -fvisibility= compile option
with GNU compilers and clang.
2013-06-02 12:00:51 +02:00