PageRenderTime 17ms CodeModel.GetById 2ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 1ms

/indra/CMakeLists.txt

https://bitbucket.org/lindenlab/viewer-beta/
CMake | 134 lines | 90 code | 21 blank | 23 comment | 15 complexity | afd685cf284abcead2f9dd9daaa42837 MD5 | raw file
  1# -*- cmake -*-
  2
  3# cmake_minimum_required should appear before any
  4# other commands to guarantee full compatibility
  5# with the version specified
  6
  7# The "cmake -E touch" command was released with 2.4.8.
  8cmake_minimum_required(VERSION 2.4.8 FATAL_ERROR)
  9
 10# This makes cmake 2.6 not complain about version 2.4 compatibility.
 11if (COMMAND cmake_policy)
 12  cmake_policy(SET CMP0003 OLD)
 13endif (COMMAND cmake_policy)
 14
 15set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING
 16    "The root project/makefile/solution name. Defaults to SecondLife.")
 17project(${ROOT_PROJECT_NAME})
 18
 19set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
 20
 21include(Variables)
 22
 23if (DARWIN)
 24  # 2.6.4 fixes a Mac bug in get_target_property(... "SLPlugin" LOCATION):
 25  # before that version it returns "pathname/SLPlugin", whereas the correct
 26  # answer is "pathname/SLPlugin.app/Contents/MacOS/SLPlugin".
 27  cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
 28endif (DARWIN)
 29
 30if (NOT CMAKE_BUILD_TYPE)
 31  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
 32      "Build type.  One of: Debug Release RelWithDebInfo" FORCE)
 33endif (NOT CMAKE_BUILD_TYPE)
 34
 35# For the library installation process;
 36# see cmake/Prebuild.cmake for the counterpart code.
 37if ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${CMAKE_BINARY_DIR}/temp/sentinel_installed")
 38  file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/temp)
 39  file(WRITE ${CMAKE_BINARY_DIR}/temp/sentinel_installed "0")
 40endif ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${CMAKE_BINARY_DIR}/temp/sentinel_installed")
 41add_subdirectory(cmake)
 42
 43add_subdirectory(${LIBS_OPEN_PREFIX}llaudio)
 44add_subdirectory(${LIBS_OPEN_PREFIX}llcharacter)
 45add_subdirectory(${LIBS_OPEN_PREFIX}llcommon)
 46add_subdirectory(${LIBS_OPEN_PREFIX}llimage)
 47add_subdirectory(${LIBS_OPEN_PREFIX}llkdu)
 48add_subdirectory(${LIBS_OPEN_PREFIX}llimagej2coj)
 49add_subdirectory(${LIBS_OPEN_PREFIX}llinventory)
 50add_subdirectory(${LIBS_OPEN_PREFIX}llmath)
 51add_subdirectory(${LIBS_OPEN_PREFIX}llmessage)
 52add_subdirectory(${LIBS_OPEN_PREFIX}llprimitive)
 53add_subdirectory(${LIBS_OPEN_PREFIX}llrender)
 54add_subdirectory(${LIBS_OPEN_PREFIX}llvfs)
 55add_subdirectory(${LIBS_OPEN_PREFIX}llwindow)
 56add_subdirectory(${LIBS_OPEN_PREFIX}llxml)
 57
 58add_subdirectory(${LIBS_OPEN_PREFIX}lscript)
 59
 60if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
 61  add_subdirectory(${LIBS_CLOSED_PREFIX}copy_win_scripts)
 62endif (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
 63
 64add_custom_target(viewer)
 65if (VIEWER)
 66  add_subdirectory(${LIBS_OPEN_PREFIX}llcrashlogger)
 67  add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
 68  add_subdirectory(${LIBS_OPEN_PREFIX}llui)
 69  add_subdirectory(${LIBS_OPEN_PREFIX}llxuixml)
 70  add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components)
 71
 72  # Legacy C++ tests. Build always, run if LL_TESTS is true.
 73  add_subdirectory(${VIEWER_PREFIX}test)
 74
 75  # viewer media plugins
 76  add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)
 77
 78  # llplugin testbed code (is this the right way to include it?)
 79  if (LL_TESTS AND NOT LINUX)
 80    add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest)
 81  endif (LL_TESTS AND NOT LINUX)
 82
 83  if (LINUX)
 84    add_subdirectory(${VIEWER_PREFIX}linux_crash_logger)
 85    add_subdirectory(${VIEWER_PREFIX}linux_updater)
 86    add_dependencies(viewer linux-crash-logger-strip-target linux-updater)
 87  elseif (DARWIN)
 88    add_subdirectory(${VIEWER_PREFIX}mac_crash_logger)
 89    add_subdirectory(${VIEWER_PREFIX}mac_updater)
 90    add_dependencies(viewer mac-updater mac-crash-logger)
 91  elseif (WINDOWS)
 92    add_subdirectory(${VIEWER_PREFIX}win_crash_logger)
 93    # cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake
 94    if (EXISTS ${VIEWER_DIR}win_setup)
 95      add_subdirectory(${VIEWER_DIR}win_setup)
 96    endif (EXISTS ${VIEWER_DIR}win_setup)
 97    add_subdirectory(${VIEWER_PREFIX}win_updater)
 98    # add_dependencies(viewer windows-updater windows-setup windows-crash-logger)
 99    add_dependencies(viewer windows-updater windows-crash-logger)
100  elseif (SOLARIS)
101    add_subdirectory(solaris_crash_logger)
102    add_dependencies(viewer solaris-crash-logger)
103  endif (LINUX)
104
105  add_subdirectory(${VIEWER_PREFIX}newview)
106  add_dependencies(viewer secondlife-bin)
107endif (VIEWER)
108
109# Linux builds the viewer and server in 2 separate projects
110# In order for build server to work on linux, 
111# the viewer project needs a server target.
112# This is not true for mac and windows.
113if (LINUX) 
114  add_custom_target(server)
115endif (LINUX)
116if (SERVER)
117  if (NOT LINUX)
118    add_custom_target(server)
119  endif (NOT LINUX)
120  include(${SERVER_PREFIX}Server.cmake)
121endif (SERVER)
122
123# Windows builds include tools like VFS tool
124if (SERVER)
125  if (WINDOWS)
126    add_subdirectory(${SERVER_PREFIX}tools)
127  endif (WINDOWS)
128endif (SERVER)
129
130if (LL_TESTS)
131  # Define after the custom viewer and server targets are created so
132  # individual apps can add themselves as dependencies
133  add_subdirectory(${INTEGRATION_TESTS_PREFIX}integration_tests)
134endif (LL_TESTS)