Commit f9c1c622 authored by Brad King's avatar Brad King

Add test covering imported target scope rules

parent ca39c5cd
......@@ -16,3 +16,5 @@ add_CMakeOnly_test(CheckSymbolExists)
add_CMakeOnly_test(CheckCXXSymbolExists)
add_CMakeOnly_test(AllFindModules)
add_CMakeOnly_test(TargetScope)
cmake_minimum_required (VERSION 2.8)
project(TargetScope NONE)
add_subdirectory(Sub)
if(TARGET SubLibLocal)
message(FATAL_ERROR "SubLibLocal visible in top directory")
endif()
if(NOT TARGET SubLibGlobal)
message(FATAL_ERROR "SubLibGlobal not visible in top directory")
endif()
add_subdirectory(Sib)
if(TARGET SubLibLocal)
message(FATAL_ERROR "SubLibLocal visible in sibling directory")
endif()
if(NOT TARGET SubLibGlobal)
message(FATAL_ERROR "SubLibGlobal not visible in sibling directory")
endif()
add_library(SubLibLocal UNKNOWN IMPORTED)
add_library(SubLibGlobal UNKNOWN IMPORTED GLOBAL)
add_subdirectory(Sub)
if(NOT TARGET SubLibLocal)
message(FATAL_ERROR "SubLibLocal not visible in own directory")
endif()
if(NOT TARGET SubLibGlobal)
message(FATAL_ERROR "SubLibGlobal not visible in own directory")
endif()
if(NOT TARGET SubLibLocal)
message(FATAL_ERROR "SubLibLocal not visible in subdirectory")
endif()
if(NOT TARGET SubLibGlobal)
message(FATAL_ERROR "SubLibGlobal not visible in subdirectory")
endif()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment