diff options
Diffstat (limited to 'indra/cmake/LLAddBuildTest.cmake')
-rw-r--r-- | indra/cmake/LLAddBuildTest.cmake | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index a6a7989955..bf4d9b72a9 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -107,7 +107,7 @@ INCLUDE(GoogleMock) # Setup target ADD_EXECUTABLE(PROJECT_${project}_TEST_${name} ${${name}_test_SOURCE_FILES}) - SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}") + SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${EXE_STAGING_DIR}) # # Per-codefile additional / external project dep and lib dep property extraction @@ -137,13 +137,21 @@ 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) - SET_TEST_PATH(LD_LIBRARY_PATH) - LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${TEST_CMD}) + 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) @@ -196,7 +204,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST message(STATUS "ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})") endif(TEST_DEBUG) ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files}) - SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}") + SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${EXE_STAGING_DIR}) # Add link deps to the executable if(TEST_DEBUG) @@ -225,8 +233,16 @@ FUNCTION(LL_ADD_INTEGRATION_TEST LIST(INSERT test_command test_exe_pos "${TEST_EXE}") ENDIF (test_exe_pos LESS 0) - SET_TEST_PATH(LD_LIBRARY_PATH) - LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${test_command}) + 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}) if(TEST_DEBUG) message(STATUS "TEST_SCRIPT_CMD: ${TEST_SCRIPT_CMD}") @@ -242,20 +258,3 @@ 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) |