我有一个具有以下布局的项目:
/build /source +--- CMakeLists.txt | +--- /bin | +--CMakefiles.txt | +--main.cpp | +--- /jsoncpp | +--- /json | | +--json.h | | +--json-forwards.h | | | +--jsoncpp.cpp | +--CMakeLists.txt | +--- /jsonreader +-- jsonreader.cpp +-- jsonreader.h +-- CMakeLists.txt
在/source/CMakeLists.txt我有这行代码;
include_directories(jsoncpp jsonreader)
但是在build目录中运行’cmake -G“MSYS Makefile”../source’生成Makefile然后运行’make’会生成以下错误:
Scanning dependencies of target updater [ 33%] Building CXX object bin/CMakeFiles/updater.dir/main.cpp.obj In file included from k:/own-projects/updater-Project/withJsonCpp/source/bin/main.cpp:2:0: ../source/jsonreader/jsonreader.h:2:18: fatal error: json.h: No such file or directory compilation terminated. make[2]: *** [bin/CMakeFiles/updater.dir/main.cpp.obj] Error 1 make[1]: *** [bin/CMakeFiles/updater.dir/all] Error 2 make: *** [all] Error 2
我做错了什么,我该怎么解决这个问题?