[CMake] LINK_LIBRARIES() does not respect SUFFIX/PREFIX
Kishore, Jonnalagadda (IE10)
Kishore.Jonnalagadda at honeywell.com
Tue Mar 20 15:05:10 EST 2007
> -----Original Message-----
> From: cmake-bounces+kishore.jonnalagadda=honeywell.com at cmake.org
> [mailto:cmake-bounces+kishore.jonnalagadda=honeywell.com at cmake.org] On
> Behalf Of Kishore, Jonnalagadda (IE10)
> Sent: Wednesday, March 21, 2007 1:28 AM
> To: cmake at cmake.org
> Subject: [CMake] LINK_LIBRARIES() does not respect SUFFIX/PREFIX
>
> My setup:
>
> Project/CMakeLists.txt:
>
> ADD_SUBDIRECTORY(dir)
> LINK_LIBRARIES(mylib)
>
> ADD_EXECUTABLE(myexec main.c)
>
> Project/dir/CMakeLists.txt:
>
> ADD_LIBRARY(mylib lib.c)
>
> SET_TARGET_PROPERTIES(mylib
> PROPERTIES
> PREFIX lib
> SUFFIX .a)
>
> Now while building myexec I get a link error "cannot find
> -llibmylib.a.lib". When I do not explicitly set the prefix and suffix,
I
> still get the error "cannot find -lmylib.lib". It links fine if I go
and
> rename the library file in the build directory.
>
> How do I solve this problem? Why is the .lib being appended in the
call
> to the linker?
Forgot to mention. I did try using TARGET_LINK_LIBRARIES() instead of
LINK_LIBRARIES() to the same effect.
Warm regards,
Kishore
More information about the CMake
mailing list