diff options
author | Oz Linden <oz@lindenlab.com> | 2011-03-19 06:32:13 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-03-19 06:32:13 -0400 |
commit | 5a1b27ba5fbaaa9ee5528b1023a294bc899f7768 (patch) | |
tree | c641bd45e6384c85bff5e43ab01af5cad784283b /indra/cmake/FindAutobuild.cmake | |
parent | 1a7369408c0b2cd15dbdc79d045f3347a8ab47d1 (diff) | |
parent | 9693227cb41f909ef66f86e6699ad0bf124a7e83 (diff) |
merge out latest viewer-development
Diffstat (limited to 'indra/cmake/FindAutobuild.cmake')
-rw-r--r-- | indra/cmake/FindAutobuild.cmake | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/indra/cmake/FindAutobuild.cmake b/indra/cmake/FindAutobuild.cmake new file mode 100644 index 0000000000..45db2b6ed0 --- /dev/null +++ b/indra/cmake/FindAutobuild.cmake @@ -0,0 +1,41 @@ +# -*- cmake -*- +# +# Find the autobuild tool +# +# Output variables: +# +# AUTOBUILD_EXECUTABLE - path to autobuild or pautobuild executable + +# *TODO - if cmake was executed by autobuild, autobuild will have set the AUTOBUILD env var +# update this to check for that case + +IF (NOT AUTOBUILD_EXECUTABLE) + IF(WIN32) + SET(AUTOBUILD_EXE_NAMES autobuild.cmd autobuild.exe) + ELSE(WIN32) + SET(AUTOBUILD_EXE_NAMES autobuild) + ENDIF(WIN32) + + SET(AUTOBUILD_EXECUTABLE) + FIND_PROGRAM( + AUTOBUILD_EXECUTABLE + NAMES ${AUTOBUILD_EXE_NAMES} + PATHS + ENV PATH + ${CMAKE_SOURCE_DIR}/.. + ${CMAKE_SOURCE_DIR}/../.. + ${CMAKE_SOURCE_DIR}/../../.. + PATH_SUFFIXES "/autobuild/bin/" + ) + + IF (AUTOBUILD_EXECUTABLE) + GET_FILENAME_COMPONENT(_autobuild_name ${AUTOBUILD_EXECUTABLE} NAME_WE) + MESSAGE(STATUS "Using autobuild at: ${AUTOBUILD_EXECUTABLE}") + ELSE (AUTOBUILD_EXECUTABLE) + IF (AUTOBUILD_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find autobuild executable") + ENDIF (AUTOBUILD_FIND_REQUIRED) + ENDIF (AUTOBUILD_EXECUTABLE) + + MARK_AS_ADVANCED(AUTOBUILD_EXECUTABLE) +ENDIF (NOT AUTOBUILD_EXECUTABLE) |