summaryrefslogtreecommitdiffstats
path: root/tdescreensaver/kxsconfig/CMakeLists.txt
blob: 103203db63bab4faf9f297201059340393aa0127 (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
#################################################
#
#  (C) 2011 Golubev Alexander
#  fatzer2 (AT) gmail.com
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

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

link_directories(
  ${TQT_LIBRARY_DIRS}
  ${X11_LIBRARY_DIR}
)

##### kxsconfig #################################
set( target kxsconfig )

set( ${target}_SRCS
   kxscontrol.cpp kxsitem.cpp kxsxml.cpp kxsconfig.cpp )

tde_add_executable( ${target} AUTOMOC
  SOURCES ${${target}_SRCS}
  LINK tdeio-shared ${X11_Xt_LIB}
  DESTINATION ${BIN_INSTALL_DIR}
)

##### kxsrun ####################################
set( target kxsrun )

set( ${target}_SRCS
   kxsrun.cpp kxscontrol.cpp kxsitem.cpp kxsxml.cpp )

tde_add_executable( ${target} AUTOMOC
  SOURCES ${${target}_SRCS}
  LINK tdeio-shared
  DESTINATION ${BIN_INSTALL_DIR}
)

##### install desktops ##########################
# code from kde4
FILE(GLOB _desktopfiles "ScreenSavers/*.desktop" )
string( REPLACE ":" ";" SEARCH_XSCREENSAVER_CONFIG_DIRS "${XSCREENSAVER_CONFIG_DIRS}" )
foreach(_currentdesktopfile ${_desktopfiles})
  STRING(REGEX REPLACE ".desktop" "" _newitem "${_currentdesktopfile}" )
  #MESSAGE(STATUS "newItem <${_newitem}>")
  GET_FILENAME_COMPONENT(_screensaverName ${_newitem} NAME_WE)
  #MESSAGE(STATUS "name without extension <${_screensaverName}>")
  find_file(XSCREENSAVER_FILE_FOUND ${_screensaverName}.xml PATHS ${SEARCH_XSCREENSAVER_CONFIG_DIRS} )
  if(XSCREENSAVER_FILE_FOUND)
    MESSAGE(STATUS "xscreensaver name ${_screensaverName} found")
  else(XSCREENSAVER_FILE_FOUND)
    MESSAGE(STATUS "xscreensaver name ${_screensaverName} not found")
  endif(XSCREENSAVER_FILE_FOUND)
  if( XSCREENSAVER_FILE_FOUND OR WITH_ALL_INCLUDED_XSCREENSAVERS )
    tde_create_translated_desktop(
      SOURCE ${_currentdesktopfile}
      DESTINATION ${APPS_INSTALL_DIR}/System/ScreenSavers
      PO_DIR tdescreensaver-desktops
    )
  endif()
  unset(XSCREENSAVER_FILE_FOUND CACHE)
endforeach(_currentdesktopfile ${_desktopfiles})