1

I have a shared object called my-shared.so

I want to include it in my CMake build, without installing it, just linking the path. How can I do it?

Federico Taschin
  • 1,649
  • 3
  • 12
  • 21
  • 1
    Possible duplicate of [CMake link to external library](https://stackoverflow.com/questions/8774593/cmake-link-to-external-library) – Tsyvarev Dec 13 '18 at 16:32

1 Answers1

2

In your CMakeLists.txt import library by:

add_library(myProjct SHARED IMPORTED)
set_target_properties(myProjct PROPERTIES
      IMPORTED_LOCATION /some/path/mylib/my-shared.so
)
user45189
  • 169
  • 8