[Cmake] Possible bug when linking library into exe of same name
Parag Chandra
pchandra@radonc.unc.edu
Fri, 14 Feb 2003 10:31:28 -0500
This is a multi-part message in MIME format.
------=_NextPart_000_002E_01C2D414.3B90E060
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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
------=_NextPart_000_002E_01C2D414.3B90E060
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1141" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hey all,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I have the following two statements in =
one of my=20
CMakeLists files:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>LINK_LIBRARIES (elec_dose <other=20
libraries>)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>ADD_EXECUTABLE (elec_dose <source=20
files>)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>so there is a library named elec_dose =
that I am=20
trying to link into my application which is also named elec_dose. During =
the=20
link phase, I get errors about undefined symbols because apparently =
CMake is not=20
giving the appropriate -lelec_dose flag to the linker. I tried changing =
the=20
syntax to use the TARGET_LINK_LIBRARIES command, but still I get the =
same=20
problem, so the only way around it is to change the name of either the =
app or=20
the library. That's not really an option for me though, because the code =
isn't=20
mine to change; I'm just trying to automate the build process with=20
CMake. This occurs with v1.2, v1.4, and v1.6 of CMake, =
so unless=20
it's been very recently fixed in CVS, it seems like it might be a bug. =
Can=20
anyone else replicate this?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Best regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Parag =
Chandra</FONT></DIV></BODY></HTML>
------=_NextPart_000_002E_01C2D414.3B90E060--