mirror of
https://github.com/reactos/CMake.git
synced 2024-11-30 23:10:26 +00:00
Merge topic 'debug-ProcessorCount'
4d0e2e8
ProcessorCount test: require SystemInformation process to worke03f83f
ProcessorCount test: fix path to cmsysTestsCxx executable
This commit is contained in:
commit
48ab5050de
@ -4,7 +4,8 @@ set(CMAKE_EXECUTABLE "${CMake_BIN_DIR}/cmake")
|
||||
macro(AddCMakeTest TestName PreArgs)
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${TestName}Test.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" @ONLY IMMEDIATE)
|
||||
add_test(CMake.${TestName} ${CMAKE_EXECUTABLE} ${PreArgs}
|
||||
add_test(NAME CMake.${TestName}
|
||||
COMMAND ${CMAKE_EXECUTABLE} ${PreArgs}
|
||||
-P "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" ${ARGN})
|
||||
endmacro()
|
||||
|
||||
@ -28,7 +29,7 @@ AddCMakeTest(String "")
|
||||
AddCMakeTest(Math "")
|
||||
AddCMakeTest(CMakeMinimumRequired "")
|
||||
AddCMakeTest(CompilerIdVendor "")
|
||||
AddCMakeTest(ProcessorCount "")
|
||||
AddCMakeTest(ProcessorCount "-DKWSYS_TEST_EXE=$<TARGET_FILE:cmsysTestsCxx>")
|
||||
AddCMakeTest(PushCheckState "")
|
||||
AddCMakeTest(While "")
|
||||
|
||||
|
@ -9,10 +9,17 @@ message("### 3. ProcessorCount(...) function call is emitting output that it sho
|
||||
message("processor_count='${processor_count}'")
|
||||
|
||||
execute_process(
|
||||
COMMAND "@CMAKE_BINARY_DIR@/Source/kwsys/$ENV{CMAKE_CONFIG_TYPE}/cmsysTestsCxx"
|
||||
COMMAND "${KWSYS_TEST_EXE}"
|
||||
testSystemInformation
|
||||
OUTPUT_VARIABLE tsi_out
|
||||
ERROR_VARIABLE tsi_err)
|
||||
ERROR_VARIABLE tsi_err
|
||||
RESULT_VARIABLE tsi_res
|
||||
)
|
||||
if (tsi_res)
|
||||
message("executing \"${KWSYS_TEST_EXE}\" failed")
|
||||
message(FATAL_ERROR "output: ${tsi_res}")
|
||||
endif ()
|
||||
|
||||
string(REGEX REPLACE "(.*)GetNumberOfPhysicalCPU:.([0-9]*)(.*)" "\\2"
|
||||
system_info_processor_count "${tsi_out}")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user