4
头文件我有只有一个衬垫 include(startevn.cmake)
在startevn.cmake我有一个CMakeList.txt文件,包括cmake的
project(startevn)
set(headers
startup.h
)
set(sources
system-init.cpp
)
new_library(startevn ${sources} ${headers})
现在我必须启动移动到不同的目录中。 startup.h:这样做,我添加 以下行“startevn.cmake”,
include_directories("/new_folder_location/sub_folder")
其中sub_folder就是startup.h现在位于但是编译器仍然说 找不到源文件之后。 我在做什么错?
你真的意味着 “/ new_folder_location/sub_folder”?这是一条绝对的道路。要给出相对路径,请删除前导“/”。 – Fraser
是的,这是一条绝对路径。 – user1566277
应该工作。您是否尝试过运行'make VERBOSE = 1'来查看实际的编译器命令?你应该在里面有'-I/new_folder_location/sub_folder'这样的东西。 – Fraser