summaryrefslogtreecommitdiff
path: root/indra/CMakeLists.txt
blob: 078b17bf53ffd74fc97bed475aa465260f962213 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# -*- cmake -*-

# cmake_minimum_required should appear before any
# other commands to guarantee full compatibility
# with the version specified

# The "cmake -E touch" command was released with 2.4.8.
cmake_minimum_required(VERSION 2.4.8 FATAL_ERROR)

# This makes cmake 2.6 not complain about version 2.4 compatibility.
if (COMMAND cmake_policy)
  cmake_policy(SET CMP0003 OLD)
endif (COMMAND cmake_policy)

set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING
    "The root project/makefile/solution name. Defaults to SecondLife.")
project(${ROOT_PROJECT_NAME})

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

include(Variables)

if (DARWIN)
  # 2.6.4 fixes a Mac bug in get_target_property(... "SLPlugin" LOCATION):
  # before that version it returns "pathname/SLPlugin", whereas the correct
  # answer is "pathname/SLPlugin.app/Contents/MacOS/SLPlugin".
  cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
endif (DARWIN)

if (NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
      "Build type.  One of: Debug Release RelWithDebInfo" FORCE)
endif (NOT CMAKE_BUILD_TYPE)

# For the library installation process;
# see cmake/Prebuild.cmake for the counterpart code.
if ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${CMAKE_BINARY_DIR}/temp/sentinel_installed")
  file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/temp)
  file(WRITE ${CMAKE_BINARY_DIR}/temp/sentinel_installed "0")
endif ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${CMAKE_BINARY_DIR}/temp/sentinel_installed")
add_subdirectory(cmake)

add_subdirectory(${LIBS_OPEN_PREFIX}llaudio)
add_subdirectory(${LIBS_OPEN_PREFIX}llappearance)
add_subdirectory(${LIBS_OPEN_PREFIX}llcharacter)
add_subdirectory(${LIBS_OPEN_PREFIX}llcommon)
add_subdirectory(${LIBS_OPEN_PREFIX}llimage)
add_subdirectory(${LIBS_OPEN_PREFIX}llkdu)
add_subdirectory(${LIBS_OPEN_PREFIX}llimagej2coj)
add_subdirectory(${LIBS_OPEN_PREFIX}llinventory)
add_subdirectory(${LIBS_OPEN_PREFIX}llmath)
add_subdirectory(${LIBS_OPEN_PREFIX}llmessage)
add_subdirectory(${LIBS_OPEN_PREFIX}llprimitive)
add_subdirectory(${LIBS_OPEN_PREFIX}llrender)
add_subdirectory(${LIBS_OPEN_PREFIX}llvfs)
add_subdirectory(${LIBS_OPEN_PREFIX}llwindow)
add_subdirectory(${LIBS_OPEN_PREFIX}llxml)

add_subdirectory(${LIBS_OPEN_PREFIX}lscript)

if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
  add_subdirectory(${LIBS_CLOSED_PREFIX}copy_win_scripts)
endif (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)

add_custom_target(viewer)
if (VIEWER)
  add_subdirectory(${LIBS_OPEN_PREFIX}llcrashlogger)
  add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
  add_subdirectory(${LIBS_OPEN_PREFIX}llui)
  add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components)

  # Legacy C++ tests. Build always, run if LL_TESTS is true.
  add_subdirectory(${VIEWER_PREFIX}test)

  # viewer media plugins
  add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)

  # llplugin testbed code (is this the right way to include it?)
  if (LL_TESTS AND NOT LINUX)
    add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest)
  endif (LL_TESTS AND NOT LINUX)

  if (LINUX)
    add_subdirectory(${VIEWER_PREFIX}linux_crash_logger)
    add_subdirectory(${VIEWER_PREFIX}linux_updater)
    add_dependencies(viewer linux-crash-logger-strip-target linux-updater)
  elseif (DARWIN)
    add_subdirectory(${VIEWER_PREFIX}mac_crash_logger)
    add_subdirectory(${VIEWER_PREFIX}mac_updater)
    add_dependencies(viewer mac-updater mac-crash-logger)
  elseif (WINDOWS)
    add_subdirectory(${VIEWER_PREFIX}win_crash_logger)
    # cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake
    if (EXISTS ${VIEWER_DIR}win_setup)
      add_subdirectory(${VIEWER_DIR}win_setup)
    endif (EXISTS ${VIEWER_DIR}win_setup)
    add_subdirectory(${VIEWER_PREFIX}win_updater)
    # add_dependencies(viewer windows-updater windows-setup windows-crash-logger)
    add_dependencies(viewer windows-updater windows-crash-logger)
  elseif (SOLARIS)
    add_subdirectory(solaris_crash_logger)
    add_dependencies(viewer solaris-crash-logger)
  endif (LINUX)

  add_subdirectory(${VIEWER_PREFIX}newview)
  add_dependencies(viewer secondlife-bin)
endif (VIEWER)

# Linux builds the viewer and server in 2 separate projects
# In order for build server to work on linux, 
# the viewer project needs a server target.
# This is not true for mac and windows.
if (LINUX) 
  add_custom_target(server)
endif (LINUX)
if (SERVER)
  if (NOT LINUX)
    add_custom_target(server)
  endif (NOT LINUX)
  include(${SERVER_PREFIX}Server.cmake)
endif (SERVER)

# Windows builds include tools like VFS tool
if (SERVER)
  if (WINDOWS)
    add_subdirectory(${SERVER_PREFIX}tools)
  endif (WINDOWS)
endif (SERVER)

if (LL_TESTS)
  # Define after the custom viewer and server targets are created so
  # individual apps can add themselves as dependencies
  add_subdirectory(${INTEGRATION_TESTS_PREFIX}integration_tests)
endif (LL_TESTS)