【发布时间】:2011-12-15 17:14:39
【问题描述】:
我正在尝试向使用 CMake 开发的大型 C++ 项目添加一些内容。在我要添加的部分,我想使用 Magick++。
如果我只是编译我的小示例程序
#include <Magick++.h>
int main()
{
Magick::Image image;
return 0;
}
与
g++ -o example example.cxx
它失败了,因为它没有找到“Magick++.h”。
如果我正在使用
g++ -I /usr/include/ImageMagick -o example example.cxx
我收到“未定义的引用”错误。
如果我按照http://www.imagemagick.org/script/magick++.php 上的说明进行编译使用
g++ `Magick++-config --cxxflags --cppflags` -o example example.cxx `Magick++-config --ldflags --libs`
它有效。
现在: 如何将其合并到使用 CMake 的较大项目中?如何更改 CMakeLists.txt?
【问题讨论】:
标签: c++ imagemagick cmake