[Cmake] Read a file

Andy Cedilnik andy.cedilnik at kitware.com
Mon Mar 17 10:43:12 EST 2003


Hi Geoffrey,

INCLUDE does read file, but it has to be in CMake format. I understood
Nils, that he wants to read file and store result to CMake variable.
There is a way actually:


SET(cat_prog cat)
IF(WIN32)
  IF(NOT UNIX)
    SET(cat_prog type)
  ELSE(NOT UNIX)
ENDIF(WIN32)

EXEC_PROGRAM(${cat_prog} ARGS /input/file.txt OUTPUT_VARIABLE variable)

MESSAGE("Content of file is: ${variable}")

				Andy

On Mon, 2003-03-17 at 10:32, Geoffrey Cross wrote:
> What about "INCLUDE"?  Isn't that what he meant?





More information about the CMake mailing list