[CMake] How to set Install_name on OS X

Mike Jackson mike.jackson at imts.us
Wed Oct 11 10:51:59 EDT 2006


Cmake 2.4.3
Unix Make files


On 10/11/06 9:38 AM, "David Cole" <david.cole at kitware.com> wrote:

> Are you using CMake 2.4.3?
> Xcode or Unix Makefiles generator?
> 
> Mike Jackson wrote:
> 
>> 
>> On 10/10/06 4:56 PM, "Brad King" <brad.king at kitware.com> wrote:
>> 
>>  
>> 
>>> Mike Jackson wrote:
>>>    
>>> 
>>>> On 10/10/06 4:08 PM, "Brad King" <brad.king at kitware.com> wrote:
>>>>      
>>>> 
>>>>> cmake --help-command SET_TARGET_PROPERTIES
>>>>>        
>>>>> 
>>>> OK.. Reading all the output from that command there seems to be some
>>>> mutually exclusive settings. Also, the output has settings like
>>>> INSTALL_NAME_DIR, should those be CMAKE_INSTALL_NAME_DIR instead?
>>>> 
>>>> I tried the following in my Cmake file and it just is not working.
>>>> 
>>>> # ------- Create a Shared Library ---------------------------------
>>>> ADD_LIBRARY(DislocationIO SHARED ${SOURCES} )
>>>> 
>>>> #---------- Link the Library  ---------------------------------
>>>> TARGET_LINK_LIBRARIES(DislocationIO
>>>>  ${vtkLocal_LIBS}
>>>> )
>>>> SET_TARGET_PROPERTIES (DislocationIO
>>>> PROPERTIES BUILD_WITH_INSTALL_RPATH ON
>>>>           CMAKE_INSTALL_NAME_DIR "@executable_path/../PlugIns"
>>>>           )
>>>> 
>>>> I don't mean to be difficult, but could you lend me a bit more help? I have
>>>> tried a few different versions of the above all with out success.
>>>>      
>>>> 
>>> The property is called INSTALL_NAME_DIR.  The variable
>>> CMAKE_INSTALL_NAME_DIR is used to initialize the value of the property
>>> on the ADD_LIBRARY line.  Try this:
>>> 
>>> SET_TARGET_PROPERTIES (DislocationIO
>>>  PROPERTIES BUILD_WITH_INSTALL_RPATH 1
>>>             INSTALL_NAME_DIR "@executable_path/../PlugIns"
>>>  )
>>> 
>>> If you leave off the BUILD_WITH_INSTALL_RPATH property then it will not
>>> be built with this install_name but when you run "make install" the
>>> installed copy of the library will get the proper value.
>>> 
>>> -Brad
>>>    
>>> 
>> 
>> Nope, that didn't work either. I tried "installing" DislocationIO to see if
>> it would relink but that didn't work either...
>> 
>>  
>> 

-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services






More information about the CMake mailing list