~ubuntu-branches/ubuntu/utopic/hedgewars/utopic

« back to all changes in this revision

Viewing changes to cmake_modules/FindFreePascal.cmake

  • Committer: Package Import Robot
  • Author(s): Gianfranco Costamagna
  • Date: 2014-01-02 12:37:23 UTC
  • mfrom: (19.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20140102123723-6pdhmyj8tb5y8xbg
Tags: 0.9.20.3-1
New upstream minor release, suitable for unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# - Try to find the FreePascal executable
2
 
# Once done this will define
3
 
#
4
 
#  FREEPASCAL_FOUND       - system has Freepascal
5
 
#  FREEPASCAL_VERSION     - Freepascal version
6
 
#  FREEPASCAL_EXECUTABLE  - Freepascal executable
7
 
#
8
 
# Copyright (c) 2012, Bryan Dunsmore <dunsmoreb@gmail.com>
9
 
# Copyright (c) 2013, Vittorio Giovara <vittorio.giovara@gmail.com>
10
 
#
11
 
# Redistribution and use is allowed according to the terms of the BSD license.
12
 
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
13
 
 
14
 
 
15
 
find_program(FREEPASCAL_EXECUTABLE
16
 
    NAMES fpc
17
 
    PATHS /opt/local/bin /usr/local/bin /usr/bin
18
 
    )
19
 
 
20
 
if (FREEPASCAL_EXECUTABLE)
21
 
    # check Freepascal version
22
 
    execute_process(COMMAND ${FREEPASCAL_EXECUTABLE} -iV
23
 
                    OUTPUT_VARIABLE FREEPASCAL_VERSION
24
 
                    ERROR_VARIABLE FREEPASCAL_VERSION_ERROR
25
 
                    RESULT_VARIABLE FREEPASCAL_VERSION_RESULT
26
 
                    OUTPUT_STRIP_TRAILING_WHITESPACE
27
 
                    )
28
 
 
29
 
    if(NOT ${FREEPASCAL_VERSION_RESULT} EQUAL 0)
30
 
        message(SEND_ERROR "Command \"${FREEPASCAL_EXECUTABLE} -iV\" failed with output: ${FREEPASCAL_VERSION_ERROR}")
31
 
    endif()
32
 
endif()
33
 
 
34
 
include(FindPackageHandleStandardArgs)
35
 
find_package_handle_standard_args(FreePascal DEFAULT_MSG FREEPASCAL_EXECUTABLE FREEPASCAL_VERSION)
36
 
mark_as_advanced(FREEPASCAL_VERSION)
37