I'm using a compiled library that I made, libexp.a
. (Was compiled with PIC so its good for this use case).
I want to use it statically in my shared library and I can do that via Mixing static libraries and shared libraries.
So now I'm trying to get that working with CMake
, my libexp.a
is in the root directory and I do:
find_library(EXP NAMES exp PATHS ${PROJECT_SOURCE_DIR} NO_DEFAULT_PATH)
Then using it in target_link_libraries
via ${EXP}
, but during link time I still get a linking error of couldn't find -lexp
. What is the right way to get this done? Using over 3.6