[CMake] ExternalProject and install dir

Hans van den Bogert hansbogert at gmail.com
Wed Aug 13 09:39:34 EDT 2014


I see thanks, so install_dir has a different meaning than the eventual install dir of the external project, I thought there would be some ‘magic’ where the ExternalProject functions would override the the prefix of, in this case, project x. 

I still have one issue, perhaps I should start a new thread,  but here goes:

The external project produces a library, how can I make that library a target, so that any executables in the main project who depend on the library from ‘x’ will not link before the library is compiled/available.

Because I some instances if I have a parallelized build the following scenario can happen.

1) x is being built
1) an executable which depends on an library, libx, from ‘x’ is being built.
2) the executable proceeds to its linking phase, but needs libx, which is not there; build fails.
3) ‘x’ has now produced libx

libx was produced too late.


My current setup (which exhibits the above) is simply to deduce the complete path to the library and add it the executable target.

Is there any way this can be fixed with custom targets or something related?


On 13 Aug 2014, at 15:23, David Cole <dlrdave at aol.com> wrote:

> See, for example:
> 
> https://github.com/OpenChemistry/openchemistry/blob/master/CMakeLists.txt#L24
> 
> A common CMAKE_INSTALL_PREFIX is used for all OpenChemistry ExternalProject builds that are driven by CMake.
> 



More information about the CMake mailing list