TDE base libraries and programs
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

579 líneas
17 KiB

  1. #################################################
  2. #
  3. # (C) 2010-2012 Serghei Amelian
  4. # serghei (DOT) amelian (AT) gmail.com
  5. #
  6. # (C) 2014 Timothy Pearson
  7. # kb9vqf (AT) pearsoncomputing (DOT) net
  8. #
  9. # Improvements and feedback are welcome
  10. #
  11. # This file is released under GPL >= 2
  12. #
  13. #################################################
  14. # required stuff
  15. tde_setup_architecture_flags( )
  16. include(TestBigEndian)
  17. test_big_endian(WORDS_BIGENDIAN)
  18. tde_setup_largefiles( )
  19. find_package( TQt )
  20. find_package( TDE )
  21. ##### check for libdl ###########################
  22. set( DL_LIBRARIES dl )
  23. check_library_exists( ${DL_LIBRARIES} dlopen /lib HAVE_LIBDL )
  24. if( NOT HAVE_LIBDL )
  25. unset( DL_LIBRARIES )
  26. check_function_exists( dlopen HAVE_DLOPEN )
  27. if( HAVE_DLOPEN )
  28. set( HAVE_LIBDL 1 )
  29. endif( HAVE_DLOPEN )
  30. endif( NOT HAVE_LIBDL )
  31. # stdint.h (drkonqi)
  32. if( BUILD_DRKONQI )
  33. check_include_file( stdint.h HAVE_STDINT_H )
  34. endif( )
  35. # termios.h (tdm, tdeioslave)
  36. if( BUILD_TDM OR BUILD_TDEIOSLAVES )
  37. check_include_file( termios.h HAVE_TERMIOS_H )
  38. endif( )
  39. # sys/bitypes.h (drkonqi)
  40. if( BUILD_DRKONQI )
  41. check_include_file( sys/bitypes.h HAVE_SYS_BITYPES_H )
  42. endif( )
  43. # sys/ioctl.h (tdeioslave/fish, kcontrol/info)
  44. if( BUILD_TDEIOSLAVES OR BUILD_KCONTROL )
  45. check_include_file( sys/ioctl.h HAVE_SYS_IOCTL_H )
  46. endif( )
  47. # sys/types.h (drkonqi, tdeioslave/smtp)
  48. if( BUILD_DRKONQI OR BUILD_TDEIOSLAVES )
  49. check_include_file( sys/types.h HAVE_SYS_TYPES_H )
  50. endif( )
  51. # sys/time.h (tdeioslave/sftp, ksmserver, ksplashml)
  52. if( BUILD_KSMSERVER OR BUILD_KSPLASHML OR BUILD_TDEIOSLAVES)
  53. check_include_file( sys/time.h HAVE_SYS_TIME_H )
  54. check_include_files( "sys/time.h;time.h" TIME_WITH_SYS_TIME )
  55. endif( )
  56. # pam
  57. if( WITH_PAM AND (BUILD_KCHECKPASS OR BUILD_TDM) )
  58. check_library_exists( pam pam_start "" HAVE_PAM )
  59. if( HAVE_PAM )
  60. check_include_file( "security/pam_appl.h" SECURITY_PAM_APPL_H )
  61. endif( )
  62. if( HAVE_PAM AND SECURITY_PAM_APPL_H )
  63. set( PAM_LIBRARY pam ${DL_LIBRARIES} )
  64. else( )
  65. tde_message_fatal( "pam are requested, but not found on your system" )
  66. endif( )
  67. endif( )
  68. # crypt
  69. set( CRYPT_LIBRARY crypt )
  70. check_library_exists( ${CRYPT_LIBRARY} crypt "" HAVE_CRYPT )
  71. if( NOT HAVE_CRYPT )
  72. unset( CRYPT_LIBRARY )
  73. check_function_exists( crypt LIBC_HAVE_CRYPT )
  74. if( LIBC_HAVE_CRYPT )
  75. set( HAVE_CRYPT 1 CACHE INTERNAL "" FORCE )
  76. endif( LIBC_HAVE_CRYPT )
  77. endif( NOT HAVE_CRYPT )
  78. # hal (ksmserver, tdeioslaves)
  79. if( WITH_HAL )
  80. pkg_search_module( HAL hal )
  81. if( NOT HAL_FOUND )
  82. tde_message_fatal( "hal is required, but was not found on your system" )
  83. endif( )
  84. endif( )
  85. # tdehwlib (drkonqi, kcontrol, kicker, ksmserver, tdeioslaves, tdm)
  86. if( WITH_TDEHWLIB )
  87. tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${TDE_INCLUDE_DIR}" )
  88. check_cxx_source_compiles( "
  89. #include <kdemacros.h>
  90. #ifndef __TDE_HAVE_TDEHWLIB
  91. #error tdecore is not build with tdehwlib
  92. #endif
  93. int main() { return 0; } "
  94. HAVE_TDEHWLIB
  95. )
  96. tde_restore( CMAKE_REQUIRED_INCLUDES )
  97. if( NOT HAVE_TDEHWLIB )
  98. tde_message_fatal( "tdehwlib is required, but not built in tdecore" )
  99. endif( NOT HAVE_TDEHWLIB )
  100. endif( )
  101. # udev (tsak)
  102. if( BUILD_TSAK )
  103. pkg_search_module( UDEV udev )
  104. if( NOT UDEV_FOUND )
  105. tde_message_fatal( "udev is required, but was not found on your system" )
  106. endif( )
  107. endif( )
  108. ##### check for gcc visibility support #########
  109. if( WITH_GCC_VISIBILITY )
  110. tde_setup_gcc_visibility( )
  111. endif( )
  112. # xrender (kdesktop, konsole, kcontrol, kicker, twin)
  113. if( WITH_XRENDER OR BUILD_KDESKTOP OR BUILD_KONSOLE OR BUILD_KCONTROL OR BUILD_KICKER )
  114. pkg_search_module( XRENDER xrender )
  115. if( XRENDER_FOUND )
  116. set( HAVE_XRENDER 1 )
  117. elseif( WITH_XRENDER )
  118. tde_message_fatal( "xrender is requested, but was not found on your system" )
  119. endif( )
  120. endif( )
  121. # xrandr (kcontrol, twin/compot-tde)
  122. if( WITH_XRANDR )
  123. pkg_search_module( XRANDR xrandr )
  124. if( NOT XRANDR_FOUND )
  125. tde_message_fatal( "xrandr are requested, but not found on your system" )
  126. endif( )
  127. endif( )
  128. # xinerama (ksplashml, twin/compot-tde)
  129. if( WITH_XINERAMA )
  130. pkg_search_module( XINERAMA xinerama )
  131. if( XINERAMA_FOUND )
  132. set( HAVE_XINERAMA 1 )
  133. else( )
  134. tde_message_fatal( "xinerama is requested, but not found on your system" )
  135. endif( )
  136. endif( WITH_XINERAMA )
  137. # xcursor (tdeioslave, kcontrol)
  138. if( WITH_XCURSOR )
  139. pkg_search_module( XCURSOR xcursor )
  140. if( XCURSOR_FOUND )
  141. set( HAVE_XCURSOR 1 )
  142. else( )
  143. tde_message_fatal( "xcursor is requested, but was not found on your system" )
  144. endif( )
  145. endif( )
  146. # xcomposite (kicker, twin)
  147. if( WITH_XCOMPOSITE )
  148. pkg_search_module( XCOMPOSITE xcomposite )
  149. if( XCOMPOSITE_FOUND )
  150. set( HAVE_XCOMPOSITE 1 )
  151. else( XCOMPOSITE_FOUND )
  152. tde_message_fatal( "xcomposite is requested, but was not found on your system" )
  153. endif( XCOMPOSITE_FOUND )
  154. # xdamage (twin/kompmgr)
  155. pkg_search_module( XDAMAGE xdamage )
  156. if( NOT XDAMAGE_FOUND )
  157. tde_message_fatal( "xdamage is required for xcomposite support, but was not found on your system" )
  158. endif( )
  159. # xext (twin/kompmgr)
  160. pkg_search_module( XEXT xext )
  161. if( NOT XEXT_FOUND )
  162. tde_message_fatal( "xext is required for xcomposite support, but was not found on your system" )
  163. endif( )
  164. # for (twin/compton)
  165. # older libXext (e.g.in debian-6.0) doesn't provide XSyncFence
  166. tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${XEXT_INCLUDE_DIRS}" )
  167. tde_save_and_set( CMAKE_REQUIRED_LIBRARIES "${XEXT_LIBRARIES}" )
  168. check_symbol_exists( "XSyncCreateFence" "X11/Xlib.h;X11/extensions/sync.h" HAVE_XEXT_XSYNCFENCE )
  169. tde_restore( CMAKE_REQUIRED_LIBRARIES )
  170. tde_restore( CMAKE_REQUIRED_INCLUDES )
  171. endif( )
  172. # xfixes (klipper, kicker)
  173. if( WITH_XFIXES )
  174. pkg_search_module( XFIXES xfixes )
  175. if( XFIXES_FOUND )
  176. set( HAVE_XFIXES 1 CACHE INTERNAL "" FORCE )
  177. else( )
  178. tde_message_fatal( "xfixes is requested, but was not found on your system" )
  179. endif( )
  180. endif( )
  181. # libconfig (twin/compton-tde)
  182. if( WITH_LIBCONFIG )
  183. pkg_search_module( LIBCONFIG libconfig )
  184. if( LIBCONFIG_FOUND )
  185. set( HAVE_LIBCONFIG 1 )
  186. # TODO replace with functionality check
  187. if( LIBCONFIG_VERSION VERSION_LESS 1.4.0 )
  188. set( HAVE_LIBCONFIG_OLD_API 1 )
  189. endif( )
  190. else( LIBCONFIG_FOUND )
  191. tde_message_fatal( "libconfig is requested, but was not found on your system" )
  192. endif( )
  193. endif( )
  194. # pcre (twin/compton-tde)
  195. if( WITH_PCRE )
  196. pkg_search_module( LIBPCRE libpcre )
  197. if( NOT LIBPCRE_FOUND )
  198. tde_message_fatal( "pcre support is requested, but not found on your system" )
  199. endif( NOT LIBPCRE_FOUND )
  200. endif( )
  201. # xtest (kxkb)
  202. if( WITH_XTEST )
  203. pkg_search_module( XTEST xtst )
  204. if( XTEST_FOUND )
  205. set( HAVE_XTEST 1 )
  206. else( XTEST_FOUND )
  207. tde_message_fatal( "xtest is requested, but was not found on your system" )
  208. endif( )
  209. endif( )
  210. # xscreensaver ()
  211. if( WITH_XSCREENSAVER )
  212. pkg_search_module( XSS xscrnsaver )
  213. if( XSS_FOUND )
  214. tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${XSS_INCLUDE_DIRS}" )
  215. check_library_exists( Xss XScreenSaverQueryInfo "${XSS_LIBRARY_DIRS}" HAVE_XSSLIB )
  216. tde_restore( CMAKE_REQUIRED_INCLUDES )
  217. else( XSS_FOUND )
  218. check_library_exists( Xss XScreenSaverQueryInfo "" HAVE_XSSLIB )
  219. endif( XSS_FOUND )
  220. if( NOT HAVE_XSSLIB )
  221. check_library_exists( Xext XScreenSaverQueryInfo "${XEXT_LIBRARY_DIRS}" HAVE_XEXT_XSS )
  222. if( HAVE_XEXT_XSS )
  223. set( HAVE_XSSLIB 1 )
  224. pkg_search_module( XSS xext )
  225. endif( )
  226. endif( )
  227. tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${XSS_INCLUDE_DIRS}" )
  228. check_include_file( X11/extensions/scrnsaver.h HAVE_XSCREENSAVER_H )
  229. tde_restore( CMAKE_REQUIRED_INCLUDES )
  230. if( HAVE_XSSLIB AND HAVE_XSCREENSAVER_H )
  231. set( HAVE_XSCREENSAVER 1 )
  232. else( )
  233. tde_message_fatal( "xscreensaver is requested, but was not found on your system" )
  234. endif( )
  235. # We don't really need the xscreensaver package for building, we only need to know
  236. # where xscreensaver stores its executables. So give the user the possibility
  237. # to define XSCREENSAVER_DIR and speficy the location manually.
  238. include( FindXscreensaver.cmake ) # not really good practise
  239. if( NOT XSCREENSAVER_DIR )
  240. tde_message_fatal(
  241. "xscreensaver is requested, but cmake can not determine the location of XSCREENSAVER_DIR
  242. You have to either specify it manually with e.g. -DXSCREENSAVER_DIR=/usr/lib/misc/xscreensaver/
  243. or make sure that xscreensaver installed properly" )
  244. endif( )
  245. endif( )
  246. # openGL (kdesktop or kcontrol or tdescreensaver or twin/compot-tde )
  247. if( WITH_OPENGL )
  248. pkg_search_module( GL gl )
  249. if( GL_FOUND )
  250. # some extra check, stricktly speaking they are not necessary
  251. tde_save_and_set( CMAKE_REQUIRED_LIBRARIES ${GL_LIBRARIES} )
  252. tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${GL_INCLUDE_DIRS}" )
  253. tde_save_and_set( CMAKE_REQUIRED_FLAGS "${GL_LDFLAGS}" )
  254. check_symbol_exists( glXChooseVisual "GL/glx.h" HAVE_GLXCHOOSEVISUAL )
  255. tde_restore( CMAKE_REQUIRED_LIBRARIES )
  256. tde_restore( CMAKE_REQUIRED_INCLUDES )
  257. tde_restore( CMAKE_REQUIRED_FLAGS )
  258. if( NOT HAVE_GLXCHOOSEVISUAL )
  259. tde_message_fatal( "opengl is requested and found, but it doesn't provides glXChooseVisual() or GL/glx.h" )
  260. endif( )
  261. else( )
  262. check_library_exists( GL glXChooseVisual "" HAVE_GLXCHOOSEVISUAL )
  263. if( HAVE_GLXCHOOSEVISUAL )
  264. set( GL_LIBRARIES "GL" )
  265. else( HAVE_GLXCHOOSEVISUAL )
  266. tde_message_fatal( "opengl is requested, but not found on your system" )
  267. endif( HAVE_GLXCHOOSEVISUAL )
  268. endif( )
  269. if( BUILD_KCONTROL )
  270. pkg_search_module( GLU glu )
  271. if( NOT GLU_FOUND )
  272. check_library_exists( GLU gluGetString "" HAVE_GLUGETSTRING )
  273. if( HAVE_GLUGETSTRING )
  274. set( GLU_LIBRARIES "GLU" )
  275. else( HAVE_GLUGETSTRING )
  276. tde_message_fatal( "glu is required, but not found on your system" )
  277. endif( HAVE_GLUGETSTRING )
  278. endif( )
  279. endif( BUILD_KCONTROL )
  280. endif( )
  281. # glib-2.0
  282. if( BUILD_NSPLUGINS )
  283. pkg_search_module( GLIB2 glib-2.0 )
  284. if( NOT GLIB2_FOUND )
  285. tde_message_fatal( "glib-2.0 are required, but not found on your system" )
  286. endif( )
  287. endif( )
  288. # kde_socklen_t
  289. if( BUILD_TDEIOSLAVES OR BUILD_KSYSGUARD )
  290. set( kde_socklen_t socklen_t )
  291. endif( )
  292. # getifaddrs (kcontrol, tdm)
  293. if( BUILD_KCONTROL OR BUILD_TDM )
  294. check_function_exists( getifaddrs HAVE_GETIFADDRS )
  295. endif( )
  296. # xkb (konsole, tdm, kxkb)
  297. if( BUILD_KONSOLE OR BUILD_TDM OR BUILD_KXKB )
  298. check_include_file( X11/XKBlib.h HAVE_X11_XKBLIB_H )
  299. if( HAVE_X11_XKBLIB_H )
  300. check_library_exists( X11 XkbLockModifiers "" HAVE_XKB )
  301. if( BUILD_TDM )
  302. check_library_exists( X11 XkbSetPerClientControls "" HAVE_XKBSETPERCLIENTCONTROLS )
  303. endif( )
  304. endif( )
  305. endif( )
  306. # XBINDIR, XLIBDIR (tdm, kxkb)
  307. if( BUILD_TDM OR BUILD_KXKB )
  308. find_program( some_x_program NAMES iceauth xrdb xterm )
  309. if( NOT some_x_program )
  310. set( some_x_program /usr/bin/xrdb )
  311. message( STATUS "Warning: Could not determine X binary directory. Assuming /usr/bin." )
  312. endif( )
  313. get_filename_component( proto_xbindir "${some_x_program}" PATH )
  314. get_filename_component( XBINDIR "${proto_xbindir}" ABSOLUTE )
  315. get_filename_component( xrootdir "${XBINDIR}" PATH )
  316. set( XBINDIR ${XBINDIR} CACHE INTERNAL "" FORCE )
  317. set( XLIBDIR "${xrootdir}/lib/X11" CACHE INTERNAL "" FORCE )
  318. endif( )
  319. # arts
  320. if( WITH_ARTS )
  321. pkg_search_module( ARTS arts )
  322. if( NOT ARTS_FOUND )
  323. message( FATAL_ERROR "\naRts is requested, but was not found on your system" )
  324. endif( )
  325. else( )
  326. set( WITHOUT_ARTS 1 )
  327. endif( )
  328. # libart
  329. if( WITH_LIBART )
  330. pkg_search_module( LIBART libart-2.0 )
  331. if( NOT LIBART_FOUND )
  332. message(FATAL_ERROR "\nlibart-2.0 support are requested, but not found on your system" )
  333. endif( NOT LIBART_FOUND )
  334. set( HAVE_LIBART 1 )
  335. endif( WITH_LIBART )
  336. # dbus (tdm, kdesktop, twin/compton-tde.c)
  337. if( BUILD_TDM OR BUILD_KDESKTOP OR (BUILD_TWIN AND WITH_XCOMPOSITE) )
  338. pkg_search_module( DBUS dbus-1 )
  339. if( NOT DBUS_FOUND )
  340. tde_message_fatal( "dbus-1 is required, but was not found on your system" )
  341. endif( )
  342. endif( )
  343. # dbus-1-tqt (kdesktop)
  344. if( BUILD_KDESKTOP )
  345. pkg_search_module( DBUS_1_TQT dbus-1-tqt )
  346. if( NOT DBUS_1_TQT_FOUND )
  347. tde_message_fatal( "dbus-1-tqt is required, but was not found on your system" )
  348. endif( )
  349. endif( )
  350. # dbus-tqt (ksmserver, kicker, tdeioslaves(media))
  351. if( WITH_HAL AND (BUILD_KSMSERVER OR BUILD_KICKER OR BUILD_TDEIOSLAVES) )
  352. # check for dbus-tqt
  353. # dbus-tqt need Qt flags
  354. pkg_check_modules( DBUS_TQT REQUIRED dbus-tqt )
  355. tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
  356. set( CMAKE_REQUIRED_INCLUDES ${DBUS_TQT_INCLUDE_DIRS} ${TQT_INCLUDE_DIRS} ${TQT_INCLUDE_DIRS})
  357. set( CMAKE_REQUIRED_LIBRARIES ${DBUS_TQT_LDFLAGS} ${TQT_LDFLAGS} ${QT_LDFLAGS} )
  358. check_cxx_source_compiles("
  359. #include <tqt.h>
  360. #include <dbus/connection.h>
  361. int main(int, char**) { return 0; } "
  362. HAVE_DBUS_QT3_07 )
  363. tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
  364. if( NOT HAVE_DBUS_QT3_07 )
  365. tde_message_fatal( "dbus-tqt is required, but was not found on your system" )
  366. endif( )
  367. endif( )
  368. # check for krb5
  369. if( WITH_KRB5 )
  370. pkg_search_module( KRB5 krb5 )
  371. if( NOT KRB5_FOUND )
  372. check_include_file( kadm5/admin.h HAVE_KRB_KADM_H )
  373. if( NOT HAVE_KRB_KADM_H )
  374. message(FATAL_ERROR "\nKerberos support was requested, but krb5 was not found on your system" )
  375. endif( NOT HAVE_KRB_KADM_H )
  376. endif( NOT KRB5_FOUND )
  377. set( HAVE_KRB5 1 )
  378. set( LIBTDELDAP_LIBRARIES "tdeldap" )
  379. endif( )
  380. # check for libr
  381. if( WITH_ELFICON )
  382. pkg_search_module( LIBR libr )
  383. if( NOT LIBR_FOUND )
  384. message(FATAL_ERROR "\nelficon support was requested, but libr was not found on your system" )
  385. endif( NOT LIBR_FOUND )
  386. if( NOT "${LIBR_VERSION}" STREQUAL "0.6.0" )
  387. message(FATAL_ERROR "\nelficon support was requested, but the libr version on your system may not be compatible with TDE" )
  388. endif( NOT "${LIBR_VERSION}" STREQUAL "0.6.0" )
  389. set( HAVE_ELFICON 1 )
  390. endif( )
  391. #
  392. # For kxkb, try to find the path to the Xkb rules files:
  393. #
  394. # 1: ask for the path from xkeyboard-config's pkg-config file
  395. # 2: ask for the path from xkbcomp's pkg-config file
  396. # 3: look under the "FILES" heading in the man page for setxkbmap
  397. # 4: take the prefix/libdir from xkbfile's pkg-config file and try the
  398. # "${prefix}/share/X11" and "${libdir}/X11" directories
  399. #
  400. # Alternatively, just take an overriding value from the command line.
  401. #
  402. if( BUILD_KXKB )
  403. if( NOT X11_XKB_RULES_DIR )
  404. pkg_search_module( XKB_CONFIG xkeyboard-config )
  405. if( XKB_CONFIG_FOUND )
  406. execute_process(
  407. COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=xkb_base xkeyboard-config
  408. OUTPUT_VARIABLE KB_RULES_DIR
  409. OUTPUT_STRIP_TRAILING_WHITESPACE
  410. )
  411. if( NOT "${KB_RULES_DIR}" STREQUAL "" )
  412. string(REGEX REPLACE "/xkb$" "/" X11_XKB_RULES_DIR "${KB_RULES_DIR}" )
  413. endif( )
  414. endif( )
  415. endif( )
  416. if( NOT X11_XKB_RULES_DIR )
  417. pkg_search_module( XKBCOMP xkbcomp )
  418. if( XKBCOMP_FOUND )
  419. execute_process(
  420. COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=xkbconfigdir xkbcomp
  421. OUTPUT_VARIABLE KB_RULES_DIR
  422. OUTPUT_STRIP_TRAILING_WHITESPACE
  423. )
  424. if( NOT "${KB_RULES_DIR}" STREQUAL "" )
  425. string(REGEX REPLACE "/xkb$" "/" X11_XKB_RULES_DIR "${KB_RULES_DIR}" )
  426. endif( )
  427. endif( )
  428. endif( )
  429. if( NOT X11_XKB_RULES_DIR )
  430. execute_process(
  431. COMMAND man -P cat setxkbmap
  432. OUTPUT_VARIABLE SETXKBMAP_OUTPUT
  433. OUTPUT_STRIP_TRAILING_WHITESPACE
  434. ERROR_VARIABLE SETXKBMAP_OUTPUT
  435. ERROR_STRIP_TRAILING_WHITESPACE
  436. RESULT_VARIABLE SETXKBMAP_RC
  437. )
  438. if( "${SETXKBMAP_RC}" STREQUAL "0" AND
  439. "${SETXKBMAP_OUTPUT}" MATCHES "\n.*FILES.*\n[^/]*(/[^\n]*/)xkb.*\n" )
  440. if( EXISTS "${CMAKE_MATCH_1}xkb" )
  441. set( X11_XKB_RULES_DIR "${CMAKE_MATCH_1}" )
  442. endif( )
  443. endif( )
  444. endif( )
  445. if( NOT X11_XKB_RULES_DIR )
  446. execute_process(
  447. COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=libdir xkbfile
  448. OUTPUT_VARIABLE KB_RULES_LIBDIR
  449. OUTPUT_STRIP_TRAILING_WHITESPACE
  450. )
  451. execute_process(
  452. COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=prefix xkbfile
  453. OUTPUT_VARIABLE KB_RULES_PREFIX
  454. OUTPUT_STRIP_TRAILING_WHITESPACE
  455. )
  456. if( KB_RULES_LIBDIR AND KB_RULES_PREFIX )
  457. find_file( RULES_FILE
  458. NAMES xorg xfree86
  459. PATHS "${KB_RULES_PREFIX}/share/X11"
  460. "${KB_RULES_LIBDIR}/X11"
  461. PATH_SUFFIXES xkb/rules
  462. NO_DEFAULT_PATH
  463. )
  464. if( RULES_FILE )
  465. string( REGEX REPLACE "/xkb/rules/(xorg|xfree86)$" "/" X11_XKB_RULES_DIR "${RULES_FILE}" )
  466. endif( )
  467. endif( )
  468. endif( )
  469. if( X11_XKB_RULES_DIR )
  470. if( NOT "${X11_XKB_RULES_DIR}" MATCHES "/$" )
  471. set( X11_XKB_RULES_DIR "${X11_XKB_RULES_DIR}/" )
  472. endif( )
  473. message( STATUS "Adding ${X11_XKB_RULES_DIR} to XKb rules directory search" )
  474. else( )
  475. message( STATUS "No additional XKb rules directory found" )
  476. endif( )
  477. endif( )