summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/LLAddBuildTest.cmake43
-rw-r--r--indra/cmake/LLSharedLibs.cmake17
-rw-r--r--indra/cmake/LLTestCommand.cmake17
3 files changed, 41 insertions, 36 deletions
diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake
index bf4d9b72a9..e8a0a949b6 100644
--- a/indra/cmake/LLAddBuildTest.cmake
+++ b/indra/cmake/LLAddBuildTest.cmake
@@ -137,21 +137,13 @@ INCLUDE(GoogleMock)
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)
-
- 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..e29076c738 100644
--- a/indra/cmake/LLSharedLibs.cmake
+++ b/indra/cmake/LLSharedLibs.cmake
@@ -5,20 +5,21 @@ 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.
+ # If its a bundle the exe is not in the target location, this should find it.
get_filename_component(TARGET_FILE ${TARGET_LOCATION} NAME)
set(OUTPUT_PATH ${TARGET_LOCATION}.app/Contents/MacOS)
set(TARGET_LOCATION ${OUTPUT_PATH}/${TARGET_FILE})
- set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources)
+ 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(OUTPUT_PATH ${OUTPUT_PATH}/lib)
+ SET_TEST_PATH(SEARCH_DIRS)
+ set(OUTPUT_PATH ${OUTPUT_PATH}/lib)
endif(DARWIN)
add_custom_command(
@@ -49,7 +50,7 @@ macro(ll_stage_sharedlib DSO_TARGET)
else(DARWIN)
set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
endif(DARWIN)
-
+
# *TODO - maybe make this a symbolic link? -brad
add_custom_command(
TARGET ${DSO_TARGET} POST_BUILD
@@ -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)