summaryrefslogtreecommitdiff
path: root/indra/cmake/Variables.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'indra/cmake/Variables.cmake')
-rw-r--r--indra/cmake/Variables.cmake81
1 files changed, 81 insertions, 0 deletions
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
new file mode 100644
index 0000000000..7e10f27418
--- /dev/null
+++ b/indra/cmake/Variables.cmake
@@ -0,0 +1,81 @@
+# -*- cmake -*-
+#
+# Definitions of variables used throughout the Second Life build
+# process.
+#
+# Platform variables:
+#
+# DARWIN - Mac OS X
+# LINUX - Linux
+# WINDOWS - Windows
+#
+# What to build:
+#
+# VIEWER - viewer and other viewer-side components
+# SERVER - simulator and other server-side bits
+
+
+# Relative and absolute paths to subtrees.
+
+set(LIBS_CLOSED_PREFIX)
+set(LIBS_OPEN_PREFIX)
+set(LIBS_SERVER_PREFIX)
+set(SCRIPTS_PREFIX ../scripts)
+set(SERVER_PREFIX)
+set(VIEWER_PREFIX)
+
+set(LIBS_CLOSED_DIR ${CMAKE_SOURCE_DIR}/${LIBS_CLOSED_PREFIX})
+set(LIBS_OPEN_DIR ${CMAKE_SOURCE_DIR}/${LIBS_OPEN_PREFIX})
+set(LIBS_SERVER_DIR ${CMAKE_SOURCE_DIR}/${LIBS_SERVER_PREFIX})
+set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/${SCRIPTS_PREFIX})
+set(SERVER_DIR ${CMAKE_SOURCE_DIR}/${SERVER_PREFIX})
+set(VIEWER_DIR ${CMAKE_SOURCE_DIR}/${VIEWER_PREFIX})
+
+set(LIBS_PREBUILT_DIR ${CMAKE_SOURCE_DIR}/../libraries CACHE PATH
+ "Location of prebuilt libraries.")
+
+
+if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+ set(WINDOWS ON BOOL FORCE)
+ set(ARCH i686)
+ set(LL_ARCH ${ARCH}_win32)
+ set(LL_ARCH_DIR ${ARCH}-win32)
+endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+
+if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(LINUX ON BOOl FORCE)
+ execute_process(COMMAND uname -m COMMAND sed s/i.86/i686/
+ OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(LL_ARCH ${ARCH}_linux)
+ set(LL_ARCH_DIR ${ARCH}-linux)
+endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+
+if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ set(DARWIN 1)
+ set(ARCH universal)
+ set(LL_ARCH ${ARCH}_darwin)
+ set(LL_ARCH_DIR ${ARCH}-darwin)
+ set(CMAKE_OSX_ARCHITECTURES i386;ppc)
+ set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk)
+endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+
+
+set(VIEWER ON CACHE BOOL "Build Second Life viewer.")
+
+
+set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.")
+
+if (NOT STANDALONE AND EXISTS ${LIBS_PREBUILT_DIR}/include/havok)
+ set(SERVER ON CACHE BOOL "Build Second Life server software.")
+endif (NOT STANDALONE AND EXISTS ${LIBS_PREBUILT_DIR}/include/havok)
+
+if (LINUX AND SERVER AND VIEWER)
+ MESSAGE(FATAL_ERROR "
+The indra source does not currently support building SERVER and VIEWER at the same time.
+Please set one of these values to OFF in your CMake cache file.
+(either by running ccmake or by editing CMakeCache.txt by hand)
+For more information, please see JIRA DEV-14943 - Cmake Linux cannot build both VIEWER and SERVER in one build environment
+ ")
+endif (LINUX AND SERVER AND VIEWER)
+
+source_group("CMake Rules" FILES CMakeLists.txt)