[poppler] cmake INSTALL file

Adrian Johnson ajohnson at redneon.com
Sun Sep 10 10:51:22 UTC 2017


On 10/09/17 01:40, Albert Astals Cid wrote:
> El dimarts, 5 de setembre de 2017, a les 19:44:04 CEST, Albert Astals Cid va 
> escriure:
>> El dimarts, 5 de setembre de 2017, a les 21:02:11 CEST, Adrian Johnson va
>>
>> escriure:
>>> I started writing an INSTALL file for cmake. Feel free to add any other
>>> useful information and correct my mistakes.
>>
>> Looks sensible, the grep is missing some command like options, i.e. the ones
>> that are "free form",
>>
>> grep '^ *set.*STRING' CMakeLists.txt
>>
>> Maybe it should mention that running ccmake . on the build dir will you a
>> nice ui for setting options?
> 
> Adrian did you see this email? Do you think you can add those? I could try to 
> do it but since you wrote the whole file i think it's better if you do it so 
> it keeps the same tone :)

Yes, it has been on my TODO list. Here is the updated file. I added a
line about using ccmake but found it is less useful than grepping the
options out of CMakeLists. ccmake displays extra variables such as
CAIRO_INCLUDE_DIR, the help text is truncated to one line, and I prefer
the command line as I set up scripts for the configurations I use.

I don't know why cmake can't provide a simple option that simply lists
all the project config options like autotools "configure --help".

> 
> Cheers,
>   Albert
> 
>>
>> Cheers,
>>   Albert
>> _______________________________________________
>> poppler mailing list
>> poppler at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/poppler
> 
> 
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/poppler
> 

-------------- next part --------------
Installation Instructions
*************************

Basic Installation
==================

mkdir build
cd build
cmake ..
make
make install


CMake configuration options can be set using the -D option. eg

  cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=release


Build Options
=============

Set install prefix:

  -DCMAKE_INSTALL_PREFIX=<path>

Set build type. This sets the standard compiler flags for the build
type.

  -DCMAKE_BUILD_TYPE=debug  or  -DCMAKE_BUILD_TYPE=release

Set compiler flags:

  -DCMAKE_CXX_FLAGS=<flags>   or set CXXFLAGS environment variable

Set linker flags:

  -DCMAKE_LD_FLAGS=<flags>   or set LDFLAGS environment variable


Optional Features
=================

  -D<FEATURE>=<ON|OFF>

eg

  -DENABLE_SPLASH=ON -DBUILD_GTK_TESTS=OFF

A list of all options can be display with the commmand:

  egrep '^ *(option|set.*STRING)' CMakeLists.txt

Alternatively, the options can be edited by running "ccmake ." in the
build directory.


Cross Compiling
===============

A toolchain file is required to specify the target specific compiler
tools. Run cmake with the option:

  -DCMAKE_TOOLCHAIN_FILE=<Toolchain file>

A sample toolchain for a 64-bit mingw build is shown below. Replace
/path/to/win/root with the install prefix for the target environment.

  SET(CMAKE_SYSTEM_NAME Windows)
  SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
  SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
  SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
  SET(CMAKE_FIND_ROOT_PATH  /usr/x86_64-w64-mingw32 /path/to/win/root )
  set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
  set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
  set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)



More information about the poppler mailing list