From 28bb987738e90f2f741b0792410de0d549ad66db Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 26 Sep 2014 18:15:43 -0400 Subject: use the value established by autobuild itself when finding autobuild --- indra/cmake/FindAutobuild.cmake | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'indra/cmake/FindAutobuild.cmake') 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) -- cgit v1.2.3 From 25acc8ecadc6af4942eb9d6b012a8ac5d3b81ae8 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 29 Sep 2014 16:22:29 +0000 Subject: remove chatty autobuild message --- indra/cmake/FindAutobuild.cmake | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/cmake/FindAutobuild.cmake') diff --git a/indra/cmake/FindAutobuild.cmake b/indra/cmake/FindAutobuild.cmake index 187eae7a08..d831257d4b 100755 --- a/indra/cmake/FindAutobuild.cmake +++ b/indra/cmake/FindAutobuild.cmake @@ -35,7 +35,6 @@ IF (NOT 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") -- cgit v1.2.3 From 35d141967a1ce42f8f22fda8423d893e2e2ed78a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 19 Dec 2014 15:58:20 -0500 Subject: Defend against cygwin-style AUTOBUILD path in environment. --- indra/cmake/FindAutobuild.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/cmake/FindAutobuild.cmake') diff --git a/indra/cmake/FindAutobuild.cmake b/indra/cmake/FindAutobuild.cmake index d831257d4b..84ae41e8aa 100755 --- a/indra/cmake/FindAutobuild.cmake +++ b/indra/cmake/FindAutobuild.cmake @@ -13,6 +13,9 @@ 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}) + # In case $AUTOBUILD is a cygwin path, fix it back to Windows style + STRING(REGEX REPLACE "^/cygdrive/(.)/" "\\1:/" AUTOBUILD_EXECUTABLE + "${AUTOBUILD_EXECUTABLE}") ELSE (DEFINED ENV{AUTOBUILD}) IF(WIN32) SET(AUTOBUILD_EXE_NAMES autobuild.cmd autobuild.exe) -- cgit v1.2.3 From 355d00685137aa0c42fdd93853096ac718a474b2 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 8 Jan 2015 16:48:29 -0500 Subject: Rationalize use of AUTOBUILD environment variable across languages. Ensure that AUTOBUILD is always in native path syntax on every platform. Remove local build.sh logic to infer AUTOBUILD: either the generic build.sh has set it properly, or scream for help. Since cygwin bash scripts need a cygwin-syntax path to autobuild, convert to a local 'autobuild' variable using shell_path. Remove kludges in other languages involving cygdrive twiddling. --- indra/cmake/FindAutobuild.cmake | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'indra/cmake/FindAutobuild.cmake') diff --git a/indra/cmake/FindAutobuild.cmake b/indra/cmake/FindAutobuild.cmake index 84ae41e8aa..ea5ad6d108 100755 --- a/indra/cmake/FindAutobuild.cmake +++ b/indra/cmake/FindAutobuild.cmake @@ -4,7 +4,7 @@ # # Output variables: # -# AUTOBUILD_EXECUTABLE - path to autobuild or pautobuild executable +# AUTOBUILD_EXECUTABLE - path to autobuild executable @@ -13,12 +13,9 @@ 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}) - # In case $AUTOBUILD is a cygwin path, fix it back to Windows style - STRING(REGEX REPLACE "^/cygdrive/(.)/" "\\1:/" AUTOBUILD_EXECUTABLE - "${AUTOBUILD_EXECUTABLE}") ELSE (DEFINED ENV{AUTOBUILD}) IF(WIN32) - SET(AUTOBUILD_EXE_NAMES autobuild.cmd autobuild.exe) + SET(AUTOBUILD_EXE_NAMES autobuild.exe autobuild.cmd) ELSE(WIN32) SET(AUTOBUILD_EXE_NAMES autobuild) ENDIF(WIN32) @@ -28,21 +25,19 @@ IF (NOT AUTOBUILD_EXECUTABLE) AUTOBUILD_EXECUTABLE NAMES ${AUTOBUILD_EXE_NAMES} PATHS - ENV PATH - ${CMAKE_SOURCE_DIR}/.. - ${CMAKE_SOURCE_DIR}/../.. - ${CMAKE_SOURCE_DIR}/../../.. + ENV PATH + ${CMAKE_SOURCE_DIR}/.. + ${CMAKE_SOURCE_DIR}/../.. + ${CMAKE_SOURCE_DIR}/../../.. PATH_SUFFIXES "/autobuild/bin/" ) ENDIF (DEFINED ENV{AUTOBUILD}) - IF (AUTOBUILD_EXECUTABLE) - GET_FILENAME_COMPONENT(_autobuild_name ${AUTOBUILD_EXECUTABLE} NAME_WE) - ELSE (AUTOBUILD_EXECUTABLE) + IF (NOT AUTOBUILD_EXECUTABLE) IF (AUTOBUILD_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Could not find autobuild executable") ENDIF (AUTOBUILD_FIND_REQUIRED) - ENDIF (AUTOBUILD_EXECUTABLE) + ENDIF (NOT AUTOBUILD_EXECUTABLE) MARK_AS_ADVANCED(AUTOBUILD_EXECUTABLE) ENDIF (NOT AUTOBUILD_EXECUTABLE) -- cgit v1.2.3