PageRenderTime 19ms CodeModel.GetById 2ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/cmake/Variables.cmake

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 158 lines | 106 code | 28 blank | 24 comment | 24 complexity | 69469f5c581ab73f4ee5e6bba01f6f9c MD5 | raw file
  1# -*- cmake -*-
  2#
  3# Definitions of variables used throughout the Second Life build
  4# process.
  5#
  6# Platform variables:
  7#
  8#   DARWIN  - Mac OS X
  9#   LINUX   - Linux
 10#   WINDOWS - Windows
 11#
 12# What to build:
 13#
 14#   VIEWER - viewer and other viewer-side components
 15#   SERVER - simulator and other server-side bits
 16
 17
 18# Relative and absolute paths to subtrees.
 19
 20if(NOT DEFINED COMMON_CMAKE_DIR)
 21    set(COMMON_CMAKE_DIR "${CMAKE_SOURCE_DIR}/cmake")
 22endif(NOT DEFINED COMMON_CMAKE_DIR)
 23
 24set(LIBS_CLOSED_PREFIX)
 25set(LIBS_OPEN_PREFIX)
 26set(LIBS_SERVER_PREFIX)
 27set(SCRIPTS_PREFIX ../scripts)
 28set(SERVER_PREFIX)
 29set(VIEWER_PREFIX)
 30set(INTEGRATION_TESTS_PREFIX)
 31set(LL_TESTS ON CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation")
 32set(INCREMENTAL_LINK OFF CACHE BOOL "Use incremental linking on win32 builds (enable for faster links on some machines)")
 33
 34if(LIBS_CLOSED_DIR)
 35  file(TO_CMAKE_PATH "${LIBS_CLOSED_DIR}" LIBS_CLOSED_DIR)
 36else(LIBS_CLOSED_DIR)
 37  set(LIBS_CLOSED_DIR ${CMAKE_SOURCE_DIR}/${LIBS_CLOSED_PREFIX})
 38endif(LIBS_CLOSED_DIR)
 39if(LIBS_COMMON_DIR)
 40  file(TO_CMAKE_PATH "${LIBS_COMMON_DIR}" LIBS_COMMON_DIR)
 41else(LIBS_COMMON_DIR)
 42  set(LIBS_COMMON_DIR ${CMAKE_SOURCE_DIR}/${LIBS_OPEN_PREFIX})
 43endif(LIBS_COMMON_DIR)
 44set(LIBS_OPEN_DIR ${LIBS_COMMON_DIR})
 45
 46set(LIBS_SERVER_DIR ${CMAKE_SOURCE_DIR}/${LIBS_SERVER_PREFIX})
 47set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/${SCRIPTS_PREFIX})
 48set(SERVER_DIR ${CMAKE_SOURCE_DIR}/${SERVER_PREFIX})
 49set(VIEWER_DIR ${CMAKE_SOURCE_DIR}/${VIEWER_PREFIX})
 50
 51set(AUTOBUILD_INSTALL_DIR ${CMAKE_BINARY_DIR}/packages)
 52
 53set(LIBS_PREBUILT_DIR ${AUTOBUILD_INSTALL_DIR} CACHE PATH
 54    "Location of prebuilt libraries.")
 55
 56if (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
 57  # We use this as a marker that you can try to use the proprietary libraries.
 58  set(INSTALL_PROPRIETARY ON CACHE BOOL "Install proprietary binaries")
 59endif (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
 60set(TEMPLATE_VERIFIER_OPTIONS "" CACHE STRING "Options for scripts/template_verifier.py")
 61set(TEMPLATE_VERIFIER_MASTER_URL "http://bitbucket.org/lindenlab/master-message-template/raw/tip/message_template.msg" CACHE STRING "Location of the master message template")
 62
 63if (NOT CMAKE_BUILD_TYPE)
 64  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
 65      "Build type.  One of: Debug Release RelWithDebInfo" FORCE)
 66endif (NOT CMAKE_BUILD_TYPE)
 67
 68if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
 69  set(WINDOWS ON BOOL FORCE)
 70  set(ARCH i686)
 71  set(LL_ARCH ${ARCH}_win32)
 72  set(LL_ARCH_DIR ${ARCH}-win32)
 73  set(WORD_SIZE 32)
 74endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
 75
 76if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
 77  set(LINUX ON BOOl FORCE)
 78
 79  # If someone has specified a word size, use that to determine the
 80  # architecture.  Otherwise, let the architecture specify the word size.
 81  if (WORD_SIZE EQUAL 32)
 82    set(ARCH i686)
 83  elseif (WORD_SIZE EQUAL 64)
 84    set(ARCH x86_64)
 85  else (WORD_SIZE EQUAL 32)
 86    execute_process(COMMAND uname -m COMMAND sed s/i.86/i686/
 87                    OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
 88    if (ARCH STREQUAL x86_64)
 89      set(WORD_SIZE 64)
 90    else (ARCH STREQUAL x86_64)
 91      set(WORD_SIZE 32)
 92    endif (ARCH STREQUAL x86_64)
 93  endif (WORD_SIZE EQUAL 32)
 94
 95  set(LL_ARCH ${ARCH}_linux)
 96  set(LL_ARCH_DIR ${ARCH}-linux)
 97endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
 98
 99if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
100  set(DARWIN 1)
101  
102  # To support a different SDK update these Xcode settings:
103  set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
104  set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
105  set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "4.0")
106  set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
107
108  # NOTE: To attempt an i386/PPC Universal build, add this on the configure line:
109  # -DCMAKE_OSX_ARCHITECTURES:STRING='i386;ppc'
110  # Build only for i386 by default, system default on MacOSX 10.6 is x86_64
111  if (NOT CMAKE_OSX_ARCHITECTURES)
112    set(CMAKE_OSX_ARCHITECTURES i386)
113  endif (NOT CMAKE_OSX_ARCHITECTURES)
114
115  if (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
116    set(ARCH universal)
117  else (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
118    if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
119      set(ARCH ppc)
120    else (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
121      set(ARCH i386)
122    endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
123  endif (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
124
125  set(LL_ARCH ${ARCH}_darwin)
126  set(LL_ARCH_DIR universal-darwin)
127  set(WORD_SIZE 32)
128endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
129
130# Default deploy grid
131set(GRID agni CACHE STRING "Target Grid")
132
133set(VIEWER ON CACHE BOOL "Build Second Life viewer.")
134set(VIEWER_CHANNEL "LindenDeveloper" CACHE STRING "Viewer Channel Name")
135set(VIEWER_LOGIN_CHANNEL ${VIEWER_CHANNEL} CACHE STRING "Fake login channel for A/B Testing")
136
137set(VERSION_BUILD "0" CACHE STRING "Revision number passed in from the outside")
138set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.")
139set(UNATTENDED OFF CACHE BOOL "Should be set to ON for building with VC Express editions.")
140
141if (NOT STANDALONE AND EXISTS ${CMAKE_SOURCE_DIR}/llphysics)
142    set(SERVER ON CACHE BOOL "Build Second Life server software.")
143endif (NOT STANDALONE AND EXISTS ${CMAKE_SOURCE_DIR}/llphysics)
144
145if (LINUX AND SERVER AND VIEWER)
146  MESSAGE(FATAL_ERROR "
147The indra source does not currently support building SERVER and VIEWER at the same time.
148Please set one of these values to OFF in your CMake cache file.
149(either by running ccmake or by editing CMakeCache.txt by hand)
150For more information, please see JIRA DEV-14943 - Cmake Linux cannot build both VIEWER and SERVER in one build environment
151  ")
152endif (LINUX AND SERVER AND VIEWER)
153
154
155set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header directives where supported.")
156
157source_group("CMake Rules" FILES CMakeLists.txt)
158