Missing Includes with new module system

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Missing Includes with new module system

Bill Lorensen
I have a simple program that fails to find the vtk include files:
Here is the CMakeLists.txt fiile:
cmake_minimum_required(VERSION 3.8)

PROJECT(ReadOBJ)
Find_package(VTK)
if (VTK_VERSION VERSION_LESS "8.90")
  # old system
  include(${VTK_USE_FILE})
  # modules are linked via `vtkCommonCore`
  # VTK_DEFINITIONS has autoinit information
else ()
  # modules are linked via `VTK::CommonCore`
  # vtk_module_autoinit is needed
endif ()

add_executable(ReadOBJ MACOSX_BUNDLE ReadOBJ.cxx )
target_link_libraries(ReadOBJ ${VTK_LIBRARIES})

The source file is here:
https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Cxx/IO/ReadOBJ.cxx

I get the error:
[build] cmake -DVTK_DIR:PATH=/Users/lorensen/ProjectsGIT/VTKNewModules-clang/lib/cmake/vtk-8.90/
..
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/ReadOBJ/build
[build] make
[ 50%] Building CXX object CMakeFiles/ReadOBJ.dir/ReadOBJ.cxx.o
/tmp/ReadOBJ/ReadOBJ.cxx:1:10: fatal error: 'vtkOBJReader.h' file not found
#include <vtkOBJReader.h>
         ^~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/ReadOBJ.dir/ReadOBJ.cxx.o] Error 1
make[1]: *** [CMakeFiles/ReadOBJ.dir/all] Error 2
make: *** [all] Error 2
[build] cmake --version
cmake version 3.10.3


--
Unpaid intern in BillsParadise at noware dot com
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Missing Includes with new module system

VTK - Dev mailing list
On Thu, Jan 10, 2019 at 14:08:28 -0800, Bill Lorensen wrote:

> I have a simple program that fails to find the vtk include files:
> Here is the CMakeLists.txt fiile:
> cmake_minimum_required(VERSION 3.8)
>
> PROJECT(ReadOBJ)
> Find_package(VTK)
> if (VTK_VERSION VERSION_LESS "8.90")
>   # old system
>   include(${VTK_USE_FILE})
>   # modules are linked via `vtkCommonCore`
>   # VTK_DEFINITIONS has autoinit information
> else ()
>   # modules are linked via `VTK::CommonCore`
>   # vtk_module_autoinit is needed
> endif ()
>
> add_executable(ReadOBJ MACOSX_BUNDLE ReadOBJ.cxx )
> target_link_libraries(ReadOBJ ${VTK_LIBRARIES})

Hmm. What is `VTK_LIBRARIES` set to?

--Ben
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Missing Includes with new module system

Bill Lorensen
VTK_LIBRARIES is empty.



On Jan 10, 2019 3:07 PM, "Ben Boeckel" <[hidden email]> wrote:
On Thu, Jan 10, 2019 at 14:08:28 -0800, Bill Lorensen wrote:
> I have a simple program that fails to find the vtk include files:
> Here is the CMakeLists.txt fiile:
> cmake_minimum_required(VERSION 3.8)
>
> PROJECT(ReadOBJ)
> Find_package(VTK)
> if (VTK_VERSION VERSION_LESS "8.90")
>   # old system
>   include(${VTK_USE_FILE})
>   # modules are linked via `vtkCommonCore`
>   # VTK_DEFINITIONS has autoinit information
> else ()
>   # modules are linked via `VTK::CommonCore`
>   # vtk_module_autoinit is needed
> endif ()
>
> add_executable(ReadOBJ MACOSX_BUNDLE ReadOBJ.cxx )
> target_link_libraries(ReadOBJ ${VTK_LIBRARIES})

Hmm. What is `VTK_LIBRARIES` set to?


--Ben


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Missing Includes with new module system

Bill Lorensen
I'm not specifying any components. If add the required components it works.
Before, I did not have to specify components... This is troublesome.

Bill

On Thu, Jan 10, 2019 at 3:27 PM Bill Lorensen <[hidden email]> wrote:

>
> VTK_LIBRARIES is empty.
>
>
>
> On Jan 10, 2019 3:07 PM, "Ben Boeckel" <[hidden email]> wrote:
>
> On Thu, Jan 10, 2019 at 14:08:28 -0800, Bill Lorensen wrote:
> > I have a simple program that fails to find the vtk include files:
> > Here is the CMakeLists.txt fiile:
> > cmake_minimum_required(VERSION 3.8)
> >
> > PROJECT(ReadOBJ)
> > Find_package(VTK)
> > if (VTK_VERSION VERSION_LESS "8.90")
> >   # old system
> >   include(${VTK_USE_FILE})
> >   # modules are linked via `vtkCommonCore`
> >   # VTK_DEFINITIONS has autoinit information
> > else ()
> >   # modules are linked via `VTK::CommonCore`
> >   # vtk_module_autoinit is needed
> > endif ()
> >
> > add_executable(ReadOBJ MACOSX_BUNDLE ReadOBJ.cxx )
> > target_link_libraries(ReadOBJ ${VTK_LIBRARIES})
>
> Hmm. What is `VTK_LIBRARIES` set to?
>
>
> --Ben
>
>


--
Unpaid intern in BillsParadise at noware dot com
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Missing Includes with new module system

Bill Lorensen
I have over 1000 C++ examples. The cmakelists.txt file on the web page
for each example is generated from a template file. So I can fix it
for all web but it is ugly...

Here is the working, general cmakelists.txt file:
cmake_minimum_required(VERSION 3.8)

PROJECT(ReadOBJ)
Find_package(VTK CONFIG)
if (VTK_VERSION VERSION_LESS "8.90")
  # old system
  Find_package(VTK REQUIRED)
  include(${VTK_USE_FILE})
  # modules are linked via `vtkCommonCore`
  # VTK_DEFINITIONS has autoinit information
else ()
  # modules are linked via `VTK::CommonCore`
  # vtk_module_autoinit is needed
  Find_package(VTK COMPONENTS
  ChartsCore
  CommonColor
  CommonComputationalGeometry
  CommonSystem
  FiltersExtraction
  FiltersFlowPaths
  FiltersGeneric
  FiltersGeometry
  FiltersHybrid
  FiltersModeling
  # FiltersParallelStatistics #  Optional
  FiltersPoints
  FiltersProgrammable
  FiltersTexture
  FiltersVerdict
  GeovisCore
  IOExodus
  IOExport
  # IOFFMPEG # Optional
  IOImport
  IOInfovis
  # IOMySQL # Optional
  IOPLY
  IOParallel
  IOParallelXML
  ImagingColor
  ImagingFourier
  ImagingHybrid
  ImagingMath
  ImagingMorphological
  ImagingSources
  ImagingStatistics
  ImagingStencil
  # InfovisBoostGraphAlgorithms # Optional
  InfovisLayout
  InteractionImage
  RenderingAnnotation
  RenderingContextOpenGL2
  RenderingImage
  RenderingLOD
  RenderingLabel
  RenderingOpenGL2
  RenderingVolumeOpenGL2
  TestingGenericBridge
  TestingRendering
  ViewsContext2D
  ViewsInfovis
)
endif ()
add_executable(ReadOBJ MACOSX_BUNDLE ReadOBJ.cxx )
target_link_libraries(ReadOBJ ${VTK_LIBRARIES})

On Thu, Jan 10, 2019 at 4:06 PM Bill Lorensen <[hidden email]> wrote:

>
> I'm not specifying any components. If add the required components it works.
> Before, I did not have to specify components... This is troublesome.
>
> Bill
>
> On Thu, Jan 10, 2019 at 3:27 PM Bill Lorensen <[hidden email]> wrote:
> >
> > VTK_LIBRARIES is empty.
> >
> >
> >
> > On Jan 10, 2019 3:07 PM, "Ben Boeckel" <[hidden email]> wrote:
> >
> > On Thu, Jan 10, 2019 at 14:08:28 -0800, Bill Lorensen wrote:
> > > I have a simple program that fails to find the vtk include files:
> > > Here is the CMakeLists.txt fiile:
> > > cmake_minimum_required(VERSION 3.8)
> > >
> > > PROJECT(ReadOBJ)
> > > Find_package(VTK)
> > > if (VTK_VERSION VERSION_LESS "8.90")
> > >   # old system
> > >   include(${VTK_USE_FILE})
> > >   # modules are linked via `vtkCommonCore`
> > >   # VTK_DEFINITIONS has autoinit information
> > > else ()
> > >   # modules are linked via `VTK::CommonCore`
> > >   # vtk_module_autoinit is needed
> > > endif ()
> > >
> > > add_executable(ReadOBJ MACOSX_BUNDLE ReadOBJ.cxx )
> > > target_link_libraries(ReadOBJ ${VTK_LIBRARIES})
> >
> > Hmm. What is `VTK_LIBRARIES` set to?
> >
> >
> > --Ben
> >
> >
>
>
> --
> Unpaid intern in BillsParadise at noware dot com



--
Unpaid intern in BillsParadise at noware dot com
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Missing Includes with new module system

Bill Lorensen
Is there a VTK cmake variable that lists all components in a particular build?

On Thu, Jan 10, 2019 at 4:10 PM Bill Lorensen <[hidden email]> wrote:

