mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-28 18:09:42 -05:00
Tests: Factor out contract test HOME finding
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
# Find a home in which to build.
|
||||||
|
if(NOT DEFINED HOME)
|
||||||
|
if(DEFINED ENV{CTEST_REAL_HOME})
|
||||||
|
set(HOME "$ENV{CTEST_REAL_HOME}")
|
||||||
|
else()
|
||||||
|
set(HOME "$ENV{HOME}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT HOME AND WIN32)
|
||||||
|
# Try for USERPROFILE as HOME equivalent:
|
||||||
|
string(REPLACE "\\" "/" HOME "$ENV{USERPROFILE}")
|
||||||
|
|
||||||
|
# But just use root of SystemDrive if USERPROFILE contains any spaces:
|
||||||
|
# (Default on XP and earlier...)
|
||||||
|
if(HOME MATCHES " ")
|
||||||
|
string(REPLACE "\\" "/" HOME "$ENV{SystemDrive}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
@@ -6,24 +6,7 @@ include(ExternalProject)
|
|||||||
include("${CMAKE_CURRENT_SOURCE_DIR}/LocalOverrides.cmake" OPTIONAL)
|
include("${CMAKE_CURRENT_SOURCE_DIR}/LocalOverrides.cmake" OPTIONAL)
|
||||||
include("${CMAKE_CURRENT_BINARY_DIR}/LocalOverrides.cmake" OPTIONAL)
|
include("${CMAKE_CURRENT_BINARY_DIR}/LocalOverrides.cmake" OPTIONAL)
|
||||||
|
|
||||||
if(NOT DEFINED HOME)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../Home.cmake)
|
||||||
if(DEFINED ENV{CTEST_REAL_HOME})
|
|
||||||
set(HOME "$ENV{CTEST_REAL_HOME}")
|
|
||||||
else()
|
|
||||||
set(HOME "$ENV{HOME}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT HOME AND WIN32)
|
|
||||||
# Try for USERPROFILE as HOME equivalent:
|
|
||||||
string(REPLACE "\\" "/" HOME "$ENV{USERPROFILE}")
|
|
||||||
|
|
||||||
# But just use root of SystemDrive if USERPROFILE contains any spaces:
|
|
||||||
# (Default on XP and earlier...)
|
|
||||||
if(HOME MATCHES " ")
|
|
||||||
string(REPLACE "\\" "/" HOME "$ENV{SystemDrive}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
message(STATUS "HOME='${HOME}'")
|
message(STATUS "HOME='${HOME}'")
|
||||||
|
|
||||||
if(NOT DEFINED url)
|
if(NOT DEFINED url)
|
||||||
|
|||||||
@@ -5,24 +5,7 @@ project(VTK)
|
|||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
|
|
||||||
# find "HOME". VTK will be downloaded & built within a subdirectory.
|
# find "HOME". VTK will be downloaded & built within a subdirectory.
|
||||||
if(NOT DEFINED HOME)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../Home.cmake)
|
||||||
if(DEFINED ENV{CTEST_REAL_HOME})
|
|
||||||
set(HOME "$ENV{CTEST_REAL_HOME}")
|
|
||||||
else()
|
|
||||||
set(HOME "$ENV{HOME}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT HOME AND WIN32)
|
|
||||||
# Try for USERPROFILE as HOME equivalent:
|
|
||||||
string(REPLACE "\\" "/" HOME "$ENV{USERPROFILE}")
|
|
||||||
|
|
||||||
# But just use root of SystemDrive if USERPROFILE contains any spaces:
|
|
||||||
# (Default on XP and earlier...)
|
|
||||||
if(HOME MATCHES " ")
|
|
||||||
string(REPLACE "\\" "/" HOME "$ENV{SystemDrive}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(base_dir "${HOME}/.cmake/Contracts/VTK")
|
set(base_dir "${HOME}/.cmake/Contracts/VTK")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user