[Cmake] Building in two separate trees

Andy Cedilnik andy.cedilnik at kitware.com
Mon Nov 25 13:30:43 EST 2002


Hi Amitha,

The way VTK does it is that it configures a cmake file, which is
included in the related project. This cmake file sets some variables
which are then used in the related project.

For example, in your project have file MyProject.cmake.in:

SET(SOME_VAR "${SOME_VAR}")
...

And then in your related project do
IMPORT(${PARENT_PROJECT_PATH}/MyProject.cmake)

Something like that.


				Andy


On Mon, 2002-11-25 at 12:54, Amitha Perera wrote:
> I know that CMake can be used to build in two separate trees using the
> LoadCache command. For example, the vxl tree is build in one
> directory, and our internal libraries are built somewhere else. The
> relevant settings, such as dependencies, are extracted from the vxl
> tree using LoadCache.
> 
> Now, LoadCache brings in pretty much everything in the cache, and
> marks them unmodifiable in the new tree. This is not appropriate for
> some entries, such as CMAKE_CXX_FLAGS and CMAKE_VERBOSE_MAKEFILE. Is
> there a better way than excluding each variable? I recall Brad
> mentioned a new style of doing things in vtk.





More information about the CMake mailing list