summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/TargetPolicies
Commit message (Collapse)AuthorAgeFilesLines
* Makefile: Add policy CMP0113 to avoid duplication of custom commandsBrad King2020-09-081-0/+1
| | | | | | | | | | | | | | | | | Do not attach a custom command to a target if it is already attached to one of the target's dependencies. The command's output will be available by the time the target needs it because the dependency containing the command will have already been built. This may break existing projects that do not properly mark non-created outputs with the `SYMBOLIC` property. Previously a chain of two custom commands whose intermediate dependency is not created would put both commands in a dependent project's Makefile even if the first command is also in its dependency's Makefile. The first command would run twice but the build would work. Now the second command needs an explicit `SYMBOLIC` mark on its input to tell CMake that it is not expected to exist. To maintain compatibility with projects that left out the mark, add a policy activating the behavior.
* GenEx: Remove unneeded dependencies from target info queriesRobert Maynard2020-09-011-0/+1
| | | | | | | | | | Only generate a graph dependency between a custom command and a target when the custom command queries for the file path of an artifact of the target. This makes generator expressions such as `TARGET_FILE_DIR` behave the same way as `TARGET_PROPERTY` which never generated a graph dependency.
* Tests/RunCMake: Update cmake_minimum_required versionsBrad King2020-06-181-1/+1
| | | | Use 3.3 or 2.8.12 where possible.
* target_link_libraries: self-link through ALIAS is an errorMarc Chevrier2020-05-301-0/+1
| | | | Fixes: #19617
* CUDA: Device linking use now link optionsMarc Chevrier2020-04-191-0/+1
| | | | | | | | | | properties LINK_OPTIONS and INTERFACE_LINK_OPTIONS are propagated to the device link step. To control which options are selected for normal link and device link steps, the $<DEVICE_LINK> and $<HOST_LINK> generator expressions can be used. Fixes: #18265
* CUDA: Add CUDA_ARCHITECTURES target propertyRaul Tambre2020-04-151-0/+1
| | | | | | | | | | | Simplifies CUDA target architecture handling. Required for Clang support as Clang doesn't automatically select a supported architecture. We detect a supported architecture during compiler identification and set CMAKE_CUDA_ARCHITECTURES to it. Introduces CMP0104 for backwards compatibility with manually setting code generation flags with NVCC. Implements #17963.
* Link properties: must be transitive over private dependency on static libraryMarc Chevrier2019-12-091-0/+1
| | | | Fixes: #20022
* cmInstallTargetGenerator: Introduce CMP0095Dennis Klein2019-06-131-0/+1
| | | | | | | Escape coincidental CMake syntax in RPATH entries when generating the intermediary cmake_install.cmake script. Fixes #19225
* POSITION_INDEPENDENT_CODE: Manage link flags for executablesMarc Chevrier2018-11-111-0/+1
| | | | Fixes: #14983, #16561
* LINK_DIRECTORIES target property: add policy for absolute paths check.Marc Chevrier2018-09-251-0/+1
|
* target_sources: Interpret relative paths as relative to the calling directoryPatrick Stotko2018-06-181-0/+1
| | | | | | | | | | Previously the command considered non-absolute source file paths relative to the associated target on the LHS. This causes problems in incremental builds where files are added from subdirectories and forces users to workaround by manually converting to absolute paths. Change this to enable more intuitive usage by projects. Fixes #17981
* Do not produce legacy _LIB_DEPENDS cache entriesBrad King2018-03-071-0/+1
| | | | | | Introduce policy `CMP0073` to avoid producing these cache entries. Fixes: #16364
* CMP0037: Allow test and package targets when features are not enabledBrad King2017-10-301-0/+1
| | | | | | | When CMake will not generate a test, package, or package_source target, allow projects to create their own targets with these names. Fixes: #16062
* Add policy CMP0069 to enforce INTERPROCEDURAL_OPTIMIZATIONRuslan Baratov2017-03-301-0/+1
| | | | | | | | | Previously the `INTERPROCEDURAL_OPTIMIZATION` target property was honored only for the Intel compiler on Linux and otherwise ignored. In order to add support for more compilers incrementally without changing behavior in the future, add a new policy whose NEW behavior enforces the `INTERPROCEDURAL_OPTIMIZATION` property. Add flags for supported compilers and otherwise produce an error.
* Add policy CMP0068 separate install_name and RPATH settings on macOSClinton Stimpson2017-02-141-0/+1
| | | | | | | | BUILD_WITH_INSTALL_RPATH, SKIP_BUILD_RPATH, CMAKE_SKIP_RPATH and CMAKE_SKIP_INSTALL_RPATH no longer any effect on the install name of a target on macOS. Fixes: #16589
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-1/+1
| | | | | | | | | | | | | 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.
* CMP0065: Restrict the use of CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGSChuck Atkins2015-09-211-0/+1
| | | | | This new policy restricts the addition of the shared library link flags to executables only when the ENABLE_EXPORTS property is set to True.
* Honor visibility properties for all target types (#15556)Brad King2015-05-261-0/+1
| | | | | | | | | | | | | | | | The <LANG>_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN were first merged in commit v2.8.12~322 (Merge topic 'VISIBILITY_PRESET-property', 2013-06-05) but worked only for shared libraries and executables with exports. Prior to commit v3.0.0-rc1~581^2 (GenerateExportHeader: Deprecate add_compiler_export_flags function., 2013-09-02) the add_compiler_export_flags function was used to add visibility flags to all targets. The visibility flags are useful for sources in all target types because they may be later linked into shared libraries or executables with exports. Introduce policy CMP0063 to enable them for all target types while preserving compatibility with existing projects that do not expect this.
* Link libraries by full path even in implicit directoriesBrad King2015-04-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | When CMP0003 was first introduced we wanted to link all libraries by full path. However, some projects had problems on platforms where find_library would find /usr/lib/libfoo.so when the project really wanted to link to /usr/lib/<arch>/libfoo.so and had been working by accident because pre-CMP0003 behavior used -lfoo to link. We first tried to address that in commit v2.6.0~440 (Teach find_library to avoid returning library paths in system directories, 2008-01-23) by returning just "foo" for libraries in implicit link directories. This caused problems for projects expecting find_library to always return a full path. We ended up using the solution in commit v2.6.0~366 (... switch library paths found in implicit link directories to use -l, 2008-01-31). However, the special case for libraries in implicit link directories has also proven problematic and confusing. Introduce policy CMP0060 to switch to linking all libraries by full path even if they are in implicit link directories. Explain in the policy documentation the factors that led to the original approach and now to this approach.
* Export: Disallow exported interface includes in src/build tree (#14592).Stephen Kelly2014-04-091-0/+1
| | | | | | | | | | | Allow directories in the source tree or build tree only if the install tree is a subdirectory of the source tree or build tree, as appropriate. Re-use the test files in the RunCMake.include_directories test to run in multiple scenarios. Bump the required CMake version in the test to 3.0 to ensure that the new policy warnings are emitted correctly.
* Record more policies on targets when createdBrad King2014-03-061-0/+3
| | | | | Policies CMP0027, CMP0038, and CMP0046 have per-target meaning so record the policy settings on targets as they are created.
* Help: Ensure that target-policies are added to the documentation.Stephen Kelly2014-01-071-0/+5
| | | | The two most-recently-added policies were not tested for.
* Cygwin: Avoid legacy warnings in RunCMake.* testsBrad King2013-08-131-1/+1
| | | | | | 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.
* Genex: Make CMP0021 and CMP0022 usable with TARGET_POLICYStephen Kelly2013-07-116-0/+35
Use preprocessor loops and add a unit test for the appropriate policies. All policies whose value is recorded at target creation time should be part of this list.