CMake: Please remove hardcoded INSTALL_NAME_DIR
Could you revert https://github.com/SOCI/soci/pull/30 please? INSTALL_NAME_DIR shouldn't be hardcoded, it prevents to create relocatable shared libs on macOS (@rpath as INSTALL_NAME_DIR, which is the default behavior of CMake since 3.0), and more generally to customize this value externally.
Sorry, I'm not fluent in CMake, so I'm not sure what needs to be done here. I suspect just reverting this wouldn't be the right thing to do, as we probably still want to do it for the non-Mac platforms?
INSTALL_NAME_DIR is irrelevant on non-Mac platforms: https://cmake.org/cmake/help/latest/prop_tgt/INSTALL_NAME_DIR.html
And the default behavior of CMake is to make shared libs on macOS rpath friendly (which means relocatables) like you have for free on other *nix platforms: https://cmake.org/cmake/help/latest/prop_tgt/MACOSX_RPATH.html
When this property is set to TRUE, the directory portion of the install_name field of this shared library will be
@rpathunless overridden by INSTALL_NAME_DIR. This indicates the shared library is to be found at runtime using runtime paths (rpaths).
@vadz I think this can probably be closed
Sorry, why? I.e. I'd be glad to close it, but it would be nice to at least have some explanation for doing it...
Oops. I only saw the linked, merged PR and figured this was the fix. Looking at the PR now though, this is wrong. Sorry for the ping :see_no_evil: