INSTALL_NAME_DIR property does not support generator expressions
The INSTALL_NAME_DIR
property of targets should support generator expressions the same way INSTALL_RPATH
does since CMake 3.16. On top of that, I think it should also support the $<INSTALL_PREFIX>
pseudo generator expression, so that the install name can be set to ${CMAKE_INSTALL_PREFIX}/bin/whatever
, with ${CMAKE_INSTALL_PREFIX}
being evaluated at install time (with cmake -DCMAKE_INSTALL_PREFIX=/path/to/install -P cmake_install.cmake
) rather than at configure time.
Currently, the way to mimic this behavior is with the following hack:
set_property(TARGET tgt PROPERTY INSTALL_NAME_DIR "\${CMAKE_INSTALL_PREFIX}/lib")
Under this proposal, we would use the following instead:
set_property(TARGET tgt PROPERTY INSTALL_NAME_DIR "$<INSTALL_PREFIX>/lib")
Edited by Kyle Edwards