summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2010-06-21 16:40:50 -0400
committerNat Goodspeed <nat@lindenlab.com>2010-06-21 16:40:50 -0400
commitc71e94581040b1a03000829735cf0fde0cef4d8c (patch)
tree71db61282178c281ef35bddb4c1eacb0cb06696e /indra/cmake
parent4eab82d5e2d71f9b0d53f5a92bc65ecc3320fee7 (diff)
parent9fe55d340feb3b761fa15be9b7c5efb7d5f4c51f (diff)
Automated merge with ssh://hg.lindenlab.com/q/viewer-release/
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/LLAddBuildTest.cmake41
-rw-r--r--indra/cmake/LLSharedLibs.cmake9
-rw-r--r--indra/cmake/LLTestCommand.cmake17
3 files changed, 36 insertions, 31 deletions
diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake
index bf4d9b72a9..dd49caaf20 100644
--- a/indra/cmake/LLAddBuildTest.cmake
+++ b/indra/cmake/LLAddBuildTest.cmake
@@ -141,17 +141,9 @@ INCLUDE(GoogleMock)
IF(LL_TEST_VERBOSE)
MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_cmd = ${TEST_CMD}")
ENDIF(LL_TEST_VERBOSE)
-
- IF(WINDOWS)
- set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
- ELSEIF(DARWIN)
- set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources:/usr/lib)
- ELSE(WINDOWS)
- set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}:/usr/lib)
- ENDIF(WINDOWS)
- LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${TEST_CMD})
- SET(TEST_SCRIPT_CMD ${LL_TEST_COMMAND_value})
+ SET_TEST_PATH(LD_LIBRARY_PATH)
+ LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${TEST_CMD})
IF(LL_TEST_VERBOSE)
MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_script = ${TEST_SCRIPT_CMD}")
ENDIF(LL_TEST_VERBOSE)
@@ -233,16 +225,8 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
LIST(INSERT test_command test_exe_pos "${TEST_EXE}")
ENDIF (test_exe_pos LESS 0)
- IF(WINDOWS)
- set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
- ELSEIF(DARWIN)
- set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources:/usr/lib)
- ELSE(WINDOWS)
- set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}:/usr/lib)
- ENDIF(WINDOWS)
-
- LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${test_command})
- SET(TEST_SCRIPT_CMD ${LL_TEST_COMMAND_value})
+ SET_TEST_PATH(LD_LIBRARY_PATH)
+ LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${test_command})
if(TEST_DEBUG)
message(STATUS "TEST_SCRIPT_CMD: ${TEST_SCRIPT_CMD}")
@@ -258,3 +242,20 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
# ADD_TEST(INTEGRATION_TEST_RUNNER_${testname} ${TEST_SCRIPT_CMD})
ENDFUNCTION(LL_ADD_INTEGRATION_TEST)
+
+MACRO(SET_TEST_PATH LISTVAR)
+ IF(WINDOWS)
+ # We typically build/package only Release variants of third-party
+ # libraries, so append the Release staging dir in case the library being
+ # sought doesn't have a debug variant.
+ set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR} ${SHARED_LIB_STAGING_DIR}/Release)
+ ELSEIF(DARWIN)
+ # We typically build/package only Release variants of third-party
+ # libraries, so append the Release staging dir in case the library being
+ # sought doesn't have a debug variant.
+ 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)
+ ENDIF(WINDOWS)
+ENDMACRO(SET_TEST_PATH)
diff --git a/indra/cmake/LLSharedLibs.cmake b/indra/cmake/LLSharedLibs.cmake
index 6f602680f4..009eeae781 100644
--- a/indra/cmake/LLSharedLibs.cmake
+++ b/indra/cmake/LLSharedLibs.cmake
@@ -5,7 +5,7 @@ macro(ll_deploy_sharedlibs_command target_exe)
get_filename_component(OUTPUT_PATH ${TARGET_LOCATION} PATH)
if(DARWIN)
- set(SEARCH_DIRS "${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources")
+ SET_TEST_PATH(SEARCH_DIRS)
get_target_property(IS_BUNDLE ${target_exe} MACOSX_BUNDLE)
if(IS_BUNDLE)
# If its a bundle the exe is not in the target location, this should find it.
@@ -15,9 +15,10 @@ macro(ll_deploy_sharedlibs_command target_exe)
set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources)
endif(IS_BUNDLE)
elseif(WINDOWS)
- set(SEARCH_DIRS "${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}" "$ENV{SystemRoot}/system32")
+ SET_TEST_PATH(SEARCH_DIRS)
+ LIST(APPEND SEARCH_DIRS "$ENV{SystemRoot}/system32")
elseif(LINUX)
- set(SEARCH_DIRS "${SHARED_LIB_STAGING_DIR}")
+ SET_TEST_PATH(SEARCH_DIRS)
set(OUTPUT_PATH ${OUTPUT_PATH}/lib)
endif(DARWIN)
@@ -71,4 +72,4 @@ macro(ll_stage_sharedlib DSO_TARGET)
)
endif(DARWIN)
-endmacro(ll_stage_sharedlib) \ No newline at end of file
+endmacro(ll_stage_sharedlib)
diff --git a/indra/cmake/LLTestCommand.cmake b/indra/cmake/LLTestCommand.cmake
index fae5640493..554559edbd 100644
--- a/indra/cmake/LLTestCommand.cmake
+++ b/indra/cmake/LLTestCommand.cmake
@@ -1,13 +1,16 @@
-MACRO(LL_TEST_COMMAND LD_LIBRARY_PATH)
+MACRO(LL_TEST_COMMAND OUTVAR 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
+ SET(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}")
+ FOREACH(dir ${LD_LIBRARY_PATH})
+ LIST(APPEND value "-l${dir}")
+ ENDFOREACH(dir)
+ LIST(APPEND value ${ARGN})
+ SET(${OUTVAR} ${value})
+##IF(LL_TEST_VERBOSE)
+## MESSAGE(STATUS "LL_TEST_COMMAND: ${value}")
+##ENDIF(LL_TEST_VERBOSE)
ENDMACRO(LL_TEST_COMMAND)