summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/Copy3rdPartyLibs.cmake1
-rw-r--r--indra/cmake/FindGoogleBreakpad.cmake40
-rw-r--r--indra/cmake/GoogleBreakpad.cmake4
-rw-r--r--indra/cmake/LLAddBuildTest.cmake6
-rw-r--r--indra/cmake/PNG.cmake2
-rw-r--r--indra/cmake/PulseAudio.cmake38
-rw-r--r--indra/cmake/Variables.cmake15
-rw-r--r--indra/cmake/run_build_test.py18
8 files changed, 92 insertions, 32 deletions
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index 2dd296bf12..95ed5d6bc8 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -221,6 +221,7 @@ elseif(LINUX)
libcrypto.so.0.9.7
libdb-4.2.so
libexpat.so
+ libexpat.so.1
libgmock_main.so
libgmock.so.0
libgmodule-2.0.so
diff --git a/indra/cmake/FindGoogleBreakpad.cmake b/indra/cmake/FindGoogleBreakpad.cmake
new file mode 100644
index 0000000000..1a0493be5e
--- /dev/null
+++ b/indra/cmake/FindGoogleBreakpad.cmake
@@ -0,0 +1,40 @@
+# -*- cmake -*-
+
+# - Find Google BreakPad
+# Find the Google BreakPad includes and library
+# This module defines
+# BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR, where to find exception_handler.h, etc.
+# BREAKPAD_EXCEPTION_HANDLER_LIBRARIES, the libraries needed to use Google BreakPad.
+# BREAKPAD_EXCEPTION_HANDLER_FOUND, If false, do not try to use Google BreakPad.
+# also defined, but not for general use are
+# BREAKPAD_EXCEPTION_HANDLER_LIBRARY, where to find the Google BreakPad library.
+
+FIND_PATH(BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR google_breakpad/exception_handler.h)
+
+SET(BREAKPAD_EXCEPTION_HANDLER_NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES} breakpad_client)
+FIND_LIBRARY(BREAKPAD_EXCEPTION_HANDLER_LIBRARY
+ NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES}
+ )
+
+IF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR)
+ SET(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES ${BREAKPAD_EXCEPTION_HANDLER_LIBRARY})
+ SET(BREAKPAD_EXCEPTION_HANDLER_FOUND "YES")
+ELSE (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR)
+ SET(BREAKPAD_EXCEPTION_HANDLER_FOUND "NO")
+ENDIF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR)
+
+
+IF (BREAKPAD_EXCEPTION_HANDLER_FOUND)
+ IF (NOT BREAKPAD_EXCEPTION_HANDLER_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Google BreakPad: ${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES}")
+ ENDIF (NOT BREAKPAD_EXCEPTION_HANDLER_FIND_QUIETLY)
+ELSE (BREAKPAD_EXCEPTION_HANDLER_FOUND)
+ IF (BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find Google BreakPad library")
+ ENDIF (BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED)
+ENDIF (BREAKPAD_EXCEPTION_HANDLER_FOUND)
+
+MARK_AS_ADVANCED(
+ BREAKPAD_EXCEPTION_HANDLER_LIBRARY
+ BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR
+ )
diff --git a/indra/cmake/GoogleBreakpad.cmake b/indra/cmake/GoogleBreakpad.cmake
index 8270c0fabb..7498674042 100644
--- a/indra/cmake/GoogleBreakpad.cmake
+++ b/indra/cmake/GoogleBreakpad.cmake
@@ -2,8 +2,8 @@
include(Prebuilt)
if (STANDALONE)
- MESSAGE(FATAL_ERROR "*TODO standalone support for google breakad is unimplemented")
- # *TODO - implement this include(FindGoogleBreakpad)
+ set(BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED ON)
+ include(FindGoogleBreakpad)
else (STANDALONE)
use_prebuilt_binary(google_breakpad)
if (DARWIN)
diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake
index a6a7989955..79c3bb7da2 100644
--- a/indra/cmake/LLAddBuildTest.cmake
+++ b/indra/cmake/LLAddBuildTest.cmake
@@ -256,6 +256,10 @@ MACRO(SET_TEST_PATH LISTVAR)
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib)
ELSE(WINDOWS)
# Linux uses a single staging directory anyway.
- set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib)
+ IF (STANDALONE)
+ set(${LISTVAR} ${CMAKE_BINARY_DIR}/llcommon /usr/lib /usr/local/lib)
+ ELSE (STANDALONE)
+ set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib)
+ ENDIF (STANDALONE)
ENDIF(WINDOWS)
ENDMACRO(SET_TEST_PATH)
diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake
index 4d0b7b2d8d..f6522d9e2f 100644
--- a/indra/cmake/PNG.cmake
+++ b/indra/cmake/PNG.cmake
@@ -9,5 +9,5 @@ if (STANDALONE)
else (STANDALONE)
use_prebuilt_binary(libpng)
set(PNG_LIBRARIES png12)
- set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
+ set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng12)
endif (STANDALONE)
diff --git a/indra/cmake/PulseAudio.cmake b/indra/cmake/PulseAudio.cmake
index f8087a8083..e918de0198 100644
--- a/indra/cmake/PulseAudio.cmake
+++ b/indra/cmake/PulseAudio.cmake
@@ -1,28 +1,28 @@
# -*- cmake -*-
include(Prebuilt)
-if (STANDALONE)
- include(FindPkgConfig)
+set(PULSEAUDIO ON CACHE BOOL "Build with PulseAudio support, if available.")
- pkg_check_modules(PULSEAUDIO REQUIRED libpulse-mainloop-glib)
+if (PULSEAUDIO)
+ if (STANDALONE)
+ include(FindPkgConfig)
+
+ pkg_check_modules(PULSEAUDIO libpulse)
-elseif (LINUX)
- use_prebuilt_binary(pulseaudio)
- set(PULSEAUDIO_FOUND ON FORCE BOOL)
- set(PULSEAUDIO_INCLUDE_DIRS
- ${LIBS_PREBUILT_DIR}/include
+ elseif (LINUX)
+ use_prebuilt_binary(pulseaudio)
+ set(PULSEAUDIO_FOUND ON FORCE BOOL)
+ set(PULSEAUDIO_INCLUDE_DIRS
+ ${LIBS_PREBUILT_DIR}/include
+ )
+ # We don't need to explicitly link against pulseaudio itself, because
+ # the viewer probes for the system's copy at runtime.
+ set(PULSEAUDIO_LIBRARIES
+ # none needed!
)
- # We don't need to explicitly link against pulseaudio itself, because
- # the viewer probes for the system's copy at runtime.
- set(PULSEAUDIO_LIBRARIES
- # none needed!
- )
-endif (STANDALONE)
+ endif (STANDALONE)
+endif (PULSEAUDIO)
if (PULSEAUDIO_FOUND)
- set(PULSEAUDIO ON CACHE BOOL "Build with PulseAudio support, if available.")
-endif (PULSEAUDIO_FOUND)
-
-if (PULSEAUDIO)
add_definitions(-DLL_PULSEAUDIO_ENABLED=1)
-endif (PULSEAUDIO)
+endif (PULSEAUDIO_FOUND)
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index bfaf3f4f26..230e228c62 100644
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -54,19 +54,20 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LINUX ON BOOl FORCE)
# If someone has specified a word size, use that to determine the
- # architecture. Otherwise, let the architecture specify the word size.
+ # architecture. Otherwise, let the compiler specify the word size.
+ # Using uname will break under chroots and other cross arch compiles. RC
if (WORD_SIZE EQUAL 32)
set(ARCH i686)
elseif (WORD_SIZE EQUAL 64)
set(ARCH x86_64)
else (WORD_SIZE EQUAL 32)
- execute_process(COMMAND uname -m COMMAND sed s/i.86/i686/
- OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
- if (ARCH STREQUAL x86_64)
- set(WORD_SIZE 64)
- else (ARCH STREQUAL x86_64)
+ if(CMAKE_SIZEOF_VOID_P MATCHES 4)
+ set(ARCH i686)
set(WORD_SIZE 32)
- endif (ARCH STREQUAL x86_64)
+ else(CMAKE_SIZEOF_VOID_P MATCHES 4)
+ set(ARCH x86_64)
+ set(WORD_SIZE 64)
+ endif(CMAKE_SIZEOF_VOID_P MATCHES 4)
endif (WORD_SIZE EQUAL 32)
set(LL_ARCH ${ARCH}_linux)
diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py
index 104585c195..e377aeef48 100644
--- a/indra/cmake/run_build_test.py
+++ b/indra/cmake/run_build_test.py
@@ -82,10 +82,24 @@ def main(command, libpath=[], vars={}):
dirs = os.environ.get(var, "").split(os.pathsep)
# Append the sequence in libpath
print "%s += %r" % (var, libpath)
- dirs.extend(libpath)
+ for dir in libpath:
+ # append system paths at the end
+ if dir in ('/lib', '/usr/lib'):
+ dirs.append(dir)
+ # prepend non-system paths
+ else:
+ dirs.insert(0, dir)
+
+ # Filter out some useless pieces
+ clean_dirs = []
+ for dir in dirs:
+ if dir and dir not in ('', '.'):
+ clean_dirs.append(dir)
+
# Now rebuild the path string. This way we use a minimum of separators
# -- and we avoid adding a pointless separator when libpath is empty.
- os.environ[var] = os.pathsep.join(dirs)
+ os.environ[var] = os.pathsep.join(clean_dirs)
+ print "%s = %r" % (var, os.environ[var])
# Now handle arbitrary environment variables. The tricky part is ensuring
# that all the keys and values we try to pass are actually strings.
if vars: