diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2022-03-29 02:53:16 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2022-03-29 09:50:36 +0200 |
commit | 2988432a72a28f15a292d79f3c6b6d11b294899c (patch) | |
tree | 076d291f80748cf39ae9ffa6c0f457da959659cc /FindXscreensaver.cmake | |
parent | cf8c057b08d378085d81c4c6f39eb3a7cdb1c299 (diff) | |
download | tdeartwork-2988432a72a28f15a292d79f3c6b6d11b294899c.tar.gz tdeartwork-2988432a72a28f15a292d79f3c6b6d11b294899c.zip |
Modify screen savers detection that the XSCREENSAVER_DIRSr14.0.12
and XSCREENSAVER_CONFIG_DIRS variables allow multiple paths.
Likewise, the XSCREENSAVER HACKS DIRS variable used to search
for an screen saver executable can contain multiple paths.
This relates to #19.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit b0eb71dedfc68ca5ce981b2853af9a64b2c2e67f)
Diffstat (limited to 'FindXscreensaver.cmake')
-rw-r--r-- | FindXscreensaver.cmake | 72 |
1 files changed, 37 insertions, 35 deletions
diff --git a/FindXscreensaver.cmake b/FindXscreensaver.cmake index 72ee19ed..93ca210e 100644 --- a/FindXscreensaver.cmake +++ b/FindXscreensaver.cmake @@ -8,29 +8,7 @@ if (NOT XSCREENSAVER_FOUND) set(xscreensaver_alldirs) - set(xscreensaver_checkdirs ${TDE_INCLUDE_DIR} - /usr/ - /usr/local/ - /opt/local/ - /usr/X11R6/ - /opt/kde/ - /opt/kde3/ - /usr/kde/ - /usr/local/kde/ - /usr/local/xscreensaver/ - /usr/openwin/lib/xscreensaver/ - /etc/ ) - foreach(suffix lib${LIB_SUFFIX}/xscreensaver lib${LIB_SUFFIX}/misc/xscreensaver lib/xscreensaver lib64/xscreensaver libexec/xscreensaver -bin/xscreensaver-hacks hacks) - foreach(xscreensaver_path ${xscreensaver_checkdirs} ) - set(xscreensaver_alldirs ${xscreensaver_alldirs} ${xscreensaver_path}/${suffix}) - endforeach(xscreensaver_path ${xscreensaver_checkdirs} ) - endforeach(suffix lib${LIB_SUFFIX}/xscreensaver lib/xscreensaver lib64/xscreensaver libexec/xscreensaver bin/xscreensaver-hacks hacks) - FIND_PATH(XSCREENSAVER_DIR deco ${xscreensaver_alldirs}) - - set(XSCREENSAVER_CONFIG_DIR) - FIND_PATH(XSCREENSAVER_CONFIG_DECO config/deco.xml - ${TDE_INCLUDE_DIR} + set(xscreensaver_checkdirs /usr/ /usr/local/ /opt/local/ @@ -45,33 +23,58 @@ bin/xscreensaver-hacks hacks) /usr/openwin/lib/xscreensaver/ /etc/ ) - #MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR :<${XSCREENSAVER_CONFIG_DIR}>") + foreach(suffix lib${LIB_SUFFIX}/xscreensaver lib${LIB_SUFFIX}/misc/xscreensaver + lib/xscreensaver lib64/xscreensaver libexec/xscreensaver + bin/xscreensaver-hacks hacks) + foreach(xscreensaver_path ${xscreensaver_checkdirs} ) + set(xscreensaver_alldirs ${xscreensaver_alldirs} ${xscreensaver_path}/${suffix}) + endforeach(xscreensaver_path ${xscreensaver_checkdirs} ) + endforeach() + + set(XSCREENSAVER_DIRS) + FIND_PATH(XSCREENSAVER_DIR_DECO deco ${xscreensaver_alldirs}) + FIND_PATH(XSCREENSAVER_DIR_FLUX flux ${xscreensaver_alldirs}) + if(XSCREENSAVER_DIR_DECO) + list(APPEND XSCREENSAVER_DIRS ${XSCREENSAVER_DIR_DECO}) + endif(XSCREENSAVER_DIR_DECO) + if(XSCREENSAVER_DIR_FLUX) + list(APPEND XSCREENSAVER_DIRS ${XSCREENSAVER_DIR_FLUX}) + endif(XSCREENSAVER_DIR_FLUX) + list( REMOVE_DUPLICATES XSCREENSAVER_DIRS ) + string( REPLACE ";" ":" XSCREENSAVER_DIRS "${XSCREENSAVER_DIRS}" ) + set(XSCREENSAVER_CONFIG_DIRS) + FIND_PATH(XSCREENSAVER_CONFIG_DECO config/deco.xml ${xscreensaver_checkdirs} ) + FIND_PATH(XSCREENSAVER_CONFIG_FLUX config/flux.xml ${xscreensaver_checkdirs} ) if(XSCREENSAVER_CONFIG_DECO) - set(XSCREENSAVER_CONFIG_DIR "${XSCREENSAVER_CONFIG_DECO}/config/") - #MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR <${XSCREENSAVER_CONFIG_DIR}>") + list(APPEND XSCREENSAVER_CONFIG_DIRS "${XSCREENSAVER_CONFIG_DECO}/config/") endif(XSCREENSAVER_CONFIG_DECO) - + if(XSCREENSAVER_CONFIG_FLUX) + list(APPEND XSCREENSAVER_CONFIG_DIRS "${XSCREENSAVER_CONFIG_FLUX}/config/") + endif(XSCREENSAVER_CONFIG_FLUX) # Try and locate XScreenSaver config when path doesn't include config - if(NOT XSCREENSAVER_CONFIG_DIR) - FIND_PATH(XSCREENSAVER_CONFIG_DIR deco.xml + if(NOT XSCREENSAVER_CONFIG_DIRS) + FIND_PATH(XSCREENSAVER_CONFIG_DIRS deco.xml /etc/xscreensaver ) - endif(NOT XSCREENSAVER_CONFIG_DIR) + endif(NOT XSCREENSAVER_CONFIG_DIRS) + + list( REMOVE_DUPLICATES XSCREENSAVER_CONFIG_DIRS ) + string( REPLACE ";" ":" XSCREENSAVER_CONFIG_DIRS "${XSCREENSAVER_CONFIG_DIRS}" ) endif(NOT XSCREENSAVER_FOUND) #MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR :<${XSCREENSAVER_CONFIG_DIR}>") #MESSAGE(STATUS "XSCREENSAVER_DIR :<${XSCREENSAVER_DIR}>") # Need to fix hack -if(XSCREENSAVER_DIR AND XSCREENSAVER_CONFIG_DIR) +if(XSCREENSAVER_DIRS AND XSCREENSAVER_CONFIG_DIRS) set(XSCREENSAVER_FOUND TRUE) -endif(XSCREENSAVER_DIR AND XSCREENSAVER_CONFIG_DIR) +endif(XSCREENSAVER_DIRS AND XSCREENSAVER_CONFIG_DIRS) if (XSCREENSAVER_FOUND) if (NOT Xscreensaver_FIND_QUIETLY) - message(STATUS "Found SCREENSAVER_CONFIG_DIR <${XSCREENSAVER_CONFIG_DIR}>") + message(STATUS "Found SCREENSAVER_CONFIG_DIRS <${XSCREENSAVER_CONFIG_DIRS}>") endif (NOT Xscreensaver_FIND_QUIETLY) else (XSCREENSAVER_FOUND) if (Xscreensaver_FIND_REQUIRED) @@ -79,5 +82,4 @@ else (XSCREENSAVER_FOUND) endif (Xscreensaver_FIND_REQUIRED) endif (XSCREENSAVER_FOUND) - -MARK_AS_ADVANCED(XSCREENSAVER_DIR XSCREENSAVER_CONFIG_DIR) +MARK_AS_ADVANCED(XSCREENSAVER_DIRS XSCREENSAVER_CONFIG_DIRS) |