From 2385cac56691e5837ad7beb08a29fdfc0815cc50 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 17 Dec 2014 16:57:48 -0500
Subject: Move the cmake package tracking files under the packages directory

---
 indra/cmake/Havok.cmake    | 14 +++++++-------
 indra/cmake/OPENAL.cmake   |  4 ----
 indra/cmake/Prebuilt.cmake | 24 ++++++++++++++++--------
 3 files changed, 23 insertions(+), 19 deletions(-)

(limited to 'indra/cmake')

diff --git a/indra/cmake/Havok.cmake b/indra/cmake/Havok.cmake
index 798e59a679..fceca13962 100755
--- a/indra/cmake/Havok.cmake
+++ b/indra/cmake/Havok.cmake
@@ -1,5 +1,5 @@
 # -*- cmake -*-
-
+include(Prebuilt)
 if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
 set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
 
@@ -61,14 +61,14 @@ foreach(HAVOK_LIB ${HAVOK_LIBS})
             set(relwithdebinfo_dir "${HAVOK_RELWITHDEBINFO_LIBRARY_PATH}/${HAVOK_LIB}")
 
     # Try to avoid extracting havok library each time we run cmake.
-    if("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted")
-      file(READ ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted "havok_${HAVOK_LIB}_extracted")
+    if("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted")
+      file(READ ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted "havok_${HAVOK_LIB}_extracted")
       if(DEBUG_PREBUILT)
         message(STATUS "havok_${HAVOK_LIB}_extracted: \"${havok_${HAVOK_LIB}_extracted}\"")
       endif(DEBUG_PREBUILT)
-    endif("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted")
+    endif("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted")
 
-    if(${CMAKE_BINARY_DIR}/temp/havok_source_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0)
+    if(${PREBUILD_TRACKING_DIR}/havok_source_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0)
       if(DEBUG_PREBUILT)
         MESSAGE(STATUS "Extracting ${HAVOK_LIB}...")
       endif(DEBUG_PREBUILT)
@@ -109,9 +109,9 @@ foreach(HAVOK_LIB ${HAVOK_LIBS})
 
       # Just assume success for now.
       set(havok_${HAVOK_LIB}_extracted 0)
-      file(WRITE ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted "${havok_${HAVOK_LIB}_extracted}")
+      file(WRITE ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted "${havok_${HAVOK_LIB}_extracted}")
 
-    endif(${CMAKE_BINARY_DIR}/temp/havok_source_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0)
+    endif(${PREBUILD_TRACKING_DIR}/havok_source_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0)
 
             file(GLOB extracted_debug "${debug_dir}/*.o")
             file(GLOB extracted_release "${release_dir}/*.o")
diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake
index df321cb918..1bbfff6f98 100755
--- a/indra/cmake/OPENAL.cmake
+++ b/indra/cmake/OPENAL.cmake
@@ -30,7 +30,3 @@ if (OPENAL)
     )
   endif()
 endif (OPENAL)
-
-if (OPENAL)
-  message(STATUS "Building with OpenAL audio support")
-endif (OPENAL)
diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake
index 5d82c9015e..98013da2f2 100755
--- a/indra/cmake/Prebuilt.cmake
+++ b/indra/cmake/Prebuilt.cmake
@@ -8,28 +8,36 @@ if(INSTALL_PROPRIETARY)
   include(FindSCP)
 endif(INSTALL_PROPRIETARY)
 
+set(PREBUILD_TRACKING_DIR ${AUTOBUILD_INSTALL_DIR}/cmake_tracking)
+# For the library installation process;
+# see cmake/Prebuild.cmake for the counterpart code.
+if ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${PREBUILD_TRACKING_DIR}/sentinel_installed")
+  file(MAKE_DIRECTORY ${PREBUILD_TRACKING_DIR})
+  file(WRITE ${PREBUILD_TRACKING_DIR}/sentinel_installed "0")
+endif ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${PREBUILD_TRACKING_DIR}/sentinel_installed")
+
 # The use_prebuilt_binary macro handles automated installation of package
 # dependencies using autobuild.  The goal is that 'autobuild install' should
 # only be run when we know we need to install a new package.  This should be
 # the case in a clean checkout, or if autobuild.xml has been updated since the
-# last run (encapsulated by the file ${CMAKE_BINARY_DIR}/temp/sentinel_installed),
+# last run (encapsulated by the file ${PREBUILD_TRACKING_DIR}/sentinel_installed),
 # or if a previous attempt to install the package has failed (the exit status
 # of previous attempts is serialized in the file
-# ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
+# ${PREBUILD_TRACKING_DIR}/${_binary}_installed)
 macro (use_prebuilt_binary _binary)
   if (NOT DEFINED USESYSTEMLIBS_${_binary})
     set(USESYSTEMLIBS_${_binary} ${USESYSTEMLIBS})
   endif (NOT DEFINED USESYSTEMLIBS_${_binary})
 
   if (NOT USESYSTEMLIBS_${_binary})
-    if("${${_binary}_installed}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/${_binary}_installed")
-      file(READ ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${_binary}_installed")
+    if("${${_binary}_installed}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/${_binary}_installed")
+      file(READ ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${_binary}_installed")
       if(DEBUG_PREBUILT)
         message(STATUS "${_binary}_installed: \"${${_binary}_installed}\"")
       endif(DEBUG_PREBUILT)
-    endif("${${_binary}_installed}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/${_binary}_installed")
+    endif("${${_binary}_installed}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/${_binary}_installed")
 
-    if(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
+    if(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
       if(DEBUG_PREBUILT)
         message("cd ${CMAKE_SOURCE_DIR} && ${AUTOBUILD_EXECUTABLE} install
         --install-dir=${AUTOBUILD_INSTALL_DIR}
@@ -42,8 +50,8 @@ macro (use_prebuilt_binary _binary)
         WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
         RESULT_VARIABLE ${_binary}_installed
         )
-      file(WRITE ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${${_binary}_installed}")
-    endif(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
+      file(WRITE ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${${_binary}_installed}")
+    endif(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
 
     if(NOT ${_binary}_installed EQUAL 0)
       message(FATAL_ERROR
-- 
cgit v1.2.3