File: FindIsoCodes.cmake

package info (click to toggle)
fcitx 1%3A4.2.9.9-2.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,800 kB
  • sloc: ansic: 134,151; cpp: 7,280; sh: 2,778; python: 800; xml: 345; makefile: 42
file content (32 lines) | stat: -rw-r--r-- 1,086 bytes parent folder | download | duplicates (8)
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
# - 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_JSON iso_639-3.json
          HINTS "${PC_ISOCODES_PREFIX}/share/iso-codes/json/"
          )

find_file(ISOCODES_ISO3166_JSON iso_3166-1.json
          HINTS "${PC_ISOCODES_PREFIX}/share/iso-codes/json/"
          )

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(IsoCodes  DEFAULT_MSG  ISOCODES_ISO639_JSON ISOCODES_ISO3166_JSON)

mark_as_advanced(ISOCODES_ISO639_JSON ISOCODES_ISO3166_JSON)