Guest User

Untitled

a guest
Aug 14th, 2019
88
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cmake_minimum_required(VERSION 3.12)
  2.  
  3. project(Foo)
  4.  
  5. set(FAKE_LIB "${CMAKE_BINARY_DIR}/libfoo.a")
  6. file(WRITE "${FAKE_LIB}")
  7.  
  8. file(WRITE foo.cpp "int main() {}")
  9.  
  10. add_library(bar INTERFACE)
  11. target_link_libraries(bar INTERFACE ${FAKE_LIB})
  12.  
  13. add_library(baz INTERFACE)
  14. target_link_libraries(baz INTERFACE ${FAKE_LIB})
  15.  
  16. add_executable(foo foo.cpp)
  17.  
  18. target_link_libraries(foo PRIVATE bar)
  19. target_link_libraries(foo PRIVATE baz)
RAW Paste Data