[vtkusers] Using vtkMy
Mike Jackson
imikejackson at gmail.com
Mon Oct 22 12:07:11 EDT 2007
If you look in the FindVTK.cmake file (included in the cmake
distribution) then you will see that they are probably defining any
include directories that need to be included. Also, if you do an
actual build and Install of VTK then vtk puts all the include files
in a single directory so there is no need for something like:
#include <vtkIO/vtkBMPReader.h>
instead you can use
#include < vtkBMPReader.h>
This is a matter of personal opinion which way is better and I am not
going to start a debate which way is better. If you have your sources
broken up into lots of subdirectories then you have some choices.
You can #include <Common/SomeCommonHeader.h> in which case you only
need the following in your cmakelists.txt file
INCLUDE_DIRECTORIES( "../vtkMy/")
You can #include <SomeCommonHeader.h> in which case you will need the
following in your cmakelists.txt file
INCLUDE_DIRECTORIES( "../vtkMy/Common"
I personally prefer the first approach as it makes it clear to a new
user coming to your code where to find the header file.
Good Luck.
For an example of how I have setup my code base have a look at http://
titanium.imts.us/viewvc/Task_7/MXADataModel/
Cheers
--
Mike Jackson Senior Research Engineer
Innovative Management & Technology Services
On Oct 22, 2007, at 11:48 AM, Tim Soper wrote:
> Hi, I have a quick question regarding the use of the vtkMy
> directory. To build, I followed all the instructions contained in
> the Examples/Build/vtkMy/README. I'm still uncertain on how I
> should build my projects that will use vtkMy. Specifically, how do
> I set the appropriate include directories? Currently I get errors
> in my project when I try to include a header file contained within
> a vtkMy subdirectory.
>
> I can of course go through the trouble of adding them all
> individually by adding the lines:
> INCLUDE_DIRECTORIES( "../vtkMy/Common" )
> INCLUDE_DIRECTORIES( "../vtkMy/Imaging" ), etc.
>
> to my project's CMakeLists file, but isn't there a way for that to
> all be taken care of the way VTK does it? I was hoping I could use
> a command like FIND_PACKAGE( VTKMY ) and all the directories would
> be included automatically. Any recommendations would be very much
> appreciated.
>
> Tim
>
>
>
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/
> Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list