diff options
author | Brad King <brad.king@kitware.com> | 2015-07-21 18:37:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-07-21 18:39:10 (GMT) |
commit | 7e9f908ef54a3c2fe42ae8f9376c77e5bc988a9a (patch) | |
tree | 7fcc67115087af898b835f71e05700789640fa4a /Tests | |
parent | 3b09398ae27f0e4b5975920ac2787427ffc6ccc4 (diff) | |
download | CMake-7e9f908ef54a3c2fe42ae8f9376c77e5bc988a9a.zip CMake-7e9f908ef54a3c2fe42ae8f9376c77e5bc988a9a.tar.gz CMake-7e9f908ef54a3c2fe42ae8f9376c77e5bc988a9a.tar.bz2 |
export: Reject custom target exports earlier (#15657)
Diagnose and reject custom targets given to the export() command
immediately. Previously we would generate an internal error later.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/export/CustomTarget-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/export/CustomTarget-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/export/CustomTarget.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/export/RunCMakeTest.cmake | 1 |
4 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/export/CustomTarget-result.txt b/Tests/RunCMake/export/CustomTarget-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/export/CustomTarget-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/export/CustomTarget-stderr.txt b/Tests/RunCMake/export/CustomTarget-stderr.txt new file mode 100644 index 0000000..57a9af3 --- /dev/null +++ b/Tests/RunCMake/export/CustomTarget-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at CustomTarget.cmake:[0-9]+ \(export\): + export given custom target "CustomTarget" which may not be exported. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/export/CustomTarget.cmake b/Tests/RunCMake/export/CustomTarget.cmake new file mode 100644 index 0000000..4d2bf18 --- /dev/null +++ b/Tests/RunCMake/export/CustomTarget.cmake @@ -0,0 +1,2 @@ +add_custom_target(CustomTarget) +export(TARGETS CustomTarget FILE somefile.cmake) diff --git a/Tests/RunCMake/export/RunCMakeTest.cmake b/Tests/RunCMake/export/RunCMakeTest.cmake index 4b04f18..6d0b7ca 100644 --- a/Tests/RunCMake/export/RunCMakeTest.cmake +++ b/Tests/RunCMake/export/RunCMakeTest.cmake @@ -1,5 +1,6 @@ include(RunCMake) +run_cmake(CustomTarget) run_cmake(TargetNotFound) run_cmake(AppendExport) run_cmake(OldIface) |