diff options
| author | Campbell Barton <ideasman42@gmail.com> | 2011-06-13 21:59:45 +0000 |
|---|---|---|
| committer | Campbell Barton <ideasman42@gmail.com> | 2011-06-13 21:59:45 +0000 |
| commit | 4f20cb327f420917d761b0fa41e50cb9d4eb1a19 (patch) | |
| tree | d880131c8f8b42ac122205857f6fb67949b654f4 | |
| parent | cmake: fix for install target (diff) | |
| download | inkscape-4f20cb327f420917d761b0fa41e50cb9d4eb1a19.tar.gz inkscape-4f20cb327f420917d761b0fa41e50cb9d4eb1a19.zip | |
cmake:
- added option WITH_DBUS (currently uses hard coded paths)
- remove duplicate version variable.
(bzr r10297)
| -rw-r--r-- | CMakeLists.txt | 32 | ||||
| -rw-r--r-- | CMakeScripts/ConfigCompileFlags.cmake | 35 | ||||
| -rw-r--r-- | CMakeScripts/DefineDependsandFlags.cmake | 13 | ||||
| -rw-r--r-- | CMakeScripts/inkscape-version.cmake | 8 | ||||
| -rw-r--r-- | config.h.cmake | 4 | ||||
| -rw-r--r-- | src/extension/CMakeLists.txt | 17 |
6 files changed, 76 insertions, 33 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f556b051..82b5e50b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,23 +19,32 @@ endif() list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeScripts") +# ----------------------------------------------------------------------------- +# Options +# ----------------------------------------------------------------------------- +option(WITH_DBUS "Compile with support for DBus interface" OFF) +#option(WITH_INKJAR "Enable support for openoffice files (SVG jars)" ON) + +option(WITH_PROFILING "Turn on profiling" OFF) # Set to true if compiler/linker should enable profiling -# XXX, TODO: use pkgconfig, This part is WIP to get building -# - campbell +include(ConfigPaths) # Installation Paths +include(DefineDependsandFlags) # Includes, Compiler Flags, and Link Libraries +include(HelperMacros) # Misc Utility Macros + + + +# ----------------------------------------------------------------------------- +# BAD HACKS, NEED TO INVESTIGATE MAKING THESE LESS BAD add_definitions(-D_FORTIFY_SOURCE=2) add_definitions(-DPOTRACE="potrace") add_definitions(-DORBIT2=1) add_definitions(-DHAVE_CONFIG_H) add_definitions(-DHAVE_CAIRO_PDF=1) # needed for src/libnrtype/Layout-TNG.h add_definitions(-DHAVE_TR1_UNORDERED_SET) # XXX make an option! -# XXX - end hackish defines! - - -include(ConfigPaths) # Installation Paths -include(DefineDependsandFlags) # Includes, Compiler Flags, and Link Libraries -include(HelperMacros) # Misc Utility Macros +# +# end badness +# ----------------------------------------------------------------------------- -option(ENABLE_PROFILING "Turn on profiling" OFF) # Set to true if compiler/linker should enable profiling # make dist target set(INKSCAPE_DIST_PREFIX "${PROJECT_NAME}-${INKSCAPE_VERSION}") @@ -58,8 +67,11 @@ add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") -add_subdirectory(src) +# ----------------------------------------------------------------------------- +# Subdirs (on only 1 atm), but a lot happens here +# ----------------------------------------------------------------------------- +add_subdirectory(src) # ----------------------------------------------------------------------------- diff --git a/CMakeScripts/ConfigCompileFlags.cmake b/CMakeScripts/ConfigCompileFlags.cmake index bc3b42ef6..0ff66fad8 100644 --- a/CMakeScripts/ConfigCompileFlags.cmake +++ b/CMakeScripts/ConfigCompileFlags.cmake @@ -1,25 +1,26 @@ -SET(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}") -ADD_DEFINITIONS(-Wall -Wformat-security -W -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch) -ADD_DEFINITIONS(-O2) +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}") +add_definitions(-Wall -Wformat-security -W -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch) +add_definitions(-O2) #define the flags for profiling if desired: -IF (ENABLE_PROFILING) - SET(COMPILE_PROFILING_FLAGS "-pg") - SET(LINK_PROFILING_FLAGS "-pg") -ENDIF (ENABLE_PROFILING) +if(WITH_PROFILING) + set(COMPILE_PROFILING_FLAGS "-pg") + set(LINK_PROFILING_FLAGS "-pg") +endif() -ADD_DEFINITIONS(-DVERSION=\\\"${INKSCAPE_VERSION}\\\") -ADD_DEFINITIONS(${DEFINE_FLAGS} -DHAVE_CONFIG_H -D_INTL_REDIRECT_INLINE) +add_definitions(-DVERSION=\\\"${INKSCAPE_VERSION}\\\") +add_definitions(${DEFINE_FLAGS} -DHAVE_CONFIG_H -D_INTL_REDIRECT_INLINE) -IF (WIN32) - ADD_DEFINITIONS(-DXP_WIN) -ENDIF (WIN32) +if(WIN32) + add_definitions(-DXP_WIN) +endif(WIN32) # for Inkboard: -ADD_DEFINITIONS(-DHAVE_SSL "-DRELAYTOOL_SSL=\"static const int libssl_is_present=1; static int __attribute__((unused)) libssl_symbol_is_present(char *s){ return 1; }\"") +add_definitions(-DHAVE_SSL "-DRELAYTOOL_SSL=\"static const int libssl_is_present=1; static int __attribute__((unused)) libssl_symbol_is_present(char *s){ return 1; }\"") -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILE_PROFILING_FLAGS} ") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILE_PROFILING_FLAGS} ") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILE_PROFILING_FLAGS} ") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILE_PROFILING_FLAGS} ") -SET(CMAKE_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM} ") -#message(STATUS "${CMAKE_CXX_FLAGS}") +set(CMAKE_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM} ") + +# message(STATUS "${CMAKE_CXX_FLAGS}") diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index 6cfb38257..6c0abf362 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -133,9 +133,16 @@ list(APPEND INKSCAPE_LIBS ${ImageMagick_Magick++_LIBRARY}) include(IncludeJava) # end Dependencies -# message(FATAL_ERROR "Whee: ${INKSCAPE_INCS}") -# message(FATAL_ERROR "Whee: ${INKSCAPE_LIBS}") -# message(FATAL_ERROR "Whee: ${INKSCAPE_LINK_DIRS}") +# ---------------------------------------------------------------------------- +# Optional +# ---------------------------------------------------------------------------- + +if(WITH_DBUS) + # XXX, needs s module + list(APPEND INKSCAPE_INCS "/usr/include/dbus-1.0") + list(APPEND INKSCAPE_INCS "/usr/lib/dbus-1.0/include") + list(APPEND INKSCAPE_LIBS "/usr/lib/libdbus-1.so") +endif() # C/C++ Flags include_directories(${INKSCAPE_INCS}) diff --git a/CMakeScripts/inkscape-version.cmake b/CMakeScripts/inkscape-version.cmake index 7e53f710b..1d98a5799 100644 --- a/CMakeScripts/inkscape-version.cmake +++ b/CMakeScripts/inkscape-version.cmake @@ -7,7 +7,6 @@ # We should extract the version from build.xml # but for now just hard code -set(INKSCAPE_VERSION "0.48+devel") set(INKSCAPE_REVISION "unknown") if(EXISTS ${INKSCAPE_SOURCE_DIR}/.bzr/) @@ -19,8 +18,13 @@ endif() file(WRITE ${INKSCAPE_BINARY_DIR}/src/inkscape-version.cpp.txt + # unlike autoconf, include config.h + "#ifdef HAVE_CONFIG_H\n" + "# include <config.h>\n" + "#endif\n" + "\n" "namespace Inkscape {\n" - " char const *version_string = \"${INKSCAPE_VERSION} ${INKSCAPE_REVISION}\";\n" + " char const *version_string = VERSION \" \" \"${INKSCAPE_REVISION}\";\n" "}\n") # Copy the file to the final header only if the version changes diff --git a/config.h.cmake b/config.h.cmake index f4532ea22..335e85ba0 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -235,6 +235,9 @@ /* Define the version as a string. */ #define VERSION "${INKSCAPE_VERSION}" +/* Build in dbus */ +#cmakedefine WITH_DBUS 1 + /* Define as the return type of signal handlers (`int' or `void'). */ #cmakedefine RETSIGTYPE @@ -296,7 +299,6 @@ /* Define to `int' if <sys/types.h> does not define. */ #cmakedefine mode_t - #endif /* _CONFIG_H_ */ diff --git a/src/extension/CMakeLists.txt b/src/extension/CMakeLists.txt index 2c3c9ab83..8a1ba37dc 100644 --- a/src/extension/CMakeLists.txt +++ b/src/extension/CMakeLists.txt @@ -221,5 +221,22 @@ if(WIN32) ) endif() +if(WITH_DBUS) + list(APPEND extension_SRC + dbus/application-interface.cpp + dbus/dbus-init.cpp + dbus/document-interface.cpp + + # ------ + # Header + dbus/application-interface.h + dbus/dbus-init.h + dbus/document-interface.h + dbus/wrapper/inkscape-dbus-wrapper.h + ) + + include_directories(dbus) +endif() + # add_inkscape_lib(extension_LIB "${extension_SRC}") add_inkscape_source("${extension_SRC}") |