>
> I have over 1000 C++ examples. The cmakelists.txt file on the web page
> for each example is generated from a template file. So I can fix it
> for all web but it is ugly...
>
> Here is the working, general cmakelists.txt file:
> cmake_minimum_required(VERSION 3.8)
>
> PROJECT(ReadOBJ)
> Find_package(VTK CONFIG)
> if (VTK_VERSION VERSION_LESS "8.90")
>   # old system
>   Find_package(VTK REQUIRED)
>   include(${VTK_USE_FILE})
>   # modules are linked via `vtkCommonCore`
>   # VTK_DEFINITIONS has autoinit information
> else ()
>   # modules are linked via `VTK::CommonCore`
>   # vtk_module_autoinit is needed
>   Find_package(VTK COMPONENTS
>   ChartsCore
>   CommonColor
>   CommonComputationalGeometry
>   CommonSystem
>   FiltersExtraction
>   FiltersFlowPaths
>   FiltersGeneric
>   FiltersGeometry
>   FiltersHybrid
>   FiltersModeling
>   # FiltersParallelStatistics #  Optional
>   FiltersPoints
>   FiltersProgrammable
>   FiltersTexture
>   FiltersVerdict
>   GeovisCore
>   IOExodus
>   IOExport
>   # IOFFMPEG # Optional
>   IOImport
>   IOInfovis
>   # IOMySQL # Optional
>   IOPLY
>   IOParallel
>   IOParallelXML
>   ImagingColor
>   ImagingFourier
>   ImagingHybrid
>   ImagingMath
>   ImagingMorphological
>   ImagingSources
>   ImagingStatistics
>   ImagingStencil
>   # InfovisBoostGraphAlgorithms # Optional
>   InfovisLayout
>   InteractionImage
>   RenderingAnnotation
>   RenderingContextOpenGL2
>   RenderingImage
>   RenderingLOD
>   RenderingLabel
>   RenderingOpenGL2
>   RenderingVolumeOpenGL2
>   TestingGenericBridge
>   TestingRendering
>   ViewsContext2D
>   ViewsInfovis
> )
> endif ()
> add_executable(ReadOBJ MACOSX_BUNDLE ReadOBJ.cxx )
> target_link_libraries(ReadOBJ ${VTK_LIBRARIES})
>
> On Thu, Jan 10, 2019 at 4:06 PM Bill Lorensen <[hidden email]> wrote:
> >
> > I'm not specifying any components. If add the required components it works.
> > Before, I did not have to specify components... This is troublesome.
> >
> > Bill
> >
> > On Thu, Jan 10, 2019 at 3:27 PM Bill Lorensen <[hidden email]> wrote:
> > >
> > > VTK_LIBRARIES is empty.
> > >
> > >
> > >
> > > On Jan 10, 2019 3:07 PM, "Ben Boeckel" <[hidden email]> wrote:
> > >
> > > On Thu, Jan 10, 2019 at 14:08:28 -0800, Bill Lorensen wrote:
> > > > I have a simple program that fails to find the vtk include files:
> > > > Here is the CMakeLists.txt fiile:
> > > > cmake_minimum_required(VERSION 3.8)
> > > >
> > > > PROJECT(ReadOBJ)
> > > > Find_package(VTK)
> > > > if (VTK_VERSION VERSION_LESS "8.90")
> > > >   # old system
> > > >   include(${VTK_USE_FILE})
> > > >   # modules are linked via `vtkCommonCore`
> > > >   # VTK_DEFINITIONS has autoinit information
> > > > else ()
> > > >   # modules are linked via `VTK::CommonCore`
> > > >   # vtk_module_autoinit is needed
> > > > endif ()
> > > >
> > > > add_executable(ReadOBJ MACOSX_BUNDLE ReadOBJ.cxx )
> > > > target_link_libraries(ReadOBJ ${VTK_LIBRARIES})
> > >
> > > Hmm. What is `VTK_LIBRARIES` set to?
> > >
> > >
> > > --Ben
> > >
> > >
> >
> >
> > --
> > Unpaid intern in BillsParadise at noware dot com
>
>
>
> --
> Unpaid intern in BillsParadise at noware dot com



--
Unpaid intern in BillsParadise at noware dot com
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Missing Includes with new module system

VTK - Dev mailing list
On Thu, Jan 10, 2019 at 16:12:26 -0800, Bill Lorensen wrote:
> Is there a VTK cmake variable that lists all components in a particular build?

Not from `find_package(VTK)` directly. Currently testing if a component
is available is `if (TARGET VTK::${component})`.

> On Thu, Jan 10, 2019 at 4:10 PM Bill Lorensen <[hidden email]> wrote:
> >   # FiltersParallelStatistics #  Optional

You can use `OPTIONAL_COMPONENTS` for these.

> > > On Thu, Jan 10, 2019 at 3:27 PM Bill Lorensen <[hidden email]> wrote:
> > > > VTK_LIBRARIES is empty.

OK, that's a bug. Will make an MR today.

--Ben
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Missing Includes with new module system

VTK - Dev mailing list
On Fri, Jan 11, 2019 at 09:24:48 -0500, Ben Boeckel wrote:
> OK, that's a bug. Will make an MR today.

Note that using VTK_LIBRARIES when not specifying components leads to
linking *all* of VTK's modules. I wouldn't recommend this for
deployments using VTK since you might end up linking Java, Python, and
other third party libraries. Probably fine for example builds though.

--Ben
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Missing Includes with new module system

Bill Lorensen
Great. Looking forward to the MR.

On Fri, Jan 11, 2019, 6:35 AM Ben Boeckel <[hidden email] wrote:
On Fri, Jan 11, 2019 at 09:24:48 -0500, Ben Boeckel wrote:
> OK, that's a bug. Will make an MR today.

Note that using VTK_LIBRARIES when not specifying components leads to
linking *all* of VTK's modules. I wouldn't recommend this for
deployments using VTK since you might end up linking Java, Python, and
other third party libraries. Probably fine for example builds though.

--Ben

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers