[CMake] "Pre-configure" step in CMake

Bill Hoffman bill.hoffman at kitware.com
Thu Sep 24 17:15:24 EDT 2015


On 9/24/2015 5:02 PM, Matthäus G. Chajdas wrote:
> Hi,
>
> how does the ExternalProject interact with subsequent find_library calls?
>
> I've seen projects building dependencies through ExternalProject, but
> those would the project manually by querying ExternalProject and adding
> a new imported target. How would I connect an ExternalProject to one or
> more find_library calls?
>
So, the trick is it all has to be ExternalProject including your 
project.  Then the find_library stuff will work.

EP_add(3rdpartylib)
EP_add(myproj)

# at build time of myproj all of 3rdparytlib will be done and 
discoverable by myproj find_* calls.    We often have project-bootstrap 
projects that use external project to configure an environment.

1. build project-bootstrap (all external project stuff)
2. cd myproject, and treat this like a standalone CMake project that has 
just discovered all of its depends on the system.

> Is there a downside from configure taking an unknown amount of time? My
> expectation was that there is no timeout for the configure step.
It is meant to be an interactive step with cmake-gui.  Also, if there 
are configuration errors you would want to see them up front and not 
after a wait.

-Bill



More information about the CMake mailing list