CMakeLists.txt revision e823a96f83e1ac6f0cbe5fa88a9d1fd347cb2ab4
# -----------------------------------------------------------------------------
# Define the main source
# -----------------------------------------------------------------------------
set(main_SRC
)
set(sp_SRC
# -------
# Headers
)
set(inkscape_SRC
# -------
# Headers
)
if(WIN32)
list(APPEND inkscape_SRC
# -------
# Headers
)
endif()
# -----------------------------------------------------------------------------
# Generate version file
# -----------------------------------------------------------------------------
# a custom target that is always built
add_custom_target(
inkscape_version ALL
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(debug)
add_subdirectory(display)
add_subdirectory(extension)
add_subdirectory(filters)
add_subdirectory(helper)
add_subdirectory(io)
add_subdirectory(live_effects)
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(inkgc)
add_subdirectory(libgdl)
add_subdirectory(libuemf)
add_subdirectory(libvpsc)
add_subdirectory(livarot)
add_subdirectory(libnrtype)
add_subdirectory(libdepixelize)
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}")
# Build everything except main and inkview.c in a shared library.
add_library(inkscape_base SHARED ${inkscape_SRC} ${sp_SRC})
# make executables for inkscape and inkview
add_executable(inkscape ${main_SRC} )
add_executable(inkview inkview.cpp )
if(UNIX)
# message after building.
add_custom_command(
TARGET inkscape
POST_BUILD MAIN_DEPENDENCY inkscape
COMMAND ${CMAKE_COMMAND} -E echo 'now run: \"make install\" to copy runtime files & scripts to ${CMAKE_INSTALL_PREFIX}'
)
endif()
add_dependencies(inkscape inkscape_version)
if(WITH_DBUS)
add_dependencies(inkscape inkscape_dbus)
endif()
set(INKSCAPE_TARGET_LIBS
# order from automake
#sp_LIB
#nrtype_LIB
#inkscape_LIB
#sp_LIB # annoying, we need both!
nrtype_LIB # annoying, we need both!
croco_LIB
avoid_LIB
cola_LIB
vpsc_LIB
livarot_LIB
uemf_LIB
2geom_LIB
depixelize_LIB
util_LIB
gc_LIB
${INKSCAPE_LIBS}
)
if (NOT "${WITH_EXT_GDL}")
# Insert it at the beginning of the list as the windows build fails otherwise
list (INSERT INKSCAPE_TARGET_LIBS 0 "gdl_LIB")
endif()
# Link the inkscape_base library against all external dependencies
target_link_libraries(inkscape_base ${INKSCAPE_TARGET_LIBS})
# Link inkscape and inkview against inkscape_base
target_link_libraries(inkscape inkscape_base )
target_link_libraries(inkview inkscape_base)
#Define the installation
install(
TARGETS inkscape_base inkscape inkview
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib/inkscape
ARCHIVE DESTINATION lib/inkscape
)