我有一个CMakeList.txt文件,它include(startevn.cmake)
在startevn.cmake中只有一个
线程,我有,
project(startevn)
set(headers
startup.h
)
set(sources
system-init.cpp
)
new_library(startevn ${sources} ${headers})
Run Code Online (Sandbox Code Playgroud)
现在我必须将启动移动到另一个目录.在这之后我将以下行添加到"startevn.cmake",
include_directories("/new_folder_location/sub_folder")
Run Code Online (Sandbox Code Playgroud)
其中sub_folder是startup.h现在所在的位置,但编译器仍然说无法找到源文件:startup.h.我究竟做错了什么?
导致之前的代码:
\n\nnew_library(startevn ${sources} ${headers})
它确实告诉了图书馆的位置,
\n\n但之后,你的include_directories()也许就不是了。
尝试\xef\xbc\x9a
\n\nset(INCLUDE_DIR /new_folder_location/sub_folder)\ninclude_directories (${INCLUDE_DIR}) # make sure your .h all inside.\nRun Code Online (Sandbox Code Playgroud)\n\n(或者需要先使用cmake的find_library()来检查是否正确找到。)
\n| 归档时间: |
|
| 查看次数: |
22080 次 |
| 最近记录: |