[CMake] Environment variable for a custom command

Gregory C. Sharp gcsharp at partners.org
Fri Aug 15 11:37:43 EDT 2008


Bill Hoffman wrote:
> Gregory C. Sharp wrote:
>>
>> I found this little tidbit in the FAQ:
>>
>>   [E]nvironment variables SET in the CMakeLists.txt only take
>>   effect for cmake itself, so you cannot use this method to set
>>   an environment variable that a custom command might need.
>>
>> I would like to augment the path during a custom command.
>> Is there a suggested workaround?
>>
> Run a cmake script in the custom command that runs the program via 
> execute_process.

OK.  I might need another hint though.  I try this:

   MACRO(RUNME)
     EXECUTE_PROCESS(...)
   ENDMACRO(RUNME)

   ADD_CUSTOM_COMMAND(OUTPUT output COMMAND RUNME ...)

Which yields:

   1> 'RUNME' is not recognized as an internal or external command

-Greg
-- 
Gregory C. Sharp
Dept. of Radiation Oncology
Massachusetts General Hospital
gcsharp at partners.org  /  617-724-3866
http://gray.mgh.harvard.edu

The information transmitted in this electronic communication is intended only
for the person or entity to whom it is addressed and may contain confidential
and/or privileged material. Any review, retransmission, dissemination or other
use of or taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. If you received this
information in error, please contact the Compliance HelpLine at 800-856-1983 and
properly dispose of this information.





More information about the CMake mailing list