[CMake] TARGET_LINK_LIBRARIES debug and optimized

Filipe Sousa filipe at ipb.pt
Fri Jul 15 13:29:51 EDT 2005


On Tuesday 05 July 2005 14:01, Ken Martin wrote:
> > Ok, the problem is in cmLocalGenerator::OutputLinkLibraries:
> >
> > if(buildType == "DEBUG")
> >     {
> >     cmakeBuildType = cmTarget::DEBUG;
> >     }
> > if(buildType.size())
> >     {
> >     cmakeBuildType = cmTarget::OPTIMIZED;
> >     }
> >
> > Shouldn't that be
> >
> > if(buildType == "DEBUG")
> >     {
> >     cmakeBuildType = cmTarget::DEBUG;
> >     }
> > else if(buildType.size())
> >     {
> >     cmakeBuildType = cmTarget::OPTIMIZED;
> >     }
> >
> > or
> >
> >
> > if(buildType == "DEBUG")
> >     {
> >     cmakeBuildType = cmTarget::DEBUG;
> >     }
> > else
> >     {
> >     cmakeBuildType = cmTarget::OPTIMIZED;
> >     }
>
> It should be the first case. If nothing is specified then it is GENERAL,
> one lib for any build type. I have checked in the fix.  Good eye Filipe.
>
> Thanks
> Ken

If I call TARGET_LINK_LIBRARIES(dr debug mylib_debug optimized mylib) and 
CMAKE_BUILD_TYPE isn't set then none of the libraries are used:

src/dr: src/dr.dir/build.make
	@echo "Linking CXX executable src/dr"
	c++  -fPIC  $(dr_OBJECTS) $(dr_EXTERNAL_OBJECTS)  -o src/dr -rdynamic 
-L/home/fsousa/tmp/dr/build/libs -Wl,-rpath,/home/fsousa/tmp/dr/build/libs 

Maybe one them should be used as default or add another keyword to 
TARGET_LINK_LIBRARIES or there is another way?

-- 
Filipe Sousa
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20050715/c5658fb9/attachment.pgp


More information about the CMake mailing list