[Cmake] EXEC_PROGRAM and it's output variable

Terry Lorber tlorber at atlantiscomp.com
Fri, 06 Feb 2004 10:50:41 -0500


I'm try to use EXEC_PROGRAM to store the current date.  I'm calling it 
like this (on cygwin) in my topmost CMakeLists.txt file:

EXEC_PROGRAM(date
   ARGS +%Y%m%d
   OUTPUT_VARIABLE BUILD_DATE
)

If I call MESSAGE(${BUILD_DATE}) in the same CMakeLists.txt, I see the 
value I want.  However, using ${BUILD_DATE} in an input file for 
CONFIGURE_FILE, results with no value being returned.  If I do 
SET(BUILD_DATE "20040206") in the value being passed through to the 
output file.

What's to do?

Thanks,
tgl
-- 
Atlantis Components Inc     270 Third St
617.661.9799x248            Cambridge MA  02142