get_filename_component未知组件DIRECTORY

时间:2016-04-04 13:02:11

标签: c++ linux cmake

问题描述

我遇到以下CmakeList.txt文件的问题。

  • 源代码目录: /home/hani/entitylinking
  • 标题文件: /entitylinking/3rdparty/include/entlk
  • 目标安装目录: /home/hani/ENTLK_DIST

我添加了以下answer中建议的message(STATUS "_file:" ${_file} )来检查文件的位置。我不知道错误是什么。

我实际上也在服务器上工作。不在我的机器上

的CMakeLists.txt

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 "_file:" ${_file} )

  get_filename_component(_resolvedFile "${_file}" REALPATH)

  # get the relative path to install
  get_filename_component(dir "${_file}" DIRECTORY)

  message(STATUS "_resolvedFile:" ${_resolvedFile} )

  install(FILES ${_resolvedFile} DESTINATION include/${dir})
endforeach()

消息

我收到的消息如下

-- _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

0 个答案:

没有答案