[CMake] Best way to build Insight as a subdirectory of a larger project

William A. Hoffman billlist at nycap.rr.com
Thu Oct 7 15:35:00 EDT 2004


You may want to look at the CMakeList files in ParaView (www.paraview.org).
For that project VTK is included as a sub directory.  The basic idea is to 
preset as many cmake variables as you want in the higher level cmake file.
Also, instead of finding an existing ITK build, you would just set the
paths to the ITK source and binary because you would know them.
 
For example Paraview does this:

SET(VTK_DIR "${ParaView_BINARY_DIR}/VTK" CACHE INTERNAL "" FORCE)
SET(VTK_FOUND 1)

You could do the same thing for ITK in your project.

-Bill

At 10:55 AM 10/7/2004, Kent Williams wrote:
>I'm trying to make our application brains2 a CMake project.  In order to build brains2 there are dependencies on several open source projects, including Insight (www.itk.org).
>
>I'd like to build Insight as a subproject of brains2, which raises 2 questions:
>
>1. Insight's CMakeLists.txt file is written to be a 'top-level' CMake project. I'd like to use the regular CMakeLists.txt
>file but pass down from the brains2 level things like target directories and compiler flags. Currently we automate that
>by running cmake in the brains2 makefile.
>
>2. The current CMakeLists.txt for the core of brains2 tries to find an existing build of Insight.  If I'm configuring brains2, and Insight isn't yet built, what's the best way to give the required paths to library and include files, which won't exist until Insight is configured and built?
>
>
>_______________________________________________
>CMake mailing list
>CMake at www.cmake.org
>http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list