doxygen 1.11.0 使用详解(二)——安装

UNIX 上源码安装

为了编译源码,至少需要:

  • GNU 工具 flexbisonlibiconvGNU make
  • python 2.7 或更高版本
  • cmake 3.14 或更高版本

为了使用 doxygen 的高级特性,还需要安装下面的工具:

  • 为了编译 GUI 前端 doxywizard,需要安装 Qt 5.14 或更高版本
  • 为了产生 LATEXPostscriptPDF 等格式的文档,需要安装 LATEX 的发行版,比如 TeX Live
  • 为了产生头文件依赖图继承关系图以及协作图,需要安装 graphviz 2.38 或更高版本 。如果通过源码编译 graphviz,需要打开 freetype support (这需要 freetype 库以及相关头文件),否则产生的图不会正确渲染 text labels
  • 为了产生 HTML 格式的公式或者不想使用 pdflatex,需要安装 ghostscript interpreter

编译安装步骤

  1. Unpack the archive
tar xvzf doxygen-$VERSION.src.tar.gz
  1. Create a build directory (for instance inside the source tree)
cd doxygen-$VERSION
mkdir build
cd build
  1. Run cmake with the makefile generator
cmake -G "Unix Makefiles" ..

If you have Qt-5.14 or higher installed and want to build the GUI front-end, you should enable it as follows:

cmake -Dbuild_wizard=YES ..

For an overview of other configuration options use

cmake -L ..
  1. Compile the program by running make:
make
  1. Optional: Generate the user manual.
cmake -Dbuild_doc=YES ..
make docs

To let doxygen generate the HTML and PDF documentation.

The HTML directory within the build directory will now contain the html documentation (just point a HTML browser to the file index.html in the html directory).

  1. Optional: static linking
    If you want to build a statically linked version of doxygen that embeds libclang you need to first build LLVM and clang from sources using the following options:
cmake -DLIBCLANG_BUILD_STATIC=ON \
-DBUILD_SHARED_LIBS=OFF \
-DLLVM_ENABLE_PIC=OFF \
-DLLVM_BUILD_LLVM_DYLIB=OFF \
-DLLVM_BUILD_LLVM_C_DYLIB=OFF \
-DLLVM_ENABLE_TERMINFO=OFF \
path_to_llvm_root_source_dir

and then build doxygen with these options:

cmake -DCMAKE_BUILD_TYPE=Release \
"-DCMAKE_FIND_LIBRARY_SUFFIXES=.a" \
"-ldl;-lz;-lpthread" \
-Duse_libclang=YES \
path_to_doxygen_root_source_dir

UNIX 上二进制安装

源码编译成功后,或者下载了 Linux 下的 doxygen 二进制分发包,输入下面命令进行安装:

make install

Binaries are installed into the directory /usr/local/bin, man pages in /usr/local/man/man1 and documentation in /usr/local/doc/doxygen To change this just edit the Makefile.

Windows 上源码安装

From version 1.8.10 onwards, build files need to be generated by cmake.

Alternatively, you can compile doxygen the UNIX way using Cygwin or MinGW.

The next step is to install modern versions of bison and flex (see this). After installation and adding them to your path rename win_flex.exe to flex.exe and win_bison.exe to bison.exe.

Furthermore you have to install python (version 2.7 or higher).

Download doxygen’s source tarball and put it somewhere (e.g. use c:\tools)

Now start a visual studio native command shell (for either x86 or x64) and type

cd c:\tools
tar zxvf doxygen-x.y.z.src.tar.gz

to unpack the sources (you can obtain tar from this). Alternatively you can use an unpack program, like 7-Zip or use the built-in unpack feature of modern Windows systems).

Now your environment is setup to generate the required project files for doxygen.

change directory to the doxygen-x.y.z directory, create and change to a build directory

mkdir build
cd build
cmake -G "Visual Studio 14 2015" ..

This will create a project file then can be opened in Visual Studio.

If you prefer compiling from the command prompt you can use the following instead:

mkdir build
cd build
cmake -G "NMake Makefiles" ..
nmake

Note that compiling Doxywizard requires Qt 5.14 or newer.

Also read the next section for additional tools you may need to install to run doxygen with certain features enabled.

Windows 上二进制安装

Doxygen comes as a self-installing archive, so installation is extremely simple. Just follow the dialogs.

After installation it is recommended to also download and install GraphViz (version 2.38 or better is highly recommended). Doxygen can use the dot tool of the GraphViz package to render nicer diagrams.

  • 12
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值