2
${CMAKE_CURRENT_SOURCE_DIR}
5
set(PLUGIN_DIR com/ubuntu/PamAuthentication)
7
set(pamauthentication_SRCS
10
pamauthentication_plugin.cpp
11
pamauthentication_plugin.h
14
add_library(PamAuthentication MODULE
15
${pamauthentication_SRCS}
18
target_link_libraries(PamAuthentication pam)
20
qt5_use_modules(PamAuthentication Gui Qml Quick Widgets DBus)
22
# Copy the plugin, the qmldir file and other assets to the build dir for running in QtCreator
23
if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
24
add_custom_command(TARGET PamAuthentication POST_BUILD
25
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/../${PLUGIN_DIR}
26
COMMENT "Creating plugin directory layout in the build directory"
27
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/qmldir ${CMAKE_CURRENT_BINARY_DIR}/../${PLUGIN_DIR}
28
COMMENT "Copying the qmldir file to the build directory"
29
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:PamAuthentication> ${CMAKE_CURRENT_BINARY_DIR}/../${PLUGIN_DIR}
30
COMMENT "Copying the plugin binary to the build directory"
32
endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
35
install(TARGETS PamAuthentication DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN_DIR})
36
install(FILES qmldir DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN_DIR})