[CMake] Problems with parallel builds

Denis Scherbakov denis_scherbakov at yahoo.com
Thu Nov 18 07:06:03 EST 2010


Dear All,

I am using CMake 2.8.1 on Linux x86. I have a project that needs to be built two times. One with -fPIC, the other - without. The project depends on header files that need to be generated by an external script.

When I build this project with several parallel jobs (gmake -j5, for example) to my disappointment CMake calls external script several times so at the end I get corrupted header files.

Does anybody know a cross-platform way of implementing a mutex (or something like that) to make sure that scripts that generate files are called only once?

So far for me parallel builds do not work with CMake at all. 

Thanks.
Denis


      


More information about the CMake mailing list