[CMake] EXECUTE_PROCESS problem

Ajay Divekar ajay.divekar at guardiantechintl.com
Tue May 15 12:38:57 EDT 2007


I am trying to execute a script which calculates checksum of the binary files 
created during install process.

the script is as follows

#!/bin/sh

IF(UNIX)
  SET(CHKSUM "/sbin/sha1 -r")
ELSE(UNIX)
  SET(CHKSUM "/usr/bin/sha1sum")
ENDIF(UNIX)

EXECUTE_PROCESS( COMMAND ${CHKSUM} $ENV{PP_ROOTDIR}/bin/PSWd OUTPUT_FILE 
CHECKSUM.txt )

The above execute_program command does not work but if I replace it with (on 
unix synstems)
EXECUTE_PROCESS( COMMAND /sbin/sha1 -r  bin/PSWd OUTPUT_FILE CHECKSUM.txt)
it works.

This leads me to believe that EXECUTE_PROCESS command does not take variables. 
Is this true? and if it is what would be the solution to calculating checksum 
on different platforms?

Regards,
-- 
Ajay Divekar


More information about the CMake mailing list