Commit Graph

3160 Commits

Author SHA1 Message Date
Stephen Kelly 71a11252e9 QtAutogen: Fix use of multiple ui files in a single target.
Don't store a mapping of the directory to the ui file. The directory
will be a unique key, allowing only one ui file to be specified.
Use the source file name instead as the mapping key.
2014-03-25 01:39:03 +01:00
Stephen Kelly 261acd9109 QtAutogen: Use the basename for resource files.
The rcc tool generates a cpp file with a symbol called qInitResources
or called qInitResources_${name}, if the name is passed. The
qInitResources symbol clashes if multiple qrc files are used in
one target.

Always pass the name to ensure that the symbol is unique. This is also
the behavior of the qtx_add_resource macros.
2014-03-25 01:16:49 +01:00
Stephen Kelly 734df96f5a Qt4: Fix moc command dependencies for incremental build.
Since commit v2.8.12~327^2 (Qt4Macros: Allow specifying a TARGET
in invokations of macros., 2013-02-26), a parameters file is
populated with moc arguments at generate-time.

When the compile definitions or include directories change, the
parameters file is updated but moc is not re-run in response.

Fix that by making the moc invocation depend on the parameters file.

Reported-At: https://bugreports.qt-project.org/browse/QTBUG-36970
2014-03-21 11:14:41 +01:00
Brad King 565213c1fd Merge topic 'configure_file-unicode'
98383f80 Unicode: check encoding of files given to configure_file.
2014-03-20 09:22:28 -04:00
Brad King df136e6c27 Merge topic 'ExternalProject-no-download-progress'
f1b953ec Help: Add notes for topic 'ExternalProject-no-download-progress'
7d35b550 ExternalProject: Add option to disable download progress (#14807)
2014-03-20 09:22:26 -04:00
Brad King b048a3edd0 Merge topic 'FindPkgConfig_Extend-PKG_CONFIG_PATH_2'
cc5a0d8f FindPkgConfig: More unit tests
453d2b24 FindPkgConfig: small refactoring
2014-03-20 09:22:25 -04:00
Brad King 82c590b12e Merge topic 'CheckTypeSize_#14056'
7f857775 CheckTypeSize: Add unit test to cover the no-C case
7d6d45f2 CheckTypeSize: Support for CXX when C language is not enabled
2014-03-20 09:22:23 -04:00
Brad King aa8f8777a4 Merge topic 'fix-AllFindModules-test-module-path'
cf3e87e1 Tests: Teach CMakeOnly.AllFindModules to tolerate a system KDE4
2014-03-20 09:22:18 -04:00
Brad King e1c1f18e39 Merge topic 'add_custom_command-DEPENDS-genex'
bbffccca add_custom_command: Evaluate generator expressions in DEPENDS
2014-03-20 09:22:17 -04:00
Brad King fb60cf46b6 Merge topic 'fix-out-of-date-CTestTestMemcheck'
84a42304 Tests: Prevent unnecessary rebuilds in CTestTestMemcheck
2014-03-20 09:22:14 -04:00
Brad King 86b003c3c6 Merge topic 'add_custom_command-no-INTERFACE-lib'
2600e923 Disallow INTERFACE libraries with add_custom_command(TARGET).
2014-03-20 09:22:12 -04:00
Stephen Kelly bbffccca42 add_custom_command: Evaluate generator expressions in DEPENDS
Rely on evaluation in cmCustomCommandGenerator for the generators.

When tracing target dependencies, depend on the union of dependencies
for all configurations.
2014-03-20 09:21:56 -04:00
David Cole 84a4230406 Tests: Prevent unnecessary rebuilds in CTestTestMemcheck
Repeated "cmake . && ninja" calls were resulting in rebuilds every time.

Change the test so that it uses "file(WRITE" to generate a ".in" file and
then configure_file to "copy if different" that ".in" file to the final
generated source file.

Now, rebuilds will only occur if there are changes to the generated source
file on "cmake ." runs after the first one.
2014-03-20 09:02:50 -04:00
Brad King cf3e87e195 Tests: Teach CMakeOnly.AllFindModules to tolerate a system KDE4
The FindKDE4 module (incorrectly) modifies CMAKE_MODULE_PATH on the
caller's behalf.  This causes KDE4-installed find modules to be used by
the test instead of those in CMake.  Teach the test to restore the
CMAKE_MODULE_PATH to its original value after each find_package call.
This ensures that the next find_package actually tests our module.
2014-03-19 13:33:00 -04:00
Stephen Kelly 2600e923a6 Disallow INTERFACE libraries with add_custom_command(TARGET).
Don't attempt to trace their dependencies.
2014-03-19 15:51:21 +01:00
Clinton Stimpson 98383f802a Unicode: check encoding of files given to configure_file.
UTF-16 and UTF-32 files are rejected.
2014-03-17 14:01:55 -06:00
Daniele E. Domenichelli cc5a0d8f42 FindPkgConfig: More unit tests 2014-03-17 18:10:59 +01:00
Daniele E. Domenichelli 7f857775e2 CheckTypeSize: Add unit test to cover the no-C case 2014-03-17 17:36:14 +01:00
Brad King 7d35b55060 ExternalProject: Add option to disable download progress (#14807)
Add a DOWNLOAD_NO_PROGRESS option to disable progress reports while
downloading source tarballs.
2014-03-17 11:28:05 -04:00
Brad King 41b82db685 Merge topic 'FindPkgConfig_Extend-PKG_CONFIG_PATH'
3df51470 FindPkgConfig: Extend PKG_CONFIG_PATH using CMake variables (#12926)
2014-03-17 09:49:58 -04:00
Daniele E. Domenichelli 3df5147043 FindPkgConfig: Extend PKG_CONFIG_PATH using CMake variables (#12926)
Use CMAKE_PREFIX_PATH, CMAKE_FRAMEWORK_PATH, and CMAKE_APPBUNDLE_PATH
cache and environment variables to extend PKG_CONFIG_PATH before calling
pkg-config.

In each of the path in these variables it searches for lib/pkgconfig.
Then, depending on the system, it searches for
lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig (debian) or for
lib64/pkgconfig (other 64 bit unixes). If any of these path is found,
it is appended to the PKG_CONFIG_PATH enviromnent variable.

Add two new arguments to the pkg_check_module and pkg_search_module
macro, NO_CMAKE_PATH and NO_CMAKE_ENVIRONMENT_PATH. The new signature
are therefore:

   pkg_check_modules(<PREFIX> [REQUIRED] [QUIET]
                     [NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
                     <MODULE> [<MODULE>]*)
   pkg_search_module(<PREFIX> [REQUIRED] [QUIET]
                     [NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH]
                     <MODULE> [<MODULE>]*)

By default, if CMAKE_MINIMUM_REQUIRED_VERSION is 3.1 or later (in
order to keep compatibility with the previous behavior), or if
PKG_CONFIG_USE_CMAKE_PREFIX_PATH is set, the CMAKE_PREFIX_PATH,
CMAKE_FRAMEWORK_PATH, and CMAKE_APPBUNDLE_PATH cache and environment
variables will be added to pkgconfig search path.

The NO_CMAKE_PATH and NO_CMAKE_ENVIRONMENT_PATH arguments disable this
behavior for the cache variables and the environment variables,
respectively, similarly to the find_package() command.
2014-03-17 09:43:08 -04:00
Brad King 6e466c6f2e Merge branch 'master' into CONFIG-LOCATION-CMP0026 2014-03-17 09:31:21 -04:00
Stephen Kelly c903b5319b cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808)
Restore support for the undocumented <CONFIG>_LOCATION target property
removed by commit v3.0.0-rc1~175^2 (cmTarget: Remove support for
<CONFIG>_LOCATION property, 2013-12-30) as part of the CMP0026 OLD
behavior.
2014-03-17 09:30:39 -04:00
Brad King a25b809f20 Tests: Check find_dependency empty extra arguments
Add cases for empty arg 2 and arg 3.
2014-03-13 15:57:03 -04:00
Brad King d363cbf315 Tests: Make RunCMake.find_dependency tolerate line number changes 2014-03-13 15:47:08 -04:00
Brad King e1a671c7d8 Merge topic 'fix-CMP0046-warning'
d83245a3 cmTarget: Don't create duplicate backtraces in CMP0046 warning
2014-03-13 09:36:06 -04:00
Stephen Kelly d83245a34f cmTarget: Don't create duplicate backtraces in CMP0046 warning 2014-03-12 18:01:26 +01:00
Stephen Kelly f74a8405b6 Test error cases in find_dependency. 2014-03-11 14:48:35 +01:00
Brad King 510ceb19ed Merge topic 'fix-AUTOGEN-custom-command-depends'
112cba92 QtAutogen: Fix AUTOGEN depends on custom command output with VS.
2014-03-11 09:13:58 -04:00
Brad King c9241cad83 Merge topic 'fix-find_dependency-EXACT-for-master'
45abfb0c find_dependency: Extend the tests for use of EXACT macro parameter.
2014-03-11 09:13:56 -04:00
Brad King ebaa5a6410 Merge branch 'fix-AUTOGEN-custom-command-depends' into release 2014-03-10 09:38:52 -04:00
Brad King 98e3831a67 Merge branch 'fix-policy-scopes' into release 2014-03-10 09:36:28 -04:00
Brad King 7b0efcded3 Merge topic 'fix-policy-scopes'
50fd0a33 Tests: Simplify and document policy scopes in RunCMake.CMP* tests
b1bbee3e Record more policies on targets when created
2014-03-10 09:33:25 -04:00
Stephen Kelly 112cba927a QtAutogen: Fix AUTOGEN depends on custom command output with VS.
Visual Studio is handled as a special case for autogen depends. However,
the special handling works only for target dependencies, not file
dependencies output by a custom command.

Use a PRE_BUILD step only if all depends are targets.
2014-03-10 13:01:29 +01:00
Stephen Kelly 45abfb0c4d find_dependency: Extend the tests for use of EXACT macro parameter. 2014-03-10 09:07:38 +01:00
Brad King ad9f0d831e Merge topic 'dev/string-apis'
b633b263 CPackWiX: Fix test to build with expected config
191f25e2 stringapi: Prevent a NULL dereference in WiX
219d6ad6 speedup: Avoid excess iterator dereferences
caaad357 speedup: Cache strings for comparisons
7abf4e31 stringapi: Use strings for dependency information
94fc63e2 stringapi: Use strings for cache iterator values
85fc9f26 stringapi: Command names
6557382d stringapi: Use strings for program paths
1a1b737c stringapi: Use strings for generator names
24b5e93d stringapi: Use strings for directories
11ed3e2c stringapi: Add string overload for the Def struct
b3bf31a5 stringapi: Miscellaneous char* parameters
5af95c39 typo: Match argument name with the header
2b17626e stringapi: Pass strings as install directories in CPack
3def29da stringapi: Use strings for feature arguments
acb116e3 stringapi: Return a string reference for the configuration
...
2014-03-09 10:29:02 -04:00
Brad King b633b26308 CPackWiX: Fix test to build with expected config 2014-03-08 13:05:40 -05:00
Ben Boeckel 270eb96df0 strings: Remove cmStdString references
Casts from std::string -> cmStdString were high on the list of things
taking up time. Avoid such implicit casts across function calls by just
using std::string everywhere.

The comment that the symbol name is too long is no longer relevant since
modern debuggers alias the templates anyways and the size is a
non-issue since the underlying methods are generated since it's
inherited.
2014-03-08 13:05:35 -05:00
Brad King 50fd0a33c9 Tests: Simplify and document policy scopes in RunCMake.CMP* tests
Drop unnecessary NO_POLICY_SCOPE options.  Document why the remaining
options are necessary.
2014-03-06 11:07:03 -05:00
Brad King b1bbee3e9a Record more policies on targets when created
Policies CMP0027, CMP0038, and CMP0046 have per-target meaning so
record the policy settings on targets as they are created.
2014-03-06 11:05:47 -05:00
Brad King 25fb430e96 Utilities/Release: Fix nightly build upload
Since commit 71b14dcb (Utilities/Release: Do not upload doc staging
tarball, 2014-02-26) the prefix upload_release.cmake computes does not
match any files when used with -DVERSION=master as has been done for the
nightly binary builds.  Since the version is not actually 'master'
anyway, change the nightly binary upload logic to explicitly pass the
destination directory.  Do not pass any VERSION so the default is taken
and matches the binaries.
2014-03-06 09:32:04 -05:00
Brad King cefa80236d Merge topic 'test-external-cmake'
9608ef6f Tests: Optionally configure tests exclusively, with an external CMake
9f5bd180 Tests: Drop CMAKE_TEST_GENERATOR(|_TOOLSET) variables
76477267 Tests: Drop CMAKE_TEST_MAKEPROGRAM variable
a8a9fb7e Tests: Rename CMAKE_TEST_MAKEPROGRAM uses for explicit make program
40475573 Tests: Rename CMAKE_TEST_MAKEPROGRAM uses for nested test projects
f99734b2 Tests: Rename CMAKE_TEST_DEVENV -> CMake_TEST_DEVENV
3c01ee5a Tests: Drop CMAKE_TEST_MSVC and test MSVC directly
daf0a5fe Tests: Drop CMAKE_TEST_GENERATOR and CMAKE_TEST_MAKEPROGRAM options
e5096312 Tests: Drop kwsys test
2014-03-05 11:07:59 -05:00
Brad King 9e6e9140c2 Merge topic 'fix-CMP0017-check'
7e187eea CMP0017: Fix check when including from CMake source tree
2014-03-05 11:07:58 -05:00
Brad King 7e187eeacd CMP0017: Fix check when including from CMake source tree
When running CMake from the build tree the CMAKE_ROOT is the
entire source tree.  Fix the CMP0017 check to be specific to
the Modules/ directory under CMAKE_ROOT so that Tests/ does
not count.  Fix the FindPackageTest modules to include FPHSA
by full path from CMAKE_ROOT so that they do not include the
local FPHSA which reports an error meant to test that CMP0017
works.
2014-03-04 09:35:00 -05:00
Brad King 9608ef6f40 Tests: Optionally configure tests exclusively, with an external CMake
Add an undocumented CMake_TEST_EXTERNAL_CMAKE option to name an external
CMake 'bin' directory.  Skip all main CMake binary builds and instead
configure the Tests directory to run using the external CMake provided.
This will provide a means to exercise the CMake test suite generating
for target platforms and compilers with which the CMake source does not
build.  That will allow us to raise the level of C++ features required
of a compiler to build our source while retaining tests for generating
projects with older compiler tools.
2014-03-03 15:49:17 -05:00
Brad King 9f5bd180c8 Tests: Drop CMAKE_TEST_GENERATOR(|_TOOLSET) variables
s/CMAKE_TEST_GENERATOR/CMAKE_GENERATOR/g
2014-03-03 15:26:49 -05:00
Brad King 76477267bd Tests: Drop CMAKE_TEST_MAKEPROGRAM variable
Remaining uses of the variable simply test its value so use
CMAKE_MAKE_PROGRAM directly instead.
2014-03-03 15:26:49 -05:00
Brad King a8a9fb7edd Tests: Rename CMAKE_TEST_MAKEPROGRAM uses for explicit make program
Rename uses of the variable for specifying the make program used to
build test projects to CMake_TEST_EXPLICIT_MAKE_PROGRAM.
2014-03-03 15:26:48 -05:00
Brad King 4047557379 Tests: Rename CMAKE_TEST_MAKEPROGRAM uses for nested test projects
In the ExportImport, Fortran, and MacRuntimePath tests the
CMAKE_TEST_MAKEPROGRAM variable is used to pass an explicit request for
a CMAKE_MAKE_PROGRAM value to be used when building the inner projects.
Rename these use cases to CMake_TEST_NESTED_MAKE_PROGRAM.
2014-03-03 15:26:48 -05:00
Brad King f99734b2da Tests: Rename CMAKE_TEST_DEVENV -> CMake_TEST_DEVENV
Follow the convention of naming variables related to the CMake build
itself as "CMake_" rather than "CMAKE_".  While at it, consolidate the
code computing CMake_TEST_DEVENV to be more localized.
2014-03-03 15:26:48 -05:00
Brad King 3c01ee5adc Tests: Drop CMAKE_TEST_MSVC and test MSVC directly
Now that we no longer support running tests using a different generator
we can trust the MSVC platform indicator directly.
2014-03-03 15:26:48 -05:00
Brad King daf0a5fede Tests: Drop CMAKE_TEST_GENERATOR and CMAKE_TEST_MAKEPROGRAM options
Drop the option to test with a different generator and make program than
was used to build.  This was used only to test support for the Open
Watcom compiler which at one time could not build CMake.  Instead we
will allow CMake to be configured to skip building binaries and just run
the test suite using an external CMake (in a future change).

For now leave the two option variables hard-coded to the old option
defaults until code can be updated to stop using them.
2014-03-03 15:26:46 -05:00
Brad King e509631237 Tests: Drop kwsys test
KWSys now has its own dashboard and test clients that run on all the
machines where we test CMake.  We no longer need a test inside CMake to
test KWSys independently.
2014-03-03 15:25:01 -05:00
Daniele E. Domenichelli 8372b4553b FeatureSummary: Add unit tests 2014-03-03 19:52:13 +01:00
Nils Gladitz 642fa25da0 CPackWIX: support installation of empty directories 2014-03-02 00:51:42 +01:00
Nils Gladitz 378eb5b712 CPackWIX: Allow Windows Installer property customization 2014-03-01 23:13:35 +01:00
Brad King a4656986e1 Merge topic 'tests-RunCMake-no-unused'
7cd239ed Tests/RunCMake: Tell cmake not to report unused command-line options
2014-02-28 09:48:40 -05:00
Brad King 7cd239ed38 Tests/RunCMake: Tell cmake not to report unused command-line options
On OS X we pass -DCMAKE_POLICY_DEFAULT_CMP0025=NEW to all tests.
Once tests start using cmake_minimum_required(VERSION 3.0) then
CMake will warn that CMAKE_POLICY_DEFAULT_CMP0025 is unused.
These warnings are not part of the expected test output and can
cause such tests to fail.  Pass --no-warn-unused-cli to each test
cmake invocation to tell it not to produce these warnings.
2014-02-27 13:25:23 -05:00
Stephen Kelly 0bba365ff5 Add test for find_dependency macro. 2014-02-26 22:21:03 +01:00
Brad King 6223621e9a Merge topic 'msvc-compiler-pdb-files'
fba51b09 MSVC: Add properties to configure compiler PDB files (#14762)
3737860a cmTarget: Add per-config compilation info
718a9532 cmTarget: Refactor ComputePDBOutputDir interface
aae5184c Help: Refactor PDB_NAME and PDB_OUTPUT_DIRECTORY docs
b4aac0ca Makefile: Fix per-config linker PDB output directory
2014-02-26 09:38:51 -05:00
Brad King fba51b096e MSVC: Add properties to configure compiler PDB files (#14762)
Since commit v2.8.12~437^2~2 (VS: Separate compiler and linker PDB files
2013-04-05) we no longer set /Fd with the PDB_NAME or PDB_OUTPUT_DIRECTORY
properties.  Those properties now exclusively handle linker PDB files.
Since STATIC libraries do not link their compiler PDB file becomes more
important.  Add new target properties "COMPILE_PDB_NAME[_<CONFIG>]" and
"COMPILE_PDB_OUTPUT_DIRECTORY[_<CONFIG>]" to specify the compiler PDB
file location and pass the value to the MSVC /Fd option.
2014-02-26 09:34:38 -05:00
Brad King 049790c0eb Merge topic 'target-SOURCES-refactor'
f9d5b1fd Handle Mac OSX source flags for individual files lazily.
64d39841 cmGeneratorTarget: Classify sources on demand, not up front.
d3682d86 cmGeneratorTarget: Use a method to access the definition file.
5771f81d cmTarget: Add GetTransitiveTargetClosure method.
a6dd4990 cmTarget: Create a temporary cmTarget in checkInterfacePropertyCompatibility
b8b99cc1 cmTarget: Avoid computing languages when computing transitive targets.
01bca553 cmTarget: Move ComputeLinkInterface to the internal class.
d93e1af2 cmTarget: Extract a ComputeLinkInterfaceLibraries method.
3bcb197c cmTarget: Re-arrange the ComputeLinkInterface method.
326d07d2 cmTarget: Extract a ComputeLinkImplementationLanguages method.
21e91350 cmTarget: Change GetTransitivePropertyLinkLibraries to output targets.
f81eb49e cmTarget: Find source files on request.
84e5f5a0 cmTarget: Move SourceFileFlags to cmGeneratorTarget.
2014-02-25 11:18:12 -05:00
Stephen Kelly 5771f81d91 cmTarget: Add GetTransitiveTargetClosure method.
Replace calls to GetLinkInformation with calls to a method to get only
the target closure, not the link languages etc.  The replaced calls
are used while evaluating generator expressions only.  This makes
transitive generator expression evaluation independent from
the languages of a target.  In a follow-up topic, it will be possible
to make the languages depend on generator expression evaluation, via
evaluation of the SOURCES and INTERFACE_SOURCES target properties.

Because the order of entries is not the same as the final link line,
the order of debug output is different in the RunCMake.CompatibleInterface
test, because the BOOL_PROP7 target property is evaluated first. Adjust
the test to account for that new order.
2014-02-24 16:43:24 +01:00
Brad King fb5b48bb27 Merge topic 'variable-expansion-tests'
a9bdef2d tests: Add variable expansion tests
2014-02-24 10:40:09 -05:00
Brad King 624b0fa923 Merge topic 'ExternalProject-BUILD_ALWAYS'
73e5c6ae ExternalProject: Add option to always run the build step
2014-02-24 10:40:07 -05:00
Brad King 6e89c8a5f1 install: Support generator expressions in FILES and PROGRAMS mode
Teach the install(FILES) and install(PROGRAMS) commands to evaluate
generator expressions in the list of files.

Extend the ExportImport test to cover installation cases involving
generator expressions.
2014-02-21 17:05:26 -05:00
Ben Boeckel a9bdef2dda tests: Add variable expansion tests
There are some corner cases in variable expansion which would be nice to
capture before going and rewriting the variable expansion code. The
majority of these are related to configuring files and strings with '@'
in them in conjunction with @ONLY being specified. Another is testing
for '(' usage inside of ENV variable references based on whether it is
quoted or not.
2014-02-21 16:39:12 -05:00
Brad King 73e5c6aead ExternalProject: Add option to always run the build step
Teach ExternalProject_Add a new BUILD_ALWAYS option to skip using
the build step stamp file and execute the step on every build.

Extend the BuildDepends test with a case to cover this option.
2014-02-21 11:05:41 -05:00
Stephen Kelly f6cae4ea06 Tests: Remove some trailing black lines. 2014-02-17 18:54:53 +01:00
Stephen Kelly f2eee72fac add_custom_command: Disallow use of SOURCE signatures.
Add CMP0050 to control this behavior.
2014-02-12 11:19:27 -05:00
Stephen Kelly c248a437c4 Add policy CMP0049 to avoid variable expansion in source lists 2014-02-12 11:17:38 -05:00
Brad King c00d84cdf3 Merge topic 'remove-Example'
2e615d4b Remove the Example from the source.
2014-02-10 11:25:06 -05:00
Brad King cdcf23bde2 Merge topic 'fix-CMP0028-iface'
b2915238 CMP0028: Trigger on libraries from INTERFACE of dependencies.
2014-02-10 11:25:02 -05:00
Brad King f67ab2a920 Merge topic 'release-notes-prep'
4b7f2f52 Help: Add hyperlink targets for argument types in cmake-language(7)
113df227 Remove ChangeLog.manual
79f55909 Remove ChangeLog.txt
d25dbc90 Tests/BundleTest: Drop use of ChangeLog.txt
2014-02-10 11:24:58 -05:00
Brad King 27d3974c66 Merge topic 'wix_desktop'
b78d74de CPackWiX: Add support for CPACK_CREATE_DESKTOP_LINKS
2014-02-10 11:24:56 -05:00
Brad King 6e149e1591 Merge topic 'interface-library-signatures'
6d85a6a6 add_library: Issue better diagnostic for INTERFACE GLOBAL signature.
770245e9 add_library: Test invalid GLOBAL INTERFACE signature.
2014-02-10 11:24:54 -05:00
Stephen Kelly 2e615d4be9 Remove the Example from the source.
It is not showing modern practice, and is obsolete as documentation
after the rst documentation system and new content.
2014-02-09 22:09:20 +01:00
Stephen Kelly b29152387d CMP0028: Trigger on libraries from INTERFACE of dependencies. 2014-02-09 15:35:28 +01:00
Timo Rothenpieler b78d74de64 CPackWiX: Add support for CPACK_CREATE_DESKTOP_LINKS 2014-02-08 19:19:33 +01:00
Brad King d25dbc9059 Tests/BundleTest: Drop use of ChangeLog.txt
The test just wants a source file from outside its tree.
Use README.rst instead.
2014-02-07 13:35:31 -05:00
Stephen Kelly 6d85a6a64c add_library: Issue better diagnostic for INTERFACE GLOBAL signature. 2014-02-07 15:49:15 +01:00
Stephen Kelly 770245e928 add_library: Test invalid GLOBAL INTERFACE signature.
This has to be tested separately from the invalid_signature test because
target sources are evaluate at a later time, and earlier errors in the
invalid_signature test cause early exit.
2014-02-07 15:49:15 +01:00
Brad King 78be324762 Tests: Speed up RunCMake.CheckModules test
Enable the C and CXX languages only in the test cases that really need
them.  In the failure cases we do not get far enough to really use the
languages, so skip enabling them.
2014-02-06 11:12:50 -05:00
Stephen Kelly 8f8edeb09b QtAutogen: Only add source files to the target if AUTORCC is ON.
The qtx_add_resources() macro adds the resource file to the output list
to maintain file-level dependencies.  Having the qrc file in a target
sources is a precondition for AUTORCC to function.

When processing the source files of a target, only add the generated
qrc_<file>.cpp to the target sources if AUTORCC is ON.  This avoids
pre-porting conflict with the macro.

Reported-by: Micha Hergarden
2014-02-05 10:13:39 +01:00
Brad King f748b59e20 Merge topic 'fix-Qt-autogen'
6053ce22 QtAutogen: Make uic work even when the source is in a subdir.
1fc9ecfa FindQt4: Make AUTOMOC work regardless which order Qt 4/5 is found.
2014-02-04 13:34:54 -05:00
Stephen Kelly 6053ce22f6 QtAutogen: Make uic work even when the source is in a subdir.
Modify the includedUis to store the path to the file which includes
the ui file. Reuse that path to generate the output file from the
uic process.
2014-02-04 13:21:43 -05:00
Brad King cdadec9f24 Merge topic 'fix-visibility-inlines-hidden'
efdcebdd VisibilityInlinesHidden: only apply -fvisibility-inlines-hidden to C++ sources
2014-02-03 11:11:11 -05:00
Brad King a7f5a6ee12 Merge topic 'project-version-variables'
41d2f2c4 write_basic_package_version_file: use PROJECT_VERSION
7e142c5a project: Manage VERSION variables
16d040c9 project: Add optional LANGUAGES keyword
00007dcc Help: Format project command and variable documentation
2014-02-03 11:10:58 -05:00
Nils Gladitz efdcebddbd VisibilityInlinesHidden: only apply -fvisibility-inlines-hidden to C++ sources 2014-02-01 09:55:24 +01:00
Stephen Kelly 1fc9ecfae6 FindQt4: Make AUTOMOC work regardless which order Qt 4/5 is found.
Commit 321e348e (QtAutogen: Use Qt 4 IMPORTED targets to find
executable locations., 2014-01-24) attempted to fix this problem,
but only solved it for a particular ordering of find_package for
Qt 4 and Qt 5.

Add a test to ensure that it works with both orderings.
2014-01-29 17:02:43 +01:00
Brad King bbc82d85e5 Merge topic 'fix-Qt-autogen'
f7ae1d8a QtAutogen: Short-circut some logic when moc is not available.
4b989d5f QtAutogen: Separate source file processing from AUTOMOC.
c48d877d QtAutogen: Make some methods appropriately file-static.
394e86df QtAutogen: Fix autouic target options in the presence of a config.
964d7f2a QtAutogen: Remove unused variables.
0d934efd QtAutogen: Remove read of SKIP_AUTOUIC target property.
321e348e QtAutogen: Use Qt 4 IMPORTED targets to find executable locations.
e96683b0 Qt4: Use IMPORTED executable names with custom commands.
e6182f5d Qt4: Create IMPORTED executable targets for all Qt executables.
2014-01-29 10:05:04 -05:00
Brad King fed6c73e1d Merge topic 'ExternalProject-git-submodules'
819015ef ExternalProject: Add option GIT_SUBMODULES
2014-01-29 10:05:03 -05:00
Brad King 7e142c5ac2 project: Manage VERSION variables
Teach the project() command to set variables

  {PROJECT,<PROJECT-NAME>}_VERSION{,_MAJOR,_MINOR,_PATCH,_TWEAK}

holding the project version number and its components.  Add project()
command option "VERSION" to specify the version explicitly, and default
to the empty string when it is not given.

Since this clears variables when no VERSION is given, this may change
behavior for existing projects that set the version variables themselves
prior to calling project().  Add policy CMP0048 for compatibility.

Suggested-by: Alex Neundorf <neundorf@kde.org>
2014-01-29 09:45:18 -05:00
Brad King 16d040c958 project: Add optional LANGUAGES keyword
Teach the project() command to recognize an optional "LANGUAGES"
keyword after the project name and prior to the list of languages.
Do not allow multiple copies of the keyword.  If the keyword is
specified and no languages are listed, imply NONE.
2014-01-29 09:40:51 -05:00
Brad King 5e4b8871bc Cygwin: Avoid legacy warnings in RunCMake.CMP004[1235] tests
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.
2014-01-28 17:07:56 -05:00
Stephen Kelly f7ae1d8ad6 QtAutogen: Short-circut some logic when moc is not available.
This is the case when AUTOMOC is false.  This prevents creating rules
to moc the files in the absense of moc.
2014-01-28 21:04:40 +01:00
Stephen Kelly 321e348e13 QtAutogen: Use Qt 4 IMPORTED targets to find executable locations.
Avoid using the moc from Qt 5 with Qt 4 based targets. Moc generates
a version check to ensure that such generated code does not compile.

The Qt4And5Automoc unit test should have been testing this, but it
was not because the test was broken. In that unit test, moc was run
on trivial files which have no significant content, and in particular
no Q_OBJECT macro.  Therefore moc was generating empty files which
do not even contain the version check.  Fix this by generating files
for input to moc at cmake time.
2014-01-28 21:04:10 +01:00
Gereon Kremer 819015ef3a ExternalProject: Add option GIT_SUBMODULES
This option allows to filter the submodules that are checked out.
Add a simple testcase for GIT_SUBMODULES option passing an empty list.
2014-01-28 12:51:27 -05:00
Brad King 5781842bc2 Merge topic 'ctest-update-p4-unknown-revision'
243cfc2f ctest_update: Handle P4 unknown revisions more robustly
2014-01-27 13:03:37 -05:00
Brad King 20263b719f Merge topic 'robust-ep-download-verify'
a432b93b file DOWNLOAD: Display the curl result status when a hash mismatch occurs.
1cb9ef81 file DOWNLOAD: Test non-zero return status.
f73f0fb3 file DOWNLOAD: Add test for bad hash.
b5e2265f ExternalProject: Reattempt download when verification fails.
2014-01-27 13:03:33 -05:00
Pedro Navarro 243cfc2f6f ctest_update: Handle P4 unknown revisions more robustly
Mark unknown revisions as such and fail instead of reporting revision 0.
Otherwise CTest reports massive file updates between revisions when the
server timeouts while trying to fetch the current revision number.
2014-01-22 08:33:33 -05:00
Brad King 82d4317503 Allow projects to specify extra inputs to CMake
Define a new 'CMAKE_CONFIGURE_DEPENDS' directory property that projects
can use to specify input files to the CMake configuration process.
Extend the RunCMake.Configure test to verify that the build system
re-runs CMake when this input changes.
2014-01-21 14:14:49 -05:00
Brad King 1ef444d678 Add test case to verify CMake does not re-run on first build
Extend the RunCMake.Configure with a case to verify that the CMake
configuration process does not immediately re-run the first time that
the generated build system is invoked.
2014-01-21 13:57:15 -05:00
Brad King 94389f6388 cmake: Add '-E sleep' command
Add a cmake command-line interface to provide a cross-platform 'sleep'.
2014-01-21 13:50:49 -05:00
Brad King e0228e2b04 cmake: Improve '-E create_symlink' edge case handling (#14713)
The logic added by commit ffc0b5e4 (Overwrite the symlink if it already
exists, 2007-02-15) does not recognize and remove existing broken links
before replacing them.  Improve the logic to remove any existing
destination file or link (but not directory).  On failure, report an
error message explaining why the existing path could not be removed or
the new one could not be created.

Add a RunCMake.CommandLine test to cover 'cmake -E' cases.  Start with
test cases covering 'cmake -E create_symlink' behavior on UNIX platforms.
2014-01-20 14:02:21 -05:00
Brad King d4ca30ae15 Tests/RunCMake: Add function to run a specified command-line
Add a 'run_cmake_command' function that can be used by tests to run a
given command-line and check the results rather than always running a
CMake configuration process.  This can be used in the future to test
'cmake -E' for example.
2014-01-20 13:46:51 -05:00
Brad King 392a6553f9 Tests/RunCMake: Move documentation to a README.rst 2014-01-20 13:46:24 -05:00
Matt McCormick 1cb9ef8173 file DOWNLOAD: Test non-zero return status. 2014-01-15 19:43:25 -05:00
Matt McCormick f73f0fb357 file DOWNLOAD: Add test for bad hash. 2014-01-15 19:43:23 -05:00
Rolf Eike Beer 3a0d164bb2 allow to mark a test as "Not Run" with a specific return code (#8466) 2014-01-14 23:57:40 +01:00
Brad King cb8c9dd01b Merge topic 'missing-dependency-error'
0bf6f13b AddDependencies: new policy requires dependencies to exist
2014-01-13 10:25:33 -05:00
Nils Gladitz 0bf6f13b1d AddDependencies: new policy requires dependencies to exist
Added new policy CMP0046 which requires dependencies added by
add_dependencies() to actually exist.
2014-01-12 12:58:04 +01:00
Stephen Kelly dea71aae6d Tests: Fix find-package mode test.
The all target was depending on the clean and pngtest targets, but
when running the tests with -jN, those can be executed out of order.

Make the main.o target depend on the clean target instead to fix
this.
2014-01-11 13:58:23 +01:00
Brad King 674bfadef0 Merge topic 'remove-duplicate-file'
fcd5531 Tests: Remove .orig file.
2014-01-10 09:19:51 -05:00
Stephen Kelly fcd5531004 Tests: Remove .orig file.
Introduced in commit be0458c5 (InstallRules: added new variable to
disable generation of install rules, 2013-12-25).
2014-01-10 10:29:36 +01:00
Stephen Kelly e7a111f094 InterfaceLibrary: Add test requiring MAP_IMPORTED_CONFIG whitelisting
The target properties with this prefix are whitelisted for
INTERFACE_LIBRARY targets.
2014-01-09 20:11:42 +01:00
Brad King 15562c11ef Merge topic 'policies'
73e9340 get_target_property: Error on non-existent target.
ab9f58f FindQt4: Ensure target exists before calling get_target_property.
37ebeb9 FindQt4: Fix use of get_target_property to use actual target name.
6aabb6a Genex: Use case-sensitive comparison for COMPILER_ID.
5bb53f6 cmTarget: Deprecate COMPILE_DEFINITIONS_ properties with a policy.
2014-01-09 09:37:20 -05:00
Brad King 69c366a281 Merge topic 'optional-install'
be0458c InstallRules: added new variable to disable generation of install rules
2014-01-09 09:37:17 -05:00
Stephen Kelly 73e93400e2 get_target_property: Error on non-existent target.
Introduce policy CMP0045 to control this behavior.
2014-01-08 16:41:34 +01:00
Stephen Kelly 6aabb6a62b Genex: Use case-sensitive comparison for COMPILER_ID. 2014-01-08 16:41:34 +01:00
Stephen Kelly 5bb53f6b73 cmTarget: Deprecate COMPILE_DEFINITIONS_ properties with a policy. 2014-01-08 16:41:34 +01:00
Nils Gladitz be0458c562 InstallRules: added new variable to disable generation of install rules
The boolean variable CMAKE_SKIP_INSTALL_RULES
allows disabling generation of install rules for projects which don't
want them.
2014-01-08 16:28:14 +01:00
Stephen Kelly 5d1fc198b7 Help: Ensure that target-policies are added to the documentation.
The two most-recently-added policies were not tested for.
2014-01-07 16:05:15 +01:00
Stephen Kelly 3917d86b26 Genex: Add a nullary form for CONFIG
This is consistent with other similar expressions such as PLATFORM_ID,
and makes the CONFIGURATION expression obsolete.

Fix an off-by-one error in
GeneratorExpressionContent::EvaluateParameters exposed by a unit test.

Remove the test for 'bad' nullary use of $<CONFIG>.

Add a unit test to verify that $<CONFIG> and $<CONFIGURATION> have
the same value.
2014-01-07 09:38:01 -05:00
Stephen Kelly ee21f1c605 CompatibleInterface: Test debugging of not-set property. 2014-01-07 09:38:01 -05:00
Stephen Kelly 28c865bb22 Tests: simplify Qt4 target usage
This content was copied from another test where both the Core and Gui
targets are used.
2014-01-07 09:38:00 -05:00
Stephen Kelly b7deca4a54 Test: Remove obsolete commented code.
This should not have survived in commit a247911a (Tests: Don't read
the LOCATION property from build targets., 2013-11-18).
2014-01-07 09:38:00 -05:00
Stephen Kelly 9c9f69fb9c Genex: Make EQUAL support upper case binary literals
As C++11, python, D and java do.

 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf

Add test for uppercase hex literals.
2014-01-06 18:46:45 +01:00
Stephen Kelly 84fac67f90 Don't allow include() of export(EXPORT) file at configure time.
As a new feature it does not need to participate in CMP0024.

Store cmExportBuildFileGenerator instances which correspond to the
export(EXPORT) signature in a second map which does not own the
pointers.  This avoids the need to add cmExportBuildFileGenerator
and dependencies to the bootstrap system.
2014-01-06 17:25:11 +01:00
Stephen Kelly faedd2bea9 cmTarget: Fix system include annotation propagation.
Direct users of IMPORTED targets treat INTERFACE_INCLUDE_DIRECTORIES
as SYSTEM, after commit a63fcbcb (Always consider includes from IMPORTED
targets to be SYSTEM., 2013-08-29).  It was intended that transitive
use of an IMPORTED target would have the same behavior, but that
did not work.  The implementation processed only direct dependencies
in cmTarget::FinalizeSystemIncludeDirectories.

Implement transitive evaluation of dependencies by traversing the
link interface of each target in the link implementation.
2014-01-06 17:25:10 +01:00
Stephen Kelly 9eb06d0dde add_library: Disallow invalid signatures for INTERFACE_LIBRARY.
Document the valid signatures. Add a test for the IMPORTED GLOBAL
signature.
2014-01-06 17:25:10 +01:00
Stephen Kelly 7461d67cf3 cmTarget: Enable convenient include dir handling for INTERFACE_LIBRARY.
Make the CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE variable affect
INTERFACE_LIBRARY targets.
2014-01-06 17:25:10 +01:00
Stephen Kelly 2af966d9ab Genex: Add EQUAL expression.
Support decimal, hex, octal and binary literals.
2014-01-06 17:25:09 +01:00
Stephen Kelly 2d6638008c cmTarget: Use strtol for numeric parsing.
On Windows apparently sscanf can not handle hex numbers.

Test that numeric comparison works with hex numbers.
2014-01-06 17:25:09 +01:00
Brad King b225dbbd02 Merge topic 'minor-cleanups'
a55c70d cmTarget: Remove support for <CONFIG>_LOCATION property.
c9f9b3c cmTarget: Test impliedByUse number-compatible properties.
fbe1fa7 cmTarget: Don't repeat property origin debug information.
01c545c cmTarget: Fix debug report for interface-set compatibility types.
c67e1a6 cmTarget: Fix reporting interface-set properties which are FALSE.
07b0f54 Qt Tests: Remove commented and unneeded line.
79db8ef cmTarget: Fix the property compatibility error message
43340a9 Help: Reformat Qt autogenerator documentation.
d98ea6c Help: Mark some code blocks as containing cmake code.
ea78935 GenerateExportHeader: Reformat docs.
272a20f cmTarget: Don't update IMPORTED target compilation properties
03d842a Run the add_compile_options command unit test.
cd3d0b6 get_property: Fix testing ALIASED_TARGET target property (#14670)
6a62228 install: Ensure that install(TARGETS) works with no DESTINATION
af3d3b8 export: Only generate and install configuration files if needed.
0de81bb Help: Workaround pygments reporting an error for genexes.
...
2014-01-06 11:15:34 -05:00
Brad King b8786da79f Merge topic 'fix-text-typos'
9e41eb6 Fix wording of "the the" typos throughout text
2014-01-06 10:36:03 -05:00
Stephen Kelly c9f9b3cd94 cmTarget: Test impliedByUse number-compatible properties.
Test that it is an error to read a number-compatible property to
determine the link implementation.  An alternative would be to
consider the value to be "0", however, that is too arbitrary
given the use-cases of this feature.  Values from this feature may
be used in setting a define, where "0" may have special or invalid
meaning and should be explicit.
2014-01-04 11:28:58 +01:00
Stephen Kelly fbe1fa722f cmTarget: Don't repeat property origin debug information. 2014-01-04 11:28:58 +01:00
Stephen Kelly 01c545c596 cmTarget: Fix debug report for interface-set compatibility types.
If the dependent target sets the property to boolean false, ensure
that that appears in the debug report.  Previously, the report
output contained whether the property was consistent among dependencies,
displaying 'TRUE', instead of the content of the property, which may
be 'FALSE'.

Return a std::pair from the consistentProperty method.  This makes
it possible to make the return value for string types easier to
reason about.  The return value of consistentProperty was previously
set to an empty static string to emulate a 'true' value for the caller
in commit 816b4a8a (cmTarget: Make consistentProperty
return consistent content., 2013-10-22).  The pair makes the
consistency result properly typed.
2014-01-04 11:28:58 +01:00
Stephen Kelly c67e1a6aac cmTarget: Fix reporting interface-set properties which are FALSE. 2014-01-04 11:28:58 +01:00
Stephen Kelly 07b0f54647 Qt Tests: Remove commented and unneeded line. 2014-01-04 11:28:57 +01:00
Stephen Kelly 79db8ef78d cmTarget: Fix the property compatibility error message
Don't refer to 'both', but a 'mixture'. List all compatible interface
property types possible.

Add another test for a mixture of three compatibilities.
2014-01-04 11:28:57 +01:00
Stephen Kelly 272a20f8e5 cmTarget: Don't update IMPORTED target compilation properties
The include_directories() and add_compile_options() commands
should not append to the corresponding target property for IMPORTED
targets.  This is already the case for add_definitions().
2014-01-04 11:28:57 +01:00
Stephen Kelly 03d842a982 Run the add_compile_options command unit test.
This has not been executed since it was added in
commit a984f325 (Introduce add_compile_options command., 2013-06-04).
2014-01-04 11:28:57 +01:00
Stephen Kelly cd3d0b613e get_property: Fix testing ALIASED_TARGET target property (#14670)
In the case where the argument is not an ALIAS, the variable should
be set to a -NOTFOUND content.
2014-01-04 11:28:57 +01:00
Stephen Kelly 6a622285a7 install: Ensure that install(TARGETS) works with no DESTINATION
INTERFACE_LIBRARY targets have no corresponding files, and so
require no DESTINATION to install anything to.
2014-01-04 11:28:57 +01:00
Stephen Kelly 6db7e6d24c add_dependencies: Disallow use with INTERFACE_LIBRARY. 2014-01-04 11:28:56 +01:00
Ruslan Baratov 9e41eb68ec Fix wording of "the the" typos throughout text 2014-01-03 11:35:32 -05:00
Brad King 6cff2afc8b Merge topic 'export-EXPORT-subcommand'
98b9f52 Help: Document export(EXPORT) in the cmake-packages manual.
a1d2bda Don't copy find_dependency in configure_package_config_file.
f4f6529 Help: cmake-packages: Add missing slash.
cbe7e8f export: Implement EXPORT subcommand (#9822)
2014-01-02 14:44:08 -05:00
Brad King 81311c670e Merge topic 'wix-rtf-encoding'
950d76e CPackWiX: allow and convert UTF-8 sequences in RTF writer
2014-01-02 14:24:25 -05:00
Brad King f6c85e7b36 Merge topic 'fix-ctest-regressions'
7f0d4af CTest: fix regressions introduced by the ctest-fix-run-serial topic
2014-01-02 14:23:22 -05:00
Brad King 0d63bdd2d9 Merge topic 'rpath-default'
d25ad48 OS X: Add CMP0042 to enable MACOSX_RPATH by default
2014-01-02 14:23:09 -05:00
Clinton Stimpson d25ad482e9 OS X: Add CMP0042 to enable MACOSX_RPATH by default
Also adding documentation for CMAKE_MACOSX_RPATH, and improving
documentation for MACOSX_RPATH.
2014-01-02 13:41:49 -05:00
Nils Gladitz 950d76ed48 CPackWiX: allow and convert UTF-8 sequences in RTF writer 2013-12-26 15:23:54 +01:00
Stephen Kelly cbe7e8fae4 export: Implement EXPORT subcommand (#9822)
Teach the export command to handle export sets defined by invocations
of install(TARGETS ... EXPORT foo).  This makes maintenance of targets
exported to both the build tree and install tree trivial.
2013-12-24 13:02:49 +01:00
Nils Gladitz 7f0d4aff24 CTest: fix regressions introduced by the ctest-fix-run-serial topic
The first regression resulted in endless looping due to unrun test
dependencies. The second regression prioritized all tests with dependencies
in serial test runs.
2013-12-23 15:31:15 +01:00
Stephen Kelly cad5c79e6c cmTarget: Fix typo
'a ALIAS' -> 'an ALIAS'
2013-12-19 16:17:59 +01:00
Stephen Kelly f4d9466130 Genex: Accept arbitrary content in *_CASE and MAKE_C_IDENTIFIER. 2013-12-19 16:17:59 +01:00
Brad King eb20fab736 Merge topic 'wix-fragment-injection'
8632233 CPackWiX: allow customization of generated WiX sources
2013-12-19 10:13:47 -05:00
Brad King 3b00ff84d2 Merge topic 'GenerateExportHeader-tests'
2410b91 Merge some GenerateExportHeader subtests.
4017db1 Speed up the GenerateExportHeader unit test (#14453).
2013-12-19 10:13:38 -05:00
Brad King 5a56da919a Merge topic 'build-symlink-invalid-sup-file'
57c008c Tests: allow valgrind test to pass with symlinked build dir
2013-12-19 10:13:34 -05:00
Brad King d42e0d552c Merge topic 'remove-INTERFACE-build-targets'
97fae68 Remove INTERFACE build targets.
2013-12-19 10:12:57 -05:00
Brad King a1e58db675 Merge topic 'fix-INTERFACE-mapped-config'
3b8e56a Don't search for IMPORTED_LOCATION of INTERFACE_LIBRARY (14636)
2013-12-19 10:12:42 -05:00
Brad King e15b14d431 Merge topic 'vtk-contract'
ad330ed Tests/Contracts: Submit notes with VTK build
2013-12-19 10:12:29 -05:00
Zack Galbreath ad330edaa2 Tests/Contracts: Submit notes with VTK build
Submit the configured Dashboard script as as Notes file to CDash.
Also add comments about the origin & purpose of this test.
2013-12-19 10:01:14 -05:00
Nils Gladitz 8632233a2f CPackWiX: allow customization of generated WiX sources
Added a new variable CPACK_WIX_PATCH_FILE that users can point at an
XML patch file. Fragments defined within the patch file will be inserted
at supported insertion points (currently Component, File and Directory).
2013-12-17 14:14:42 +01:00
Stephen Kelly 2410b912fe Merge some GenerateExportHeader subtests. 2013-12-15 11:22:19 +01:00
Stephen Kelly 4017db13aa Speed up the GenerateExportHeader unit test (#14453).
Instead of running many small tests with many cmake projects, simply
compare the generated export header against a reference.

Remove the helper macros and the try_compiles which are duplicates
of the library build tests.
2013-12-15 11:22:19 +01:00
Nils Gladitz 57c008c37a Tests: allow valgrind test to pass with symlinked build dir 2013-12-15 00:31:14 +01:00
Stephen Kelly 97fae68b81 Remove INTERFACE build targets.
Commit b04f3b9a (Create make rules for INTERFACE_LIBRARY
targets., 2013-08-21) extended the makefile generator to create
build targets for INTERFACE_LIBRARY targets. No other generators
were extended with this feature.

This conflicts with the feature of whitelisting of target properties
read from INTERFACE_LIBRARY targets. The INTERFACE_* properties
of the INTERFACE_LIBRARY may legitimately contain TARGET_PROPERTY
generator expressions for reading properties from the 'head target'.
The 'head target' would be the INTERFACE_LIBRARY itself when creating
the build rules for it, which means that non-whitelisted properties
would be read.
2013-12-10 17:58:36 +01:00
Stephen Kelly 3b8e56a50f Don't search for IMPORTED_LOCATION of INTERFACE_LIBRARY (14636)
The INTERFACE_LIBRARY type does not have any LOCATION at all, so
return early from GetMappedConfig. GetMappedConfig is called from
two locations, one of which already pre-checks the INTERFACE_LIBRARY
case. Remove that pre-check and handle that case inside the method
instead.
2013-12-09 20:52:52 +01:00
Brad King 330af68ed4 Merge topic 'vtk-contract'
ca9e117 Tests/Contracts: Fix failing VTK Contract test
2013-12-09 10:35:58 -05:00
Brad King 5026696fcc Merge topic 'INTERFACE_AUTOUIC_OPTIONS'
77f3772 cmTarget: Require a compatible INTERFACE_AUTOUIC_OPTIONS from dependencies.
2e60b5f cmTarget: Report origin of COMPATIBLE_INTERFACE properties.
2013-12-09 10:33:30 -05:00
Zack Galbreath ca9e11727b Tests/Contracts: Fix failing VTK Contract test
This test was failing because it was attempting to build VTK in the
wrong directory.
2013-12-09 10:27:55 -05:00
Stephen Kelly 77f3772784 cmTarget: Require a compatible INTERFACE_AUTOUIC_OPTIONS from dependencies.
Revert the origin-tracking infrastructure from commit 98093c45 (QtAutoUic:
Add INTERFACE_AUTOUIC_OPTIONS target property., 2013-11-20). Use the
compatibility-tracking for compatible strings instead.

If two different dependencies require different AUTOUIC_OPTIONS,
cmake will now appropriately issue an error.
2013-12-08 07:03:29 +01:00
Stephen Kelly 2e60b5fcf7 cmTarget: Report origin of COMPATIBLE_INTERFACE properties. 2013-12-08 07:03:29 +01:00
Brad King 8ee6f3199a Merge topic 'cleanup-build-commands'
ef7c11e Tests: Fix standalone build of tests with nested projects
2013-12-06 15:52:41 -05:00
Brad King ef7c11ee31 Tests: Fix standalone build of tests with nested projects
Since commit fd6076d0 (Tests: Pass CMAKE_MAKE_PROGRAM instead of
--build-makeprogram, 2013-11-15) the ExportImport, Fortran, and
MacRuntimePath tests use the value of CMAKE_TEST_MAKEPROGRAM as the
CMAKE_MAKE_PROGRAM for their nested projects configurations.
Teach these tests to initialize CMAKE_TEST_MAKEPROGRAM when it is
not provided, such as when building the tests manually.
2013-12-05 12:52:11 -05:00
Brad King e1af1d3592 Merge topic 'vtk-contract'
1b173f2 Tests/Contracts: Update test for VTK release branch
2013-12-05 09:26:51 -05:00
Zack Galbreath 1b173f25b4 Tests/Contracts: Update test for VTK release branch
The plan is to reinstate the VTK contracts test so that CMake
& VTK devs will both be made aware when a change in CMake causes
build problems for VTK.
2013-12-05 09:26:00 -05:00
Brad King a5c3f059ff Merge topic 'fix-export-segfault'
1cd1430 export(): Check targets exist at configure-time (#14608)
2013-12-04 08:33:36 -05:00
Stephen Kelly 1cd1430b1f export(): Check targets exist at configure-time (#14608)
Commit 66b290e7 (export(): Process the export() command at generate
time., 2012-10-06 ) refactored export() so that it could evaluate
strings at generate-time. This was intended for evaluating target
properties, but that commit also removed a check for target
existence at configure-time. Restore that check and add a test for
this case.
2013-12-04 08:30:26 -05:00
Brad King ea8d1a9cca Merge topic 'INTERFACE_AUTOUIC_OPTIONS'
98093c4 QtAutoUic: Add INTERFACE_AUTOUIC_OPTIONS target property.
02542b4 QtAutoUic: Handle new -include command line parameter.
1242f4e Genex: Add {UPPER,LOWER}_CASE and MAKE_C_IDENTIFIER.
754b321 QtAutogen: Use config without prefix in map key.
2013-12-02 12:07:31 -05:00
Brad King ed1de30da0 Merge topic 'wix-components'
7b390f7 CPackWiX: add CPack component support
2013-12-02 12:07:24 -05:00
Brad King 9d51c764f7 Merge topic 'export-includes'
5838aba Export: Report error on relative include with genex.
7a3e45b Export: Prefix relative items with genexes in INSTALL_INTERFACE.
f088a32 Export: Process INSTALL_INTERFACE in INCLUDES DESTINATION.
9eedc85 Export: Process relative includes after genex evaluation.
80790f3 Export: Test existing behavior of exporting includes with genexes.
38afc82 target_include_directories: Allow relative path with genex
2013-12-02 12:06:43 -05:00
Stephen Kelly 98093c45db QtAutoUic: Add INTERFACE_AUTOUIC_OPTIONS target property.
Transitively consume the property from linked dependents.

Implement configuration-specific support by following the pattern
set out for compile definitions and includes in cmQtAutoGenerators.

Implement support for origin-tracking with CMAKE_DEBUG_TARGET_PROPERTIES.

This is motivated by the needs of KDE, which provides a separate
translation system based on gettext instead of the Qt linguist
translation system. The Qt uic tool provides command line options
for configuring the method used to translate text, and to add an
include directive to the generated file to provide the method.

 http://thread.gmane.org/gmane.comp.kde.devel.frameworks/7930/focus=7992

Implement the interface to provide the uic options as a usage-requirement
on the KI18n target, as designed for KDE.
2013-11-27 19:06:12 +01:00
Stephen Kelly 1242f4e569 Genex: Add {UPPER,LOWER}_CASE and MAKE_C_IDENTIFIER. 2013-11-27 19:06:12 +01:00
Nils Gladitz 7b390f75e8 CPackWiX: add CPack component support
Creates a hierarchy of WiX features from CPack components and component groups.
Switch to the FeatureTree UI in case components have been defined.
Handles the component REQUIRE and HIDDEN options
and the component group EXPANDED option.
2013-11-26 22:15:57 +01:00
Brad King 3eca31f81a Merge topic 'autogen-depends'
1320e07 cmQtAutogen: Allow specifying depends for autogen targets.
2013-11-26 09:38:40 -05:00
Stephen Kelly 5838aba1aa Export: Report error on relative include with genex.
Diagnostics which check the sanity of exported include paths
previously skipped over any path containing a generator expression.

Introduce a policy to issue an error message in such cases.

The export files created in the OLD behavior are not usable, because
they contain relative paths or paths to the source or build location
which are not suitable for use on installation. CMake will report an
error on import.
2013-11-26 13:01:55 +01:00
Stephen Kelly 7a3e45b9d4 Export: Prefix relative items with genexes in INSTALL_INTERFACE.
Code such as

 target_include_directories(foo INTERFACE
   $<INSTALL_INTERFACE:include$<FOO>>
 )

should be treated as a relative directory, despite the genex, after
the INSTALL_INTERFACE is stripped away.

Previously, this would generate a relative directory on export, which
would be an error on import, so no policy is needed.
2013-11-26 13:01:53 +01:00
Stephen Kelly f088a32450 Export: Process INSTALL_INTERFACE in INCLUDES DESTINATION.
Code such as

 install(TARGETS ...
   INCLUDES DESTINATION $<INSTALL_INTERFACE:include>
 )

should behave as if the INSTALL_INTERFACE wrapper were not present.
2013-11-26 13:01:50 +01:00
Stephen Kelly 9eedc850eb Export: Process relative includes after genex evaluation.
In code such as

 install(TARGETS ...
   INCLUDES DESTINATION $<FOO>include
 )

the generator expressions are evaluated at generate-time. Delay
determining whether each entry is a relative path until after
the generator expressions are evaluated. Such relative paths
are based relative to the CMAKE_INSTALL_PREFIX.
2013-11-26 13:01:29 +01:00
Stephen Kelly 80790f3311 Export: Test existing behavior of exporting includes with genexes.
Test that no warning or error diagnostic is issued for 'good code'.
2013-11-26 13:00:43 +01:00
Stephen Kelly 38afc82e76 target_include_directories: Allow relative path with genex
Treat paths which are relative and which contain a generator
expression which is not at the beginning as relative to the
source directory.

This matches the behavior of paths which are relative but contain
no generator expression at all.

Previously this would generate a relative path with the IMPORTED
target on export(), which would be a reported as a non-existent
path on import. If used directly in the buildsystem, it would be
reported as a relative path, which is also an error. There is no
need for a policy in this case.
2013-11-26 10:30:18 +01:00
Stephen Kelly 1320e0768e cmQtAutogen: Allow specifying depends for autogen targets.
Test this by generating files with a custom target, which moc
requires to be present when it is run.
2013-11-25 22:41:21 +01:00
Stephen Kelly 5ee9e6bc11 cmTarget: Add whitelist of properties on INTERFACE_LIBRARY. 2013-11-25 16:23:11 +01:00
Brad King 3013a11826 Merge topic 'cross-compiling-toolchain-variables'
7521da2 Introduce CMAKE_STAGING_PREFIX variable.
2013-11-22 08:40:50 -05:00
Nils Gladitz a02f3d2de0 Add policy CMP0040 to disallow custom commands on missing targets 2013-11-21 09:24:08 -05:00
Stephen Kelly 7521da2852 Introduce CMAKE_STAGING_PREFIX variable.
This variable can be useful in cross-compiling contexts where the
sysroot is read-only or where the sysroot should otherwise remain
pristine.

If the new CMAKE_STAGING_PREFIX variable is set, it is used instead
of CMAKE_INSTALL_PREFIX when generating the installation rules in
cmake_install.cmake.

This way, the CMAKE_INSTALL_PREFIX variable
always refers to the installation prefix on the target device, regardless
of whether host==target.

If any -rpath paths passed to the linker contain the CMAKE_STAGING_PREFIX,
the matching path fragments are replaced with the CMAKE_INSTALL_PREFIX.
Matching paths in the -rpath-link are not transformed.

The cross-prefix usr-move workaround is assumed not to require extension
regarding CMAKE_STAGING_PREFIX. The staging area is a single prefix, so
there is no scope for cross-prefix symlinks. The CMAKE_INSTALL_PREFIX
is still used to determine the workaround path, and that variable
remains the relevant one even if CMAKE_STAGING_PREFIX is used. If the
generated export files are deployed to the target, the workaround
will still be in place, and still be employed if required.
2013-11-21 11:48:03 +01:00
Stephen Kelly a247911a88 Tests: Don't read the LOCATION property from build targets. 2013-11-19 18:07:27 +01:00
Brad King 1da77bf1ee Merge topic 'cleanup-build-commands'
4cce44b Help: Document the CMAKE_MAKE_PROGRAM variable in more detail
558c74d VS: Switch to internal CMAKE_MAKE_PROGRAM lookup by generators
5229f2d Tests: Do not use an explicit make program for VS generators
72dd738 Tests: Fix MFC test heuristic for empty CMAKE_TEST_MAKEPROGRAM
fd6076d Tests: Pass CMAKE_MAKE_PROGRAM instead of --build-makeprogram
68031ab Tests: Configure SubProject-Stage2 test more robustly
003d10c Tests: Simplify VSExcludeFromDefaultBuild configuration
e47d934 Tests: Simplify VSProjectInSubdir configuration
e965cb1 Tests: Simplify CTest.BuildCommand.ProjectInSubdir configuration
72bf255 Tests: Pass --build-options to every test
4d1d772 ctest: Teach --build-options to allow zero options
96966b5 ctest: Make the --build-makeprogram optional for --build-and-test
91a0211 Simplify some calls to cmGlobalGenerator::Build
123a060 Teach GenerateBuildCommand to find its own make program
5f5c92b VS: Add internal APIs to find MSBuild, devenv/VCExpress, and msdev
4ac75fd Prefer CMAKE_MAKE_PROGRAM over CMAKE_BUILD_TOOL (#14548)
...
2013-11-19 10:55:39 -05:00
Nils Gladitz 3900fcf4a8 CMP0037: Extend policy to reserved names and custom targets
Teach add_custom_target to check the policy too.  Extend the policy to
disallow reserved target names that we use for builtin targets like
"all".

Extend the RunCMake.CMP0037 test to cover these cases.
2013-11-19 09:44:22 -05:00
Brad King 5229f2df63 Tests: Do not use an explicit make program for VS generators
Do not pass the CMAKE_MAKE_PROGRAM cache entry to tests when using the
VS generators.  Allow them to pick the correct build tool automatically.
2013-11-18 11:30:50 -05:00
Brad King 72dd738bd4 Tests: Fix MFC test heuristic for empty CMAKE_TEST_MAKEPROGRAM
Also disable the MFC test if CMAKE_MAKE_PROGRAM is vcexpress.
2013-11-18 11:30:50 -05:00
Brad King fd6076d075 Tests: Pass CMAKE_MAKE_PROGRAM instead of --build-makeprogram
Pass the CMAKE_TEST_MAKEPROGRAM, if any, to each test at CMake time in
the CMAKE_MAKE_PROGRAM cache entry.  Pass the CMAKE_TEST_MAKEPROGRAM
into the ExportImport, Fortran, and MacRuntimePath tests so that they
may do the same for the nested project configurations.

Now "ctest --build-and-test" can get the make program from the test
build tree cache, so drop the explicit --build-makeprogram.
2013-11-18 11:30:50 -05:00
Brad King 68031abf15 Tests: Configure SubProject-Stage2 test more robustly
Fix the condition that adds the test to check CMAKE_TEST_GENERATOR
rather than the tools used to build CMake.  Drop the test on Ninja
because the generator does not support subproject generation anyway.
Stop using the general build_generator_args and pass the
--build-generator options explicitly.  Also pass --build-makeprogram
explicitly when CMAKE_TEST_MAKEPROGRAM is available because there is no
CMakeCache.txt in the test project subdirectory from which to pick up
the make program.
2013-11-18 11:30:50 -05:00
Brad King 003d10c248 Tests: Simplify VSExcludeFromDefaultBuild configuration
Create a CTEST_TEST_DEVENV variable that is set to the
CMAKE_MAKE_PROGRAM used for Visual Studio 7, 8, and 9.  It will always
be either "devenv" or "VCExpress", and not "MSBuild".  Add the
VSExcludeFromDefaultBuild test only when this variable is set, and use
its value as the --build-makeprogram value.

More work will be needed later to restore the test on VS 10 and above
when devenv is available, but this is the simplest approach for now.
2013-11-18 11:30:49 -05:00
Brad King e47d934a5a Tests: Simplify VSProjectInSubdir configuration
The test is only enabled on VS 10 and above, where the generators now
select for "ctest --build-and-test" the MSBuild tool by default.
Simplify the test configuration by dropping the --build-makeprogram
option and all the logic needed to compute its value.  The test will
automatically use MSBuild.
2013-11-18 11:30:49 -05:00
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