Advertisement
Guest User

Untitled

a guest
May 7th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 0.58 KB | None | 0 0
  1. cmake_minimum_required (VERSION 3.5)
  2.  
  3. project (example1 CXX)
  4. set (CMAKE_CXX_STANDARD 14)
  5.  
  6. set (SRC
  7.                 "src/main.cpp"
  8.                 "src/mod1.cpp"
  9. )
  10.                
  11. set (INC
  12.                 "inc/mod1.hpp"
  13. )
  14.  
  15.  
  16. add_library(mylib SHARED IMPORTED GLOBAL)
  17. set_target_properties(mylib PROPERTIES
  18.     IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/../../lib/mylib.so"
  19.     INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/../../lib/inc"
  20. )
  21.  
  22. add_executable (example1 ${SRC})
  23. target_include_directories(example1 PRIVATE "inc")
  24. target_include_directories(example1 PRIVATE "../common_inc")
  25. target_link_libraries(example1 mylib)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement