summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-07-31 19:17:45 (GMT)
committerBrad King <brad.king@kitware.com>2019-07-31 23:32:55 (GMT)
commitd70a0f8681919713940d254f9e23141f69f68c31 (patch)
tree52ece17592afe59331a49ffd887998d6f9124d49 /Tests/RunCMake
parentf43a7d76c737c5bb9b903a2b1be5186c081ec21e (diff)
downloadCMake-d70a0f8681919713940d254f9e23141f69f68c31.zip
CMake-d70a0f8681919713940d254f9e23141f69f68c31.tar.gz
CMake-d70a0f8681919713940d254f9e23141f69f68c31.tar.bz2
fileapi: Fix codemodel target install destination for cross-dir rules
Since commit e89ad0f94e (install: Allow installing targets created in another directory, 2018-06-18, v3.13.0-rc1~407^2) we support calling `install(TARGETS)` for targets created in another directory. However, install generators are associated with the directory in which the call to `install()` appears. This may not be the same directory in which the target is defined. Record in each target the list of install generators it has. Fixes: #19546
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py35
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2.cmake2
2 files changed, 36 insertions, 1 deletions
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index 18b9347..3096358 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -2087,7 +2087,40 @@ def gen_check_targets(c, g, inSource):
],
"build": "^cxx$",
"source": "^cxx$",
- "install": None,
+ "install": {
+ "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$",
+ "destinations": [
+ {
+ "path": "bin",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 37,
+ "command": "install",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ },
"link": {
"language": "CXX",
"lto": None,
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2.cmake b/Tests/RunCMake/FileAPI/codemodel-v2.cmake
index 72073d5..c98a84c 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2.cmake
+++ b/Tests/RunCMake/FileAPI/codemodel-v2.cmake
@@ -33,3 +33,5 @@ if(_ipo)
set_property(TARGET c_static_lib PROPERTY INTERPROCEDURAL_OPTIMIZATION ON)
file(WRITE "${CMAKE_BINARY_DIR}/ipo_enabled.txt" "")
endif()
+
+install(TARGETS cxx_exe)