summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-05-20 13:25:30 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-05-20 13:25:36 (GMT)
commit6f656d6b58886a07c773fb83ec6f1a9633204af5 (patch)
tree984218ce4e4910b7473421d4f9a2d6925745998b /Tests
parent35ea23a618a83902a83659a1f422a0f3af90c249 (diff)
parent99ff75455ece5ec4add771a2de93b237ab858d08 (diff)
downloadCMake-6f656d6b58886a07c773fb83ec6f1a9633204af5.zip
CMake-6f656d6b58886a07c773fb83ec6f1a9633204af5.tar.gz
CMake-6f656d6b58886a07c773fb83ec6f1a9633204af5.tar.bz2
Merge topic 'install-script-all-components'
99ff75455e install: Implement new install(CODE|SCRIPT) option ALL_COMPONENTS Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6140
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py4
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json54
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2.cmake1
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS-all-check.cmake1
-rw-r--r--Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS-dev-check.cmake1
-rw-r--r--Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS-uns-check.cmake1
-rw-r--r--Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS.cmake5
10 files changed, 72 insertions, 0 deletions
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index 0d718a4..b9a1fbf 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -136,6 +136,10 @@ def check_directory(c):
expected_keys.append("isExcludeFromAll")
assert is_bool(a["isExcludeFromAll"], e["isExcludeFromAll"])
+ if e["isForAllComponents"] is not None:
+ expected_keys.append("isForAllComponents")
+ assert is_bool(a["isForAllComponents"], e["isForAllComponents"])
+
if e["isOptional"] is not None:
expected_keys.append("isOptional")
assert is_bool(a["isOptional"], e["isOptional"])
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json
index 55dd573..6d2952d 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json
@@ -20,6 +20,7 @@
"^.*/Tests/RunCMake/FileAPIExternalSource/\\.$"
],
"isExcludeFromAll": null,
+ "isForAllComponents": null,
"isOptional": null,
"targetId": null,
"targetIndex": null,
@@ -51,6 +52,7 @@
"^.*/Tests/RunCMake/FileAPIExternalSource$"
],
"isExcludeFromAll": true,
+ "isForAllComponents": null,
"isOptional": null,
"targetId": null,
"targetIndex": null,
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json
index ef2dd0b..44bc725 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json
@@ -23,6 +23,7 @@
"^object/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?c_object_exe(\\.exe)?$"
],
"isExcludeFromAll": null,
+ "isForAllComponents": null,
"isOptional": null,
"targetId": "^c_object_exe::@5ed5358f70faf8d8af7a$",
"targetIndex": "c_object_exe",
@@ -54,6 +55,7 @@
"^object/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?cxx_object_exe(\\.exe)?$"
],
"isExcludeFromAll": null,
+ "isForAllComponents": null,
"isOptional": null,
"targetId": "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
"targetIndex": "cxx_object_exe",
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
index 4727607..99287fb 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
@@ -35,6 +35,7 @@
"^cxx/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?cxx_exe(\\.exe)?$"
],
"isExcludeFromAll": null,
+ "isForAllComponents": null,
"isOptional": null,
"targetId": "^cxx_exe::@a56b12a3f5c0529fb296$",
"targetIndex": "cxx_exe",
@@ -78,6 +79,7 @@
"^((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib)?c_shared_lib\\.(lib|dll\\.a)$"
],
"isExcludeFromAll": null,
+ "isForAllComponents": null,
"isOptional": null,
"targetId": "^c_shared_lib::@6890427a1f51a3e7e1df$",
"targetIndex": "c_shared_lib",
@@ -126,6 +128,7 @@
"^lib/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib)?c_shared_lib\\.(so\\.1|1\\.dylib)$"
],
"isExcludeFromAll": null,
+ "isForAllComponents": null,
"isOptional": null,
"targetId": "^c_shared_lib::@6890427a1f51a3e7e1df$",
"targetIndex": "c_shared_lib",
@@ -169,6 +172,7 @@
"^cxx/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib)?cxx_shared_lib\\.(lib|dll\\.a)$"
],
"isExcludeFromAll": null,
+ "isForAllComponents": null,
"isOptional": null,
"targetId": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
"targetIndex": "cxx_shared_lib",
@@ -213,6 +217,7 @@
"^cxx/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib|cyg|msys-)?cxx_shared_lib\\.(dll|so|dylib)$"
],
"isExcludeFromAll": null,
+ "isForAllComponents": null,
"isOptional": null,
"targetId": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
"targetIndex": "cxx_shared_lib",
@@ -256,6 +261,7 @@
"^lib/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib)?c_shared_lib\\.(dll|so|dylib)$"
],
"isExcludeFromAll": null,
+ "isForAllComponents": null,
"isOptional": null,
"targetId": "^c_shared_lib::@6890427a1f51a3e7e1df$",
"targetIndex": "c_shared_lib",
@@ -302,6 +308,7 @@
}
],
"isExcludeFromAll": null,
+ "isForAllComponents": null,
"isOptional": true,
"targetId": null,
"targetIndex": null,
@@ -346,6 +353,7 @@
"^empty\\.h$"
],
"isExcludeFromAll": null,
+ "isForAllComponents": null,
"isOptional": null,
"targetId": null,
"targetIndex": null,
@@ -394,6 +402,7 @@
}
],
"isExcludeFromAll": null,
+ "isForAllComponents": null,
"isOptional": true,
"targetId": null,
"targetIndex": null,
@@ -445,6 +454,7 @@
}
],
"isExcludeFromAll": null,
+ "isForAllComponents": null,
"isOptional": null,
"targetId": null,
"targetIndex": null,
@@ -488,6 +498,7 @@
"^CMakeFiles/Export/lib/cmake/foo/FooTargets\\.cmake$"
],
"isExcludeFromAll": null,
+ "isForAllComponents": null,
"isOptional": null,
"targetId": null,
"targetIndex": null,
@@ -534,6 +545,7 @@
"destination": null,
"paths": null,
"isExcludeFromAll": null,
+ "isForAllComponents": null,
"isOptional": null,
"targetId": null,
"targetIndex": null,
@@ -568,6 +580,48 @@
"hasParent": false
}
]
+ },
+ {
+ "component": "Unspecified",
+ "type": "code",
+ "destination": null,
+ "paths": null,
+ "isExcludeFromAll": null,
+ "isForAllComponents": true,
+ "isOptional": null,
+ "targetId": null,
+ "targetIndex": null,
+ "targetIsImportLibrary": null,
+ "targetInstallNamelink": null,
+ "exportName": null,
+ "exportTargets": null,
+ "scriptFile": null,
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 54,
+ "command": "install",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
}
]
}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2.cmake b/Tests/RunCMake/FileAPI/codemodel-v2.cmake
index 528f075..da928eb 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2.cmake
+++ b/Tests/RunCMake/FileAPI/codemodel-v2.cmake
@@ -51,3 +51,4 @@ install(DIRECTORY . dir cxx/ OPTIONAL DESTINATION dir1)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/dir" "${CMAKE_CURRENT_SOURCE_DIR}/cxx/" DESTINATION dir2)
install(EXPORT FooTargets DESTINATION lib/cmake/foo)
install(SCRIPT InstallScript.cmake)
+install(CODE "message(foo)" ALL_COMPONENTS)
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index 3e56746..94887a0 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -179,3 +179,4 @@ run_install_test(FILES-EXCLUDE_FROM_ALL)
run_install_test(TARGETS-EXCLUDE_FROM_ALL)
run_install_test(TARGETS-NAMELINK_COMPONENT)
run_install_test(SCRIPT-COMPONENT)
+run_install_test(SCRIPT-ALL_COMPONENTS)
diff --git a/Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS-all-check.cmake b/Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS-all-check.cmake
new file mode 100644
index 0000000..48d8e1a
--- /dev/null
+++ b/Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS-all-check.cmake
@@ -0,0 +1 @@
+check_installed([[^empty1.txt;empty2.txt$]])
diff --git a/Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS-dev-check.cmake b/Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS-dev-check.cmake
new file mode 100644
index 0000000..48d8e1a
--- /dev/null
+++ b/Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS-dev-check.cmake
@@ -0,0 +1 @@
+check_installed([[^empty1.txt;empty2.txt$]])
diff --git a/Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS-uns-check.cmake b/Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS-uns-check.cmake
new file mode 100644
index 0000000..48d8e1a
--- /dev/null
+++ b/Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS-uns-check.cmake
@@ -0,0 +1 @@
+check_installed([[^empty1.txt;empty2.txt$]])
diff --git a/Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS.cmake b/Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS.cmake
new file mode 100644
index 0000000..aa3f9d1
--- /dev/null
+++ b/Tests/RunCMake/install/SCRIPT-ALL_COMPONENTS.cmake
@@ -0,0 +1,5 @@
+install(
+ SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/install_script.cmake"
+ CODE "write_empty_file(empty2.txt)"
+ ALL_COMPONENTS
+ )