Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- CMakeLists.txt ---
- cmake_minimum_required(VERSION 3.1)
- project(Foo)
- add_library(a a.cpp)
- add_executable(foo main.cpp)
- target_link_libraries(foo a)
- --- a.cpp ---
- int a() {
- return 42;
- }
- --- main.cpp ---
- #include <iostream>
- int a();
- int main() {
- std::cout << "a: " << a() << std::endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement