[vtk-developers] Errors in building VTKExamples in today's CVS

Bill Lorensen bill.lorensen at gmail.com
Mon Dec 21 11:31:34 EST 2009


Brad,

I added the proect(VTKExamples) in the Examples/CMakeLists.txt file.

Also added the
IF(NOT VTK_BINARY_DIR)
 FIND_PACKAGE(VTK REQUIRED)
ENDIF(NOT VTK_BINARY_DIR)

Then ran cmake with source: VTK/Examples with the bin pointing to a
separate build tree.

I generated a solution file and I was able to build it in Visual Studio.

Also ran cmake with source: Examples/Medical/Cxx

I generated a solution file and I was able to build it in Visual Studio.

So far so good,

Bill

On Mon, Dec 21, 2009 at 10:46 AM, Brad King <brad.king at kitware.com> wrote:
> Bill Lorensen wrote:
>> In my local build I have modified the Examples/Foo/Cxx files to do this:
>>
>> IF(NOT VTK_BINARY_DIR)
>> FIND_PACKAGE(VTK REQUIRED)
>> ENDIF(NOT VTK_BINARY_DIR)
>>
>> This seems to let me build outside of the VTK tree. Doesn't this
>> simple approach work OK?
>
> As long as there is a test that builds the whole examples tree, or
> perhaps a test for each individual example, as an outside project.
> Otherwise examples will stop working outside the tree.
>
>> Also, since one can build with examples off, the solution can be kept
>> small if one desires it to be small.
>
> Another advantage of the separate solution for VTKExamples is that
> after building VTK one could go load that solution to edit-and-build
> the examples by themselves.  Since the custom-target approach was
> implemented, CMake has gained a new feature that allows this use case
> without using the custom target.
>
> At the top of the VTK/Examples/CMakeLists.txt file, add the command
>
>  project(VTKExamples)
>
> if it is not there already.  CMake now converts all project() calls
> into a VS solution that has just the subproject and its dependencies.
> If you add a
>
>  project(MyExample)
>
> in each test project, there will be a solution for each example with
> all its dependencies but no other examples.
>
>> BTW, for the tests themselves I am using the vtk test framework, so
>> that only one executable per kit is generated for testing. That works
>> great.
>
> Great.
>
> -Brad
>



More information about the vtk-developers mailing list