Compare commits
1 commit
master
...
albertvaka
Author | SHA1 | Date | |
---|---|---|---|
|
8542e6311c |
1 changed files with 21 additions and 11 deletions
|
@ -17,15 +17,25 @@ target_link_libraries(kdeconnectdeclarativeplugin
|
|||
kdeconnectinterfaces
|
||||
)
|
||||
|
||||
install(TARGETS kdeconnectdeclarativeplugin 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 POST_BUILD
|
||||
##
|
||||
# Installs a QML declarative plugin and its qmldir file
|
||||
#
|
||||
function(install_qml_plugin plugin_name qml_install_dir_path)
|
||||
|
||||
install(TARGETS ${plugin_name} DESTINATION ${QML_INSTALL_DIR}/${qml_install_dir_path})
|
||||
install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/${qml_install_dir_path})
|
||||
|
||||
# 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 POST_BUILD
|
||||
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/
|
||||
)
|
||||
copy ${CMAKE_CURRENT_SOURCE_DIR}/qmldir ${CMAKE_BINARY_DIR}/bin/${qml_install_dir_path})
|
||||
add_dependencies(${plugin_name} copy_to_build_dir_bin)
|
||||
set_target_properties(${plugin_name}
|
||||
PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${qml_install_dir_path}
|
||||
)
|
||||
endfunction()
|
||||
|
||||
install_qml_plugin(kdeconnectdeclarativeplugin "org/kde/kdeconnect")
|
||||
|
||||
|
|
Loading…
Reference in a new issue