this is a quick and dirty attempt at this.. i don't know how much it would break, but i think in order to have a correct import usable without install it should do something along the lines
On Tue, Sep 12, 2017 at 8:49 PM, Marco Martin <notm...@gmail.com> wrote: > On Mon, Sep 11, 2017 at 4:59 PM, Harald Sitter <sit...@kde.org> wrote: >> Another option I can think of is "installing" to the build directory >> during cmake stage (i.e. construct a qml import path in >> $CMAKE_BINARY_DIR). That's only more complicated and altogether meh >> though, compared to simply adjusting the source tree. It also makes >> the cmake stage take longer :'< > > > > uuh, I actually like it, I'll give it a try.. as i think just > adjusting the source tree wouldn't be enough, as the qml plugin is > comprised by qml files *and* a c++ plugin, which needs to be installed > together the source qml files? > > so this way would put everything togetether > > -- > Marco Martin
diff --git a/CMakeLists.txt b/CMakeLists.txt index 289b778..a19a27e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,10 @@ include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) +file(MAKE_DIRECTORY {CMAKE_BINARY_DIR}/bin/org/kde/kirigami.2) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/org/kde/kirigami.2") +#set(CMAKE_BINARY_DIR ${CMAKE_BINARY_DIR}/org/kde/kirigami.2) + set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Kirigami2") configure_package_config_file( diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 408e656..902fb67 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -24,6 +24,17 @@ ELSE(STATIC_LIBRARY) add_library(kirigamiplugin SHARED ${kirigami_SRCS}) target_link_libraries(kirigamiplugin Qt5::Core Qt5::Qml Qt5::Quick) + +file(GLOB RUNTIME_FILES + "controls/*" +) +file(GLOB STYLE_FILES + "styles/*" +) +file(MAKE_DIRECTORY {CMAKE_BINARY_DIR}/bin/org/kde/kirigami.2) +file(COPY ${RUNTIME_FILES} DESTINATION ${CMAKE_BINARY_DIR}/bin/org/kde/kirigami.2) +file(COPY ${STYLE_FILES} DESTINATION ${CMAKE_BINARY_DIR}/bin/org/kde/kirigami.2/styles) + install(TARGETS kirigamiplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kirigami.2) install(DIRECTORY controls/ DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kirigami.2)