CMakeLists.txt 824 B

12345678910111213141516171819202122232425
  1. cmake_minimum_required (VERSION 2.7.20090711)
  2. cmake_policy(SET CMP0025 NEW)
  3. project(Import C CXX)
  4. # Import everything in a subdirectory.
  5. add_subdirectory(A)
  6. # Make sure the imported targets are scoped inside the subdirectory.
  7. if(TARGET exp_testLib2)
  8. message(FATAL_ERROR "Imported target exp_testLib2 is not scoped in subdir!")
  9. endif()
  10. if(TARGET bld_testLib2)
  11. message(FATAL_ERROR "Imported target bld_testLib2 is not scoped in subdir!")
  12. endif()
  13. # Test transitive linking to a target imported in the subdirectory.
  14. add_executable(imp_testTransExe1 imp_testTransExe1.c)
  15. target_link_libraries(imp_testTransExe1 imp_lib1)
  16. add_executable(imp_testTransExe1b imp_testTransExe1.c)
  17. target_link_libraries(imp_testTransExe1b imp_lib1b)
  18. add_subdirectory(try_compile)
  19. # Test package INTERFACE controls
  20. add_subdirectory(Interface)