From 353ae84c90a2b9a1fefff3f94787746168da1a6c Mon Sep 17 00:00:00 2001
From: Nicky <nicky.dasmijn@gmail.com>
Date: Wed, 6 Apr 2022 23:30:22 +0200
Subject: [PATCH] CMake 3.8.0 compatibility for the ugly havok/stub 3p which
 really is just a source tarball

---
 indra/newview/CMakeLists.txt | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 1253c0971c2..e213087f407 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -52,9 +52,19 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
 
 if (NOT HAVOK_TPV)
    # When using HAVOK_TPV, the library is precompiled, so no need for this
+
+   # Stub and probably havok lib itself is a hack, autobuild loads a 3p that really is a source tarball
+   # which includes a CMakeList.txt and then this whole source tree gets pushed into out build ... :/
+   # To make matters worse there is a internal assumption about the structure of the viewers CMake layout,
+   # which means we need to duct tape this togther ...
+   get_property( LLCOMMON_INCLUDE_DIRS TARGET llcommon PROPERTY INTERFACE_INCLUDE_DIRECTORIES )
+   get_property( LLMATH_INCLUDE_DIRS TARGET llmath PROPERTY INTERFACE_INCLUDE_DIRECTORIES )
+
    add_subdirectory(${LLPHYSICSEXTENSIONS_SRC_DIR} llphysicsextensions)
-   cmake_policy( SET CMP0079 NEW)
-   target_link_libraries(llphysicsextensionsstub llcommon llmath)
+
+   # Another hack that works with newer cmake versions:
+   #cmake_policy( SET CMP0079 NEW)
+   #target_link_libraries(llphysicsextensionsstub llcommon llmath)
 endif (NOT HAVOK_TPV)
 
 
-- 
GitLab