diff options
-rwxr-xr-x | indra/cmake/FindAutobuild.cmake | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/indra/cmake/FindAutobuild.cmake b/indra/cmake/FindAutobuild.cmake index 4b5fd484ae..187eae7a08 100755 --- a/indra/cmake/FindAutobuild.cmake +++ b/indra/cmake/FindAutobuild.cmake @@ -6,10 +6,14 @@ # # 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 cmake was executed by autobuild, autobuild will have set the AUTOBUILD env var + IF (DEFINED ENV{AUTOBUILD}) + SET(AUTOBUILD_EXECUTABLE $ENV{AUTOBUILD}) + ELSE (DEFINED ENV{AUTOBUILD}) IF(WIN32) SET(AUTOBUILD_EXE_NAMES autobuild.cmd autobuild.exe) ELSE(WIN32) @@ -27,15 +31,16 @@ IF (NOT AUTOBUILD_EXECUTABLE) ${CMAKE_SOURCE_DIR}/../../.. PATH_SUFFIXES "/autobuild/bin/" ) + ENDIF (DEFINED ENV{AUTOBUILD}) - 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) + 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) + MARK_AS_ADVANCED(AUTOBUILD_EXECUTABLE) ENDIF (NOT AUTOBUILD_EXECUTABLE) |