Advertisement
Guest User

Untitled

a guest
Feb 15th, 2015
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. --- CMakeLists.txt ---
  2.  
  3. cmake_minimum_required(VERSION 3.1)
  4. project(Foo)
  5.  
  6. add_library(a a.cpp)
  7.  
  8. add_executable(foo main.cpp)
  9. target_link_libraries(foo a)
  10.  
  11. --- a.cpp ---
  12.  
  13. int a() {
  14. return 42;
  15. }
  16.  
  17. --- main.cpp ---
  18.  
  19. #include <iostream>
  20. int a();
  21.  
  22. int main() {
  23. std::cout << "a: " << a() << std::endl;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement