[cmake-developers] [CMake 0012954]: cmake does not properly detect shared libraries on OpenBSD 5.0

Mantis Bug Tracker mantis at public.kitware.com
Fri Feb 10 19:44:11 EST 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=12954 
====================================================================== 
Reported By:                Eric Anderson
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12954
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-02-10 19:44 EST
Last Modified:              2012-02-10 19:44 EST
====================================================================== 
Summary:                    cmake does not properly detect shared libraries on
OpenBSD 5.0
Description: 
cmake does not properly detect shared libraries on OpenBSD 5.0.

Shared libraries on that platform always end in .so.#.#

When detecting shared libraries, cmake only considers files that end in .so

Therefore in cmComputeLinkInformation::AddLibraryRuntimeInfo, libraries will not
be considered for adding rpath information.

Simplest fix is to put:

    LIST(APPEND CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES .so.[0-9]+.[0-9]+)

Into some module, e.g. OpenBSD.cmake; there may be a better fix.  I also tried
CMAKE_SHARED_LIBRARY_SUFFIX, but that caused shared libraries to not build.


Steps to Reproduce: 
Put a required shared library in a non-standard path.

Setup cmake to include the rpath in the build tree:

SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 

Add a target that depends on that non-standard path

Build the target

Run ldd on the built executable (or try to execute it), it will fail to link to
the special path.

Note that if you set CMAKE_INSTALL_RPATH to include the non-standard path, the
installed binary will work fine.

      


====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-02-10 19:44 Eric Anderson  New Issue                                    
======================================================================




More information about the cmake-developers mailing list