Tests: Replace exec_program with execute_process

Drop use of the old exec_program command from CMake's own CMakeLists.txt
files.
This commit is contained in:
Brad King 2013-02-22 08:08:12 -05:00
parent 3bb57bab7b
commit ef8b2fd101
1 changed files with 5 additions and 6 deletions

View File

@ -384,7 +384,8 @@ if(BUILD_TESTING)
# mainly it tests that cmake doesn't crash when generating these project files. # mainly it tests that cmake doesn't crash when generating these project files.
if(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop") if(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop")
# check which generators we have # check which generators we have
exec_program(${CMAKE_CMAKE_COMMAND} ARGS --help OUTPUT_VARIABLE cmakeOutput ) execute_process(COMMAND ${CMAKE_CMAKE_COMMAND} --help
OUTPUT_VARIABLE cmakeOutput ERROR_VARIABLE cmakeOutput)
# check for the Eclipse generator # check for the Eclipse generator
if ("${cmakeOutput}" MATCHES Eclipse) if ("${cmakeOutput}" MATCHES Eclipse)
add_test(Simple_EclipseGenerator ${CMAKE_CTEST_COMMAND} add_test(Simple_EclipseGenerator ${CMAKE_CTEST_COMMAND}
@ -1239,11 +1240,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
endif() endif()
set(MAKE_IS_GNU ) set(MAKE_IS_GNU )
if(${CMAKE_TEST_MAKEPROGRAM} MATCHES make) if(${CMAKE_TEST_MAKEPROGRAM} MATCHES make)
exec_program( execute_process(COMMAND ${CMAKE_TEST_MAKEPROGRAM} no_such_target --version
${CMAKE_TEST_MAKEPROGRAM} ARGS no_such_target --version RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_VARIABLE out)
RETURN_VALUE res OUTPUT_VARIABLE out if("${res}" STREQUAL "0")
)
if("${res}" EQUAL 0)
if("${out}" MATCHES "GNU") if("${out}" MATCHES "GNU")
set(MAKE_IS_GNU 1) set(MAKE_IS_GNU 1)
endif() endif()