You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cmake/Tests/RunCMake/CMP0065/BuildTargetInSubProject.cmake

16 lines
624 B

function(BuildTargetInSubProject P T E)
try_compile(RESULTVAR
${CMAKE_CURRENT_BINARY_DIR}/subproject
${CMAKE_CURRENT_SOURCE_DIR}/subproject
${P} ${T} OUTPUT_VARIABLE O)
if(E AND RESULTVAR)
message(STATUS "${P} target ${T} succeeded as expected")
elseif(E AND NOT RESULTVAR)
message(FATAL_ERROR "${P} target ${T} failed but should have succeeded. Output:${O}")
elseif(NOT E AND NOT RESULTVAR)
message(STATUS "${P} target ${T} failed as expected")
elseif(NOT E AND RESULTVAR)
message(FATAL_ERROR "${P} target ${T} succeeded but should have failed. Output:${O}")
endif()
endfunction()