Make qml apps run from build/bin

This commit is contained in:
Albert Vaca Cintora 2019-07-23 00:41:12 +02:00
parent 27d5fd0600
commit 22795c1a14

View file

@ -16,5 +16,16 @@ target_link_libraries(kdeconnectdeclarativeplugin
Qt5::Qml Qt5::Qml
kdeconnectinterfaces kdeconnectinterfaces
) )
install(TARGETS kdeconnectdeclarativeplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/kdeconnect) install(TARGETS kdeconnectdeclarativeplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/kdeconnect)
install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/kdeconnect) install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/kdeconnect)
# So qml apps using this plugin can be run from build/bin directory
add_custom_target(copy_to_build_dir_bin)
add_custom_command(TARGET copy_to_build_dir_bin
COMMAND ${CMAKE_COMMAND} -E
copy ${CMAKE_CURRENT_SOURCE_DIR}/qmldir ${CMAKE_BINARY_DIR}/bin/org/kde/kdeconnect/)
add_dependencies(kdeconnectdeclarativeplugin copy_to_build_dir_bin)
set_target_properties(kdeconnectdeclarativeplugin
PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/org/kde/kdeconnect/
)