summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'use-string-append'Brad King2016-08-0111-37/+37
|\ | | | | | | | | | | 7a649111 Use string(APPEND) in Tests 5d0d980d Use string(APPEND) in Modules
| * Use string(APPEND) in TestsDaniel Pfeifer2016-07-2711-37/+37
| | | | | | | | | | | | | | 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'
* | Merge topic 'app-framework-bundle-extension'Brad King2016-08-013-4/+64
|\ \ | |/ |/| | | | | | | | | | | 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)
| * Add tests for BUNDLE_EXTENSIONGregor Jasny2016-07-223-4/+64
| |
* | Merge topic 'tests-hide-ldd-check-errors'Brad King2016-07-221-1/+2
|\ \ | | | | | | | | | | | | d6a6024e Tests: Hide errors from `ldd --help` output check
| * | Tests: Hide errors from `ldd --help` output checkBrad King2016-07-211-1/+2
| |/ | | | | | | | | If `--help` is not a valid option then it may print content to stderr, so we need to capture that.
* | Merge topic 'windows-export-all-fix-objlib'Brad King2016-07-223-1/+9
|\ \ | |/ |/| | | | | 13a6ff31 VS: Fix WINDOWS_EXPORT_ALL_SYMBOLS for object libraries
| * VS: Fix WINDOWS_EXPORT_ALL_SYMBOLS for object librariesBrad King2016-07-213-1/+9
| | | | | | | | | | | | | | | | | | 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>
* | Ninja: Fix inter-target order-only dependencies of custom commandsBrad King2016-07-202-0/+45
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Honor CMAKE_*_LINKER_FLAGS[_<CONFIG>]_INIT set in toolchain filesBrad King2016-07-144-0/+73
| | | | | | | | | | | | | | 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.
* Merge topic 'windows-export-all-from-exe'Brad King2016-07-133-0/+22
|\ | | | | | | | | | | 9da725cb Windows: Honor WINDOWS_EXPORT_ALL_SYMBOLS for executables with exports 2005b960 Makefile: Factor out WINDOWS_EXPORT_ALL_SYMBOLS helper
| * Windows: Honor WINDOWS_EXPORT_ALL_SYMBOLS for executables with exportsYury Zhuravlev2016-07-113-0/+22
| | | | | | | | | | For executables with ENABLE_EXPORTS set, export all symbols when instructed to do so by WINDOWS_EXPORT_ALL_SYMBOLS.
* | Fix typos.Felix Geyer2016-07-101-1/+1
| |
* | Honor CMAKE_<LANG>_FLAGS[_<CONFIG>]_INIT set in toolchain filesBrad King2016-07-064-0/+45
|/ | | | | | | | | | | | | | | | | | | | | | | 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.
* try_compile: Add policy CMP0066 to honor CMAKE_<LANG>_FLAGS_<CONFIG>Brad King2016-06-295-0/+81
| | | | | | | | | | | | | | | | 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.
* Merge topic 'revert-try_compile-config-flags'Brad King2016-06-293-21/+0
|\ | | | | | | | | 943fe6e3 Revert "try_compile: Honor CMAKE_<LANG>_FLAGS_<CONFIG> changes"
| * Revert "try_compile: Honor CMAKE_<LANG>_FLAGS_<CONFIG> changes"Brad King2016-06-283-21/+0
| | | | | | | | | | | | | | | | | | | | 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.
* | Merge topic 'cmake-trace-source'Brad King2016-06-204-0/+9
|\ \ | | | | | | | | | | | | e63151ff cmake: Add an option to control what files needs to be traced
| * | cmake: Add an option to control what files needs to be tracedAlex Turbov2016-06-174-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even in relatively small projects using `--trace` (and `--trace-expand`) may produce a lot of output. When developing a custom module usually one is interested in output of only a few particular modules. Add a `--trace-source=<file>` option to enable tracing only a subset of source files. The final output would be only from requested modules, ignoring anything else not matched to given filename(s).
* | | Merge topic 'cpack-deb-test-fixes'Brad King2016-06-203-10/+13
|\ \ \ | |/ / |/| / | |/ | | | | 6107fab4 CPack/Deb: Fix test to actually test the preinst script 302391ba CPack/Deb: Fix tests for SELinux-enabled systems
| * CPack/Deb: Fix test to actually test the preinst scriptDomen Vrankar2016-06-201-2/+2
| | | | | | | | | | | | | | The test regex variable name was invalid and did not test preinst script. Reported-by: Patrick <mail6543210@yahoo.com.tw>
| * CPack/Deb: Fix tests for SELinux-enabled systemsDomen Vrankar2016-06-203-10/+13
| | | | | | | | Suggested-by: Patrick <mail6543210@yahoo.com.tw>
* | Merge topic 'link_what_you_use'Brad King2016-06-1713-0/+62
|\ \ | | | | | | | | | | | | | | | a0902efa Help: Add notes for topic 'link_what_you_use' 96242f80 Add options to run `ldd -u -r` as a "link-what-you-use" tool
| * | Add options to run `ldd -u -r` as a "link-what-you-use" toolBill Hoffman2016-06-1713-0/+62
| | | | | | | | | | | | | | | | | | | | | Create a LINK_WHAT_YOU_USE target property and corresponding CMAKE_LINK_WHAT_YOU_USE variable to enable this behavior. Extend link commands by running `ldd -u -r` to detect shared libraries that are linked but not needed.
* | | Parser: Issue file open error messages through dedicated APIStephen Kelly2016-06-134-20/+4
| | |
* | | Merge topic 'fix-Message-API-ISP-violation'Brad King2016-06-135-0/+25
|\ \ \ | | | | | | | | | | | | | | | | 0a4af073 cmake: Issue message independent of cmMakefile definition
| * | | cmake: Issue message independent of cmMakefile definitionStephen Kelly2016-06-125-0/+25
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The makefile is only used when called by the cmMessageCommand, so inline the use of it there. It otherwise creates an undesirable dependency on cmMakefile for issuing messages in the cmake instance, a violation of the Interface Segregation Principle. https://en.wikipedia.org/wiki/Interface_segregation_principle This also makes it more explicit that the variable definitions only affect the message() command. If an AUTHOR_WARNING is issued for any other reason, it is not affected. To affect that, it is necessary to set the cache variable instead of the regular variable. This is an unfortunate interface quirk, but one which can't be fixed easily now.
* | | Teach find_library and find_package to search lib32 paths (#11260)Daniel Scharrer2016-06-108-18/+40
|/ / | | | | | | | | | | | | Add a ``FIND_LIBRARY_USE_LIB32_PATHS`` global property analogous to the ``FIND_LIBRARY_USE_LIB64_PATHS`` property. This helps find commands on multilib systems that use ``lib32`` directories and either do not have ``lib`` symlinks or point ``lib`` to ``lib64``.
* | find_path: Fix location of <dir/header.h> in a framework on OS XHarry Mallon2016-06-074-0/+8
|/ | | | | | | After finding it in `foo.Framework/Headers/dir/header.h`, we should report the `foo.Framework/Headers` directory, not `foo.Framework/Headers/dir`, because the former is what actually contains the path the caller wishes to include.
* Fix crash on $<TARGET_PROPERTY:...,LOCATION> genex (#16134)Brad King2016-06-023-0/+14
| | | | | | | | | | | | | | | | | | Policy CMP0026 deprecated the LOCATION property, and we have long provided a $<TARGET_FILE:...> generator expression. However, if a project tries to use $<TARGET_PROPERTY:...,LOCATION> we should at least not crash. The compatibility implementation of the LOCATION property uses cmGlobalGenerator::CreateGenerationObjects to create the structures needed to evaluate the property before generation starts. The implementation assumed that accessing the property could only be done during configuration (via the typical get_property command use case). The $<TARGET_PROPERTY:...,LOCATION> genex causes the LOCATION property to be accessed during generation. Calling CreateGenerationObjects during generation blows away all the objects currently being used for generation and is not safe. Add a condition to call it only when configuration is not finished.
* try_compile: Optionally forward custom platform variables to test projectBrad King2016-05-252-0/+27
| | | | | | | | | Add a `CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` variable to specify a list of custom variables to be forwarded to a `try_compile` test project. This will be useful for platform information modules or toolchain files to forward some platform-specific set of variables from the host project (perhaps set in its cache) to the test project so that it can build the same way.
* CPack/Deb possibility to change package nameDomen Vrankar2016-05-2317-13/+38
| | | | | | | | This patch preserves backward compatibility of deb package names with previous CMake versions but similarly to CPack/RPM allows to change package name format and supports DEB-DEFAULT setting that produces proper Debian package names.
* Merge topic 'ninja-output-path-prefix'Brad King2016-05-1921-0/+328
|\ | | | | | | | | | | | | | | | | | | | | | | | | eb076692 Tests: Select RunCMake.Ninja test cases based on ninja version 8a862a4d Ninja: Support embedding of CMake as subninja project 038e7716 Ninja: Pass all build paths through a central method 7c26a6a2 Ninja: Fix path to soname-d target file ac3cdd9a Ninja: Convert object file names to ninja paths earlier d4381cb1 Ninja: Convert link library file names like all other output paths 0397c92a Ninja: Pre-compute "CMakeCache.txt" build target name 3b3ecdfa Ninja: Pre-compute "all" build target name 5ca72750 Ninja: Simplify generation of custom target logical path
| * Tests: Select RunCMake.Ninja test cases based on ninja versionBrad King2016-05-181-0/+20
| | | | | | | | | | Some test cases need features not available in Ninja < 1.6, so check the version before running them.
| * Ninja: Support embedding of CMake as subninja projectNicolas Despres2016-05-1721-0/+308
| | | | | | | | | | | | Add a `CMAKE_NINJA_OUTPUT_PATH_PREFIX` variable. When it is set, CMake generates a `build.ninja` file suitable for embedding into another ninja project potentially generated by an alien generator.
* | file: Sort GLOB results to make it deterministic (#14491)Reiner Herrmann2016-05-173-9/+0
|/ | | | | | | | | | | | | | | | | Even though the `file(GLOB)` documentation specifically warns against using it to collect a list of source files, projects often do it anyway. Since it uses `readdir()`, the list of files will be unsorted. This list is often passed directly to add_executable / add_library. Linking binaries with an unsorted list will make it unreproducible, which means that the produced binary will differ depending on the unpredictable `readdir()` order. To solve those reproducibility issues in a lot of programs (which don't explicitly `list(SORT)` the list manually), sort the resulting list of the `file(GLOB)` command. A more detailed rationale about reproducible builds is available [here](https://reproducible-builds.org/).
* Revise C++ coding style using clang-formatKitware Robot2016-05-1663-97/+143
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Merge topic 'findpkgconfig-target'Brad King2016-05-162-0/+27
|\ | | | | | | | | df97b979 FindPkgConfig: optionally create imported target for the found libraries
| * FindPkgConfig: optionally create imported target for the found librariesRolf Eike Beer2016-05-142-0/+27
| |
* | Merge topic 'cpack-rpm-adding-dist-to-release-tag'Brad King2016-05-164-0/+21
|\ \ | | | | | | | | | | | | | | | f5089cfc CPack/RPM adding dist to release tag test f7003a60 CPack/RPM release dist tag support
| * | CPack/RPM adding dist to release tag testDomen Vrankar2016-05-144-0/+21
| |/ | | | | | | Tests and release notes
* | Merge topic 'cpack-rpm-different-package-names'Brad King2016-05-164-0/+24
|\ \ | | | | | | | | | | | | 44ee2d71 CPack/RPM different package names
| * | CPack/RPM different package namesDomen Vrankar2016-05-154-0/+24
| |/ | | | | | | | | | | | | | | Packagers may now set their own rpm package file names or request that rpmbuild tool chooses one for them. It also supports handing of situations where one spec file may produce multiple rpm packages.
* | Merge topic 'cpack-deb-improvements'Brad King2016-05-1618-16/+198
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | 4461e8bb CPack/Deb cpack-deb-improvements release notes 7e940bf7 CPack/Deb test changes due to breaking changes 3b648894 CPack/Deb package release number in file name 316dd613 CPack/Deb proper package file naming 271e03f0 CPack/Deb per-component package architecture 23baaf8d CPack/Deb inter package dependencies 3a55a0e7 CPack/Deb proper component packages file naming c7f388e7 CPack/Deb generation of postinst and postrm ldconfig files 2d589653 CPack/Deb generation of DEBIAN/shlibs control file
| * CPack/Deb test changes due to breaking changesDomen Vrankar2016-05-1318-16/+198
| | | | | | | | | | | | New CPack/Deb tests and changes to old tests as package file names and inter component dependency detection was changed.
* | Drop find_(library|file|path) prefixes from PATH on non-WindowsBrad King2016-05-093-3/+9
|/ | | | | | | | | | | Since commit v3.3.0-rc1~430^2 (Teach find_(library|file|path) to get prefixes from PATH, 2015-02-18) we search in <prefix>/include and <prefix>/lib directories for prefixes with bin directories in the PATH environment variable. The motivation was to support MSYS, MinGW and similar Windows platforms in their default environments automatically. At the time this behavior was thought to be worthwhile in general. Suggested-by: Chuck Atkins <chuck.atkins@kitware.com>
* CustomCommandGenerator: Add support for CROSSCOMPILING_EMULATORJean-Christophe Fillion-Robin2016-05-098-1/+134
| | | | | | Teach the `add_custom_command` and `add_custom_target' commands to substitute argv0 with the crosscompiling emulator if it is a target with the `CROSSCOMPILING_EMULATOR` property set.
* Tests: Improve source file name in RunCMake.CrosscompilingEmulatorJean-Christophe Fillion-Robin2016-05-035-7/+9
| | | | | The test executable returns with an error, so indicate this in the source name.
* Tests: Cover genex behavior in CROSSCOMPILING_EMULATOR test caseJean-Christophe Fillion-Robin2016-05-033-4/+35
| | | | | | | | A `$<TARGET_FILE:tgt>` generator expression does not cause insertion of the emulator. Add a test covering this. While at it, extend the test case to cover executables in a subdirectory. Also make the test matching expressions more robust to support multiple add_test calls without mixing them while matching.
* CMP0059: Fix typo in policy descriptionBrad King2016-05-021-2/+2
|