mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 13:51:33 -06:00
Tests: add tests for export set error messages
This commit is contained in:
1
Tests/RunCMake/export/DependOnDoubleExport-result.txt
Normal file
1
Tests/RunCMake/export/DependOnDoubleExport-result.txt
Normal file
@@ -0,0 +1 @@
|
||||
1
|
||||
13
Tests/RunCMake/export/DependOnDoubleExport-stderr.txt
Normal file
13
Tests/RunCMake/export/DependOnDoubleExport-stderr.txt
Normal 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.
|
||||
7
Tests/RunCMake/export/DependOnDoubleExport.cmake
Normal file
7
Tests/RunCMake/export/DependOnDoubleExport.cmake
Normal 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")
|
||||
1
Tests/RunCMake/export/DependOnNotExport-result.txt
Normal file
1
Tests/RunCMake/export/DependOnNotExport-result.txt
Normal file
@@ -0,0 +1 @@
|
||||
1
|
||||
6
Tests/RunCMake/export/DependOnNotExport-stderr.txt
Normal file
6
Tests/RunCMake/export/DependOnNotExport-stderr.txt
Normal 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.
|
||||
4
Tests/RunCMake/export/DependOnNotExport.cmake
Normal file
4
Tests/RunCMake/export/DependOnNotExport.cmake
Normal 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")
|
||||
@@ -10,3 +10,5 @@ run_cmake(ForbiddenToExportInterfaceProperties)
|
||||
run_cmake(ForbiddenToExportImportedProperties)
|
||||
run_cmake(ForbiddenToExportPropertyWithGenExp)
|
||||
run_cmake(ExportPropertiesUndefined)
|
||||
run_cmake(DependOnNotExport)
|
||||
run_cmake(DependOnDoubleExport)
|
||||
|
||||
Reference in New Issue
Block a user