Notes |
|
(0004393)
|
Marc Espie
|
2006-07-03 08:59
|
|
I've since found about ::Glob, and I'm using it.
The following patch lets cmake find OpenBSD shared
libs, provided CMAKE_OPENBSD_SHARED_LIBS is set to TRUE. |
|
|
(0008434)
|
Alex Neundorf
|
2007-08-13 15:22
|
|
What about the patch ?
Instead if testing the variable CMAKE_OPENBSD_SHARED_LIBS, the CMAKE_SYSTEM_NAME variable could be tested for "OpenBSD" ?
Oh, there may be more issues, like e.g. the link directory ordering.
Alex |
|
|
(0008435)
|
Brad King
|
2007-08-13 15:42
|
|
The patch needs a little tweaking but looks okay at a quick glance. I don't have time to integrate it now. Also until we have a volunteer to run an OpenBSD nightly dashboard we cannot claim full support anyway.
We should not test the platform name. This is a platform feature, so the platform file should configure a global property to indicate this kind of naming is used.
Fixing library directory ordering will require a change to cmOrderLinkDirectories::LibraryInDirectory which tests whether a given library might be found by the linker in a given directory. |
|
|
(0013509)
|
Hannah Schroeter
|
2008-09-18 10:26
|
|
This issue also affects me, with cmake 2.6.1 (locally compiled) on OpenBSD 4.4. This hinders me from running boost based tests, as the boost test library behaves differently, causing linking to *fail*, when one links the static library instead of the dynamic one.
By the way, I've been told that even on Linux, not *all* packages do provide foo.so -> foo.so.x (or foo.so.x.y) symlinks, at least I've been told by co-workers who run Linux that this issue isn't completely unknown to them.
If one could use target_link_libraries to "-L... -l..." I could work around the issue for this time, at least, but that fails too (cmake creates a dependency on -L...\ -l..., from whence ever it's got the backslash). |
|
|
(0013510)
|
Brad King
|
2008-09-18 10:36
|
|
In CMake 2.6 you can always link to the exact file you want by passing the full path to it. The problem here is finding the shared library.
You can achieve "-L... -l..." by using the link_directories command and passing just the library name to target_link_libraries. |
|
|
(0013511)
|
Hannah Schroeter
|
2008-09-18 10:43
|
|
Ok.
A more difficult issue is this, though:
On OpenBSD the mysql client libraries are installed like this:
In /usr/local/lib/mysql are the libraries proper, libfoo.a and libfoo.so.x.y
In /usr/local/lib are links, but only libfoo.so.x.y -> mysql/libfoo.so.x.y. *No* links for libfoo.a. So how do I "find" the path /usr/local/lib (i.e. I want to configure it to use /usr/local/lib as directory and foo as name)? I'd have to "find" that a file libfoo.so.* exists in /usr/local/lib to identify that as the right directory to use for link_directories. |
|
|
(0013538)
|
Brad King
|
2008-09-22 10:09
|
|
I've created (but not yet committed) a new implementation of find_library that uses the directory-listing/name-matching approach to find libraries. It builds a regular expression that matches library names with the same combinations of prefixes and suffixes previously enumerated explicitly. Among the files matching the regular expression, the one that would have appeared earliest in the old enumeration order is chosen. This reproduces the old find-library behavior.
Now I need to support the versioning for OpenBSD's naming convention. I can do this by adding the version components to the regular expression for that platform. However, I'd like to make sure that CMake will find the library that would be found by the linker. Can anyone point me to documentation of how ld compares version numbers and chooses a library? Is it just a component-wise integer comparison? |
|
|
(0013541)
|
Brad King
|
2008-09-22 10:15
|
|
|
|
(0013542)
|
Brad King
|
2008-09-22 11:00
|
|
I've committed the find_library refactoring mentioned above:
/cvsroot/CMake/CMake/Source/cmFindLibraryCommand.cxx,v <-- Source/cmFindLibraryCommand.cxx
new revision: 1.61; previous revision: 1.60 |
|
|
(0013543)
|
Brad King
|
2008-09-22 11:10
|
|
I've committed changes that teach find_library to find OpenBSD-style shared libs:
/cvsroot/CMake/CMake/Modules/Platform/OpenBSD.cmake,v <-- Modules/Platform/OpenBSD.cmake
new revision: 1.7; previous revision: 1.6
/cvsroot/CMake/CMake/Source/cmFindLibraryCommand.cxx,v <-- Source/cmFindLibraryCommand.cxx
new revision: 1.62; previous revision: 1.61
/cvsroot/CMake/CMake/Source/cmake.cxx,v <-- Source/cmake.cxx
new revision: 1.396; previous revision: 1.395
I'm assuming the obvious component-wise integer version test is correct because the originally submitted patch uses it. If not, someone may re-open this bug. |
|