CMakeLists.txt revision f98842312bb830766228121d8054a17069be4492
01d27eab5fca2dcb8e883011f8be77ae6b78a11cTed Gould# CMake TODO
07bda0b13ae048815f53f21ad1edbe3cc1b7e4e8Johan Engelen# - Remove hard coded defines (see bwelow)
07bda0b13ae048815f53f21ad1edbe3cc1b7e4e8Johan Engelen# - Test on MinGW and OSX
07bda0b13ae048815f53f21ad1edbe3cc1b7e4e8Johan Engelen# - Add configurable options for Python/Perl/Whiteboard, see configure --help
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen#
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen# ideasman42
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenproject(inkscape)
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenset(INKSCAPE_VERSION 0.48+devel)
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenset(PROJECT_NAME inkscape)
981b809bc6ed10a21e89444d9447e5475801874fjohanengelencmake_minimum_required(VERSION 2.8.0)
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenset(CMAKE_INCLUDE_CURRENT_DIR TRUE)
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenif(COMMAND cmake_policy)
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen cmake_policy(SET CMP0003 NEW)
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen cmake_policy(SET CMP0005 NEW) # propper define quoting
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenendif()
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenlist(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeScripts")
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen# -----------------------------------------------------------------------------
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen# Options
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen# -----------------------------------------------------------------------------
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenoption(WITH_DBUS "Compile with support for DBus interface" OFF)
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen#option(WITH_INKJAR "Enable support for openoffice files (SVG jars)" ON)
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenoption(WITH_PROFILING "Turn on profiling" OFF) # Set to true if compiler/linker should enable profiling
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengeleninclude(ConfigPaths) # Installation Paths
981b809bc6ed10a21e89444d9447e5475801874fjohanengeleninclude(DefineDependsandFlags) # Includes, Compiler Flags, and Link Libraries
981b809bc6ed10a21e89444d9447e5475801874fjohanengeleninclude(HelperMacros) # Misc Utility Macros
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen# -----------------------------------------------------------------------------
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen# BAD HACKS, NEED TO INVESTIGATE MAKING THESE LESS BAD
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenadd_definitions(-D_FORTIFY_SOURCE=2)
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenadd_definitions(-DPOTRACE="potrace")
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenadd_definitions(-DORBIT2=1)
8001ba81cb851b38d86650a2fef5817facffb763johanengelenadd_definitions(-DHAVE_CONFIG_H)
8001ba81cb851b38d86650a2fef5817facffb763johanengelenadd_definitions(-DHAVE_CAIRO_PDF=1) # needed for src/libnrtype/Layout-TNG.h
8001ba81cb851b38d86650a2fef5817facffb763johanengelenadd_definitions(-DHAVE_TR1_UNORDERED_SET) # XXX make an option!
8001ba81cb851b38d86650a2fef5817facffb763johanengelen#
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen# end badness
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen# -----------------------------------------------------------------------------
6c3e745a94ef6b25a4ef9f018d350a7535aa45afTed Gould
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen# make dist target
6c3e745a94ef6b25a4ef9f018d350a7535aa45afTed Gouldset(INKSCAPE_DIST_PREFIX "${PROJECT_NAME}-${INKSCAPE_VERSION}")
6c3e745a94ef6b25a4ef9f018d350a7535aa45afTed Gouldadd_custom_target(dist svn export --force -q "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}/${INKSCAPE_DIST_PREFIX}"
6c3e745a94ef6b25a4ef9f018d350a7535aa45afTed Gould COMMAND tar -czf "${CMAKE_BINARY_DIR}/${INKSCAPE_DIST_PREFIX}.tar.gz" -C "${CMAKE_BINARY_DIR}" --exclude=".hidden" ${INKSCAPE_DIST_PREFIX}
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen# make unistall target
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelenconfigure_file(
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen IMMEDIATE @ONLY)
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelenconfigure_file(
6c3e745a94ef6b25a4ef9f018d350a7535aa45afTed Gould "${CMAKE_CURRENT_SOURCE_DIR}/inkscape.desktop.in"
6c3e745a94ef6b25a4ef9f018d350a7535aa45afTed Gould "${CMAKE_BINARY_DIR}/inkscape.desktop"
6c3e745a94ef6b25a4ef9f018d350a7535aa45afTed Gould IMMEDIATE @ONLY)
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelenadd_custom_target(uninstall
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen# -----------------------------------------------------------------------------
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen# Subdirs (on only 1 atm), but a lot happens here
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen# -----------------------------------------------------------------------------
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenadd_subdirectory(src)
dc249e33217a0cf547f743fbc08fbce188911972johanengelen
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen# -----------------------------------------------------------------------------
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen# Installation
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen# -----------------------------------------------------------------------------
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelenif(UNIX)
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen # TODO: man, locale, icons
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen # message after building.
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen add_custom_command(
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen TARGET blender POST_BUILD MAIN_DEPENDENCY blender
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen COMMAND ${CMAKE_COMMAND} -E echo 'now run: \"make install\" to copy runtime files & scripts to ${CMAKE_INSTALL_PREFIX}'
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen )
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen install(
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen PROGRAMS ${CMAKE_BINARY_DIR}/src/inkscape
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen )
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen install(
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen FILES ${CMAKE_BINARY_DIR}/inkscape.desktop
98a704c566ce5a750d76d5fc9675ccc804ac65f5johanengelen DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
98a704c566ce5a750d76d5fc9675ccc804ac65f5johanengelen )
dc249e33217a0cf547f743fbc08fbce188911972johanengelen
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen install(
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen DIRECTORY
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen ${CMAKE_SOURCE_DIR}/share/clipart
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen ${CMAKE_SOURCE_DIR}/share/examples
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen ${CMAKE_SOURCE_DIR}/share/extensions
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen ${CMAKE_SOURCE_DIR}/share/filters
98a704c566ce5a750d76d5fc9675ccc804ac65f5johanengelen ${CMAKE_SOURCE_DIR}/share/fonts
98a704c566ce5a750d76d5fc9675ccc804ac65f5johanengelen ${CMAKE_SOURCE_DIR}/share/gradients
98a704c566ce5a750d76d5fc9675ccc804ac65f5johanengelen ${CMAKE_SOURCE_DIR}/share/icons
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen ${CMAKE_SOURCE_DIR}/share/keys
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen ${CMAKE_SOURCE_DIR}/share/markers
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen ${CMAKE_SOURCE_DIR}/share/palettes
07bda0b13ae048815f53f21ad1edbe3cc1b7e4e8Johan Engelen ${CMAKE_SOURCE_DIR}/share/patterns
07bda0b13ae048815f53f21ad1edbe3cc1b7e4e8Johan Engelen ${CMAKE_SOURCE_DIR}/share/screens
07bda0b13ae048815f53f21ad1edbe3cc1b7e4e8Johan Engelen ${CMAKE_SOURCE_DIR}/share/templates
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen ${CMAKE_SOURCE_DIR}/share/tutorials
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen ${CMAKE_SOURCE_DIR}/share/ui
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen DESTINATION ${CMAKE_INSTALL_PREFIX}/share/inkscape
d02f89424319afe28fe2cc6696c28108448de3acmcecchetti )
d02f89424319afe28fe2cc6696c28108448de3acmcecchetti
d02f89424319afe28fe2cc6696c28108448de3acmcecchettielse()
c3a8ad9235ff81909bd472707550aef5b91daf7bjohanengelen # TODO, WIN32/APPLE
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenendif()
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen