我试图使用CMake来调试我正在处理的JUCE失真项目,但是我无法让CMakeLists.txt文件找到头文件JuceHeader.h
,这样它就可以构建和调试项目。
下面是文件结构的样子:
distort (CMakeLists located here)
|
|_______Source
| |
| |________PluginEditor.cpp and .h, PluginProcessor.cpp and .h
|
|_______JuceLibraryCode
|
|________JuceHeader.h (and more)
以及整个txt文件:
cmake_minimum_required(VERSION 3.0.0)
project(Distort VERSION 0.1.0)
include(CTest)
enable_testing()
set(HEADER_FILES /home/wolf/vst/distort/JuceLibraryCode)
set(SOURCES Source/PluginProcessor.cpp Source/PluginEditor.cpp ${HEADER_FILES}/JuceHeader.h)
add_executable(Distort ${SOURCES})
target_include_directories(Distort PRIVATE home/wolf/vst/distort/JuceLibraryCode/)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
它错误地说它找不到JuceHeader.h
最后,错误输出:
[build] /home/wolf/vst/distort/Source/PluginProcessor.h:11:10: fatal error: 'JuceHeader.h' file not found
[build] #include <JuceHeader.h>
[build] ^~~~~~~~~~~~~~
[build] In file included from /home/wolf/vst/distort/Source/PluginEditor.cpp:9:
[build] /home/wolf/vst/distort/Source/PluginProcessor.h:11:10: fatal error: 'JuceHeader.h' file not found
[build] #include <JuceHeader.h>
如有任何帮助,将不胜感激!)
发布于 2022-08-13 17:58:34
我认为home/wolf/vst/distort/JuceLibraryCode/
应该是一条绝对路径,但相对路径是给出的。但绝对的道路不是解决办法。
target_include_directories(Distort PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/JuceLibraryCode)
或者就像咆哮
target_include_directories(Distort PRIVATE JuceLibraryCode)
https://stackoverflow.com/questions/73346507
复制相似问题