View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001643CMakeCMakepublic2005-03-05 10:082008-02-06 15:29
ReporterDavid Somers 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001643: FIND_LIBRARY needs to distinguish between shared and static libraries
DescriptionAt present, FIND_LIBRARY has a preference for pickup up shared libraries over static libraries.

How about changing the signature from:

FIND_LIBRARY(<var> NAMES name1 [name2 ...] ....

to

FIND_LIBRARY(<var> SHARED name1 [name2 ...] ....
FIND_LIBRARY(<var> DYNAMIC name1 [name2 ...] ....

The old signature should still be supported (to maintain compatability) and should explicity default to SHARED mode.
TagsNo tags attached.
Attached Files

 Relationships
has duplicate 0006250closed find_library should support to search for static libs 

  Notes
(0004923)
Brad King (manager)
2006-09-15 14:13

Bug 0001644 is related to this bug. Now that it is fixed the results of fixing this bug will actually work.
(0008695)
Philip Lowman (developer)
2007-08-28 00:11

This was brought up on the mailing list, again.

There has to be a way to determine if a ".lib" file in Windows is shared or static. Even if there's not, VS could just be a noop when coming across the SHARED/STATIC keywords.
(0010404)
Brad King (manager)
2008-02-06 15:29

We cannot easily determine whether a library is static or shared on windows. I suspect in most cases people want to use this to create static binaries on UNIX anyway. Instead of trying to create a documented signature that makes people think the command can find STATIC libraries on all platforms, I've taken a simpler approach.

When searching for a library the command now tries the name given by the user as an explicit file name before trying prefixes and suffixes. One may now write

  find_library(MATH_LIBRARY NAMES libm.a)

and end up with something like "/usr/lib/libm.a". This solution should be sufficient because static library names are very predictable.

/cvsroot/CMake/CMake/Source/cmFindLibraryCommand.cxx,v <-- cmFindLibraryCommand.cxx
new revision: 1.56; previous revision: 1.55

 Issue History
Date Modified Username Field Change
2007-08-28 00:11 Philip Lowman Note Added: 0008695
2008-02-06 15:19 Brad King Relationship added has duplicate 0006250
2008-02-06 15:29 Brad King Status assigned => closed
2008-02-06 15:29 Brad King Note Added: 0010404
2008-02-06 15:29 Brad King Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team