[CMake] ExternalProject_Add ALWAYS, VisualStudo

James Turner james.turner at kdab.com
Tue Dec 3 05:29:37 EST 2013


On 1 Dec 2013, at 10:53, James Turner <james.turner at kdab.com> wrote:

> I am trying to force the BUILD step of an ExternalProject_Add target to be run - always. I have found several wiki articles, and references in the archives of this list, to setting an ALWAYS option for the stage I want to force to run each time. The problem is I can’t find any documentation on the exact syntax to use - can someone please enlighten me? (This is for a project where the files are on the local disk when the build is run, but may change due to external sync mechanisms - right now the build system never notices this)

Following up on this: I was wrong, the problem is not needing to run the ‘build’ step always. (I discovered this by adding the steps as Kevin suggested).

Instead, I’ve realised the problem is with the Visual Studio projects (I can only test 2010) - using the makefile generator on Linux, everything works as expected without any custom ExternalProject_Add_Step.

To make this clearer, here is the current superbuild file:

	https://gitorious.org/fg/fgmeta/source/fe39e97c2ed376a081de8251e18bfd876621c617:CMakeLists.txt

(Containing the ExternalProject_Add_Step, but these make no difference)

When building, we have a structure as follows on Windows:

	C:\FGFS\fgmeta
				\flightgear
				\simgear
				\fgrun
	(these subdirs being Git submodules, the whole of fgmeta being obtained via 'git clone —recursive’)
	
and:

	C:\FGFS\metabuild

I run the CMake GUI, passing 'C:\FGFS\fgmeta’ as the source dir, and 'C:\FGFS\metabuild’ as the binary dir. When using the VS2010 generator, this produces something like:


	C:\FGFS\metabuild
				\FlightGear-Meta.sln
				… vcxproj for each ExternaProject_add in the superbuild CMakeList.txt …

				\fgbuild\FlightGear.sln
				\sgbuild\SimGear.sln

On an initial build, all is fine. The issue is that on successive builds, the top level -Meta.sln does not seem to descend into ‘fgbuild’, ’sgbuild' dirs at all; if I invoke the solutions inside those dirs manually (from the GUI or via msbuild.exe) they compile fine, but using msbuild or the GUI on the top-level solution simply says ‘nothing to be done’ for those steps.

Am I doing something wrong here that’s confusing the MSVC generator? This seems like a completely standard way to use External projects with MSVC, but equally I have no problem adjust the structure if it would simplify things. The only restriction is I need to keep each sub-project building cleanly outside of the superbuild - but I have control over them, including their Cmake files.

Kind regards,
James


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20131203/0eb3d999/attachment-0001.htm>


More information about the CMake mailing list