[CMake] Trouble with parallel builds for targets created by add_executable, target_link_libraries, and add_library

Bill Hoffman bill.hoffman at kitware.com
Tue Sep 29 16:36:31 EDT 2009


Alan W. Irwin wrote:
> As part of the build of PLplot and for STRING_INDEX = 01, 02, ...,
> I have created test targets x01c, x02c,.... with
> 
> add_executable(x${STRING_INDEX}c x${STRING_INDEX}c.c)
> target_link_libraries(x${STRING_INDEX}c plplot${LIB_TAG})
> 
> where LIB_TAG is "d", and plplotd is a target created by add_library when
> our core library is built.  I have simplified our build so that libplplotd
> only depends on one other internal library (via target_link_libraries)
> called qsastime, and there are no dependencies on custom targets or custom
> commands.
> 
> For this simplified build, if I try
> 
> make -j2 x01c x02c
> 

make -j N is only supported with the all target.

Best approximation would be to cd into the directory that had the 
targets and do a make  -j N from that directory.



-Bill


More information about the CMake mailing list