CMakeLists.txt revision e661c64a3dee1421ca5f20d596766d6e5ea5816b
961N/A# CMake TODO
961N/A# - Remove hard coded defines (see bwelow)
961N/A# - Test on MinGW and OSX
961N/A# - Add configurable options for Python/Perl/Whiteboard, see configure --help
961N/A#
961N/A# ideasman42
961N/A
961N/Acmake_minimum_required(VERSION 2.8.0)
6983N/Alist(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeScripts")
6983N/A
961N/Aproject(inkscape)
961N/A
961N/Aset(INKSCAPE_VERSION 0.48+devel)
961N/Aset(PROJECT_NAME inkscape)
6983N/Aset(CMAKE_INCLUDE_CURRENT_DIR TRUE)
6983N/A
6983N/Aif(COMMAND cmake_policy)
6983N/A cmake_policy(SET CMP0003 NEW)
961N/A cmake_policy(SET CMP0005 NEW) # propper define quoting
961N/Aendif()
961N/A
961N/A# workaround for omission in cmake 2.8.4's GNU.cmake, fixed in 2.8.5
961N/Aif(CMAKE_COMPILER_IS_GNUCC)
5025N/A if(NOT DARWIN)
6173N/A set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
961N/A endif()
961N/Aendif()
961N/A
961N/A#-----------------------------------------------------------------------------
961N/A# Redirect output files
961N/A
961N/Aset(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "" FORCE )
961N/Aset(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" FORCE )
961N/A
1295N/A# -----------------------------------------------------------------------------
961N/A# Options
961N/A# -----------------------------------------------------------------------------
961N/Aoption(WITH_DBUS "Compile with support for DBus interface" OFF)
961N/A#option(WITH_INKJAR "Enable support for openoffice files (SVG jars)" ON)
961N/A
961N/Aoption(WITH_PROFILING "Turn on profiling" OFF) # Set to true if compiler/linker should enable profiling
961N/A
961N/Ainclude(ConfigPaths) # Installation Paths
961N/Ainclude(DefineDependsandFlags) # Includes, Compiler Flags, and Link Libraries
961N/Ainclude(HelperMacros) # Misc Utility Macros
961N/A
961N/A
961N/A
961N/A# -----------------------------------------------------------------------------
961N/A# BAD HACKS, NEED TO INVESTIGATE MAKING THESE LESS BAD
961N/Aadd_definitions(-D_FORTIFY_SOURCE=2)
961N/Aadd_definitions(-DPOTRACE="potrace")
961N/Aadd_definitions(-DORBIT2=1)
961N/Aadd_definitions(-DHAVE_CONFIG_H)
961N/Aadd_definitions(-DHAVE_CAIRO_PDF=1) # needed for src/libnrtype/Layout-TNG.h
961N/Aadd_definitions(-DHAVE_TR1_UNORDERED_SET) # XXX make an option!
961N/A#
961N/A# end badness
1298N/A# -----------------------------------------------------------------------------
1298N/A
961N/A
961N/A# make dist target
961N/Aset(INKSCAPE_DIST_PREFIX "${PROJECT_NAME}-${INKSCAPE_VERSION}")
961N/Aadd_custom_target(dist svn export --force -q "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}/${INKSCAPE_DIST_PREFIX}"
961N/A COMMAND tar -czf "${CMAKE_BINARY_DIR}/${INKSCAPE_DIST_PREFIX}.tar.gz" -C "${CMAKE_BINARY_DIR}" --exclude=".hidden" ${INKSCAPE_DIST_PREFIX}
961N/A WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
961N/A
961N/A# make unistall target
961N/Aconfigure_file(
961N/A "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
961N/A "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
961N/A IMMEDIATE @ONLY)
1298N/A
1298N/Aconfigure_file(
1878N/A "${CMAKE_CURRENT_SOURCE_DIR}/inkscape.desktop.in"
961N/A "${CMAKE_BINARY_DIR}/inkscape.desktop"
961N/A IMMEDIATE @ONLY)
961N/A
961N/Aadd_custom_target(uninstall
961N/A "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
961N/A
961N/A
961N/A# -----------------------------------------------------------------------------
961N/A# Subdirs (on only 1 atm), but a lot happens here
961N/A# -----------------------------------------------------------------------------
961N/A
961N/Aadd_subdirectory(src)
961N/A
961N/A
961N/A# -----------------------------------------------------------------------------
961N/A# Installation
961N/A# -----------------------------------------------------------------------------
961N/A
961N/Aif(UNIX)
961N/A # TODO: man, locale, icons
961N/A
5385N/A # message after building.
961N/A add_custom_command(
961N/A TARGET blender POST_BUILD MAIN_DEPENDENCY blender
961N/A COMMAND ${CMAKE_COMMAND} -E echo 'now run: \"make install\" to copy runtime files & scripts to ${CMAKE_INSTALL_PREFIX}'
961N/A )
961N/A
961N/A install(
961N/A PROGRAMS ${EXECUTABLE_OUTPUT_PATH}/inkscape
961N/A DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
961N/A )
961N/A
961N/A install(
961N/A FILES ${CMAKE_BINARY_DIR}/inkscape.desktop
961N/A DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
961N/A )
5385N/A
961N/A install(
961N/A DIRECTORY
961N/A ${CMAKE_SOURCE_DIR}/share/clipart
961N/A ${CMAKE_SOURCE_DIR}/share/examples
961N/A ${CMAKE_SOURCE_DIR}/share/extensions
961N/A ${CMAKE_SOURCE_DIR}/share/filters
961N/A ${CMAKE_SOURCE_DIR}/share/fonts
961N/A ${CMAKE_SOURCE_DIR}/share/gradients
961N/A ${CMAKE_SOURCE_DIR}/share/icons
961N/A ${CMAKE_SOURCE_DIR}/share/keys
961N/A ${CMAKE_SOURCE_DIR}/share/markers
961N/A ${CMAKE_SOURCE_DIR}/share/palettes
961N/A ${CMAKE_SOURCE_DIR}/share/patterns
961N/A ${CMAKE_SOURCE_DIR}/share/screens
961N/A ${CMAKE_SOURCE_DIR}/share/templates
961N/A ${CMAKE_SOURCE_DIR}/share/tutorials
961N/A ${CMAKE_SOURCE_DIR}/share/ui
961N/A DESTINATION ${CMAKE_INSTALL_PREFIX}/share/inkscape
961N/A )
961N/A
961N/Aelse()
961N/A # TODO, WIN32/APPLE
961N/Aendif()
961N/A