summaryrefslogtreecommitdiffstats
path: root/mountconfig/CMakeLists.txt
blob: 0368f57ebad686e4ca8b2dc5ecbd9554f471ff7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

include_directories(
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_BINARY_DIR}
  ${PYTHON_INCLUDE_DIR}
  ${TQT_INCLUDE_DIRS}
  ${TDE_INCLUDE_DIR}
)

link_directories(
  ${TQT_LIBRARY_DIRS}
  ${TDE_LIBRARY_DIRS}
)


##### generate kcm control module code

set( MODULE_NAME mountconfig )

set( _MODULEDIR_       ${DATA_INSTALL_DIR}/guidance )
set( _EXTRAMODULE_     ${TDE_GUIDANCE_DIST_PKG_PATH} )
set( _MODULENAME_      ${MODULE_NAME} )
set( _FACTORYFUNCTION_ create_${MODULE_NAME} )

configure_file(
  ${CMAKE_SOURCE_DIR}/templates/kcm_module_stub.cpp.cmake
  ${CMAKE_CURRENT_BINARY_DIR}/kcm_${MODULE_NAME}.cpp @ONLY
)


##### kcm_userconfig (module) #######################

tde_add_kpart( kcm_${MODULE_NAME} AUTOMOC
  SOURCES ${CMAKE_CURRENT_BINARY_DIR}/kcm_${MODULE_NAME}.cpp

  LINK
    tdecore-shared tdeui-shared
    ${PYTHON_LIBRARIES} ${PYTHONIZE_LIBRARIES}
    ${CMAKE_DL_LIBS}

  DESTINATION ${PLUGIN_INSTALL_DIR}
)


##### Generate UI files

add_custom_command(
  OUTPUT fuser_ui.py
  COMMAND ${PYTQUIC_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/fuser_ui.ui
          -o ${CMAKE_CURRENT_BINARY_DIR}/fuser_ui.py
  COMMENT "Gerenate fuser_ui.py"
)

add_custom_target( fuser_ui-pytquic ALL
  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/fuser_ui.py
)


##### other files

tde_create_translated_desktop(
  SOURCE ${MODULE_NAME}.desktop
  DESTINATION ${XDG_APPS_INSTALL_DIR}
)

install(
  FILES
    SimpleCommandRunner.py SMBShareSelectDialog.py MicroHAL.py
    fuser.py ${CMAKE_CURRENT_BINARY_DIR}/fuser_ui.py sizeview.py
  DESTINATION ${TDE_GUIDANCE_DIST_PKG_PATH}
)

install(
  PROGRAMS ${MODULE_NAME}.py
  DESTINATION ${TDE_GUIDANCE_DIST_PKG_PATH}
)

tde_install_symlink( ${TDE_GUIDANCE_DIST_PKG_PATH}/${MODULE_NAME}.py ${BIN_INSTALL_DIR}/${MODULE_NAME} )