summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2012-07-05 06:08:34 -0400
committerOz Linden <oz@lindenlab.com>2012-07-05 06:08:34 -0400
commit14f754f1608a0f8ca62ead485669d88cc651667d (patch)
tree0270cbc6fb6a74a5290eef59c69bb253fe976037 /indra/cmake
parent619e0b9a359a0dd340bcb734ff6397b8af976258 (diff)
begin integrating building of llphysicsextensions from source here (incomplete)
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/Havok.cmake67
-rw-r--r--indra/cmake/LLPhysicsExtensions.cmake38
2 files changed, 85 insertions, 20 deletions
diff --git a/indra/cmake/Havok.cmake b/indra/cmake/Havok.cmake
new file mode 100644
index 0000000000..d3df85fd39
--- /dev/null
+++ b/indra/cmake/Havok.cmake
@@ -0,0 +1,67 @@
+# -*- cmake -*-
+
+use_prebuilt_binary(havok-source)
+set(Havok_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/havok/Source)
+list(APPEND Havok_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/havok/Demo)
+
+set(HAVOK_DEBUG_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug/havok)
+set(HAVOK_RELEASE_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/release/havok)
+
+set(HAVOK_LIBS
+ hkBase
+ hkCompat
+ hkGeometryUtilities
+ hkInternal
+ hkSerialize
+ hkSceneData
+ hkpCollide
+ hkpUtilities
+ hkpConstraintSolver
+ hkpDynamics
+ hkpInternal
+ hkaiInternal
+ hkaiPathfinding
+ hkaiAiPhysicsBridge
+ hkcdInternal
+ hkcdCollide
+ hkpVehicle
+ hkVisualize
+ hkaiVisualize
+ hkgpConvexDecomposition
+)
+
+unset(HK_DEBUG_LIBRARIES)
+unset(HK_RELEASE_LIBRARIES)
+unset(HK_LIBRARIES)
+
+foreach(HAVOK_LIB ${HAVOK_LIBS})
+ find_library(HAVOK_DEBUG_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_DEBUG_LIBRARY_PATH})
+ find_library(HAVOK_RELEASE_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_RELEASE_LIBRARY_PATH})
+
+ if(LINUX)
+ set(cmd "mkdir")
+ set(debug_dir "${HAVOK_DEBUG_LIBRARY_PATH}/${HAVOK_LIB}")
+ set(release_dir "${HAVOK_RELEASE_LIBRARY_PATH}/${HAVOK_LIB}")
+ exec_program( ${cmd} ${HAVOK_DEBUG_LIBRARY_PATH} ARGS ${debug_dir} OUTPUT_VARIABLE rv)
+ exec_program( ${cmd} ${HAVOK_RELEASE_LIBRARY_PATH} ARGS ${release_dir} OUTPUT_VARIABLE rv)
+
+ set(cmd "ar")
+ set(arg " -xv")
+ set(arg "${arg} ../lib${HAVOK_LIB}.a")
+ exec_program( ${cmd} ${debug_dir} ARGS ${arg} OUTPUT_VARIABLE rv)
+ exec_program( ${cmd} ${release_dir} ARGS ${arg} OUTPUT_VARIABLE rv)
+
+ file(GLOB extracted_debug "${debug_dir}/*.o")
+ file(GLOB extracted_release "${release_dir}/*.o")
+ list(APPEND HK_DEBUG_LIBRARIES ${extracted_debug})
+ list(APPEND HK_RELEASE_LIBRARIES ${extracted_release})
+ list(APPEND HK_LIBRARIES debug ${extracted_debug}
+ optimized ${extracted_release})
+ else(LINUX)
+ list(APPEND HK_DEBUG_LIBRARIES ${HAVOK_DEBUG_LIB_${HAVOK_LIB}})
+ list(APPEND HK_RELEASE_LIBRARIES ${HAVOK_RELEASE_LIB_${HAVOK_LIB}})
+ list(APPEND HK_LIBRARIES debug ${HAVOK_DEBUG_LIB_${HAVOK_LIB}}
+ optimized ${HAVOK_RELEASE_LIB_${HAVOK_LIB}})
+ endif (LINUX)
+endforeach(HAVOK_LIB)
+
diff --git a/indra/cmake/LLPhysicsExtensions.cmake b/indra/cmake/LLPhysicsExtensions.cmake
index 73d5dd59cf..c9812d06d6 100644
--- a/indra/cmake/LLPhysicsExtensions.cmake
+++ b/indra/cmake/LLPhysicsExtensions.cmake
@@ -1,29 +1,27 @@
# -*- cmake -*-
include(Prebuilt)
-if (INSTALL_PROPRIETARY AND NOT STANDALONE)
- use_prebuilt_binary(llphysicsextensions)
- set(LLPHYSICS_EXTENSIONS_LIB_NAME llphysicsextensions)
-else (INSTALL_PROPRIETARY AND NOT STANDALONE)
- use_prebuilt_binary(llphysicsextensionsstub)
- set(LLPHYSICS_EXTENSIONS_LIB_NAME llphysicsextensionsstub)
-endif (INSTALL_PROPRIETARY AND NOT STANDALONE)
+# Note that the use_prebuilt_binary macros below do not in fact include binaries;
+# the llphysicsextensions_* packages are source only and are built here.
+# The source package and the stub package both build libraries of the same name.
-set(LLPHYSICS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/lib/include)
+# Using the real wrapper or the stub can be controlled with -DHAVOK:BOOL={ON,OFF}
+# the default
+if (INSTALL_PROPRIETARY)
+ set(HAVOK ON CACHE BOOL "Use Havok physics library")
+endif (INSTALL_PROPRIETARY)
-set(LLPHYSICS_DEBUG_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug)
-set(LLPHYSICS_RELEASE_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/release)
+if (HAVOK)
+ include(Havok)
+ use_prebuilt_binary(llphysicsextensions_source)
+ set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/src)
-find_library(LL_PHYSICS_DEBUG_LIB ${LLPHYSICS_EXTENSIONS_LIB_NAME} PATHS ${LLPHYSICS_DEBUG_LIBRARY_PATH})
-find_library(LL_PHYSICS_RELEASE_LIB ${LLPHYSICS_EXTENSIONS_LIB_NAME} PATHS ${LLPHYSICS_RELEASE_LIBRARY_PATH})
+else (HAVOK)
+ use_prebuilt_binary(llphysicsextensions_stub)
+ set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub)
-set(LLPHYSICS_LIBRARIES
+endif (HAVOK)
- debug ${LL_PHYSICS_DEBUG_LIB}
- optimized ${LL_PHYSICS_RELEASE_LIB}
-)
+set(LLPHYSICSEXTENSIONS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/llphysicsextensions)
-if (LINUX)
- list(INSERT LLPHYSICS_LIBRARIES 0 -Wl,--start-group)
- list(APPEND LLPHYSICS_LIBRARIES -Wl,--end-group)
-endif (LINUX)
+add_subdirectory(${LLPHYSICSEXTENSIONS_SRC_DIR} llphysicsextensions)