summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmExportBuildFileGenerator.cxx10
-rw-r--r--Source/cmExportInstallFileGenerator.cxx11
-rw-r--r--Tests/RunCMake/TargetSources/ExportBuild-result.txt1
-rw-r--r--Tests/RunCMake/TargetSources/ExportBuild-stderr.txt1
-rw-r--r--Tests/RunCMake/TargetSources/ExportBuild.cmake5
-rw-r--r--Tests/RunCMake/TargetSources/ExportInstall-result.txt1
-rw-r--r--Tests/RunCMake/TargetSources/ExportInstall-stderr.txt1
-rw-r--r--Tests/RunCMake/TargetSources/ExportInstall.cmake6
-rw-r--r--Tests/RunCMake/TargetSources/RunCMakeTest.cmake2
9 files changed, 38 insertions, 0 deletions
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 30a52d4..134ee98 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -68,6 +68,16 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
tei != this->Exports.end(); ++tei)
{
cmTarget* te = *tei;
+ if (te->GetProperty("INTERFACE_SOURCES"))
+ {
+ cmOStringStream e;
+ e << "Target \""
+ << te->GetName()
+ << "\" has a populated INTERFACE_SOURCES property. This is not "
+ "currently supported.";
+ cmSystemTools::Error(e.str().c_str());
+ return false;
+ }
this->GenerateImportTargetCode(os, te);
te->AppendBuildInterfaceIncludes();
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 89071c0..23180f1 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -123,6 +123,17 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
{
cmTarget* te = (*tei)->Target;
+ if (te->GetProperty("INTERFACE_SOURCES"))
+ {
+ cmOStringStream e;
+ e << "Target \""
+ << te->GetName()
+ << "\" has a populated INTERFACE_SOURCES property. This is not "
+ "currently supported.";
+ cmSystemTools::Error(e.str().c_str());
+ return false;
+ }
+
requiresConfigFiles = requiresConfigFiles
|| te->GetType() != cmTarget::INTERFACE_LIBRARY;
diff --git a/Tests/RunCMake/TargetSources/ExportBuild-result.txt b/Tests/RunCMake/TargetSources/ExportBuild-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/ExportBuild-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetSources/ExportBuild-stderr.txt b/Tests/RunCMake/TargetSources/ExportBuild-stderr.txt
new file mode 100644
index 0000000..0d65a55
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/ExportBuild-stderr.txt
@@ -0,0 +1 @@
+CMake Error: Target "iface" has a populated INTERFACE_SOURCES property. This is not currently supported.
diff --git a/Tests/RunCMake/TargetSources/ExportBuild.cmake b/Tests/RunCMake/TargetSources/ExportBuild.cmake
new file mode 100644
index 0000000..b626aa6
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/ExportBuild.cmake
@@ -0,0 +1,5 @@
+
+add_library(iface INTERFACE)
+target_sources(iface INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/empty_1.cpp")
+
+export(TARGETS iface FILE ${CMAKE_CURRENT_BINARY_DIR}/targets.cmake)
diff --git a/Tests/RunCMake/TargetSources/ExportInstall-result.txt b/Tests/RunCMake/TargetSources/ExportInstall-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/ExportInstall-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetSources/ExportInstall-stderr.txt b/Tests/RunCMake/TargetSources/ExportInstall-stderr.txt
new file mode 100644
index 0000000..0d65a55
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/ExportInstall-stderr.txt
@@ -0,0 +1 @@
+CMake Error: Target "iface" has a populated INTERFACE_SOURCES property. This is not currently supported.
diff --git a/Tests/RunCMake/TargetSources/ExportInstall.cmake b/Tests/RunCMake/TargetSources/ExportInstall.cmake
new file mode 100644
index 0000000..8e7c9f9
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/ExportInstall.cmake
@@ -0,0 +1,6 @@
+
+add_library(iface INTERFACE)
+target_sources(iface INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/empty_1.cpp")
+
+install(TARGETS iface EXPORT exp)
+install(EXPORT exp DESTINATION cmake)
diff --git a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
index c6d7f43..1b4ef0b 100644
--- a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
+++ b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
@@ -9,3 +9,5 @@ endif()
run_cmake(CMP0026-LOCATION)
run_cmake(RelativePathInInterface)
+run_cmake(ExportBuild)
+run_cmake(ExportInstall)