summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
authorSteve Bennetts <steve@lindenlab.com>2009-10-23 12:18:46 -0700
committerSteve Bennetts <steve@lindenlab.com>2009-10-23 12:18:46 -0700
commit4ddaa866dde7a92e56617a32464e0667de3759ef (patch)
treed28e7e39f8a5f4a1070482154824fbfb2a7b52e8 /indra/cmake
parenta5453d45feaceb713c7cece76d88c2d2b8f825c6 (diff)
parent80b682d4b4dd1256ee09dd3327d2c51e3adee0b5 (diff)
merge
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/00-Common.cmake16
-rw-r--r--indra/cmake/APR.cmake32
-rw-r--r--indra/cmake/Boost.cmake2
-rw-r--r--indra/cmake/CMakeLists.txt2
-rw-r--r--indra/cmake/Externals.cmake34
-rw-r--r--indra/cmake/FindMono.cmake2
-rw-r--r--indra/cmake/FindSVN.cmake34
-rw-r--r--indra/cmake/GoogleMock.cmake27
-rw-r--r--indra/cmake/LLAddBuildTest.cmake46
-rw-r--r--indra/cmake/LLCommon.cmake4
-rw-r--r--indra/cmake/LLKDU.cmake4
-rw-r--r--indra/cmake/LLLogin.cmake7
-rw-r--r--indra/cmake/LLTestCommand.cmake13
-rw-r--r--indra/cmake/Linking.cmake3
-rw-r--r--indra/cmake/Pth.cmake21
-rw-r--r--indra/cmake/run_build_test.py111
16 files changed, 324 insertions, 34 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 173e650961..db5495091e 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -182,11 +182,17 @@ endif (LINUX)
if (DARWIN)
- add_definitions(-DLL_DARWIN=1)
+ # NOTE (per http://lists.apple.com/archives/darwin-dev/2008/Jan/msg00232.html):
+ # > Why the bus error? What am I doing wrong?
+ # This is a known issue where getcontext(3) is writing past the end of the
+ # ucontext_t struct when _XOPEN_SOURCE is not defined (rdar://problem/5578699 ).
+ # As a workaround, define _XOPEN_SOURCE before including ucontext.h.
+ add_definitions(-DLL_DARWIN=1 -D_XOPEN_SOURCE)
set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-branch")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-branch")
+ set(DARWIN_extra_cstar_flags "-mlong-branch")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}")
# NOTE: it's critical that the optimization flag is put in front.
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
@@ -195,13 +201,13 @@ endif (DARWIN)
if (LINUX OR DARWIN)
- set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs -Wno-non-virtual-dtor -Woverloaded-virtual")
+ set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
if (NOT GCC_DISABLE_FATAL_WARNINGS)
set(GCC_WARNINGS "${GCC_WARNINGS} -Werror")
endif (NOT GCC_DISABLE_FATAL_WARNINGS)
- set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder")
+ set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Woverloaded-virtual")
set(CMAKE_C_FLAGS "${GCC_WARNINGS} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${GCC_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")
diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake
index 0755aeee03..f4706dd4f2 100644
--- a/indra/cmake/APR.cmake
+++ b/indra/cmake/APR.cmake
@@ -13,26 +13,38 @@ if (STANDALONE)
else (STANDALONE)
use_prebuilt_binary(apr_suite)
if (WINDOWS)
+ if (LLCOMMON_LINK_SHARED)
+ set(APR_selector "lib")
+ else (LLCOMMON_LINK_SHARED)
+ set(APR_selector "")
+ endif (LLCOMMON_LINK_SHARED)
set(APR_LIBRARIES
- debug ${ARCH_PREBUILT_DIRS_DEBUG}/apr-1.lib
- optimized ${ARCH_PREBUILT_DIRS_RELEASE}/apr-1.lib
+ debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apr-1.lib
+ optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib
)
set(APRICONV_LIBRARIES
- debug ${ARCH_PREBUILT_DIRS_DEBUG}/apriconv-1.lib
- optimized ${ARCH_PREBUILT_DIRS_RELEASE}/apriconv-1.lib
+ debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apriconv-1.lib
+ optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apriconv-1.lib
)
set(APRUTIL_LIBRARIES
- debug ${ARCH_PREBUILT_DIRS_DEBUG}/aprutil-1.lib ${APRICONV_LIBRARIES}
- optimized ${ARCH_PREBUILT_DIRS_RELEASE}/aprutil-1.lib ${APRICONV_LIBRARIES}
+ debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES}
+ optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES}
)
elseif (DARWIN)
+ if (LLCOMMON_LINK_SHARED)
+ set(APR_selector "0.3.7.dylib")
+ set(APRUTIL_selector "0.3.8.dylib")
+ else (LLCOMMON_LINK_SHARED)
+ set(APR_selector "a")
+ set(APRUTIL_selector "a")
+ endif (LLCOMMON_LINK_SHARED)
set(APR_LIBRARIES
- debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.a
- optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a
+ debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.${APR_selector}
+ optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.${APR_selector}
)
set(APRUTIL_LIBRARIES
- debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.a
- optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a
+ debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.${APRUTIL_selector}
+ optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.${APRUTIL_selector}
)
set(APRICONV_LIBRARIES iconv)
else (WINDOWS)
diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake
index 0578ae95ff..efe9ad74d3 100644
--- a/indra/cmake/Boost.cmake
+++ b/indra/cmake/Boost.cmake
@@ -15,7 +15,7 @@ else (STANDALONE)
set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
if (WINDOWS)
- set(BOOST_VERSION 1_34_1)
+ set(BOOST_VERSION 1_39)
if (MSVC71)
set(BOOST_PROGRAM_OPTIONS_LIBRARY
optimized libboost_program_options-vc71-mt-s-${BOOST_VERSION}
diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt
index 3ce393b659..4563b59ad2 100644
--- a/indra/cmake/CMakeLists.txt
+++ b/indra/cmake/CMakeLists.txt
@@ -53,6 +53,7 @@ set(cmake_SOURCE_FILES
LLPrimitive.cmake
LLRender.cmake
LLScene.cmake
+ LLTestCommand.cmake
LLUI.cmake
LLVFS.cmake
LLWindow.cmake
@@ -69,7 +70,6 @@ set(cmake_SOURCE_FILES
PNG.cmake
Python.cmake
Prebuilt.cmake
- RunBuildTest.cmake
TemplateCheck.cmake
Tut.cmake
UI.cmake
diff --git a/indra/cmake/Externals.cmake b/indra/cmake/Externals.cmake
new file mode 100644
index 0000000000..26f3b56049
--- /dev/null
+++ b/indra/cmake/Externals.cmake
@@ -0,0 +1,34 @@
+# -*- cmake -*-
+
+include(Python)
+include(FindSVN)
+
+macro (use_svn_external _binary _path _url _rev)
+ if (NOT STANDALONE)
+ if(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
+ if(SVN_FOUND)
+ if(DEBUG_EXTERNALS)
+ message("cd ${_path} && ${SVN_EXECUTABLE} checkout -r ${_rev} ${_url} ${_binary}")
+ endif(DEBUG_EXTERNALS)
+ execute_process(COMMAND ${SVN_EXECUTABLE}
+ checkout
+ -r ${_rev}
+ ${_url}
+ ${_binary}
+ WORKING_DIRECTORY ${_path}
+ RESULT_VARIABLE ${_binary}_installed
+ )
+ else(SVN_FOUND)
+ message(FATAL_ERROR "Failed to find SVN_EXECUTABLE")
+ endif(SVN_FOUND)
+ file(WRITE ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${${_binary}_installed}")
+ else(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
+ set(${_binary}_installed 0)
+ endif(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
+ if(NOT ${_binary}_installed EQUAL 0)
+ message(FATAL_ERROR
+ "Failed to download or unpack prebuilt '${_binary}'."
+ " Process returned ${${_binary}_installed}.")
+ endif (NOT ${_binary}_installed EQUAL 0)
+ endif (NOT STANDALONE)
+endmacro (use_svn_external _binary _path _url _rev)
diff --git a/indra/cmake/FindMono.cmake b/indra/cmake/FindMono.cmake
index c36d7259e8..d956c48656 100644
--- a/indra/cmake/FindMono.cmake
+++ b/indra/cmake/FindMono.cmake
@@ -42,7 +42,7 @@ FIND_PROGRAM (GACUTIL_EXECUTABLE gacutil
/usr/local/bin
)
FIND_PROGRAM (ILASM_EXECUTABLE
- ilasm
+ NAMES ilasm.bat ilasm
NO_DEFAULT_PATH
PATHS "$ENV{PROGRAMFILES}/Mono-1.9.1/bin" "$ENV{PROGRAMFILES}/Mono-1.2.6/bin" /bin /usr/bin /usr/local/bin
)
diff --git a/indra/cmake/FindSVN.cmake b/indra/cmake/FindSVN.cmake
new file mode 100644
index 0000000000..3322be4ca9
--- /dev/null
+++ b/indra/cmake/FindSVN.cmake
@@ -0,0 +1,34 @@
+# -*- cmake -*-
+#
+# Find the svn executable for exporting old svn:externals.
+#
+# Input variables:
+# SVN_FIND_REQUIRED - set this if configuration should fail without scp
+#
+# Output variables:
+#
+# SVN_FOUND - set if svn was found
+# SVN_EXECUTABLE - path to svn executable
+# SVN_BATCH_FLAG - how to put svn into batch mode
+
+
+SET(SVN_EXECUTABLE)
+FIND_PROGRAM(SVN_EXECUTABLE NAMES svn svn.exe)
+
+IF (SVN_EXECUTABLE)
+ SET(SVN_FOUND ON)
+ELSE (SVN_EXECUTABLE)
+ SET(SVN_FOUND OFF)
+ENDIF (SVN_EXECUTABLE)
+
+IF (SVN_FOUND)
+ GET_FILENAME_COMPONENT(_svn_name ${SVN_EXECUTABLE} NAME_WE)
+ SET(SVN_BATCH_FLAG --non-interactive)
+ELSE (SVN_FOUND)
+ IF (SVN_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find svn executable")
+ ENDIF (SVN_FIND_REQUIRED)
+ENDIF (SVN_FOUND)
+
+MARK_AS_ADVANCED(SVN_EXECUTABLE SVN_FOUND SVN_BATCH_FLAG)
+
diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake
new file mode 100644
index 0000000000..ca5a8034ba
--- /dev/null
+++ b/indra/cmake/GoogleMock.cmake
@@ -0,0 +1,27 @@
+# -*- cmake -*-
+include(Prebuilt)
+include(Linking)
+
+use_prebuilt_binary(googlemock)
+
+set(GOOGLEMOCK_INCLUDE_DIRS
+ ${LIBS_PREBUILT_DIR}/include)
+
+if (LINUX)
+ set(GOOGLEMOCK_LIBRARIES
+ gmock
+ gtest)
+elseif(WINDOWS)
+ set(GOOGLEMOCK_LIBRARIES
+ gmock)
+ set(GOOGLEMOCK_INCLUDE_DIRS
+ ${LIBS_PREBUILT_DIR}/include
+ ${LIBS_PREBUILT_DIR}/include/gmock
+ ${LIBS_PREBUILT_DIR}/include/gmock/boost/tr1/tr1)
+elseif(DARWIN)
+ set(GOOGLEMOCK_LIBRARIES
+ gmock
+ gtest)
+endif(LINUX)
+
+
diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake
index 008b277960..d8f64199cf 100644
--- a/indra/cmake/LLAddBuildTest.cmake
+++ b/indra/cmake/LLAddBuildTest.cmake
@@ -1,4 +1,6 @@
# -*- cmake -*-
+include(LLTestCommand)
+include(GoogleMock)
MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
# Given a project name and a list of sourcefiles (with optional properties on each),
@@ -13,6 +15,8 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
#
# WARNING: do NOT modify this code without working with poppy -
# there is another branch that will conflict heavily with any changes here.
+INCLUDE(GoogleMock)
+
IF(LL_TEST_VERBOSE)
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS UNITTEST_PROJECT_${project} sources: ${sources}")
@@ -41,8 +45,10 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
${LLMATH_INCLUDE_DIRS}
${LLCOMMON_INCLUDE_DIRS}
${LIBS_OPEN_DIR}/test
+ ${GOOGLEMOCK_INCLUDE_DIRS}
)
SET(alltest_LIBRARIES
+ ${GOOGLEMOCK_LIBRARIES}
${PTHREAD_LIBRARY}
${WINDOWS_LIBRARIES}
)
@@ -51,6 +57,11 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
${CMAKE_SOURCE_DIR}/test/test.h
)
+ # Use the default flags
+ if (LINUX)
+ SET(CMAKE_EXE_LINKER_FLAGS "")
+ endif (LINUX)
+
# start the source test executable definitions
SET(${project}_TEST_OUTPUT "")
FOREACH (source ${sources})
@@ -93,9 +104,9 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_INCLUDE_DIRS ${${name}_test_additional_INCLUDE_DIRS}")
ENDIF(LL_TEST_VERBOSE)
+
# Setup target
ADD_EXECUTABLE(PROJECT_${project}_TEST_${name} ${${name}_test_SOURCE_FILES})
-
#
# Per-codefile additional / external project dep and lib dep property extraction
#
@@ -123,16 +134,20 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
GET_TARGET_PROPERTY(TEST_EXE PROJECT_${project}_TEST_${name} LOCATION)
SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PROJECT_${project}_TEST_${name}_ok.txt)
SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR})
- # daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19
+
+ # daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19
IF(LL_TEST_VERBOSE)
MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_cmd = ${TEST_CMD}")
ENDIF(LL_TEST_VERBOSE)
- SET(TEST_SCRIPT_CMD
- ${CMAKE_COMMAND}
- -DLD_LIBRARY_PATH=${ARCH_PREBUILT_DIRS}:/usr/lib
- -DTEST_CMD:STRING="${TEST_CMD}"
- -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake
- )
+
+ IF(WINDOWS)
+ set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
+ ELSE(WINDOWS)
+ set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}:/usr/lib)
+ ENDIF(WINDOWS)
+
+ LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${TEST_CMD})
+ SET(TEST_SCRIPT_CMD ${LL_TEST_COMMAND_value})
IF(LL_TEST_VERBOSE)
MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_script = ${TEST_SCRIPT_CMD}")
ENDIF(LL_TEST_VERBOSE)
@@ -176,6 +191,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
SET(libraries
${library_dependencies}
+ ${GOOGLEMOCK_LIBRARIES}
${PTHREAD_LIBRARY}
)
@@ -212,12 +228,14 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
LIST(INSERT test_command test_exe_pos "${TEST_EXE}")
ENDIF (test_exe_pos LESS 0)
- SET(TEST_SCRIPT_CMD
- ${CMAKE_COMMAND}
- -DLD_LIBRARY_PATH=${ARCH_PREBUILT_DIRS}:/usr/lib
- -DTEST_CMD:STRING="${test_command}"
- -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake
- )
+ IF(WINDOWS)
+ set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
+ ELSE(WINDOWS)
+ set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}:/usr/lib)
+ ENDIF(WINDOWS)
+
+ LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${test_command})
+ SET(TEST_SCRIPT_CMD ${LL_TEST_COMMAND_value})
if(TEST_DEBUG)
message(STATUS "TEST_SCRIPT_CMD: ${TEST_SCRIPT_CMD}")
diff --git a/indra/cmake/LLCommon.cmake b/indra/cmake/LLCommon.cmake
index ef202dd879..d1ab264a41 100644
--- a/indra/cmake/LLCommon.cmake
+++ b/indra/cmake/LLCommon.cmake
@@ -17,3 +17,7 @@ set(LLCOMMON_LIBRARIES llcommon)
add_definitions(${TCMALLOC_FLAG})
+set(LLCOMMON_LINK_SHARED ON CACHE BOOL "Build the llcommon target as a shared library.")
+if(LLCOMMON_LINK_SHARED)
+ add_definitions(-DLL_COMMON_LINK_SHARED=1)
+endif(LLCOMMON_LINK_SHARED)
diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake
index f103dcf664..6b69388896 100644
--- a/indra/cmake/LLKDU.cmake
+++ b/indra/cmake/LLKDU.cmake
@@ -1,7 +1,7 @@
# -*- cmake -*-
include(Prebuilt)
-if (NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu)
+if (INSTALL_PROPRIETARY AND NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu)
use_prebuilt_binary(kdu)
if (WINDOWS)
set(KDU_LIBRARY debug kdu_cored optimized kdu_core)
@@ -15,4 +15,4 @@ if (NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu)
set(LLKDU_STATIC_LIBRARY llkdu_static)
set(LLKDU_LIBRARIES ${LLKDU_LIBRARY})
set(LLKDU_STATIC_LIBRARIES ${LLKDU_STATIC_LIBRARY})
-endif (NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu)
+endif (INSTALL_PROPRIETARY AND NOT STANDALONE AND EXISTS ${LIBS_CLOSED_DIR}/llkdu)
diff --git a/indra/cmake/LLLogin.cmake b/indra/cmake/LLLogin.cmake
new file mode 100644
index 0000000000..47d171876a
--- /dev/null
+++ b/indra/cmake/LLLogin.cmake
@@ -0,0 +1,7 @@
+# -*- cmake -*-
+
+set(LLLOGIN_INCLUDE_DIRS
+ ${LIBS_OPEN_DIR}/viewer_components/login
+ )
+
+set(LLLOGIN_LIBRARIES lllogin)
diff --git a/indra/cmake/LLTestCommand.cmake b/indra/cmake/LLTestCommand.cmake
new file mode 100644
index 0000000000..fae5640493
--- /dev/null
+++ b/indra/cmake/LLTestCommand.cmake
@@ -0,0 +1,13 @@
+MACRO(LL_TEST_COMMAND LD_LIBRARY_PATH)
+ # nat wonders how Kitware can use the term 'function' for a construct that
+ # cannot return a value. And yet, variables you set inside a FUNCTION are
+ # local. Try a MACRO instead.
+ SET(LL_TEST_COMMAND_value
+ ${PYTHON_EXECUTABLE}
+ "${CMAKE_SOURCE_DIR}/cmake/run_build_test.py")
+ IF(LD_LIBRARY_PATH)
+ LIST(APPEND LL_TEST_COMMAND_value "-l${LD_LIBRARY_PATH}")
+ ENDIF(LD_LIBRARY_PATH)
+ LIST(APPEND LL_TEST_COMMAND_value ${ARGN})
+##MESSAGE(STATUS "Will run: ${LL_TEST_COMMAND_value}")
+ENDMACRO(LL_TEST_COMMAND)
diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake
index eaa8a6dc29..1f3553539f 100644
--- a/indra/cmake/Linking.cmake
+++ b/indra/cmake/Linking.cmake
@@ -5,6 +5,7 @@ if (NOT STANDALONE)
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib)
set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release)
set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug)
+ set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged DLLs")
elseif (LINUX)
if (VIEWER)
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release_client)
@@ -13,10 +14,12 @@ if (NOT STANDALONE)
endif (VIEWER)
set(ARCH_PREBUILT_DIRS_RELEASE ${ARCH_PREBUILT_DIRS})
set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS})
+ set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged .sos")
elseif (DARWIN)
set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release)
set(ARCH_PREBUILT_DIRS ${ARCH_PREBUILT_DIRS_RELEASE})
set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS_RELEASE})
+ set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs CACHE FILEPATH "Location of staged DLLs")
endif (WINDOWS)
endif (NOT STANDALONE)
diff --git a/indra/cmake/Pth.cmake b/indra/cmake/Pth.cmake
new file mode 100644
index 0000000000..a28f6ec696
--- /dev/null
+++ b/indra/cmake/Pth.cmake
@@ -0,0 +1,21 @@
+# -*- cmake -*-
+include(Prebuilt)
+
+set(PTH_FIND_QUIETLY ON)
+set(PTH_FIND_REQUIRED ON)
+
+if (STANDALONE)
+# ?? How would I construct FindPTH.cmake? This file was cloned from
+# CURL.cmake, which uses include(FindCURL), but there's no FindCURL.cmake?
+# include(FindPTH)
+else (STANDALONE)
+ # This library is only needed to support Boost.Coroutine, and only on Mac.
+ if (DARWIN)
+ use_prebuilt_binary(pth)
+ set(PTH_LIBRARIES pth)
+ set(PTH_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
+ else (DARWIN)
+ set(PTH_LIBRARIES)
+ set(PTH_INCLUDE_DIRS)
+ endif (DARWIN)
+endif (STANDALONE)
diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py
new file mode 100644
index 0000000000..17bce6f434
--- /dev/null
+++ b/indra/cmake/run_build_test.py
@@ -0,0 +1,111 @@
+#!/usr/bin/python
+"""\
+@file run_build_test.py
+@author Nat Goodspeed
+@date 2009-09-03
+@brief Helper script to allow CMake to run some command after setting
+ environment variables.
+
+CMake has commands to run an external program. But remember that each CMake
+command must be backed by multiple build-system implementations. Unfortunately
+it seems CMake can't promise that every target build system can set specified
+environment variables before running the external program of interest.
+
+This helper script is a workaround. It simply sets the requested environment
+variables and then executes the program specified on the rest of its command
+line.
+
+Example:
+
+python run_build_test.py -DFOO=bar myprog somearg otherarg
+
+sets environment variable FOO=bar, then runs:
+myprog somearg otherarg
+
+$LicenseInfo:firstyear=2009&license=internal$
+Copyright (c) 2009, Linden Research, Inc.
+$/LicenseInfo$
+"""
+
+import os
+import sys
+import subprocess
+
+def main(command, libpath=[], vars={}):
+ """Pass:
+ command is a sequence (e.g. a list) of strings. The first item in the list
+ must be the command name, the rest are its arguments.
+
+ libpath is a sequence of directory pathnames. These will be appended to
+ the platform-specific dynamic library search path environment variable.
+
+ vars is a dict of arbitrary (var, value) pairs to be added to the
+ environment before running 'command'.
+
+ This function runs the specified command, waits for it to terminate and
+ returns its return code. This will be negative if the command terminated
+ with a signal, else it will be the process's specified exit code.
+ """
+ # Handle platform-dependent libpath first.
+ if sys.platform == "win32":
+ lpvars = ["PATH"]
+ elif sys.platform == "darwin":
+ lpvars = ["LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH"]
+ elif sys.platform.startswith("linux"):
+ lpvars = ["LD_LIBRARY_PATH"]
+ else:
+ # No idea what the right pathname might be! But only crump if this
+ # feature is requested.
+ if libpath:
+ raise NotImplemented("run_build_test: unknown platform %s" % sys.platform)
+ lpvars = []
+ for var in lpvars:
+ # Split the existing path. Bear in mind that the variable in question
+ # might not exist; instead of KeyError, just use an empty string.
+ dirs = os.environ.get(var, "").split(os.pathsep)
+ # Append the sequence in libpath
+## print "%s += %r" % (var, libpath)
+ dirs.extend(libpath)
+ # 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)
+ # 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:
+## print "Setting:"
+## for key, value in vars.iteritems():
+## print "%s=%s" % (key, value)
+ os.environ.update(dict([(str(key), str(value)) for key, value in vars.iteritems()]))
+ # Run the child process.
+## print "Running: %s" % " ".join(command)
+ return subprocess.call(command)
+
+if __name__ == "__main__":
+ from optparse import OptionParser
+ parser = OptionParser(usage="usage: %prog [options] command args...")
+ # We want optparse support for the options we ourselves handle -- but we
+ # DO NOT want it looking at options for the executable we intend to run,
+ # rejecting them as invalid because we don't define them. So configure the
+ # parser to stop looking for options as soon as it sees the first
+ # positional argument (traditional Unix syntax).
+ parser.disable_interspersed_args()
+ parser.add_option("-D", "--define", dest="vars", default=[], action="append",
+ metavar="VAR=value",
+ help="Add VAR=value to the env variables defined")
+ parser.add_option("-l", "--libpath", dest="libpath", default=[], action="append",
+ metavar="DIR",
+ help="Add DIR to the platform-dependent DLL search path")
+ opts, args = parser.parse_args()
+ # What we have in opts.vars is a list of strings of the form "VAR=value"
+ # or possibly just "VAR". What we want is a dict. We can build that dict by
+ # constructing a list of ["VAR", "value"] pairs -- so split each
+ # "VAR=value" string on the '=' sign (but only once, in case we have
+ # "VAR=some=user=string"). To handle the case of just "VAR", append "" to
+ # the list returned by split(), then slice off anything after the pair we
+ # want.
+ rc = main(command=args, libpath=opts.libpath,
+ vars=dict([(pair.split('=', 1) + [""])[:2] for pair in opts.vars]))
+ if rc not in (None, 0):
+ print >>sys.stderr, "Failure running: %s" % " ".join(args)
+ print >>sys.stderr, "Error: %s" % rc
+ sys.exit((rc < 0) and 255 or rc)