[CMake] CMake script return a value

Brandon J. Van Every bvanevery at gmail.com
Sat Jul 15 03:45:30 EDT 2006


Can a CMake script invoked with

EXECUTE_PROCESS(
  COMMAND ${CMAKE_COMMAND} -P myscript.cmake
  RESULT_VARIABLE myresult
)

return a value?  I don't really want to use stdout.  I need that for 
status messages.  I could regex the stdout to extract a decorated 
string, but that's bletcherous.  What I want is to do something like 
RETURN(${value}) and have RESULT_VARIABLE pick it up.


Cheers,
Brandon Van Every



More information about the CMake mailing list