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:

  1. use ${cmake_install_prefix} destination value. correctly resolved path, in case of install(export), paths in generated target.cmake absolute, makes package not relocatable.
  2. use . destination. @ least generates relative paths inside target.cmake, paths incorrect. . apparently considered regular folder, , in process of target.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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -