File: FindIsoCodes.cmake

package info (click to toggle)
fcitx5-configtool 5.1.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,512 kB
  • sloc: cpp: 9,083; javascript: 31; makefile: 3; sh: 2
file content (36 lines) | stat: -rw-r--r-- 1,263 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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# - Try to find the IsoCodes libraries
# Once done this will define
#
#  ISOCODES_FOUND - system has ISOCODES
#  ISOCODES_INCLUDE_DIR - the ISOCODES include directory
#  ISOCODES_LIBRARIES - ISOCODES library
#
# Copyright (c) 2012 CSSlayer <wengxt@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

if(ISOCODES_INCLUDE_DIR AND ISOCODES_LIBRARIES)
    # Already in cache, be silent
    set(ISOCODES_FIND_QUIETLY TRUE)
endif(ISOCODES_INCLUDE_DIR AND ISOCODES_LIBRARIES)

find_package(PkgConfig)
pkg_check_modules(PC_ISOCODES iso-codes)

find_file(ISOCODES_ISO639_2_JSON iso_639-2.json
          HINTS "${PC_ISOCODES_PREFIX}/share/iso-codes/json/"
          )

find_file(ISOCODES_ISO639_3_JSON iso_639-3.json
          HINTS "${PC_ISOCODES_PREFIX}/share/iso-codes/json/"
          )

find_file(ISOCODES_ISO639_5_JSON iso_639-5.json
          HINTS "${PC_ISOCODES_PREFIX}/share/iso-codes/json/"
          )

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(IsoCodes  DEFAULT_MSG  ISOCODES_ISO639_2_JSON ISOCODES_ISO639_3_JSON ISOCODES_ISO639_5_JSON)

mark_as_advanced(ISOCODES_ISO639_2_JSON ISOCODES_ISO639_3_JSON ISOCODES_ISO639_5_JSON)