On Ubuntu, I downloaded the third-party shared library mylibrary.so , which I placed in the /home/karnivaurus/Libraries directory. I also placed the associated header file myheader.h in the directory /home/karnivaurus/Headers . Now I want to link this library with my C ++ code using cmake. Here is my CMakeLists.txt file:
cmake_minimum_required(VERSION 2.0.0) project(DemoProject) include_directories(/home/karnivaurus/Headers) add_executable(demo demo.cpp) target_link_libraries(demo /home/karnivaurus/Libraries/mylibrary)
However, this gives me an error message:
:-1: error: No rule to make target `/home/karnivaurus/Libraries/mylibrary', needed by `demo'. Stop.
What's happening?
source share