[CMake] Best way to handle application data path for local run vs. installation

Ruslan Baratov ruslan_baratov at yahoo.com
Thu Dec 3 05:50:12 EST 2015


On 03-Dec-15 16:59, Johannes Zarl-Zierl wrote:
>>> I.e. it could be replaced with a string of the same length or a
>>> shorter one, but not a longer one.
>>>
>>> CMake works around this by extending the build RPATH artificially with
>>> ":" at the end I think, patchelf works around this by making the whole
>>> executable one page bigger if the new entry is longer.
>> Just an implementation notes, doesn't change the fact that it can be
>> done and it's designed to be modifiable.
> This is only nitpicking about a side-topic, but: Just because it can be done
> does not mean that it was designed for that purpose.
If it succeed it doesn't break the things. And for every C++ string 
changing trick can be created counter-example (yes, synthetic, but 
anyway) that violates logic or even crash an application. At least in 
the form how I see it will be implemented.

> You argument is like saying that a wrench was designed to be used as a hammer
> (after all, you can hit a nail with it).
I've never seen manual to the wrench but if one exists I doubt there is 
a section "how to hit a nail with wrench". But I see chrpath tool on 
Linux and install_name_tool on OSX.

Will you be okay if I change "designed" to "can be done correctly"?

Ruslo


More information about the CMake mailing list