diff --git a/CMakeLists.txt b/CMakeLists.txt index ef25bfe7fc..356cf5a173 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -659,6 +659,16 @@ IF(ENABLE_TESTS) SET(NC_CTEST_DROP_SITE "my.cdash.org" CACHE STRING "Dashboard location for CTest-based testing purposes.") SET(NC_CTEST_DROP_LOC_PREFIX "" CACHE STRING "Prefix for Dashboard location on remote server when using CTest-based testing.") + FIND_PROGRAM(HOSTNAME_CMD NAMES hostname) + IF(HOSTNAME_CMD) + EXEC_PROGRAM(${HOSTNAME_CMD} ARGS "-s" OUTPUT_VARIABLE HOSTNAME) + SET(NC_CTEST_SITE "${HOSTNAME}" CACHE STRING "Hostname of test machine.") + ENDIF() + + IF(NC_CTEST_SITE) + SET(SITE "${NC_CTEST_SITE}" CACHE STRING "") + ENDIF() + # Create a CTestConfig file from the template. CONFIGURE_FILE("${netCDF_SOURCE_DIR}/CTestConfig.cmake.in" "${netCDF_SOURCE_DIR}/CTestConfig.cmake" @@ -997,9 +1007,9 @@ MACRO(add_bin_env_temp_large_test prefix F) ADD_TEST(${prefix}_${F} bash "-c" "TEMP_LARGE=${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/${prefix}_${F}") IF(MSVC) SET_PROPERTY(TARGET ${prefix}_${F} PROPERTY FOLDER "tests") - SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY + SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG + SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}) SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}) @@ -1031,9 +1041,9 @@ MACRO(build_bin_test F) SET_TARGET_PROPERTIES(${F} PROPERTIES LINK_FLAGS_DEBUG " /NODEFAULTLIB:MSVCRT" ) - SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY + SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG + SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}) SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}) @@ -1046,12 +1056,12 @@ MACRO(add_bin_test_no_prefix F) ADD_TEST(${F} ${EXECUTABLE_OUTPUT_PATH}/${F}) IF(MSVC) SET_PROPERTY(TEST ${F} PROPERTY FOLDER "tests/") - SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY + SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG + SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}) SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE - ${CMAKE_CURRENT_BINARY_DIR}) + ${CMAKE_CURRENT_BINARY_DIR}) ENDIF() ENDMACRO() @@ -1061,9 +1071,9 @@ MACRO(build_bin_test_no_prefix F) ADD_TEST(${F} ${EXECUTABLE_OUTPUT_PATH}/${F}) IF(MSVC) SET_PROPERTY(TEST ${F} PROPERTY FOLDER "tests/") - SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY + SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG + SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}) SET_TARGET_PROPERTIES(${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}) @@ -1089,9 +1099,9 @@ MACRO(add_bin_test prefix F) ADD_TEST(${prefix}_${F} ${EXECUTABLE_OUTPUT_PATH}/${prefix}_${F}) IF(MSVC) SET_PROPERTY(TEST ${prefix}_${F} PROPERTY FOLDER "tests/") - SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY + SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG + SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}) SET_TARGET_PROPERTIES(${prefix}_${F} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/CTestConfig.cmake.in b/CTestConfig.cmake.in index fef7980662..6c992f34c7 100644 --- a/CTestConfig.cmake.in +++ b/CTestConfig.cmake.in @@ -10,8 +10,9 @@ set(DART_TESTING_TIMEOUT "4800") set(CTEST_PROJECT_NAME "@NC_CTEST_PROJECT_NAME@") set(CTEST_NIGHTLY_START_TIME "02:00:00 EDT") +SET(CTEST_SITE "@NC_CTEST_SITE@") set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "@NC_CTEST_DROP_SITE@") +set(CTEST_DROP_SITE "@NC_CTEST_DROP_SITE@") set(CTEST_DROP_LOCATION "@NC_CTEST_DROP_LOC_PREFIX@/submit.php?project=@NC_CTEST_PROJECT_NAME@") set(CTEST_DROP_SITE_CDASH TRUE)