In my source code directory, I have a shared library file called libAlpha.so
. Then, in my CMakeLists.txt file, I have:
target_link_libraries(MyProgram Alpha)
However, this gives me the error:
usr/bin/ld: cannot find -lAlpha
If I rename the library file to Alpha.so
or lAlpha.so
, I get the same error. Similarly, if I instead use the line:
target_link_libraries(MyProgram libAlpha)
or:
target_link_libraries(MyProgram libAlpha.so)
Why can cmake not find this library, even though it is in the same directory as CMakeLists.txt?