CMakeLists.txt revision fb48f2d077b22740e62995c9fdb2cbd3251d153d
SET(INKSCAPE_SRC)
# A macro to replace slashes and spaces in a string with underscores
MACRO(SANITIZE_PATH _string_var)
STRING(REGEX REPLACE "[\\/ ]+" "_" ${_string_var} ${${_string_var}})
ENDMACRO(SANITIZE_PATH _string_var)
# A macro to prepend a given string onto the beginning of each string in a list
MACRO(PREPEND _list _str)
SET(_temp_list ${${_list}})
SET(${_list})
FOREACH(x ${_temp_list})
SET(${_list} ${${_list}} ${_str}${x})
ENDFOREACH(x)
ENDMACRO(PREPEND _list _str)
# All folder with CMakeLists.txt files (excluding internal libraries)
SET(srcfolders
algorithms
api
bind
debug
dialogs
display
dom
extension
graphlayout
helper
inkjar
io
jabber_whiteboard
live_effects
pedro
removeoverlap
svg
trace
traits
ui
#utest
util
widgets
xml
)
# 1) include each list file
# 2) grab the variable inside
# 3) prepend the full relative path to each file in list
# 4) append the list to INKSCAPE_SRC
FOREACH(dirlist ${srcfolders})
SET(_temp_dirlist "${dirlist}")
MESSAGE(STATUS "Processing ${CMAKE_CURRENT_SOURCE_DIR}/${dirlist}/CMakeLists.txt")
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/${dirlist}/CMakeLists.txt)
SANITIZE_PATH(dirlist)
PREPEND(${dirlist}_SRC "${_temp_dirlist}/")
SET(INKSCAPE_SRC ${INKSCAPE_SRC} ${${dirlist}_SRC})
ENDFOREACH(dirlist)
# All directories containing lists files that describe building internal libraries
SET(libfolders
2geom
application
#dialogs
libavoid
libcola
libcroco
libgdl
libnr
libnrtype
libvpsc
livarot
)
FOREACH(dirlist ${libfolders})
ADD_SUBDIRECTORY(${dirlist})
ENDFOREACH(dirlist)
IF(WIN32)
SET(ONLY_WIN
)
ELSEIF(WIN32)
SET(ONLY_WIN)
ENDIF(WIN32)
SET(INKSCAPE_SRC
${INKSCAPE_SRC}
extension
jabber_whiteboard
${ONLY_WIN}
)
# make executable for INKSCAPE
ADD_EXECUTABLE(inkscape ${INKSCAPE_SRC})
TARGET_LINK_LIBRARIES(inkscape
"${INKSCAPE_LINK_FLAGS}" 2geom avoid cola croco gdl nr nrtype vpsc livarot
)
# make executable for INKVIEW
ADD_EXECUTABLE(inkview inkview.cpp)
TARGET_LINK_LIBRARIES(inkview
"${INKSCAPE_LINK_FLAGS}" 2geom avoid cola croco gdl nr nrtype vpsc livarot
)