File: FindMediaPlayerInfo.cmake

package info (click to toggle)
solid 5.78.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 5,100 kB
  • sloc: cpp: 21,549; xml: 464; lex: 111; yacc: 83; sh: 14; makefile: 5
file content (22 lines) | stat: -rw-r--r-- 895 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# This module searches media-player info
# The following variables are provided:
#  MEDIAPLAYERINFO_FOUND  - TRUE if found
#  MEDIAPLAYERINFO_PATH - the path where the files can be found

set(XDG_DATA_DIRS_ENV $ENV{XDG_DATA_DIRS})  # if(ENV{..}) does not work for me
if(XDG_DATA_DIRS_ENV)
   find_path(MEDIAPLAYERINFO_PATH sony_psp.mpi
             PATHS ENV XDG_DATA_DIRS
             PATH_SUFFIXES "media-player-info" NO_DEFAULT_PATH
            )
else()
   set(XDG_DATA_DIRS "/usr/share")
   message(STATUS "Warning: environment variable XDG_DATA_DIRS not set, falling back to ${XDG_DATA_DIRS}")
   find_path(MEDIAPLAYERINFO_PATH sony_psp.mpi
             PATHS "${XDG_DATA_DIRS}"
             PATH_SUFFIXES "media-player-info" NO_DEFAULT_PATH
            )
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MediaPlayerInfo  DEFAULT_MSG MEDIAPLAYERINFO_PATH )