I am trying to link a shared object on my executable with an executable in my cmake project.
my CMakeLists.txt
cmake_minimum_required (VERSION 2.8)
project (proto_app)
add_executable( helloDemo hello.cpp )
add_executable( faissDemo 1-Flat.cpp )
My executable faissDemo
doesn't compile like this because the shared object is not linked. The shared object is located in /usr/local/lib/libfaiss.so
. My question is how should I link to the shared object in CMake?
I can compile 1-Flat.cpp
successfully from the command line like:
$ g++ 1-Flat.cpp -L /usr/local/lib/ -lfaiss