Got OpenOffice.org unipresent backend to compile, but it can't yet connect to OO...
[kworship.git] / unipresent / openoffice.org / CMakeLists.txt
blobc473865619d8911998a9e3dd1a95f614f94888c9
1 project(unipresent_openoffice)
3 set(SHOULD_BUILD_OOO_PLUGIN YES)
4 if (NOT SHOULD_BUILD_OOO_PLUGIN)
5   message(STATUS "OpenOffice.org Impress integration plugin will not be built")
6 else (NOT SHOULD_BUILD_OOO_PLUGIN)
8   # We need uno
9   find_package(UNO)
10   if (NOT UNO_FOUND)
11     message(STATUS "OpenOffice.org SDK NOT found - OpenOffice.org Impress integration plugin will not be built")
12   else (NOT UNO_FOUND)
13     message(STATUS "OpenOffice.org SDK found - OpenOffice.org Impress integration plugin will be built")
15     find_package(KDE4 REQUIRED)
17     # Remove flags from CMAKE_CXX_FLAGS
18     MACRO (REMOVE_CXX_FLAGS)
19       FOREACH(FLAG ${ARGN})
20         STRING(REPLACE "${FLAG}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
21       ENDFOREACH(FLAG)
22     ENDMACRO (REMOVE_CXX_FLAGS)
24     # KDE adds a bunch of flags, several of which UNO doesn't like
25     # UNO throws exceptions
26     REMOVE_CXX_FLAGS(-fno-exceptions)
27     # -fvisibility=hidden prevents us from catching UNO exceptions
28     REMOVE_CXX_FLAGS(-fvisibility=hidden)
29     # These flags cause lots of warnings with UNO
30     REMOVE_CXX_FLAGS(-Wnon-virtual-dtor -Wundef -Wall -Wformat-security)
32     include_directories(${KDE4_INCLUDES}
33                         ${QT_INCLUDES})
35     include_directories(${UNO_INCLUDES})
37     set(unipresent_openoffice_UNOTYPES
38         com.sun.star.beans.XPropertySet
39         com.sun.star.bridge.XUnoUrlResolver
40         com.sun.star.container.XEnumeration
41         com.sun.star.container.XEnumerationAccess
42         com.sun.star.container.XIndexAccess
43         com.sun.star.container.XHierarchicalNameAccess
44         com.sun.star.drawing.XDrawPagesSupplier
45         com.sun.star.drawing.XDrawPages
46         com.sun.star.drawing.XDrawPage
47         com.sun.star.drawing.XShapes
48         com.sun.star.text.XText
49         com.sun.star.frame.XComponentLoader
50         com.sun.star.frame.XDesktop
51         com.sun.star.lang.XComponent
52         com.sun.star.lang.XMultiComponentFactory
53         com.sun.star.lang.XMultiServiceFactory
54         com.sun.star.presentation.XPresentationSupplier
55         com.sun.star.presentation.XPresentation
56         com.sun.star.registry.XSimpleRegistry
57     )
59     set(unipresent_openoffice_SRCS
60         UpOoBackend.cpp
61         UpOoBridge.cpp
62         UpOoPresentation.cpp
63         UpOoSlide.cpp
64     )
66     UNO_ADD_TYPES(unipresent_openoffice_SRCS
67                   ${unipresent_openoffice_UNOTYPES}
68     )
70     kde4_add_plugin(unipresent_openoffice ${unipresent_openoffice_SRCS})
72     target_link_libraries(unipresent_openoffice
73                           unipresent
74                           ${KDE4_KDECORE_LIBS}
75                           ${KDE4_KIO_LIBS}
76                           ${QT_LIBRARIES}
77                           ${UNO_LIBS}
78                           )
80     ########### install files ###############
82     install( TARGETS unipresent_openoffice DESTINATION ${PLUGIN_INSTALL_DIR} )
83     install( FILES unipresent_openoffice.desktop  DESTINATION  ${SERVICES_INSTALL_DIR} )
85     install( FILES ${UNO_RDB}
86              DESTINATION  ${DATA_INSTALL_DIR}/unipresent/openoffice.org
87              RENAME "types.rdb" )
88   endif (NOT UNO_FOUND)
89 endif (NOT SHOULD_BUILD_OOO_PLUGIN)