how consider pre build

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how consider pre build

"Sören Freudiger"
Hi
One Problem.

There's one file in my sources that produces a cxx file in a pre build step (similar to qt_ui or moc, swig ...)

But the source file isn't a h,c,cxx, file. It's a .if file thus I caonnot put this to the project source files without getting an error.

Ok, but step by step...

#input file    : file.if
#generated file: gen_file.cxx

 ADD_CUSTOM_COMMAND(OUTPUT gen_file.cxx
                    PRE_BUILD
                    COMMAND echo on \n ..\if.exe
                    ARGS -c++
                         ${include_dirs}
                         ${preProcessorDefs}
                         -o gen_file.cxx
                         file.if
                    MAIN_DEPENDENCY file.if
                    DEPENDS file.if
                    COMMENT generating gen_file.cxx )

SET_SOURCE_FILES_PROPERTIES(gen_file.cxx PROPERTIES GENERATED 1)


lets use this stuff (LINUX gxx):

cmake
make       --> first run -> generates gen_file.cxx
make clean --> gen_file.cxx gets deleted becaus eit's generated
make       --> error: gen_file.cxx : No such file or directory

On Windows with VS 200x the file.if appears in my project witout adding it explecitly. And the gen_file.cxx will be rebuild if missing.

How can I ensure that the cxx is rebuilded if it's missing on Linux?

Best,
 SirAnn
--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: how consider pre build

Alexander Neundorf-3
On Wednesday 25 November 2009, Sören Freudiger wrote:
> Hi
> One Problem.
>
> There's one file in my sources that produces a cxx file in a pre build step
> (similar to qt_ui or moc, swig ...)
>
> But the source file isn't a h,c,cxx, file. It's a .if file thus I caonnot
> put this to the project source files without getting an error.

Did you try that ? What error do you get ? With which generator ?
If it's an extension unknown to cmake (".if" should be) then I thought this
was supposed to work.

Alex
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake