On Monday, November 30, 2015 16:13:03 Ruslan Baratov via CMake wrote: > On 30-Nov-15 09:10, Dmitry Marakasov wrote: > > Hi! > > ... > > The best solution would be for cmake to fix path in executable file > > right after installation, something similar to what cmake does with > > rpaths. > > I doubt there is a general way to patch data section with string in > executable. At least with different size and in safe manner. For example > Clang is smart enough to figure out 'strlen' of literal string at > compile time, so changing string affects logic and hence is dangerous. > And rpaths unlike data is designed to be modifiable
Not really. CMake has extra code to make sure the build rpath is as long as the install rpath will be, so it can be patched in later. > (e.g. see > install_name_tool for OS X) so it's okay to hack it back and forth. > > Second thought is that when you hardcode path in executable you make it > non-relocatable. E.g. on Linux $ORIGIN could be used in the RPATH. Alex
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake