Tests: add tests for export set error messages

This commit is contained in:
Ben Boeckel
2019-06-27 08:50:57 -04:00
parent 49cfd39007
commit 27d6e51ae9
7 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1 @@
1

View File

@@ -0,0 +1,13 @@
CMake Error in CMakeLists.txt:
export called with target "exported" which requires target "doubleexported"
that is not in this export set, but in multiple other export sets:
.*/Tests/RunCMake/export/DependOnDoubleExport-build/exportset.cmake,
.*/Tests/RunCMake/export/DependOnDoubleExport-build/manual.cmake.
An exported target cannot depend upon another target which is exported
multiple times. Consider consolidating the exports of the "doubleexported"
target to a single export.
CMake Generate step failed. Build files cannot be regenerated correctly.

View File

@@ -0,0 +1,7 @@
add_library(doubleexported INTERFACE)
install(TARGETS doubleexported EXPORT exportset)
export(TARGETS doubleexported FILE "${CMAKE_CURRENT_BINARY_DIR}/manual.cmake")
export(EXPORT exportset FILE "${CMAKE_CURRENT_BINARY_DIR}/exportset.cmake")
add_library(exported INTERFACE)
target_link_libraries(exported INTERFACE doubleexported)
export(TARGETS exported FILE "${CMAKE_CURRENT_BINARY_DIR}/exports.cmake")

View File

@@ -0,0 +1 @@
1

View File

@@ -0,0 +1,6 @@
CMake Error in CMakeLists.txt:
export called with target "exported" which requires target "notexported"
that is not in any export set.
CMake Generate step failed. Build files cannot be regenerated correctly.

View File

@@ -0,0 +1,4 @@
add_library(notexported INTERFACE)
add_library(exported INTERFACE)
target_link_libraries(exported INTERFACE notexported)
export(TARGETS exported FILE "${CMAKE_CURRENT_BINARY_DIR}/exports.cmake")

View File

@@ -10,3 +10,5 @@ run_cmake(ForbiddenToExportInterfaceProperties)
run_cmake(ForbiddenToExportImportedProperties)
run_cmake(ForbiddenToExportPropertyWithGenExp)
run_cmake(ExportPropertiesUndefined)
run_cmake(DependOnNotExport)
run_cmake(DependOnDoubleExport)