[Cmake] running another command

Nikhil Kriplani nmkripps at hotmail . com
Tue, 24 Dec 2002 08:34:12 -0500

Hi All,

I am new to cmake, and I was having a problem running a shell command during 
the make process.

The command I want to run is

sh mkheaders.sh $(ELEMNAMES).
What this does is, it generates a file called element_headers.h, which is 
used by other source files later on during the make process.

What I tried is:

ADD_CUSTOM_TARGET(ElementHeaders echo "creating element_headers.h")

        COMMAND sh
        ARGS mkheaders.sh
        TARGET ElementHeaders
        OUTPUTS element_headers.h)

In the CMakeLists.txt file, I made sure that I use SET(ELEMNAMES 
source_list) and it shows up correctly in the Makefile generated.
Also, I was not sure what name to give to TARGET, so I just arbitrarily used 

Help will be appreciated.


Add photos to your messages with MSN 8. Get 2 months FREE*. 
http://join . msn . com/?page=features/featuredemail&xAPID=42&PS=47575&PI=7324&DI=7474&SU= 
http://www . hotmail . msn . com/cgi-bin/getmsg&HL=1216hotmailtaglines_addphotos_3mf