Revert "[PERFORMANCE] Should now perform tests in parallel using the ctest -j flag according to how many cores there are in the system."

This reverts commit 28f7704eea.
release/4.3a0
= 2016-06-17 09:09:14 -04:00
parent a7d02de3b5
commit 393f3d0f72
1 changed files with 1 additions and 33 deletions

View File

@ -97,42 +97,10 @@ else()
option(GTSAM_SINGLE_TEST_EXE "Combine unit tests into single executable (faster compile)" OFF)
endif()
mark_as_advanced(GTSAM_SINGLE_TEST_EXE)
#Parallelize CTests since ctest supports the -j command
#Get number of cores from here: https://cmake.org/pipermail/cmake/2010-October/040122.html
if(NOT DEFINED PROCESSOR_COUNT)
# Unknown:
set(PROCESSOR_COUNT 0)
# Linux:
set(cpuinfo_file "/proc/cpuinfo")
if(EXISTS "${cpuinfo_file}")
file(STRINGS "${cpuinfo_file}" procs REGEX "^processor.: [0-9]+$")
list(LENGTH procs PROCESSOR_COUNT)
endif()
# Mac:
if(APPLE)
find_program(cmd_sys_pro "system_profiler")
if(cmd_sys_pro)
execute_process(COMMAND ${cmd_sys_pro} OUTPUT_VARIABLE info)
string(REGEX REPLACE "^.*Total Number Of Cores: ([0-9]+).*$" "\\1"
PROCESSOR_COUNT "${info}")
endif()
endif()
# Windows:
if(WIN32)
set(PROCESSOR_COUNT "$ENV{NUMBER_OF_PROCESSORS}")
endif()
endif()
if(PROCESSOR_COUNT)
set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}")
endif()
# Enable make check (http://www.cmake.org/Wiki/CMakeEmulateMakeCheck)
if(GTSAM_BUILD_TESTS)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} ${CTEST_BUILD_FLAGS} -C $<CONFIGURATION> --output-on-failure)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --output-on-failure)
endif()
# Add examples target