CMake无法找到源文件,即使它位于正确的位置

时间:2019-04-05 16:39:22

标签: c++ qt cmake

我在easypaint中添加了一些镜像效果。在构建项目时,遇到了一个问题。当我在CMake中运行generate时(是的,我知道QMake会更好,但是我们必须使用CMake),它使CMakeLIsts.txt文件中始终出现错误,提示它找不到我的镜像cpp文件之一。我已将所有代码插入到项目中适当的文件和标题中,并且已将标题和cpp文件添加到CMake Lists文件中的适当位置。

CMake错误: “”“” CMakeLists.txt:129(add_executable)的CMake错误: 找不到源文件:   来源/效果/mirrorrighteffect.cpp

尝试扩展名.c .C .c ++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h ++ .hm   .hpp .hxx .in .txx

我再次检查了所有文件都在正确的目录中,所以我不知道问题出在哪里。

#------- headers --------
set (HEADERS
sources/mainwindow.h
sources/easypaintenums.h
sources/imagearea.h
sources/datasingleton.h
sources/additionaltools.h
sources/effects/abstracteffect.h
sources/effects/negativeeffect.h
sources/effects/grayeffect.h
sources/effects/binarizationeffect.h
sources/effects/customeffect.h
sources/effects/effectwithsettings.h
sources/effects/gammaeffect.h
sources/effects/mirrorrighteffect.h   <<<-----------My file
sources/effects/mirrordowneffect.h    <<<-----------My file
sources/effects/gaussianblureffect.h
sources/effects/sharpeneffect.h
sources/undocommand.h
sources/widgets/toolbar.h
sources/widgets/colorchooser.h
sources/widgets/palettebar.h
sources/widgets/palettebutton.h
sources/widgets/shortcutedit.h
sources/widgets/abstracteffectsettings.h
sources/widgets/customfiltersettings.h
sources/widgets/sharpenfiltersettings.h
sources/widgets/gaussianblurfiltersettings.h
sources/widgets/imagepreview.h
sources/dialogs/resizedialog.h
sources/dialogs/settingsdialog.h
sources/dialogs/textdialog.h
sources/dialogs/effectsettingsdialog.h
sources/instruments/abstractinstrument.h
sources/instruments/abstractselection.h
sources/instruments/selectioninstrument.h
sources/instruments/pencilinstrument.h
sources/instruments/lineinstrument.h
sources/instruments/eraserinstrument.h
sources/instruments/rectangleinstrument.h
sources/instruments/ellipseinstrument.h
sources/instruments/fillinstrument.h
sources/instruments/sprayinstrument.h
sources/instruments/magnifierinstrument.h
sources/instruments/colorpickerinstrument.h
sources/instruments/curvelineinstrument.h
sources/instruments/textinstrument.h)

#------- sources --------
set (SOURCES
sources/main.cpp
sources/mainwindow.cpp
sources/imagearea.cpp
sources/datasingleton.cpp
sources/additionaltools.cpp
sources/effects/abstracteffect.cpp
sources/effects/negativeeffect.cpp
sources/effects/grayeffect.cpp
sources/effects/binarizationeffect.cpp
sources/effects/effectwithsettings.cpp
sources/effects/gammaeffect.cpp
sources/effect/mirrorrighteffect.cpp   <<<-----------My file
sources/effect/mirrordowneffect.cpp    <<<-----------My file
sources/undocommand.cpp
sources/widgets/toolbar.cpp
sources/widgets/colorchooser.cpp
sources/widgets/palettebar.cpp
sources/widgets/palettebutton.cpp
sources/widgets/shortcutedit.cpp
sources/widgets/customfiltersettings.cpp
sources/widgets/sharpenfiltersettings.cpp
sources/widgets/gaussianblurfiltersettings.cpp
sources/widgets/imagepreview.cpp
sources/dialogs/resizedialog.cpp
sources/dialogs/settingsdialog.cpp
sources/dialogs/textdialog.cpp
sources/dialogs/effectsettingsdialog.cpp
sources/instruments/abstractinstrument.cpp
sources/instruments/abstractselection.cpp
sources/instruments/selectioninstrument.cpp
sources/instruments/pencilinstrument.cpp
sources/instruments/lineinstrument.cpp
sources/instruments/eraserinstrument.cpp
sources/instruments/rectangleinstrument.cpp
sources/instruments/ellipseinstrument.cpp
sources/instruments/fillinstrument.cpp
sources/instruments/sprayinstrument.cpp
sources/instruments/magnifierinstrument.cpp
sources/instruments/colorpickerinstrument.cpp
sources/instruments/curvelineinstrument.cpp
sources/instruments/textinstrument.cpp)

1 个答案:

答案 0 :(得分:0)

您似乎在sources/———>>>effect<<<——-/mirrorrighteffect.cpp中有一个错字。

我相信它必须改为sources/effects/mirrorrighteffect.cpp