OpenOffice CMake Integration

From Apache OpenOffice Wiki
Revision as of 11:13, 30 May 2010 by Annulen (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


CMake is a cross-platform build system for build automation with support of popular programming languages including C++ and Java. Also, it could be used as a convenient configurator for existing build system.


  • Automatically finds the next OOo SDK version on Unix platforms:
    • Official stable build of OOo SDK
    • Official development build of OOo SDK
    • Installation of OOo SDK, provided by Linux distribution (in most cases)
  • Automatically skips all installations without SDK, found in the system
  • Allows developer to override automatic choice of OOo SDK with custom path

After successful run module sets the next CMake variables:

  • OpenOffice_FOUND - System has with SDK (logical)
  • OpenOffice_VERSION - Version of with SDK
  • OOO_PREFIX - Prefix of installation
  • OOO_BASIS_DIR - "basis" directory of
  • OOO_PROGRAM_DIR - "program" directory of
  • OOO_URE_DIR - "ure" directory of
  • OOO_SDK_DIR - "sdk" directory of
  • OOO_INCLUDE_DIR - include directory of
  • UNOPKG_EXECUTABLE - Absolute path of unopkg tool

CMake module "FindOpenOffice" can be downloaded here:


Finding SDK

To use it, download this file, uncompress it, copy into your project directory (it's traditional to use subdirectory cmake/modules/ for this purpose), and add line


into your CMakeLists.txt. It's needed to set variable CMAKE_MODULE_PATH in the beginning of project, see example below. If SDK is mandatory for building of your project, use

find_package(OpenOffice REQUIRED)

to stop configuration process if SDK was not found.

Personal tools