2
# This module looks for valac.
3
# This module defines the following values:
10
#=============================================================================
11
# Copyright Přemysl Janouch 2011
12
# All rights reserved.
14
# Redistribution and use in source and binary forms, with or without
15
# modification, are permitted provided that the following conditions are met:
16
# * Redistributions of source code must retain the above copyright
17
# notice, this list of conditions and the following disclaimer.
18
# * Redistributions in binary form must reproduce the above copyright
19
# notice, this list of conditions and the following disclaimer in the
20
# documentation and/or other materials provided with the distribution.
22
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
23
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE
26
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
33
#=============================================================================
35
find_program (VALA_COMPILER "valac")
38
execute_process (COMMAND ${VALA_COMPILER} --version
39
OUTPUT_VARIABLE VALA_VERSION)
40
string (REGEX MATCH "[.0-9]+" VALA_VERSION "${VALA_VERSION}")
43
find_program (VAPI_GEN "vapigen")
46
execute_process (COMMAND ${VAPI_GEN} --version
47
OUTPUT_VARIABLE VAPI_GEN_VERSION)
48
string (REGEX MATCH "[.0-9]+" VAPI_GEN_VERSION "${VAPI_GEN_VERSION}")
51
include (FindPackageHandleStandardArgs)
52
FIND_PACKAGE_HANDLE_STANDARD_ARGS (Vala
53
REQUIRED_VARS VALA_COMPILER
54
VERSION_VAR VALA_VERSION)
56
mark_as_advanced (VALA_COMPILER VALA_VERSION VAPI_GEN)