Merge topic 'tests-use-CMAKE_MAKE_PROGRAM'

c180f0cb Tests: Fix CMAKE_MAKE_PROGRAM selection in FortranC.Flags test
586b2e5e Tests: Fix CMAKE_MAKE_PROGRAM selection in CMakeOnly tests
This commit is contained in:
Brad King 2015-08-12 09:30:36 -04:00 committed by CMake Topic Stage
commit ce254de60e
2 changed files with 12 additions and 0 deletions

View File

@ -2,6 +2,11 @@ if (NOT TEST_SOURCE)
set(TEST_SOURCE "${TEST}")
endif ()
set(make_program "@CMake_TEST_EXPLICIT_MAKE_PROGRAM@")
if(make_program)
set(maybe_make_program "-DCMAKE_MAKE_PROGRAM=${make_program}")
endif()
set(source_dir "@CMAKE_CURRENT_SOURCE_DIR@/${TEST_SOURCE}")
set(binary_dir "@CMAKE_CURRENT_BINARY_DIR@/${TEST}-build")
file(REMOVE_RECURSE "${binary_dir}")
@ -11,6 +16,7 @@ execute_process(
"${source_dir}" -G "@CMAKE_GENERATOR@"
-A "@CMAKE_GENERATOR_PLATFORM@"
-T "@CMAKE_GENERATOR_TOOLSET@"
${maybe_make_program}
WORKING_DIRECTORY "${binary_dir}"
RESULT_VARIABLE result
)

View File

@ -12,11 +12,17 @@ configure_file("${src}/test_opt.sh.in" "${bld}/fc.sh" @ONLY)
set(ID)
set(COMMAND)
set(make_program "@CMake_TEST_EXPLICIT_MAKE_PROGRAM@")
if(make_program)
set(maybe_make_program "-DCMAKE_MAKE_PROGRAM=${make_program}")
endif()
execute_process(
WORKING_DIRECTORY "${bld}"
COMMAND ${CMAKE_COMMAND} "${src}" -G "@CMAKE_GENERATOR@"
-A "@CMAKE_GENERATOR_PLATFORM@"
-T "@CMAKE_GENERATOR_TOOLSET@"
${maybe_make_program}
"-DFortranC_TEST_FLAGS=1"
"-DCMAKE_C_COMPILER=${bld}/cc.sh"
"-DCMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@"