Update: Translations from eints
[openttd-github.git] / cmake / FindAllegro.cmake
blob5d873dd3e18ebc80ae35f551d2a2dca1b2df1dc4
1 #[=======================================================================[.rst:
2 FindAllegro
3 -------
5 Finds the allegro library.
7 Result Variables
8 ^^^^^^^^^^^^^^^^
10 This will define the following variables:
12 ``Allegro_FOUND``
13   True if the system has the allegro library.
14 ``Allegro_INCLUDE_DIRS``
15   Include directories needed to use allegro.
16 ``Allegro_LIBRARIES``
17   Libraries needed to link to allegro.
18 ``Allegro_VERSION``
19   The version of the allegro library which was found.
21 Cache Variables
22 ^^^^^^^^^^^^^^^
24 The following cache variables may also be set:
26 ``Allegro_INCLUDE_DIR``
27   The directory containing ``allegro.h``.
28 ``Allegro_LIBRARY``
29   The path to the allegro library.
31 #]=======================================================================]
33 find_package(PkgConfig QUIET)
34 pkg_check_modules(PC_Allegro QUIET allegro<5)
36 find_path(Allegro_INCLUDE_DIR
37     NAMES allegro.h
38     PATHS ${PC_Allegro_INCLUDE_DIRS}
41 find_library(Allegro_LIBRARY
42     NAMES alleg
43     PATHS ${PC_Allegro_LIBRARY_DIRS}
46 set(Allegro_VERSION ${PC_Allegro_VERSION})
48 include(FindPackageHandleStandardArgs)
49 find_package_handle_standard_args(Allegro
50     FOUND_VAR Allegro_FOUND
51     REQUIRED_VARS
52         Allegro_LIBRARY
53         Allegro_INCLUDE_DIR
54     VERSION_VAR Allegro_VERSION
57 if(Allegro_FOUND)
58     set(Allegro_LIBRARIES ${Allegro_LIBRARY})
59     set(Allegro_INCLUDE_DIRS ${Allegro_INCLUDE_DIR})
60 endif()
62 mark_as_advanced(
63     Allegro_INCLUDE_DIR
64     Allegro_LIBRARY