Debian Codegraph @

cmake/modules/FindGettextPO.cmake

raw
1 # - Try to find GettextPO
2 #
3 # Once done this will define
4 #
5 # GETTEXTPO_FOUND - System has GETTEXTPO
6 # GETTEXTPO_INCLUDE_DIR - The GETTEXTPO include directory
7 # GETTEXTPO_LIBRARY - The library needed to use GETTEXTPO
8
9 # SPDX-FileCopyrightText: 2012 Ni Hui <[email protected]>
10 # Based off FindLibXml2.cmake from CMake 2.6.4:
11 # SPDX-FileCopyrightText: Alexander Neundorf <[email protected]>
12 #
13 # SPDX-License-Identifier: BSD-3-Clause
14
15
16 if(GETTEXTPO_INCLUDE_DIR AND GETTEXTPO_LIBRARY)
17 # in cache already
18 set(GETTEXTPO_FIND_QUIETLY TRUE)
19 endif()
20
21 find_path(GETTEXTPO_INCLUDE_DIR gettext-po.h)
22
23 find_library(GETTEXTPO_LIBRARY NAMES gettextpo)
24
25 include(FindPackageHandleStandardArgs)
26
27 # handle the QUIETLY and REQUIRED arguments and set GETTEXTPO_FOUND to TRUE if
28 # all listed variables are TRUE
29 find_package_handle_standard_args(GettextPO DEFAULT_MSG GETTEXTPO_LIBRARY GETTEXTPO_INCLUDE_DIR)
30
31 mark_as_advanced(GETTEXTPO_INCLUDE_DIR GETTEXTPO_LIBRARY)
32
33 if (GETTEXTPO_FOUND AND NOT TARGET GettextPO::GettextPO)
34 add_library(GettextPO::GettextPO UNKNOWN IMPORTED)
35 set_target_properties(GettextPO::GettextPO PROPERTIES
36 IMPORTED_LOCATION "${GETTEXTPO_LIBRARY}"
37 INTERFACE_INCLUDE_DIRECTORIES "${GETTEXTPO_INCLUDE_DIR}"
38 )
39 endif()