title: get_filename_component unknown component DIRECTORY
body: <h1>Problem description</h1>
  <p>I am having a problem with the following <code>CmakeList.txt</code> file.</p>
  <ul>
  <li><strong>Source code directory:</strong> <code>/home/hani/entitylinking</code></li>
  <li><strong>Header files :</strong> <code>/entitylinking/3rdparty/include/entlk</code></li>
  <li><strong>Target installation directory :</strong> <code>/home/hani/ENTLK_DIST</code></li>
  </ul>
  <p>I added the <code>message(STATUS &quot;_file:&quot; ${_file} )</code> as proposed in the following <a href="https://stackoverflow.com/questions/31900252/cmake-get-filename-component-unknown-component-directory">answer</a> to check where the files are located. And I don't get what is the error.</p>
  <p>I am actually also working on a server. not on my machine.</p>
  <hr />
  <h1>CMakeLists.txt</h1>
  <pre><code>file(GLOB_RECURSE _files RELATIVE ${Entlk_SOURCE_DIR}/3rdparty/include/ *.h)
  # TODO if needed, let append a list of *.hpp files. A solution may be to replace by
  # file(GLOB_RECURSE _files RELATIVE ${Entlk_SOURCE_DIR}/3rdparty/include/ *.h??)
  
  foreach (_file ${_files})
    # get the real file instead of the symbolic link
    message(STATUS &quot;_file:&quot; ${_file} )
  
    get_filename_component(_resolvedFile &quot;${_file}&quot; REALPATH)
  
    # get the relative path to install
    get_filename_component(dir &quot;${_file}&quot; DIRECTORY)
  
    message(STATUS &quot;_resolvedFile:&quot; ${_resolvedFile} )
  
    install(FILES ${_resolvedFile} DESTINATION include/${dir})
  endforeach()
  </code></pre>
  <hr />
  <h1>Messages</h1>
  <p>The messages that I am getting are the following</p>
  <pre><code>-- _resolvedFile:/home/hani/entitylinking/3rdparty/sqlite3/sqlite_modern_cpp/utility/function_traits.h
  -- _file:entlk/3rdparty/simstring/memory_mapped_file.h
  CMake Error at 3rdparty/include/CMakeLists.txt:12 (get_filename_component):
    get_filename_component unknown component DIRECTORY
  
  
  -- _resolvedFile:/home/hani/entitylinking/3rdparty/include/entlk/3rdparty/simstring/memory_mapped_file.h
  -- _file:entlk/3rdparty/simstring/measure.h
  CMake Error at 3rdparty/include/CMakeLists.txt:12 (get_filename_component):
    get_filename_component unknown component DIRECTORY
  </code></pre>