[Cmake] Possible bug when linking library into exe of same name

Parag Chandra pchandra at radonc.unc.edu
Fri Feb 14 10:31:28 EST 2003


Hey all,

I have the following two statements in one of my CMakeLists files:

LINK_LIBRARIES (elec_dose <other libraries>)
ADD_EXECUTABLE (elec_dose <source files>)

so there is a library named elec_dose that I am trying to link into my application which is also named elec_dose. During the link phase, I get errors about undefined symbols because apparently CMake is not giving the appropriate -lelec_dose flag to the linker. I tried changing the syntax to use the TARGET_LINK_LIBRARIES command, but still I get the same problem, so the only way around it is to change the name of either the app or the library. That's not really an option for me though, because the code isn't mine to change; I'm just trying to automate the build process with CMake. This occurs with v1.2,  v1.4, and v1.6 of CMake, so unless it's been very recently fixed in CVS, it seems like it might be a bug. Can anyone else replicate this?

Best regards,
Parag Chandra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20030214/4403445f/attachment.html>


More information about the CMake mailing list