簡體   English   中英

由CMake生成的Xcode項目不是show header file

[英]Xcode project that was generated by CMake is not show header file

我用CMake構建我的C ++項目。 我想使用Xcode作為編輯器,所以,我運行此命令。

cmake . -GXcode

BTW,我的C ++項目標題和源文件位於不同的文件夾中。

我的項目目錄樹:

project_root
└CMakeLists.txt
└src
   └CMakeLists.txt
   └main.cpp
└include
   └xxx1.hpp
   └inner
      └in_xxx1.hpp 

所以我像這樣設置src / CMakeLists.txt:

include_directories (
   ${CMAKE_SOURCE_DIR}/include
)
add_executable( "runrun" main.cpp )

在Xcode中,只顯示main.cpp文件。

在此輸入圖像描述

我想在Xcode中看到頭文件。

我該怎么辦?

要讓CMake還將頭文件放入您的XCode項目,您只需將相應的頭文件添加到源中。

在你的情況,你也應該補充xxx1.hppinner/in_xxx1.hpp作為參數add_executables 到目前為止,我還沒有看到任何不利之處。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM