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 -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -