[Cmake] EXEC_PROGRAM and it's output variable

Terry Lorber tlorber at atlantiscomp.com
Fri, 06 Feb 2004 13:46:01 -0500


This is a multi-part message in MIME format.
--------------090202010906050103060603
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

See attached.

I get the same results with CMakeSetup as well as running cmake from the 
command line (cygwin).  If I replace the EXEC_PROGRAM command with 
SET(BUILD_DATE "20040401") it works.

tgl

William A. Hoffman wrote:

> If the MESSAGE(${BUILD_DATA}) works, then there must be something
> wrong with the CONFIGURE_FILE call or input.  Since, you did not
> provide that code, it will be hard to say exactly what is wrong.
> 
> 
> -Bill
> 
> 
> At 10:50 AM 2/6/2004, Terry Lorber wrote:
> 
>>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

--------------090202010906050103060603
Content-Type: application/x-gzip;
 name="execprogram.tar.gz"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="execprogram.tar.gz"

H4sICEzfI0AAAGV4ZWNwcm9ncmFtLnRhcgDtlktPwkAUhbueX3EDkoAm0KGvhXHRlgFreKWl
RlaTQgecKNVANSbG/+5UBBFMiJGHi/k2k7kzaRf3njOHvbDh4/RhPI0mFWVPAIBlWSBWgbq2
fm6wqmLVMixNM8Te1HQTFEOR7JvV/rut6I41+SydldOXVNkZ2/pfVfGi/6ZpqAAYYx2DoiqS
fdP1O1fE7RWJmIPufA5KCJEb4lJx1PDtVjGOUoYAbL8RwFmhX5gUYrHthL1u2KPXtu/ZTpOA
E3rNGq3ZPYLEB1okCOwGKZ68ftXfRD0InZrnB8XhQzLiY1FAiuSYrOp/3pTdPwPwG//Xtey6
iavS/w/BD/0fPPH7OBN9+bbME+XvwFb/X/bf1LEu/L+qGab0/0OQ56MkZiOgHz6d2TS9pCgv
Sjxha1VUqUAECR8yeI6mPBrcMyRmZpbC8DaansLYySanJiYHLiD3zfpz5wjlWRLztT9J+z8y
m/rffQzcpn9saEv9WxrO9C9sQOr/ECzyn7sIZG6nXfcaoU9o3WtmAW5+QoNO6LuEivT2tvZC
gEiDy2uO17b9/sY1VJJJTyL5d7wDoVXINgASAAA=
--------------090202010906050103060603--