Mac平台编译mupdf-qt的开源项目
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mac平台编译mupdf-qt的开源项目相关的知识,希望对你有一定的参考价值。
How to compile mupdf-qt
Compile on Linux
Install tools and thirdparty libraries
You should install some tools and thirdparty libraries. For Ubuntu users, you can use the following command(similar for other Linux users):
sudo apt-get install build-essential pkg-config cmake qtbase5-dev qt5-default libfreetype6-dev
Clone source code
git clone https://github.com/xiangxw/mupdf-qt.git //克隆该版本到本地
cd mupdf-qt //进入该目录
git submodule update --init --recursive //把mupdf和一些第三方库都给克隆下来 方便编译
Compile MuPDF Source
cd mupdf //首先进入该目录
make //进行make
Compile mupdf-qt
cd ..
mkdir build
cd build
cmake .. //该步骤在mac下面可能会出现错误记得要设置cmake的CMAKE_PREFIX_PATH环境变量
//例如export CMAKE_PREFIX_PATH=/Users/username/Qt-SDK-ALL/Qt5.5/5.5/clang_64/
make
Compile on Window with Visual Studio
Clone source code
git clone https://github.com/xiangxw/mupdf-qt.git
cd mupdf-qt
git submodule update --init --recursive
Compile MuPDF Source
Go to platforms/win32, open mupdf.sln and build.
Qt5
Install Qt5 and add path of qmake.exe to PATH
Compile mupdf-qt
Launch CMake(gui version), set source code directory and build directory. Configure and generate mupdf-qt.sln. Open mupdf-qt.sln and build it.
Compile on Window with MSYS MinGW
Clone source code
git clone https://github.com/xiangxw/mupdf-qt.git
cd mupdf-qt
git submodule update --init --recursive
Installing MSYS/MinGW
Install MSYS and MinGW (http://www.mingw.org/wiki/Getting_Started). Using the Graphical User Interface Installer, mingw-get-setup.exe, is recommended. During installation, “checking/ticking” the following in “Basic Setup” is recommended:
- mingw32-base
- mingw32-gcc-g++
- msys-base
- mingw-developer-toolkit
Add C:\MinGW\bin;
to your PATH system variables (at the beginning).
Compile MuPDF source
cd mupdf-qt
make build=debug NOX11=yes
For release, just change “debug” to "release". NOX11 is necessary since X11 headers are not available in Windows. Note that this will not build the “app” packaged with the MuPDF source.
Compile mupdf-qt
Install CMake.
Open CMakeLists.txt with Qt Creator(Qt5 built with mingw), run cmake and build mupdf-qt
在windows编译mingw版本 需要特别注意
- 必须按照文档的步骤进行git clone and update子项目
- 需要保证mingw版本
- 使用msys和mingw编译 可以下载Msys和MinGW
- 设置MinGW的环境变量
- 使用mingw安装包下面的msys目录下面的xx.bat启动命令行
- 先编译mupdf源码
- 安装CMAKE工具
- 使用qtcreator打开mupdf-qt目录下面的cmakelists文件
- 执行cmake
- 在qtcreator下执行build
使用Mupdf-qt出错的话 可以参考 如下
INCLUDEPATH += /home/bertero/mupdf-qt/include/ LIBS += -L/home/bertero/mupdf-qt/build/lib -lmupdf-qt LIBS += -L/home/bertero/mupdf-qt/mupdf/build/debug/ -lmupdf -ljpeg -lfreetype -lz -ljbig2dec -lcrypto -ldl -lmujs -lopenjpeg
http://www.heilqt.com/topic/56f25db1e498871267b374d4
以上是关于Mac平台编译mupdf-qt的开源项目的主要内容,如果未能解决你的问题,请参考以下文章