~verzegnassi-stefano/+junk/ubuntu-terminal-app-uitk13

« back to all changes in this revision

Viewing changes to src/plugin/pamauthentication/CMakeLists.txt

  • Committer: Filippo Scognamiglio
  • Date: 2014-10-25 04:42:31 UTC
  • Revision ID: flscogna@gmail.com-20141025044231-javjhusbqa171127
Initial reboot commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
include_directories(
 
2
    ${CMAKE_CURRENT_SOURCE_DIR}
 
3
)
 
4
 
 
5
set(PLUGIN_DIR com/ubuntu/PamAuthentication)
 
6
 
 
7
set(pamauthentication_SRCS
 
8
    pamauthentication.cpp
 
9
    pamauthentication.h
 
10
    pamauthentication_plugin.cpp
 
11
    pamauthentication_plugin.h
 
12
)
 
13
 
 
14
add_library(PamAuthentication MODULE
 
15
    ${pamauthentication_SRCS}
 
16
)
 
17
 
 
18
target_link_libraries(PamAuthentication pam)
 
19
 
 
20
qt5_use_modules(PamAuthentication Gui Qml Quick Widgets DBus)
 
21
 
 
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"
 
31
    )
 
32
endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
 
33
 
 
34
# Install plugin file
 
35
install(TARGETS PamAuthentication DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN_DIR})
 
36
install(FILES qmldir DESTINATION ${QT_IMPORTS_DIR}/${PLUGIN_DIR})
 
37