PageRenderTime 29ms CodeModel.GetById 26ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/cmake/FindAutobuild.cmake

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 41 lines | 27 code | 5 blank | 9 comment | 0 complexity | 2d0baa0b1ac76c957a8609186e328afb MD5 | raw file
 1# -*- cmake -*-
 2#
 3# Find the autobuild tool
 4#
 5# Output variables:
 6#
 7#   AUTOBUILD_EXECUTABLE - path to autobuild or pautobuild executable
 8
 9# *TODO - if cmake was executed by autobuild, autobuild will have set the AUTOBUILD env var
10# update this to check for that case
11
12IF (NOT AUTOBUILD_EXECUTABLE)
13    IF(WIN32)
14      SET(AUTOBUILD_EXE_NAMES autobuild.cmd autobuild.exe)
15    ELSE(WIN32)
16      SET(AUTOBUILD_EXE_NAMES autobuild)
17    ENDIF(WIN32)
18
19    SET(AUTOBUILD_EXECUTABLE)
20    FIND_PROGRAM(
21      AUTOBUILD_EXECUTABLE 
22      NAMES ${AUTOBUILD_EXE_NAMES}
23      PATHS 
24    ENV PATH
25    ${CMAKE_SOURCE_DIR}/.. 
26    ${CMAKE_SOURCE_DIR}/../..
27    ${CMAKE_SOURCE_DIR}/../../..
28      PATH_SUFFIXES "/autobuild/bin/"
29    )
30
31    IF (AUTOBUILD_EXECUTABLE)
32      GET_FILENAME_COMPONENT(_autobuild_name ${AUTOBUILD_EXECUTABLE} NAME_WE)
33      MESSAGE(STATUS "Using autobuild at: ${AUTOBUILD_EXECUTABLE}")
34    ELSE (AUTOBUILD_EXECUTABLE)
35      IF (AUTOBUILD_FIND_REQUIRED)
36    MESSAGE(FATAL_ERROR "Could not find autobuild executable")
37      ENDIF (AUTOBUILD_FIND_REQUIRED)
38    ENDIF (AUTOBUILD_EXECUTABLE)
39
40    MARK_AS_ADVANCED(AUTOBUILD_EXECUTABLE)
41ENDIF (NOT AUTOBUILD_EXECUTABLE)