I am trying to build
Building PoDoFo on Windows
CMake 2.6.x is required for Windows. You can download it from
On Windows, PoDoFo may be built as either a shared or static library.
Building both is not supported. By default only the shared library
will be built. If you want a static library, just disable generation
of the shared library with the extra argument to cmake:
Handling library naming on win32
Especially on Windows it is also common for custom built libraries to
have different names to those you might download as pre-built copies.
CMake won't be able to find them if they're called something else
unless you tell it. Use these variables to tell CMake what names to
look for a library under:
•FREETYPE_LIBRARY_NAMES_DEBUG, FREETYPE_LIBRARY_NAMES_RELEASE and FREETYPE_LIBRARY_NAMES
•TIFF_LIBRARY_NAMES_DEBUG, TIFF_LIBRARY_NAMES_RELEASE and TIFF_LIBRARY_NAMES
•LIBJPEG_LIBRARY_NAMES_DEBUG, LIBJPEG_LIBRARY_NAMES_RELEASE and LIBJPEG_LIBRARY_NAMES
CMake builds on Windows with MinGW
Once MinGW is set up, make sure that the MinGW "bin" directory is on
your PATH, and be sure to set CMAKE_INCLUDE_PATH and
CMAKE_LIBRARY_PATH such that CMake can find the headers and .lib files
for the libraries PoDoFo requires. The GnuWin32 library packages from
http://gnuwin32.sf.net/ are known to work with PoDoFo, so installing
zlib, freetype, and libjpeg from there should do the trick.
To configure and build PoDoFo with a default GnuWin32 install and with
MinGW already on your PATH:
cmake -G "MinGW Makefiles" ..\podofo-src -DCMAKE_INCLUDE_PATH=c:\progra~1\gnuwin32\include -DCMAKE_LIBRARY_PATH=c:\progra~1\gnuwin32\lib -DPODOFO_BUILD_SHARED:BOOL=FALSE mingw32-make
freetype, zlib, libjpeg
-- Ensure you cppunit installed version is at least 1.12.0
Cppunit not found. No unit tests will be built.
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPack
Could NOT find FREETYPE (missing: FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStan
If you followed all the instructions, to compile it should normally be enough to do:
cd <podofo root directory (where CMakeLists.txt is)> mkdir build cd build cmake -G "MinGW Makefiles" -DCMAKE_INCLUDE_PATH=<path to headers> -DCMAKE_LIBRARY_PATH=<path to libraries> -DPODOFO_BUILD_SHARED:BOOL=FALSE .. mingw32-make
Step by step:
First, go to the directory where your podofo sources are. You should see a
CMakeLists.txt file lying around.
Second (and third), create (and go into) a directory where the compilation will be done. I call it build but it can be any name. This is a best practice since you can simply delete the build directory and come back to a clean state.
Fourth, ask cmake to create the makefile(s) for mingw:
PODOFO_BUILD_SHAREDlike advertised in the manual: build shared or static version.
CMAKE_LIBRAY_PATH are used to reference to the packages needed to build podofo. If you downloaded the precompiled packages like you did since you have de headers and the binaries, then you need to give to cmake the path to those headers and binaries. You can specify the variables multiple times if needed, e.g.:
cmake -G "MinGW Makefiles" -DCMAKE_INCLUDE_PATH=/path/to/freetype/include -DCMAKE_LIBRARY_PATH=/path/to/freetype/lib -DCMAKE_INCLUDE_PATH=/path/to/zlib/include -DCMAKE_LIBRARY_PATH=/path/to/zlib/lib -DPODOFO_BUILD_SHARED:BOOL=FALSE ..
"MinGW Makefiles" tells cmake to create makefiles specific to mingw. Else, by default on windows, it creates makefiles specific to Microsoft Visual Studio.
CMakeLists.txtin the parent directory with
..at the end.
Last, but not least, compile with the mingw version of make.