~midori/midori/trunk

« back to all changes in this revision

Viewing changes to cmake/FindVala.cmake

  • Committer: Christian Dywan
  • Date: 2013-08-18 00:47:45 UTC
  • mto: This revision was merged to the branch mainline in revision 6370.
  • Revision ID: christian.dywan@canonical.com-20130818004745-7yo9c8utphdhjt1k
Initial minimal CMake build setup

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
 
2
 
 
3
find_program(VALA_EXECUTABLE NAMES valac)
 
4
if (NOT VALA_NOTFOUND)
 
5
    execute_process(COMMAND ${VALA_EXECUTABLE} "--version" OUTPUT_VARIABLE "VALA_VERSION")
 
6
    string(REPLACE "Vala " "" VALA_VERSION ${VALA_VERSION})
 
7
    string(STRIP ${VALA_VERSION} VALA_VERSION)
 
8
else ()
 
9
    message(FATAL_ERROR "valac not found")
 
10
endif ()
 
11
 
 
12
macro(vala_require VALA_REQUIRED)
 
13
    if (${VALA_VERSION} VERSION_GREATER ${VALA_REQUIRED} OR ${VALA_VERSION} VERSION_EQUAL ${VALA_REQUIRED})
 
14
        message(STATUS "valac ${VALA_VERSION} found")
 
15
    else ()
 
16
        message(FATAL_ERROR "valac >= ${VALA_REQUIRED} or later required")
 
17
    endif ()
 
18
endmacro(vala_require)