Warning, /office/calligra/qtquick/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 project(calligraqtquickcomponents)
0002 
0003 # While it is not standard practice to make use of this, we have to do so here:
0004 # Qt Quick components have to be located in some discoverable location, known
0005 # as the Qt Quick Components Import directory. This can be any number of
0006 # locations, but most importantly it must be inside the library location, as
0007 # they tend to be binary plugins, like this one is. As it turns out, GNUInstallDirs
0008 # is broken in some linux distributions, but we must consider this a bug in the
0009 # distribution, which needs to be fixed.
0010 #
0011 # An example (based on this plugin) of how Qt Quick locates modules:
0012 # A qml file requires a module by having the statement
0013 # import org.calligra.CalligraComponents 1.0
0014 # and this will cause Qt Quick to look through its list of import locations for
0015 # a directory structure matching
0016 # (importdir)/org/calligra/CalligraComponents/qmldir
0017 # The qmldir file is important, and defines the module as one such (see Qt
0018 # documentation for details on how to construct one). For us, it defines
0019 # specifically the module's library file with the like
0020 # plugin calligraqtquickcomponentsplugin
0021 # which makes Qt Quick look in the same directory (and only there) for a file
0022 # which matches that description. On various Unixes this would be
0023 # libcalligratquickcomponents.so
0024 # and on Windows it is
0025 # calligraqtquickcomponents.dll
0026 #
0027 # So, in short - because this is binary, executable data, we can't put it in e.g.
0028 # the data dir (for which we would not need GNUInstallDirs), and as it is a library
0029 # we also cannot put it in the binaries dir. In short, it must be the library
0030 # location, and without GNUInstallDirs, this turns out to be very difficult/awkward
0031 #
0032 # Personal note:
0033 # It is perhaps also worth mentioning that this has been gone over several times
0034 # by various people, and changing the method keeps breaking in various places, and
0035 # in particular on Windows, which as always is a second class citizen (unsurprisingly,
0036 # but it simply means it doesn't get tested as rigorously, and wellmeaning changes
0037 # such as install location changes have wide reaching consequences for these less
0038 # well supported targets).
0039 # This would be worth revisiting for the Frameworks 5 port, where i believe certain
0040 # changes have been made to the cmake system, to accommodate the Qt Quick plugins
0041 # built for Plasma 5. At that time, we can switch to using the same installation
0042 # methodology as is used there. Until then, i would prefer to not break things
0043 # any further by attempting to "fix" this by not using GNUInstallDirs and switching
0044 # back to using something which doesn't work on Windows.
0045 include(GNUInstallDirs)
0046 
0047 set(calligraqtquickcomponents_SRCS
0048     CQThumbnailItem.cpp
0049     CQPresentationModel.cpp
0050 #    CQSpreadsheetListModel.cpp
0051     CQCanvasBase.cpp
0052     CQCanvasControllerItem.cpp
0053 #    CQSpreadsheetCanvas.cpp
0054     CalligraQtQuickComponentsPlugin.cpp
0055     CQCanvasController.cpp
0056     CQTextDocumentCanvas.cpp
0057     CQTextDocumentModel.cpp
0058     CQImageProvider.cpp
0059     CQPresentationView.cpp
0060     CQPresentationCanvas.cpp
0061     CQTextToCModel.cpp
0062     CQPluginLoaderProxy.cpp
0063     CQLinkArea.cpp
0064     CQTextDocumentNotesModel.cpp
0065 )
0066 
0067 include_directories(
0068     ${CMAKE_SOURCE_DIR}
0069     ${CMAKE_BINARY_DIR}
0070     ${KOMAIN_INCLUDES}
0071     ${CMAKE_SOURCE_DIR}/words/part
0072 #    ${CMAKE_SOURCE_DIR}/sheets
0073     ${CMAKE_SOURCE_DIR}/libs/pageapp
0074 )
0075 
0076 add_library(calligraqtquickcomponentsplugin SHARED ${calligraqtquickcomponents_SRCS})
0077 
0078 target_link_libraries(calligraqtquickcomponentsplugin
0079     Qt5::Declarative
0080     Qt5::OpenGL
0081     Qt5::Svg
0082     komain
0083     kotextlayout
0084     wordsprivate
0085 #    calligrasheetscommon
0086     kopageapp
0087     koplugin
0088     calligrastageprivate)
0089 
0090 install(TARGETS calligraqtquickcomponentsplugin
0091     DESTINATION ${QML_INSTALL_DIR}/org/calligra/CalligraComponents)
0092 install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/calligra/CalligraComponents)