Advertisement
Guest User

Untitled

a guest
Nov 5th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 0.28 KB | None | 0 0
  1. cmake_minimum_required(VERSION 3.1)
  2.  
  3. file(WRITE foo.cpp [[
  4. void bar();
  5.  
  6. int main()
  7. {
  8.     bar();
  9. }
  10. ]])
  11.  
  12. add_executable(foo foo.cpp)
  13.  
  14. file(WRITE bar.cpp [[
  15. #include <iostream>
  16.  
  17. void bar()
  18. {
  19.     std::cout << "bar" << std::endl;
  20. }
  21. ]])
  22.  
  23. target_sources(foo PRIVATE bar.cpp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement