[cmake-developers] [CMake 0015868]: Property INSTALL_NAME_DIR is completely ignored

Mantis Bug Tracker mantis at public.kitware.com
Mon Nov 30 22:58:57 EST 2015


The following issue has been SUBMITTED. 
====================================================================== 
https://cmake.org/Bug/view.php?id=15868 
====================================================================== 
Reported By:                Lucas Christian
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15868
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-11-30 22:58 EST
Last Modified:              2015-11-30 22:58 EST
====================================================================== 
Summary:                    Property INSTALL_NAME_DIR is completely ignored
Description: 
CMake ignores the INSTALL_NAME_DIR property unless the following properties are
set:
- BUILD_WITH_INSTALL_RPATH is TRUE
- SKIP_RPATH is FALSE
- SKIP_INSTALL_RPATH is FALSE

In some cases, users may wish to use INSTALL_NAME_DIR without having any
intention of using any path-related features.  For example, I may want my
executables to link to libraries encoding the absolute path "/usr/local/lib" in
the executable for each library.  This has nothing to do with rpath.

In both the build tree and install destination, the emitted library name is
"@rpath/mylib.dylib" despite explicitly setting INSTALL_NAME_DIR otherwise. 
Enabling BUILD_WITH_INSTALL_RPATH does cause the correct path to be emitted, but
this requirement is not obvious, and likely unintentional.

Steps to Reproduce: 
Produce a simple CMake file that builds an executable against a shared library. 
Set these to install into /usr/local root.

Include set(CMAKE_INSTALL_NAME_DIR "/usr/local/lib")

Additional Information: 
Cursory examination of the CMake source code suggests this issue may be rooted
in "cmGeneratorTarget.cxx", likely the code for generating install_path is
getting short-circuited by some additional checks on the rpath* properties.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-11-30 22:58 Lucas ChristianNew Issue                                    
======================================================================



More information about the cmake-developers mailing list