From: Hiromichi Watari Date: December 19 2011 11:08pm Subject: Re: Can't link custom library List-Archive: http://lists.mysql.com/internals/38406 Message-Id: <1324336099.2986.YahooMailNeo@web121506.mail.ne1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable =0A=0AHi Vladislav,=0AThank you for your reply.=0AMy method should have wor= ked but CXXFLAGS (including -lfoo) are put into c++ command line before tar= get object hence functions in foo didn't get picked up.=0AI am not very fam= iliar with cmake but obviously your approach is much better.=0AThanks,=0AHi= romichi=0A=0A=0A=0A----- Original Message -----=0AFrom: Vladislav Vaintroub= =0ATo: 'Hiromichi Watari' ; internals@stripped=0ACc: =0ASent: Monday, December 19, 2011 = 3:40 PM=0ASubject: RE: Can't link custom library=0A=0A=0A> -----Original Me= ssage-----=0A> From: Hiromichi Watari [mailto:hiromichiwatari@stripped]=0A= > Sent: Montag, 19. Dezember 2011 20:13=0A> To: internals@stripped= =0A> Subject: Can't link custom library=0A> =0A> =0A> =0A> Hi,=0A> =0A> I c= an't link my custom library with cmake (mysql 5.5), has anyone seen=0Athis = ?=0A> I ended up adding the library file into link.txt after cmake creates = it as=0Aa=0A> workaround.=0A=0AThis is very basic CMake. If you link foo to= something, add=0ATARGET_LINK_LIBRARY(something foo) to CMakeLists.txt=A0 a= fter "something" is=0Acreated.=0AFor statically built plugins it is done au= tomatically. Anything else needs=0ATARGET_LINK_LIBRARY. What is the purpose= of the linking your custom library=0A(and with what would you like to link= it?) =0A=0A> Thanks,=0A> Hiromichi=0A> =0A> ------------------------------= -----------------------------------------=0A> CXXFLAGS=3D"-L/my_lib_dir -lf= oo"=0A> export CXXFLAGS=0A> cmake .=0A> // modify link.txt as a workaround= =0A> make=0A> =0A> =0A> --=0A> MySQL Internals Mailing List=0A> For list ar= chives: http://lists.mysql.com/internals=0A> To unsubscribe:=A0 =A0 http://= lists.mysql.com/internals=0A=0A=0A=0A-- =0AMySQL Internals Mailing List=0AF= or list archives: http://lists.mysql.com/internals=0ATo unsubscribe:=A0 =A0= http://lists.mysql.com/internals