Just a note.. .

That method does NOT work with windows...  And since the visual studio project 
has the external as a single command, (not sure if its calling nmake or the new 
build cmd) the proeject is not run in parallel.

Scott

-----Original Message-----
From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Scott Aron Bloom
Sent: Wednesday, March 23, 2016 8:53 PM
To: Alan W. Irwin
Cc: cmake@cmake.org
Subject: Re: [CMake] Two phase install?

> Thanks I'm getting close now.
>
> However, for the two sub projects, there doesn’t seem to be a way to run the 
> make stage with -j 6 or any make options.
>
> Am I missing something? I see how to set CMAKE_ARGS but no MAKE_ARGS

Hi Scott:

Some of my further comments are somewhat off your original topic since I 
discuss parallel build issues for the case of larger numbers of projects in the 
superproject, but I thought you might be interested in that case even though 
you just have two projects in your superproject.

For the superproject (epa_build in my case) I configure the 
EPA_PARALLEL_BUILD_COMMAND variable to create the build command that I use for 
all individual projects.  That can be anything accessible from the command-line 
such as nmake in the Windows case and make in the Unix case.  So in your case, 
your overall superproject could specify

set(SUPERPROJECT_BUILD_COMMAND make -j4)

(say), and then each of your two projects could be configured via 
ExternalProject_Add to use ${SUPERPROJECT_BUILD_COMMAND} as the build command 
for each individual project.  But getting back to the more complex case, for 
Unix on Windows (e.g. Cygwin, MinGW-w64/MSYS2,
MinGW/MSYS) I find parallel build options are not reliable (presumably because 
of make bugs in all those platforms) so to work around that issue, epa_build 
deliberately drops any -j options that might be specified in 
EPA_PARALLEL_BUILD_COMMAND for those platforms.  But for the Linux case (and I 
assume Mac OS X, also although I haven't tried it yet), the -j option for make 
does work reliably so I allow that option to be part of the 
EPA_PARALLEL_BUILD_COMMAND for that platform.

N.B. with 60 projects being built (each one using a parallel build on
Linux) with one overall make command, I am currently careful to build each of 
those projects one at a time (i.e., avoid any parallel options on the overall 
build or just use -j1) to avoid overwhelming my computer with parallel builds.  
However, come to think of it I have always used that combination of -j options 
(-j4 for individual project builds and -j1 for overall build) out of inertia, 
and there are many other ways that avoidance can be done (e.g., -j4 on the 
overall build and -j1 on the individual builds) so long as the product of the 
two integers specified by the -j options does not get too excessive.  So I may 
do some experimentation concerning the most efficient combination of individual 
and overall -j options the next time I do an epa_build on Linux.

Alan

==========
Thanks that  is what I was planning.  I was just hoping, there was a variable I 
was missing in the docs

I have it working now on linux, off to try and see how it works with windows

Scott

-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to