[CMake] INSTALL_NAME_DIR on MacOSX

James Bigler bigler at cs.utah.edu
Wed Oct 24 14:16:47 EDT 2007


So, I had a dynamic library with the following:

SET_TARGET_PROPERTIES(narfencode
   PROPERTIES BUILD_WITH_INSTALL_RPATH OFF
   INSTALL_NAME_DIR "@executable_path"
   )

When I compile it I get this:

/usr/bin/c++    -dynamiclib -headerpad_max_install_names  -o  
libnarfencode.dylib -install_name /Users/bigler/cibc/cpack_install/ 
opt/libnarfencode.dylib "CMakeFiles/narfencode.dir/encode.o"

Note that the -install_name is the local build directory.  This works  
well for when I run the binary out of the build directory, but if I  
run "make install" it doesn't relink the library with the *installed*  
-install_name.

I believe it should be relinking the library during installation to  
match where it will be after it's installed.

Note that if I set it to ON, it works for the installed version (and  
may not work for the build tree version).

James


More information about the CMake mailing list