Commit Graph

4288 Commits

Author SHA1 Message Date
Brad King 33d4aff50d Merge topic 'autogen-same-name'
61a607e8 Help: Document AUTORCC behavior for same .qrc name case
e4f508e4 Tests/QtAutogen: Test same moc/qrc source names in different directories
4e9b97d7 QtAutogen: Allow multiple qrc files with the same name
41c9e14a QtAutogen: Allow multiple moc files with the same name
3c3b37b0 QtAutogen: Use std:: instead of ::std::
0a5dd3c7 cmFilePathUuid: Add class to generate deterministic unique file names
2016-08-15 08:59:46 -04:00
Sebastian Holtermann e4f508e423 Tests/QtAutogen: Test same moc/qrc source names in different directories 2016-08-10 13:21:34 -04:00
Brad King 50ada755e3 Merge topic '15687-xcode-support-system-include'
93ac2a78 Xcode: Obey SYSTEM keyword for includes (#15687)
2016-08-10 11:16:01 -04:00
Brad King 655d242b90 Merge topic 'fix-test-macOS-case-sensitive'
677e73cb Tests: Fix RunCMake.Framework on case sensitive file systems.
2016-08-10 11:15:58 -04:00
Brad King e01c576338 Merge topic 'ninja-directory-targets'
02789894 Ninja: Add `$subdir/{test,install,package}` targets
a88c99f1 Ninja: Simplify computation of GLOBAL_TARGET outputs
2016-08-10 11:15:55 -04:00
Brad King 4887640b7a Merge topic 'add-extra-boolean-comparisons'
02d177c9 Add additional <= and >= comparison operators
2016-08-10 11:15:47 -04:00
Chaoren Lin 677e73cb8a Tests: Fix RunCMake.Framework on case sensitive file systems.
The file is lowercase: Tests/RunCMake/Framework/osx.cmake
2016-08-09 16:00:27 -04:00
Brad King 0278989405 Ninja: Add `$subdir/{test,install,package}` targets
With the Makefile generator one can use `cd $subdir; make install` to build and
install targets associated with a given subdirectory.  This is not possible to
do with the Ninja generator since there is only one `build.ninja` file at the
top of the build tree.  However, we can approximate it by allowing one to run
`ninja $subdir/install` at the top of the tree to build the targets in the
corresponding subdirectory and install them.

This also makes sense for `test`, `package`, and other GLOBAL_TARGET targets.
It was already done for `all` by commit v3.6.0-rc1~240^2~2 (Ninja: Add
`$subdir/all` targets, 2016-03-11).
2016-08-09 15:15:24 -04:00
Gregor Jasny 93ac2a78d5 Xcode: Obey SYSTEM keyword for includes (#15687)
CMake used to put all header search paths into HEADER_SEARCH_PATHS
attribute. Unfortunately this attribute does not support to declare
a search path as a system include.

As a hack one could add a -isystem /path to the cflags but then include
ordering is not deterministic. A better approach was chosen with this
patch by not filling HEADER_SEARCH_PATHS at all and to populate
the C, C++, and Fortran flags directly. The include paths used by
Xcode should be now identical to the ones used by Unix Makefiles and
Ninja generator.
2016-08-09 20:30:07 +02:00
Chuck Atkins 02d177c9cc Add additional <= and >= comparison operators
This adds the LESS_EQUAL, GREATER_EQUAL, and associated STR and VERSION
equivalents to use the combined <= and >= functionality.
2016-08-09 09:30:34 -04:00
Daniel Pfeifer 3a7be4f394 prefer list(APPEND) over string(APPEND) where appropriate 2016-08-08 21:28:52 +02:00
Brad King 88e1c54a7c Merge topic 'use-string-append'
7a649111 Use string(APPEND) in Tests
5d0d980d Use string(APPEND) in Modules
2016-08-01 14:59:50 -04:00
Brad King 2711c35a8d Merge topic 'app-framework-bundle-extension'
f951d0ad Add tests for BUNDLE_EXTENSION
c63380b1 Update documentation about bundle extensions
134d5c1f Honor BUNDLE_EXTENSION also for Frameworks (#14742)
2b909c08 Honor BUNDLE_EXTENSION also for App Bundles (#16148)
2016-08-01 14:59:44 -04:00
Brad King 8427b8e11c Merge topic 'aliased-target-properties'
ea647533 Do not report ALIASED_TARGET as always set (#15783)
2016-08-01 14:59:41 -04:00
Daniel Pfeifer 7a649111cd Use string(APPEND) in Tests
Automate with:

find Tests -type f -print0 | xargs -0 perl -i -0pe \
's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
2016-07-28 00:43:04 +02:00
Brad King d504999d86 Merge topic 'tests-hide-ldd-check-errors'
d6a6024e Tests: Hide errors from `ldd --help` output check
2016-07-22 09:17:53 -04:00
Brad King 1fc340f0d4 Merge topic 'windows-export-all-fix-objlib'
13a6ff31 VS: Fix WINDOWS_EXPORT_ALL_SYMBOLS for object libraries
2016-07-22 09:17:48 -04:00
Brad King 19ccd35473 Merge topic 'revert-autogen-subdirs'
5e55d87b Autogen: Revert changes to generate moc/rcc in subdirectories
2016-07-22 09:17:28 -04:00
Gregor Jasny f951d0adb4 Add tests for BUNDLE_EXTENSION 2016-07-21 23:18:56 -07:00
Brad King d6a6024e9e Tests: Hide errors from `ldd --help` output check
If `--help` is not a valid option then it may print content to stderr,
so we need to capture that.
2016-07-21 15:39:05 -04:00
Brad King 13a6ff31be VS: Fix WINDOWS_EXPORT_ALL_SYMBOLS for object libraries
Teach Visual Studio generators to include object files from object
libraries in the list of objects whose symbols are to be exported.
The Makefile and Ninja generators already did this.  Update the
test to cover this case.

Reported-by: Bertrand Bellenot <Bertrand.Bellenot@cern.ch>
2016-07-21 11:05:22 -04:00
Brad King 5e55d87bdc Autogen: Revert changes to generate moc/rcc in subdirectories
Revert these commits:

* v3.6.0-rc1~134^2
  Tests: QtAutogen: Same source name in different directories test, 2016-04-13
* v3.6.0-rc1~134^2~1
  Autogen: Generate qrc_NAME.cpp files in subdirectories, 2016-04-19
* v3.6.0-rc1~134^2~2
  Autogen: Generate not included moc files in subdirectories, 2016-04-19

They regress existing builds that depend on the paths/symbols generated
previously.  Another approach will be needed to solve the name collision
problem they were intended to solve.  Leave the error diagnostics for
the colliding cases that were added in the same topic as the above
commits because they provide a useful early failure in relevant cases.

Fixes #16209.
2016-07-21 09:27:19 -04:00
Brad King 1296a0eada Ninja: Fix inter-target order-only dependencies of custom commands
Custom command dependencies are followed for each target's source files
and add their transitive closure to the corresponding target.  This
means that when a custom command in one target has a dependency on a
custom command in another target, both will appear in the dependent
target's sources.  For the Makefile, VS IDE, and Xcode generators this
is not a problem because each target gets its own independent build
system that is evaluated in target dependency order.  By the time the
dependent target is built the custom command that belongs to one of its
dependencies will already have been brought up to date.

For the Ninja generator we need to generate a monolithic build system
covering all targets so we can have only one copy of a custom command.
This means that we need to reconcile the target-level ordering
dependencies from its appearance in multiple targets to include only the
least-dependent common set.  This is done by computing the set
intersection of the dependencies of all the targets containing a custom
command.  However, we previously included only the direct dependencies
so any target-level dependency not directly added to all targets into
which a custom command propagates was discarded.

Fix this by computing the transitive closure of dependencies for each
target and then intersecting those sets.  That will get the common set
of dependencies.  Also add a test to cover a case in which the
incorrectly dropped target ordering dependencies would fail.
2016-07-20 13:12:24 -04:00
Gregor Jasny ea6475334a Do not report ALIASED_TARGET as always set (#15783)
The cmGetPropertyCommand::StoreResult expects NULL for unset
properties. Make ALIASED_TARGET align with that expectation.

Additional corrections to the unit tests are necessary because
get_property removes variables for unset properties (in contrast
to get_target_property which stores a -NOTFOUND value).
2016-07-16 11:09:18 -07:00
Brad King c8e59d2dfa Merge topic 'toolchain-flag-init'
8a98cf64 Honor CMAKE_*_LINKER_FLAGS[_<CONFIG>]_INIT set in toolchain files
37d15c39 MSVC: Set all CMAKE_*_LINKER_FLAGS_INIT directly
55c884ed Embarcadero: Set all CMAKE_*_LINKER_FLAGS_INIT directly
aec3c79a Strip CMAKE_*_LINKER_FLAGS[_<CONFIG>] initializer whitespace
2016-07-15 09:04:30 -04:00
Brad King 8a98cf6432 Honor CMAKE_*_LINKER_FLAGS[_<CONFIG>]_INIT set in toolchain files
Document these variables.

Change our convention for setting these variables from:

    set(CMAKE_EXE_LINKER_FLAGS_INIT "...")

to

    string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ...")

so that any value previously set by a toolchain file will be used.
2016-07-14 15:47:32 -04:00
Brad King f5c19a9dcc Merge topic 'no-implicit-link-clang-rt'
35322226 CMakeParseImplicitLinkInfo: Exclude libclang_rt libraries
2016-07-14 09:23:35 -04:00
Brad King 53df6d5995 Merge topic 'findicu'
0e9e6aa8 Tests: Run clang-format on FindICU test code
2016-07-13 10:01:47 -04:00
Brad King 0e9e6aa85d Tests: Run clang-format on FindICU test code 2016-07-13 10:01:02 -04:00
Brad King 291e41855c Merge topic 'findicu'
e3bff7b3 Help: Add notes for topic 'findicu'
4a63be15 FindICU: New module
2016-07-13 09:26:55 -04:00
Brad King 40f24f0ec2 Merge topic 'windows-export-all-from-exe'
9da725cb Windows: Honor WINDOWS_EXPORT_ALL_SYMBOLS for executables with exports
2005b960 Makefile: Factor out WINDOWS_EXPORT_ALL_SYMBOLS helper
2016-07-13 09:26:33 -04:00
Brad King 43875ca59c Merge topic 'cmake-spelling'
56608618 Fix typos.
2016-07-13 09:26:30 -04:00
Roger Leigh 4a63be15dd FindICU: New module 2016-07-13 09:15:16 -04:00
Brad King 353222262a CMakeParseImplicitLinkInfo: Exclude libclang_rt libraries
These libraries are used for Clang runtime analysis support with
flags like `-fsanitize=memory` and are not actually implicitly
linked libraries.

Fixes #16194.
2016-07-11 16:30:02 -04:00
Brad King 507aa256e5 Merge topic 'tiff-typo'
7959d518 FindTIFF: Correct variable names in unit test
2016-07-11 09:56:17 -04:00
Yury Zhuravlev 9da725cb00 Windows: Honor WINDOWS_EXPORT_ALL_SYMBOLS for executables with exports
For executables with ENABLE_EXPORTS set, export all symbols when
instructed to do so by WINDOWS_EXPORT_ALL_SYMBOLS.
2016-07-11 09:41:04 -04:00
Roger Leigh 7959d51847 FindTIFF: Correct variable names in unit test 2016-07-10 18:16:16 +00:00
Felix Geyer 566086187f Fix typos. 2016-07-10 11:05:56 +02:00
Brad King 4786ec515f Source: Remove long-unused .cvsignore file 2016-07-08 13:36:38 -04:00
Brad King a66004bee0 Honor CMAKE_<LANG>_FLAGS[_<CONFIG>]_INIT set in toolchain files
Document these variables.

Change our convention for setting these variables from:

    set(CMAKE_C_FLAGS_INIT "...")

to

    string(APPEND CMAKE_C_FLAGS_INIT " ...")

so that any value previously set by a toolchain file will be used.

Automate the conversion with:

    sed -i 's/set *(\(CMAKE_\(C\|CXX\|Fortran\|RC\|ASM\|${[^}]\+}\)_FLAGS\(_[^_]\+\)\?_INIT \+"\)/string(APPEND \1 /' \
      Modules/Compiler/*.cmake Modules/Platform/*.cmake

and follow up with some manual fixes (e.g. to cases that already
meant to append).  Also revert the automated changes to contexts
that are not protected from running multiple times.
2016-07-06 10:13:31 -04:00
Brad King d582c23a47 try_compile: Add policy CMP0066 to honor CMAKE_<LANG>_FLAGS_<CONFIG>
In the `try_compile` source file signature we propagate the caller's
value of `CMAKE_<LANG>_FLAGS` into the test project.  Extend this to
propagate `CMAKE_<LANG>_FLAGS_<CONFIG>` too instead of always using the
default value in the test project.  This will be useful, for example, to
allow the MSVC runtime library to be changed (e.g. `-MDd` => `-MTd`).
However, some projects may currently depend on this not being done,
so we need to activate the behavior using a policy.

This change was originally made by commit v3.6.0-rc1~160^2 (try_compile:
Honor CMAKE_<LANG>_FLAGS_<CONFIG> changes, 2016-04-11) but without the
policy and so had to be reverted during the 3.6 release candidate cycle.

Fixes #16174.
2016-06-29 09:11:02 -04:00
Brad King 8d79375818 Merge topic 'GenerateExportHeader-custom-content'
a9252441 Tests: Run clang-format on GenerateExportHeader code
2016-06-29 09:10:29 -04:00
Brad King a9252441b3 Tests: Run clang-format on GenerateExportHeader code 2016-06-29 09:09:54 -04:00
Brad King cb93dc048f Merge topic 'GenerateExportHeader-custom-content'
843402b0 GenerateExportHeader: Add option to specify custom content
2016-06-29 09:07:33 -04:00
Brad King db4ba61f39 Merge topic 'revert-try_compile-config-flags'
943fe6e3 Revert "try_compile: Honor CMAKE_<LANG>_FLAGS_<CONFIG> changes"
2016-06-29 09:07:28 -04:00
Brad King e34c5543fa Merge branch 'revert-try_compile-config-flags' into release 2016-06-28 15:09:44 -04:00
Brad King 943fe6e3b4 Revert "try_compile: Honor CMAKE_<LANG>_FLAGS_<CONFIG> changes"
Revert commit v3.6.0-rc1~160^2 (try_compile: Honor
CMAKE_<LANG>_FLAGS_<CONFIG> changes, 2016-04-11).  The behavior it
introduced can break projects that depend on the lack of such behavior.
We will have to introduce a policy or other mechanism to enable the
behavior in a compatible way.  Simply revert it for now.

See issue #16174.
2016-06-28 15:03:45 -04:00
Brad King 843402b04a GenerateExportHeader: Add option to specify custom content 2016-06-28 09:43:52 -04:00
Brad King 1b021a64f8 Merge topic 'ninja-no-rsp-for-rc'
15b3f6f0 ninja, rc: ignore CMAKE_NINJA_FORCE_RESPONSE_FILE for RC files
2016-06-28 09:06:34 -04:00
Ben Boeckel 15b3f6f0f1 ninja, rc: ignore CMAKE_NINJA_FORCE_RESPONSE_FILE for RC files
In commit v3.6.0-rc1~174^2 (Ninja: Honor CMAKE_NINJA_FORCE_RESPONSE_FILE
for compile rules, 2016-04-06), Ninja learned to look for
`CMAKE_NINJA_FORCE_RESPONSE_FILE` in the current scope or the
environment in order to force response file usage for all compilation
rules.

However, on Windows, the RC compiler goes through cmcldeps which does a
`replace(output, output + ".dep.obj")` on the command line. However,
with a response file (which we name `output + ".rsp"`), the response
file path is replaced instead causing the compiler to (correctly)
complain that the response file `output + ".dep.obj.rsp"` does not
exist.

What needs to happen is for cmcldeps to look through the response file,
replace *its* contents and place it in the `output + ".dep.obj.rsp"`
file.

Also add a test which actually compiles an RC file into a library and
executable for all generators on Windows and additionally test
`CMAKE_NINJA_FORCE_RESPONSE_FILE` for Ninja generators.

Fixes #16167.
2016-06-27 14:34:06 -04:00