You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This leads to a hardcoded path in installed shared lib, which shouldn't be the default behavior for sure. Default CMake behavior is to install relocatable runtimes on macOS with @rpath/<libname>, if https://cmake.org/cmake/help/v3.0/policy/CMP0042.html is NEW (which is the case in openjpeg CMakeLists, this is why it's very surprising to see this hardcoded INSTALL_NAME).
I would expect this after running otool -l libopenjp2.2.4.0.dylib (relevant part in this output is name @rpath/libopenjp2.7.dylib (offset 24)):
But currently, I get this in relevant part which makes the shared lib non-relocatable:
Load command 3
cmd LC_ID_DYLIB
cmdsize 152
name /Users/spaceim/.conan/data/openjpeg/2.3.1/_/_/package/bda713dd3b257827c8d11a06ac9d824038871572/lib/libopenjp2.7.dylib (offset 24)
time stamp 1 Thu Jan 1 01:00:01 1970
current version 2.3.1
compatibility version 7.0.0
This absolute path should just be @rpath/libopenjp2.7.dylib on macOS.
If openjpeg really wants to hardcode a path in shared lib of the install tree on macOS, at least it would be nice to provide an option to generate relocatable binaries.
But honestly, INSTALL_NAME_DIR shouldn't be hardcoded in a CMakeLists, it should be injected externally with CMAKE_INSTALL_NAME_DIR.
The text was updated successfully, but these errors were encountered:
openjpeg
CMakeLists unconditionally (and surprisingly) changesINSTALL_NAME_DIR
property ofopenjp2
target if Apple:openjpeg/CMakeLists.txt
Line 159 in a5c95cf
This leads to a hardcoded path in installed shared lib, which shouldn't be the default behavior for sure. Default CMake behavior is to install relocatable runtimes on macOS with
@rpath/<libname>
, if https://cmake.org/cmake/help/v3.0/policy/CMP0042.html is NEW (which is the case in openjpeg CMakeLists, this is why it's very surprising to see this hardcodedINSTALL_NAME
).I would expect this after running
otool -l libopenjp2.2.4.0.dylib
(relevant part in this output isname @rpath/libopenjp2.7.dylib (offset 24)
):But currently, I get this in relevant part which makes the shared lib non-relocatable:
This absolute path should just be
@rpath/libopenjp2.7.dylib
on macOS.If openjpeg really wants to hardcode a path in shared lib of the install tree on macOS, at least it would be nice to provide an option to generate relocatable binaries.
But honestly,
INSTALL_NAME_DIR
shouldn't be hardcoded in a CMakeLists, it should be injected externally withCMAKE_INSTALL_NAME_DIR
.The text was updated successfully, but these errors were encountered: