[CMake] Generating shell script through cmake

Eric Noulard eric.noulard at gmail.com
Thu Feb 26 05:02:15 EST 2009


2009/2/26 ankit jain <ankitguddu at gmail.com>:
> Hi,
>
> I want to generate a shell script which should be executable through three
> files.
>
> first file has some macros with other functions and other code.
> Second and third file haev definitions fot he macro the functions.
>
> Can i generate a shell script from all this.

You should try to be more specific.

Should the file be generated:
   1) at CMake time
   2) at build time

Does the file depends on some previously generated other files?
What are the varying part of your generated files?
Should the generated file be executed after it has been generated?

Using CMake you may use FILE(WRITE
in order to write any text file, so basically YES you may generate a
shell script using CMake.

I do usually use a combination fo FILE(WRITE  and CONFIGURE_FILE
for my generated files, which are generated at CMake time and then
used at build time from custom command/target.

-- 
Erk


More information about the CMake mailing list