cmake - Can parameter DESTINATION for INSTALL be empty? -
in general, relative parameters of type path
, "lib" or "source/include" resolved in cmake absolute path using current value of variables, instance: ${cmake_install_prefix}
in case of command install
. this, however, not work if use empty relative path (or not set @ all), resulting absolute path equal ${cmake_install_prefix}
- cmake generator complain non existing destination
, although there no reason why couldn't resolved.
i know 2 workarounds issue, both have flaws prevent me achieving goal:
- use
${cmake_install_prefix}
destination
value. correctly resolved path, in case ofinstall(export)
, paths in generatedtarget.cmake
absolute, makes package not relocatable. use
.
destination
. @ least generates relative paths insidetarget.cmake
, paths incorrect..
apparently considered regular folder, , in process oftarget.cmake
generation, when_import_prefix
determined, cmake strips 1 folder component much:# compute installation prefix relative file. get_filename_component(_import_prefix "${cmake_current_list_file}" path) get_filename_component(_import_prefix "${_import_prefix}" path)
is there other workaround? think lack of empty relative paths considered bug?
Comments
Post a Comment