CMakeLists.txt revision 71ea20454af9348248ee3726f4fb8edb69e07677
# -----------------------------------------------------------------------------
# Define the main source
# -----------------------------------------------------------------------------
set(main_SRC
)
set(sp_SRC
)
set(inkscape_SRC
# -------
# Headers
)
if(WIN32)
list(APPEND inkscape_SRC
)
endif()
# -----------------------------------------------------------------------------
# Generate version file
# -----------------------------------------------------------------------------
# a custom target that is always built
add_custom_target(
inkscape_version ALL
DEPENDS ${CMAKE_BINARY_DIR}/src/inkscape-version.cpp)
# creates inkscape-version.cpp using cmake script
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/src/inkscape-version.cpp
COMMAND ${CMAKE_COMMAND}
-DINKSCAPE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
-DINKSCAPE_BINARY_DIR=${CMAKE_BINARY_DIR}
-P ${CMAKE_SOURCE_DIR}/CMakeScripts/inkscape-version.cmake)
# buildinfo.h is a generated file
set_source_files_properties(
${CMAKE_BINARY_DIR}/src/inkscape-version.cpp
PROPERTIES GENERATED TRUE)
list(APPEND inkscape_SRC
${CMAKE_BINARY_DIR}/src/inkscape-version.cpp
)
# -----------------------------------------------------------------------------
# Load in subdirectories
# -----------------------------------------------------------------------------
# All folders for internal inkscape
# these call add_inkscape_source
add_subdirectory(bind)
add_subdirectory(debug)
add_subdirectory(dialogs)
add_subdirectory(display)
add_subdirectory(dom)
add_subdirectory(extension)
add_subdirectory(filters)
add_subdirectory(helper)
add_subdirectory(io)
# add_subdirectory(jabber_whiteboard)
add_subdirectory(live_effects)
# add_subdirectory(pedro)
add_subdirectory(svg)
add_subdirectory(trace)
add_subdirectory(ui)
add_subdirectory(util)
add_subdirectory(widgets)
add_subdirectory(xml)
add_subdirectory(2geom)
# Directories containing lists files that describe building internal libraries
add_subdirectory(libavoid)
add_subdirectory(libcola)
add_subdirectory(libcroco)
add_subdirectory(libgdl)
add_subdirectory(libvpsc)
add_subdirectory(livarot)
add_subdirectory(libnr)
add_subdirectory(libnrtype)
get_property(inkscape_global_SRC GLOBAL PROPERTY inkscape_global_SRC)
set(inkscape_SRC
${inkscape_global_SRC}
${inkscape_SRC}
)
# -----------------------------------------------------------------------------
# Setup the executable
# -----------------------------------------------------------------------------
add_inkscape_lib(sp_LIB "${sp_SRC}")
add_inkscape_lib(inkscape_LIB "${inkscape_SRC}")
# make executable for INKSCAPE
add_executable(inkscape ${main_SRC})
add_dependencies(inkscape inkscape_version)
target_link_libraries(inkscape
# order from automake
sp_LIB
inkscape_LIB
sp_LIB # annoying, we need both!
nr_LIB
nrtype_LIB
dom_LIB
croco_LIB
avoid_LIB
gdl_LIB
cola_LIB
vpsc_LIB
livarot_LIB
2geom_LIB
${INKSCAPE_LIBS}
)
# TODO
# make executable for INKVIEW
#add_executable(inkview inkview.cpp)
# ...
# -----------------------------------------------------------------------------
# Installation
# -----------------------------------------------------------------------------
if(UNIX)
# TODO: man, locale, icons
# message after building.
add_custom_command(
TARGET blender POST_BUILD MAIN_DEPENDENCY blender
COMMAND ${CMAKE_COMMAND} -E echo 'now run: \"make install\" to copy runtime files & scripts to ${CMAKE_INSTALL_PREFIX}'
)
install(
PROGRAMS inkscape
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
)
install(
FILES ${CMAKE_SOURCE_DIR}/inkscape.desktop
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
)
install(
DIRECTORY
${CMAKE_SOURCE_DIR}/share/clipart
${CMAKE_SOURCE_DIR}/share/examples
${CMAKE_SOURCE_DIR}/share/extensions
${CMAKE_SOURCE_DIR}/share/filters
${CMAKE_SOURCE_DIR}/share/fonts
${CMAKE_SOURCE_DIR}/share/gradients
${CMAKE_SOURCE_DIR}/share/icons
${CMAKE_SOURCE_DIR}/share/keys
${CMAKE_SOURCE_DIR}/share/markers
${CMAKE_SOURCE_DIR}/share/palettes
${CMAKE_SOURCE_DIR}/share/patterns
${CMAKE_SOURCE_DIR}/share/screens
${CMAKE_SOURCE_DIR}/share/templates
${CMAKE_SOURCE_DIR}/share/tutorials
${CMAKE_SOURCE_DIR}/share/ui
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/inkscape
)
else()
# TODO, WIN32/APPLE
endif()