From 0c1471f1da0ee8d76e9db0d95a0c434f0b38a7f5 Mon Sep 17 00:00:00 2001 From: VTK Developers <vtk-developers@vtk.org> Date: Mon, 9 Apr 2012 10:11:57 -0400 Subject: [PATCH] Add modular VTK build system Add module.cmake, CMakeLists.txt, and other build system files. The modular VTK build system is not yet mature. The monolithic build files had a lot of infrastructure. The modular build files reproduce much of the functionality but some features will need to be restored later. Document status and tasks in "TODO-Modularization.txt". Co-Author: Marcus D. Hanwell <marcus.hanwell@kitware.com> Co-Author: Chris Harris <chris.harris@kitware.com> Co-Author: Brad King <brad.king@kitware.com> Co-Author: Nikhil Shetty <nikhil.shetty@kitware.com> --- .gitattributes | 2 +- AMR/Core/CMakeLists.txt | 32 + AMR/Core/Testing/Cxx/CMakeLists.txt | 22 +- AMR/Core/module.cmake | 12 + AMR/Core/vtkAMREnzoParticlesReader.cxx | 2 +- AMR/Core/vtkAMREnzoReader.cxx | 2 +- AMR/Core/vtkAMREnzoReaderInternal.cxx | 2 +- AMR/Core/vtkAMRFlashParticlesReader.cxx | 2 +- AMR/Core/vtkAMRFlashReader.cxx | 2 +- AMR/Core/vtkAMRFlashReaderInternal.h | 2 +- CMake/FindMPI.cmake | 631 +++++++ CMake/FindODBC.cmake | 2 +- CMake/FindPackageHandleStandardArgs.cmake | 296 ++++ CMake/FindPostgreSQL.cmake | 179 ++ CMake/GenerateExportHeader.cmake | 383 ++++ CMake/TopologicalSort.cmake | 140 ++ CMake/UseVTK.cmake | 29 + CMake/VTKConfig.cmake.in | 84 + CMake/exportheader.cmake.in | 37 + CMake/vtkBuildPath.cmake | 36 + CMake/vtkCompilerExtras.cmake | 22 +- CMake/vtkGroups.cmake | 38 + CMake/vtkJavaWrapping.cmake | 68 + CMake/vtkModuleAPI.cmake | 90 + CMake/vtkModuleInfo.cmake.in | 6 + CMake/vtkModuleMacros.cmake | 398 +++++ CMake/vtkModuleTop.cmake | 275 +++ CMake/vtkObjectFactory.cxx.in | 70 + CMake/vtkObjectFactory.h.in | 42 + CMake/vtkPythonWrapping.cmake | 53 + CMake/vtkTclWrapping.cmake | 66 + CMake/vtkThirdParty.cmake | 64 - CMake/vtkWrapHierarchy.cmake | 230 ++- CMake/vtkWrapJava.cmake | 21 +- CMake/vtkWrapPython.cmake | 291 ++- CMake/vtkWrapping.cmake | 61 + CMakeLists.txt | 1574 +++-------------- CTestConfig.cmake | 13 +- Charts/Core/CMakeLists.txt | 44 + Charts/Core/Testing/Cxx/CMakeLists.txt | 95 +- Charts/Core/Testing/Python/CMakeLists.txt | 33 + Charts/Core/module.cmake | 12 + Chemistry/Core/CMakeLists.txt | 61 +- Chemistry/Core/Testing/Cxx/CMakeLists.txt | 52 + Chemistry/Core/module.cmake | 13 + Chemistry/Core/vtkChemistryConfigure.h.in | 5 +- Common/ComputationalGeometry/CMakeLists.txt | 27 + .../Testing/Tcl/CMakeLists.txt | 34 + Common/ComputationalGeometry/module.cmake | 6 + Common/Core/CMakeLists.txt | 940 ++++------ Common/Core/Testing/Cxx/CMakeLists.txt | 145 +- Common/Core/Testing/Python/CMakeLists.txt | 22 + Common/Core/Testing/Tcl/CMakeLists.txt | 26 + Common/Core/Testing/Tcl/TestString.tcl | 4 +- Common/Core/module.cmake | 8 + Common/Core/vtkAutoInit.h | 36 + Common/Core/vtkConfigure.h.in | 4 - Common/Core/vtkInformationDataObjectKey.cxx | 10 +- Common/Core/vtkOStreamWrapper.h | 4 +- Common/Core/vtkToolkits.h.in | 60 - Common/DataModel/CMakeLists.txt | 256 +++ Common/DataModel/Testing/Cxx/CMakeLists.txt | 47 + .../DataModel/Testing/Python/CMakeLists.txt | 9 + Common/DataModel/Testing/Tcl/CMakeLists.txt | 35 + Common/DataModel/module.cmake | 12 + Common/DataModel/vtkDataObjectTypes.cxx | 11 - Common/DataModel/vtkImageIterator.cxx | 30 +- Common/ExecutionModel/CMakeLists.txt | 80 + .../ExecutionModel/Testing/Cxx/CMakeLists.txt | 30 + Common/ExecutionModel/module.cmake | 11 + .../vtkImageProgressIterator.cxx | 30 +- Common/Math/CMakeLists.txt | 26 + Common/Math/Testing/Cxx/CMakeLists.txt | 18 + Common/Math/Testing/Tcl/CMakeLists.txt | 10 + Common/Math/module.cmake | 8 + Common/Misc/CMakeLists.txt | 13 + Common/Misc/module.cmake | 6 + Common/Misc/vtkHeap.cxx | 3 +- Common/System/CMakeLists.txt | 26 + Common/System/Testing/Cxx/CMakeLists.txt | 16 + Common/System/module.cmake | 9 + Common/Transforms/CMakeLists.txt | 28 + Common/Transforms/module.cmake | 4 + Examples/Statistics/CMakeLists.txt | 19 + .../ExampleDescriptiveStatistics.cxx | 791 +++++++++ .../Statistics/ExampleKMeansStatistics.cxx | 254 +++ Filters/Core/CMakeLists.txt | 86 + Filters/Core/Testing/Cxx/CMakeLists.txt | 34 + Filters/Core/module.cmake | 16 + Filters/Extraction/CMakeLists.txt | 38 + Filters/Extraction/Testing/Cxx/CMakeLists.txt | 26 + Filters/Extraction/module.cmake | 11 + Filters/General/CMakeLists.txt | 136 ++ Filters/General/Testing/Cxx/CMakeLists.txt | 48 + Filters/General/module.cmake | 11 + Filters/Generic/CMakeLists.txt | 13 + Filters/Generic/module.cmake | 7 + Filters/Geometry/CMakeLists.txt | 34 + Filters/Geometry/Testing/Cxx/CMakeLists.txt | 32 + Filters/Geometry/module.cmake | 10 + Filters/Hybrid/CMakeLists.txt | 55 + Filters/Hybrid/Testing/Cxx/CMakeLists.txt | 18 + Filters/Hybrid/module.cmake | 13 + Filters/HyperOctree/CMakeLists.txt | 14 + .../HyperOctree/Testing/Cxx/CMakeLists.txt | 30 + Filters/HyperOctree/module.cmake | 9 + Filters/Imaging/CMakeLists.txt | 7 + Filters/Imaging/module.cmake | 9 + Filters/Modeling/CMakeLists.txt | 33 + Filters/Modeling/Testing/Cxx/CMakeLists.txt | 29 + Filters/Modeling/module.cmake | 10 + Filters/Parallel/CMakeLists.txt | 55 + Filters/Parallel/module.cmake | 12 + Filters/Parallel/vtkBlockDistribution.h | 2 +- Filters/ParallelGeometry/CMakeLists.txt | 13 + Filters/ParallelGeometry/module.cmake | 7 + Filters/ParallelImaging/CMakeLists.txt | 7 + Filters/ParallelImaging/module.cmake | 9 + Filters/ParallelStatistics/CMakeLists.txt | 12 + Filters/ParallelStatistics/module.cmake | 11 + Filters/Programmable/CMakeLists.txt | 7 + Filters/Programmable/module.cmake | 6 + Filters/ReebGraph/CMakeLists.txt | 12 + Filters/ReebGraph/module.cmake | 4 + Filters/Sources/CMakeLists.txt | 41 + Filters/Sources/Testing/Cxx/CMakeLists.txt | 26 + Filters/Sources/Testing/Tcl/CMakeLists.txt | 32 + Filters/Sources/module.cmake | 14 + Filters/Statistics/CMakeLists.txt | 22 + Filters/Statistics/Testing/Cxx/CMakeLists.txt | 26 + Filters/Statistics/module.cmake | 12 + .../Statistics/vtkContingencyStatistics.cxx | 111 +- Filters/Statistics/vtkContingencyStatistics.h | 7 + .../Statistics/vtkCorrelativeStatistics.cxx | 75 +- Filters/Statistics/vtkCorrelativeStatistics.h | 8 +- .../Statistics/vtkDescriptiveStatistics.cxx | 77 +- Filters/Statistics/vtkDescriptiveStatistics.h | 8 +- Filters/Statistics/vtkPCAStatistics.cxx | 85 +- Filters/Statistics/vtkPCAStatistics.h | 6 + Filters/StatisticsGnuR/CMakeLists.txt | 62 + Filters/StatisticsGnuR/module.cmake | 8 + .../vtkContingencyStatisticsGnuR.cxx | 110 ++ .../vtkContingencyStatisticsGnuR.h | 67 + .../vtkCorrelativeStatisticsGnuR.cxx | 74 + .../vtkCorrelativeStatisticsGnuR.h | 66 + .../vtkDescriptiveStatisticsGnuR.cxx | 74 + .../vtkDescriptiveStatisticsGnuR.h | 64 + .../vtkFiltersStatisticsGnuRConfigure.h.in | 23 + .../StatisticsGnuR/vtkPCAStatisticsGnuR.cxx | 77 + Filters/StatisticsGnuR/vtkPCAStatisticsGnuR.h | 69 + Filters/Texture/CMakeLists.txt | 11 + Filters/Texture/module.cmake | 6 + Filters/Verdict/CMakeLists.txt | 7 + Filters/Verdict/Testing/Cxx/CMakeLists.txt | 23 + Filters/Verdict/module.cmake | 10 + GUISupport/MFC/CMakeLists.txt | 49 +- GUISupport/MFC/module.cmake | 10 + GUISupport/MFC/vtkMFCWindow.h | 10 - GUISupport/Qt/CMakeLists.txt | 463 +---- GUISupport/Qt/QVTKWidget.cxx | 1 + GUISupport/Qt/Testing/Cxx/CMakeLists.txt | 55 +- GUISupport/Qt/module.cmake | 12 + GUISupport/QtOpenGL/CMakeLists.txt | 18 + GUISupport/QtOpenGL/module.cmake | 10 + GUISupport/QtSQL/CMakeLists.txt | 22 + GUISupport/QtSQL/module.cmake | 9 + GUISupport/QtSQL/vtkQtSQLDatabase.h | 4 +- GUISupport/QtSQL/vtkQtSQLQuery.h | 4 +- GUISupport/QtSQL/vtkQtTimePointUtility.h | 4 +- GUISupport/QtWebkit/CMakeLists.txt | 21 + GUISupport/QtWebkit/module.cmake | 9 + Geovis/Core/CMakeLists.txt | 46 +- Geovis/Core/module.cmake | 10 + IO/Core/CMakeLists.txt | 44 + IO/Core/Testing/Cxx/CMakeLists.txt | 27 + IO/Core/module.cmake | 12 + IO/Core/vtkASCIITextCodec.cxx | 6 +- IO/Core/vtkArrayWriter.cxx | 2 +- IO/Core/vtkArrayWriter.h | 4 +- IO/Core/vtkTextCodec.cxx | 3 +- IO/Core/vtkUTF16TextCodec.cxx | 6 +- IO/Core/vtkUTF8TextCodec.cxx | 6 +- IO/EnSight/CMakeLists.txt | 16 + IO/EnSight/module.cmake | 6 + IO/Exodus/CMakeLists.txt | 15 + IO/Exodus/module.cmake | 8 + IO/Exodus/vtkExodusIIReaderPrivate.h | 4 +- IO/Export/CMakeLists.txt | 44 + IO/Export/Testing/Cxx/CMakeLists.txt | 24 + IO/Export/module.cmake | 14 + IO/Geometry/CMakeLists.txt | 61 + IO/Geometry/Testing/Cxx/CMakeLists.txt | 27 + IO/Geometry/module.cmake | 16 + IO/Image/CMakeLists.txt | 51 + IO/Image/Testing/Cxx/CMakeLists.txt | 41 + IO/Image/module.cmake | 20 + IO/Import/CMakeLists.txt | 12 + IO/Import/Testing/Cxx/CMakeLists.txt | 24 + IO/Import/module.cmake | 10 + IO/Infovis/CMakeLists.txt | 24 + IO/Infovis/Testing/Cxx/CMakeLists.txt | 26 + IO/Infovis/module.cmake | 15 + IO/LSDyna/CMakeLists.txt | 28 + IO/LSDyna/Testing/Cxx/CMakeLists.txt | 26 + IO/LSDyna/module.cmake | 10 + IO/LSDyna/private/LSDynaFamily.h | 2 +- IO/LSDyna/private/LSDynaMetaData.h | 2 +- IO/MINC/CMakeLists.txt | 13 + IO/MINC/module.cmake | 10 + IO/MySQL/CMakeLists.txt | 17 + IO/MySQL/Testing/Cxx/CMakeLists.txt | 28 + IO/MySQL/Testing/Cxx/TestMySQLDatabase.cxx | 22 +- IO/MySQL/module.cmake | 9 + IO/MySQL/vtkIOMySQL_AutoInit.cxx | 61 + IO/MySQL/vtkMySQLDatabase.cxx | 35 - IO/NetCDF/CMakeLists.txt | 14 + IO/NetCDF/Testing/Cxx/CMakeLists.txt | 30 + IO/NetCDF/module.cmake | 14 + IO/NetCDF/vtkMPASReader.cxx | 1 - IO/ODBC/CMakeLists.txt | 12 + IO/ODBC/Testing/Cxx/CMakeLists.txt | 25 + IO/ODBC/module.cmake | 5 + IO/PLY/CMakeLists.txt | 12 + IO/PLY/Testing/Cxx/CMakeLists.txt | 24 + IO/PLY/module.cmake | 12 + IO/Parallel/CMakeLists.txt | 21 + IO/Parallel/module.cmake | 13 + IO/ParallelExodus/CMakeLists.txt | 8 + IO/ParallelExodus/module.cmake | 6 + IO/ParallelLSDyna/CMakeLists.txt | 10 + IO/ParallelLSDyna/module.cmake | 6 + IO/ParallelMPI/CMakeLists.txt | 8 + IO/ParallelMPI/module.cmake | 7 + IO/ParallelNetCDF/CMakeLists.txt | 10 + IO/ParallelNetCDF/module.cmake | 9 + IO/PostgreSQL/CMakeLists.txt | 17 + IO/PostgreSQL/Testing/Cxx/CMakeLists.txt | 28 + .../Testing/Cxx/TestPostgreSQLDatabase.cxx | 27 +- IO/PostgreSQL/module.cmake | 8 + IO/PostgreSQL/vtkIOPostgreSQL_AutoInit.cxx | 61 + IO/PostgreSQL/vtkPostgreSQLDatabase.cxx | 37 +- IO/SQL/CMakeLists.txt | 30 + IO/SQL/Testing/Cxx/CMakeLists.txt | 34 + IO/SQL/Testing/Cxx/TestSQLDatabaseSchema.cxx | 8 +- IO/SQL/Testing/Cxx/TestSQLiteDatabase.cxx | 12 +- IO/SQL/module.cmake | 10 + IO/Video/CMakeLists.txt | 16 + IO/Video/module.cmake | 4 + IO/XML/CMakeLists.txt | 84 + IO/XML/Testing/Cxx/CMakeLists.txt | 31 + IO/XML/module.cmake | 17 + IO/XML/vtkXMLWriterC.h | 14 - Imaging/Color/CMakeLists.txt | 12 + Imaging/Color/module.cmake | 7 + Imaging/Core/CMakeLists.txt | 64 + Imaging/Core/Testing/Cxx/CMakeLists.txt | 57 + Imaging/Core/module.cmake | 22 + Imaging/Core/vtkImageStencilIterator.cxx | 30 +- Imaging/Fourier/CMakeLists.txt | 14 + Imaging/Fourier/module.cmake | 7 + Imaging/General/CMakeLists.txt | 32 + Imaging/General/module.cmake | 7 + Imaging/Hybrid/CMakeLists.txt | 15 + Imaging/Hybrid/module.cmake | 7 + Imaging/Math/CMakeLists.txt | 11 + Imaging/Math/module.cmake | 8 + Imaging/Morphological/CMakeLists.txt | 14 + Imaging/Morphological/module.cmake | 8 + Imaging/Sources/CMakeLists.txt | 11 + Imaging/Sources/module.cmake | 7 + Imaging/Statistics/CMakeLists.txt | 7 + Imaging/Statistics/module.cmake | 7 + Imaging/Stencil/CMakeLists.txt | 11 + Imaging/Stencil/module.cmake | 7 + Infovis/Boost/CMakeLists.txt | 1 + Infovis/Boost/Testing/Cxx/CMakeLists.txt | 11 + Infovis/Boost/module.cmake | 6 + Infovis/BoostGraphAlgorithms/CMakeLists.txt | 19 + .../Testing/Cxx/CMakeLists.txt | 32 + Infovis/BoostGraphAlgorithms/module.cmake | 9 + Infovis/Core/CMakeLists.txt | 41 + Infovis/Core/Testing/Cxx/CMakeLists.txt | 43 + Infovis/Core/module.cmake | 13 + Infovis/Layout/CMakeLists.txt | 56 + Infovis/Layout/Testing/Cxx/CMakeLists.txt | 30 + Infovis/Layout/module.cmake | 14 + Infovis/Parallel/CMakeLists.txt | 21 + Infovis/Parallel/module.cmake | 10 + Interaction/Style/CMakeLists.txt | 53 + Interaction/Style/module.cmake | 7 + Interaction/Widgets/CMakeLists.txt | 157 ++ .../Widgets/Testing/Cxx/CMakeLists.txt | 292 +-- Interaction/Widgets/module.cmake | 19 + Parallel/Core/CMakeLists.txt | 44 + Parallel/Core/module.cmake | 8 + Parallel/Core/vtkCommunicator.cxx | 3 - Parallel/Core/vtkSocketCommunicator.cxx | 2 +- Parallel/MPI/CMakeLists.txt | 29 + Parallel/MPI/module.cmake | 6 + Rendering/Annotation/CMakeLists.txt | 23 + .../Annotation/Testing/Cxx/CMakeLists.txt | 43 + Rendering/Annotation/module.cmake | 13 + Rendering/Context2D/CMakeLists.txt | 50 + Rendering/Context2D/module.cmake | 12 + Rendering/Context2D/vtkContextActor.h | 2 +- Rendering/Core/CMakeLists.txt | 169 ++ Rendering/Core/Testing/Cxx/CMakeLists.txt | 26 + Rendering/Core/module.cmake | 15 + Rendering/Core/vtkGraphicsFactory.cxx | 235 --- Rendering/Core/vtkImagingFactory.cxx | 119 -- Rendering/FreeType/CMakeLists.txt | 44 + Rendering/FreeType/module.cmake | 9 + Rendering/Image/CMakeLists.txt | 11 + Rendering/Image/module.cmake | 10 + Rendering/LOD/CMakeLists.txt | 5 + Rendering/LOD/module.cmake | 7 + Rendering/Label/CMakeLists.txt | 24 + Rendering/Label/module.cmake | 7 + Rendering/OpenGL/CMakeLists.txt | 392 ++++ Rendering/OpenGL/Testing/Cxx/CMakeLists.txt | 341 ++-- Rendering/OpenGL/module.cmake | 22 + Rendering/OpenGL/vtkOpenGL.h | 1 + .../OpenGL/vtkRenderingOpenGLConfigure.h.in | 66 + Rendering/Parallel/CMakeLists.txt | 26 + Rendering/Parallel/module.cmake | 8 + Rendering/Qt/CMakeLists.txt | 14 + Rendering/Qt/module.cmake | 10 + Rendering/Volume/CMakeLists.txt | 213 +-- Rendering/Volume/Testing/Cxx/CMakeLists.txt | 61 + Rendering/Volume/module.cmake | 15 + .../Volume/vtkVolumeRenderingFactory.cxx | 7 +- TODO-Modularization.txt | 14 + Testing/Core/CMakeLists.txt | 1 + Testing/Core/module.cmake | 2 + Testing/IOSQL/CMakeLists.txt | 5 + Testing/IOSQL/DatabaseSchemaWith2Tables.cxx | 49 +- Testing/IOSQL/DatabaseSchemaWith2Tables.h | 35 + Testing/IOSQL/module.cmake | 5 + Testing/Rendering/CMakeLists.txt | 7 + Testing/Rendering/module.cmake | 6 + Testing/Rendering/vtkTestingInteractor.h | 4 +- .../Rendering/vtkTestingObjectFactory.cmake | 11 +- ThirdParty/Cosmo/CMakeLists.txt | 19 +- ThirdParty/Cosmo/module.cmake | 6 + ThirdParty/VPIC/CMakeLists.txt | 17 +- ThirdParty/VPIC/module.cmake | 7 + ThirdParty/alglib/CMakeLists.txt | 31 +- ThirdParty/alglib/module.cmake | 1 + ThirdParty/exodusII/CMakeLists.txt | 4 + ThirdParty/exodusII/module.cmake | 5 + ThirdParty/exodusII/vtk_exodusII.h | 2 +- .../exodusII/vtkexodusII/CMakeLists.txt | 12 - .../exodusII/vtkexodusII/include/exodusII.h | 2 +- ThirdParty/expat/CMakeLists.txt | 1 + ThirdParty/expat/module.cmake | 1 + ThirdParty/expat/vtkexpat/CMakeLists.txt | 12 - ThirdParty/freetype/CMakeLists.txt | 3 + ThirdParty/freetype/module.cmake | 1 + .../freetype/vtkfreetype/CMakeLists.txt | 13 - ThirdParty/ftgl/CMakeLists.txt | 27 +- ThirdParty/ftgl/module.cmake | 5 + ThirdParty/gl2ps/CMakeLists.txt | 1 + ThirdParty/gl2ps/module.cmake | 1 + ThirdParty/hdf5/CMakeLists.txt | 71 + ThirdParty/hdf5/module.cmake | 5 + ThirdParty/jpeg/CMakeLists.txt | 1 + ThirdParty/jpeg/module.cmake | 1 + ThirdParty/jpeg/vtkjpeg/CMakeLists.txt | 12 - ThirdParty/libproj4/CMakeLists.txt | 4 + ThirdParty/libproj4/module.cmake | 1 + .../libproj4/vtklibproj4/CMakeLists.txt | 16 +- ThirdParty/libxml2/CMakeLists.txt | 1 + ThirdParty/libxml2/module.cmake | 1 + ThirdParty/libxml2/vtklibxml2/CMakeLists.txt | 12 - ThirdParty/mrmpi/module.cmake | 6 + ThirdParty/mrmpi/mpistubs/CMakeLists.txt | 11 - ThirdParty/mrmpi/src/CMakeLists.txt | 11 - ThirdParty/netcdf/CMakeLists.txt | 4 + ThirdParty/netcdf/module.cmake | 4 + ThirdParty/netcdf/vtknetcdf/CMakeLists.txt | 21 +- ThirdParty/netcdf/vtknetcdf/libsrc4/error4.c | 2 +- .../netcdf/vtknetcdf/libsrc4/nc4internal.h | 2 +- ThirdParty/oggtheora/CMakeLists.txt | 1 + ThirdParty/oggtheora/module.cmake | 1 + .../oggtheora/vtkoggtheora/CMakeLists.txt | 14 - ThirdParty/png/CMakeLists.txt | 1 + ThirdParty/png/module.cmake | 5 + ThirdParty/png/vtkpng/CMakeLists.txt | 14 +- ThirdParty/sqlite/CMakeLists.txt | 4 + ThirdParty/sqlite/module.cmake | 1 + ThirdParty/sqlite/vtksqlite/CMakeLists.txt | 14 +- ThirdParty/tiff/CMakeLists.txt | 1 + ThirdParty/tiff/module.cmake | 6 + ThirdParty/tiff/vtktiff/CMakeLists.txt | 14 +- ThirdParty/verdict/CMakeLists.txt | 11 +- ThirdParty/verdict/module.cmake | 1 + ThirdParty/zlib/CMakeLists.txt | 1 + ThirdParty/zlib/module.cmake | 1 + ThirdParty/zlib/vtkzlib/CMakeLists.txt | 13 - Utilities/DICOMParser/CMakeLists.txt | 17 +- Utilities/DICOMParser/module.cmake | 5 + Utilities/EncodeString/CMakeLists.txt | 5 +- Utilities/EncodeString/module.cmake | 4 + Utilities/HashSource/CMakeLists.txt | 2 + Utilities/HashSource/module.cmake | 5 + Utilities/KWSys/CMakeLists.txt | 37 + Utilities/KWSys/module.cmake | 2 + Utilities/LastConfigureStep/CMakeLists.txt | 17 +- Utilities/MaterialLibrary/CMakeLists.txt | 15 + Utilities/MaterialLibrary/module.cmake | 5 + Utilities/MetaIO/CMakeLists.txt | 9 + Utilities/MetaIO/module.cmake | 5 + Utilities/ParseOGLExt/CMakeLists.txt | 5 + Utilities/ParseOGLExt/ParseOGLExt.cxx | 15 +- Utilities/ParseOGLExt/module.cmake | 2 + Views/Context2D/CMakeLists.txt | 6 + Views/Context2D/module.cmake | 8 + Views/Core/CMakeLists.txt | 10 + Views/Core/module.cmake | 7 + Views/Geovis/CMakeLists.txt | 6 + Views/Geovis/module.cmake | 5 + Views/Infovis/CMakeLists.txt | 29 + Views/Infovis/module.cmake | 9 + Views/Qt/CMakeLists.txt | 29 + Views/Qt/module.cmake | 10 + Wrapping/CMakeLists.txt | 143 +- Wrapping/Java/CMakeLists.txt | 704 +++----- Wrapping/JavaCore/CMakeLists.txt | 11 + Wrapping/JavaCore/module.cmake | 6 + Wrapping/JavaCore/vtkJavaUtil.h | 4 +- Wrapping/Python/CMakeLists.txt | 412 +---- Wrapping/Python/setup.py.in | 54 +- Wrapping/Python/vtk/__init__.py.in | 91 +- Wrapping/Python/vtk/module.py.in | 1 + Wrapping/Python/vtkPythonAppInit.cxx | 49 - .../Python/vtkPythonAppInitConfigure.h.in | 2 +- Wrapping/PythonCore/CMakeLists.txt | 40 + Wrapping/PythonCore/module.cmake | 7 + Wrapping/PythonCore/vtkPython.h | 18 +- Wrapping/Tcl/CMakeLists.txt | 280 ++- Wrapping/Tcl/pkgIndex.tcl.in | 14 +- Wrapping/Tcl/vtkTkAppInit.cxx | 117 +- Wrapping/Tcl/vtkbase/vtkbase.tcl.in | 2 +- Wrapping/Tcl/vtkmodule.tcl.in | 8 +- Wrapping/vtkWrapPythonInit.c | 2 +- Wrapping/vtkWrapTclInit.c | 6 +- 446 files changed, 13209 insertions(+), 6083 deletions(-) create mode 100644 AMR/Core/CMakeLists.txt create mode 100644 AMR/Core/module.cmake create mode 100644 CMake/FindMPI.cmake create mode 100644 CMake/FindPackageHandleStandardArgs.cmake create mode 100644 CMake/FindPostgreSQL.cmake create mode 100644 CMake/GenerateExportHeader.cmake create mode 100644 CMake/TopologicalSort.cmake create mode 100644 CMake/UseVTK.cmake create mode 100644 CMake/VTKConfig.cmake.in create mode 100644 CMake/exportheader.cmake.in create mode 100644 CMake/vtkBuildPath.cmake create mode 100644 CMake/vtkGroups.cmake create mode 100644 CMake/vtkJavaWrapping.cmake create mode 100644 CMake/vtkModuleAPI.cmake create mode 100644 CMake/vtkModuleInfo.cmake.in create mode 100644 CMake/vtkModuleMacros.cmake create mode 100644 CMake/vtkModuleTop.cmake create mode 100644 CMake/vtkObjectFactory.cxx.in create mode 100644 CMake/vtkObjectFactory.h.in create mode 100644 CMake/vtkPythonWrapping.cmake create mode 100644 CMake/vtkTclWrapping.cmake create mode 100644 CMake/vtkWrapping.cmake create mode 100644 Charts/Core/CMakeLists.txt create mode 100644 Charts/Core/Testing/Python/CMakeLists.txt create mode 100644 Charts/Core/module.cmake create mode 100644 Chemistry/Core/Testing/Cxx/CMakeLists.txt create mode 100644 Chemistry/Core/module.cmake create mode 100644 Common/ComputationalGeometry/CMakeLists.txt create mode 100644 Common/ComputationalGeometry/Testing/Tcl/CMakeLists.txt create mode 100644 Common/ComputationalGeometry/module.cmake create mode 100644 Common/Core/Testing/Python/CMakeLists.txt create mode 100644 Common/Core/Testing/Tcl/CMakeLists.txt create mode 100644 Common/Core/module.cmake create mode 100644 Common/Core/vtkAutoInit.h create mode 100644 Common/DataModel/CMakeLists.txt create mode 100644 Common/DataModel/Testing/Cxx/CMakeLists.txt create mode 100644 Common/DataModel/Testing/Python/CMakeLists.txt create mode 100644 Common/DataModel/Testing/Tcl/CMakeLists.txt create mode 100644 Common/DataModel/module.cmake create mode 100644 Common/ExecutionModel/CMakeLists.txt create mode 100644 Common/ExecutionModel/Testing/Cxx/CMakeLists.txt create mode 100644 Common/ExecutionModel/module.cmake create mode 100644 Common/Math/CMakeLists.txt create mode 100644 Common/Math/Testing/Cxx/CMakeLists.txt create mode 100644 Common/Math/Testing/Tcl/CMakeLists.txt create mode 100644 Common/Math/module.cmake create mode 100644 Common/Misc/CMakeLists.txt create mode 100644 Common/Misc/module.cmake create mode 100644 Common/System/CMakeLists.txt create mode 100644 Common/System/Testing/Cxx/CMakeLists.txt create mode 100644 Common/System/module.cmake create mode 100644 Common/Transforms/CMakeLists.txt create mode 100644 Common/Transforms/module.cmake create mode 100644 Examples/Statistics/CMakeLists.txt create mode 100644 Examples/Statistics/ExampleDescriptiveStatistics.cxx create mode 100644 Examples/Statistics/ExampleKMeansStatistics.cxx create mode 100644 Filters/Core/CMakeLists.txt create mode 100644 Filters/Core/Testing/Cxx/CMakeLists.txt create mode 100644 Filters/Core/module.cmake create mode 100644 Filters/Extraction/CMakeLists.txt create mode 100644 Filters/Extraction/Testing/Cxx/CMakeLists.txt create mode 100644 Filters/Extraction/module.cmake create mode 100644 Filters/General/CMakeLists.txt create mode 100644 Filters/General/Testing/Cxx/CMakeLists.txt create mode 100644 Filters/General/module.cmake create mode 100644 Filters/Generic/CMakeLists.txt create mode 100644 Filters/Generic/module.cmake create mode 100644 Filters/Geometry/CMakeLists.txt create mode 100644 Filters/Geometry/Testing/Cxx/CMakeLists.txt create mode 100644 Filters/Geometry/module.cmake create mode 100644 Filters/Hybrid/CMakeLists.txt create mode 100644 Filters/Hybrid/Testing/Cxx/CMakeLists.txt create mode 100644 Filters/Hybrid/module.cmake create mode 100644 Filters/HyperOctree/CMakeLists.txt create mode 100644 Filters/HyperOctree/Testing/Cxx/CMakeLists.txt create mode 100644 Filters/HyperOctree/module.cmake create mode 100644 Filters/Imaging/CMakeLists.txt create mode 100644 Filters/Imaging/module.cmake create mode 100644 Filters/Modeling/CMakeLists.txt create mode 100644 Filters/Modeling/Testing/Cxx/CMakeLists.txt create mode 100644 Filters/Modeling/module.cmake create mode 100644 Filters/Parallel/CMakeLists.txt create mode 100644 Filters/Parallel/module.cmake create mode 100644 Filters/ParallelGeometry/CMakeLists.txt create mode 100644 Filters/ParallelGeometry/module.cmake create mode 100644 Filters/ParallelImaging/CMakeLists.txt create mode 100644 Filters/ParallelImaging/module.cmake create mode 100644 Filters/ParallelStatistics/CMakeLists.txt create mode 100644 Filters/ParallelStatistics/module.cmake create mode 100644 Filters/Programmable/CMakeLists.txt create mode 100644 Filters/Programmable/module.cmake create mode 100644 Filters/ReebGraph/CMakeLists.txt create mode 100644 Filters/ReebGraph/module.cmake create mode 100644 Filters/Sources/CMakeLists.txt create mode 100644 Filters/Sources/Testing/Cxx/CMakeLists.txt create mode 100644 Filters/Sources/Testing/Tcl/CMakeLists.txt create mode 100644 Filters/Sources/module.cmake create mode 100644 Filters/Statistics/CMakeLists.txt create mode 100644 Filters/Statistics/Testing/Cxx/CMakeLists.txt create mode 100644 Filters/Statistics/module.cmake create mode 100644 Filters/StatisticsGnuR/CMakeLists.txt create mode 100644 Filters/StatisticsGnuR/module.cmake create mode 100644 Filters/StatisticsGnuR/vtkContingencyStatisticsGnuR.cxx create mode 100644 Filters/StatisticsGnuR/vtkContingencyStatisticsGnuR.h create mode 100644 Filters/StatisticsGnuR/vtkCorrelativeStatisticsGnuR.cxx create mode 100644 Filters/StatisticsGnuR/vtkCorrelativeStatisticsGnuR.h create mode 100644 Filters/StatisticsGnuR/vtkDescriptiveStatisticsGnuR.cxx create mode 100644 Filters/StatisticsGnuR/vtkDescriptiveStatisticsGnuR.h create mode 100644 Filters/StatisticsGnuR/vtkFiltersStatisticsGnuRConfigure.h.in create mode 100644 Filters/StatisticsGnuR/vtkPCAStatisticsGnuR.cxx create mode 100644 Filters/StatisticsGnuR/vtkPCAStatisticsGnuR.h create mode 100644 Filters/Texture/CMakeLists.txt create mode 100644 Filters/Texture/module.cmake create mode 100644 Filters/Verdict/CMakeLists.txt create mode 100644 Filters/Verdict/Testing/Cxx/CMakeLists.txt create mode 100644 Filters/Verdict/module.cmake create mode 100755 GUISupport/MFC/module.cmake create mode 100644 GUISupport/Qt/module.cmake create mode 100644 GUISupport/QtOpenGL/CMakeLists.txt create mode 100644 GUISupport/QtOpenGL/module.cmake create mode 100644 GUISupport/QtSQL/CMakeLists.txt create mode 100644 GUISupport/QtSQL/module.cmake create mode 100644 GUISupport/QtWebkit/CMakeLists.txt create mode 100644 GUISupport/QtWebkit/module.cmake create mode 100644 Geovis/Core/module.cmake create mode 100644 IO/Core/CMakeLists.txt create mode 100644 IO/Core/Testing/Cxx/CMakeLists.txt create mode 100644 IO/Core/module.cmake create mode 100644 IO/EnSight/CMakeLists.txt create mode 100644 IO/EnSight/module.cmake create mode 100644 IO/Exodus/CMakeLists.txt create mode 100644 IO/Exodus/module.cmake create mode 100644 IO/Export/CMakeLists.txt create mode 100644 IO/Export/Testing/Cxx/CMakeLists.txt create mode 100644 IO/Export/module.cmake create mode 100644 IO/Geometry/CMakeLists.txt create mode 100644 IO/Geometry/Testing/Cxx/CMakeLists.txt create mode 100644 IO/Geometry/module.cmake create mode 100644 IO/Image/CMakeLists.txt create mode 100644 IO/Image/Testing/Cxx/CMakeLists.txt create mode 100644 IO/Image/module.cmake create mode 100644 IO/Import/CMakeLists.txt create mode 100644 IO/Import/Testing/Cxx/CMakeLists.txt create mode 100644 IO/Import/module.cmake create mode 100644 IO/Infovis/CMakeLists.txt create mode 100644 IO/Infovis/Testing/Cxx/CMakeLists.txt create mode 100644 IO/Infovis/module.cmake create mode 100644 IO/LSDyna/CMakeLists.txt create mode 100644 IO/LSDyna/Testing/Cxx/CMakeLists.txt create mode 100644 IO/LSDyna/module.cmake create mode 100644 IO/MINC/CMakeLists.txt create mode 100644 IO/MINC/module.cmake create mode 100644 IO/MySQL/CMakeLists.txt create mode 100644 IO/MySQL/Testing/Cxx/CMakeLists.txt create mode 100644 IO/MySQL/module.cmake create mode 100644 IO/MySQL/vtkIOMySQL_AutoInit.cxx create mode 100644 IO/NetCDF/CMakeLists.txt create mode 100644 IO/NetCDF/Testing/Cxx/CMakeLists.txt create mode 100644 IO/NetCDF/module.cmake create mode 100644 IO/ODBC/CMakeLists.txt create mode 100644 IO/ODBC/Testing/Cxx/CMakeLists.txt create mode 100644 IO/ODBC/module.cmake create mode 100644 IO/PLY/CMakeLists.txt create mode 100644 IO/PLY/Testing/Cxx/CMakeLists.txt create mode 100644 IO/PLY/module.cmake create mode 100644 IO/Parallel/CMakeLists.txt create mode 100644 IO/Parallel/module.cmake create mode 100644 IO/ParallelExodus/CMakeLists.txt create mode 100644 IO/ParallelExodus/module.cmake create mode 100644 IO/ParallelLSDyna/CMakeLists.txt create mode 100644 IO/ParallelLSDyna/module.cmake create mode 100644 IO/ParallelMPI/CMakeLists.txt create mode 100644 IO/ParallelMPI/module.cmake create mode 100644 IO/ParallelNetCDF/CMakeLists.txt create mode 100644 IO/ParallelNetCDF/module.cmake create mode 100644 IO/PostgreSQL/CMakeLists.txt create mode 100644 IO/PostgreSQL/Testing/Cxx/CMakeLists.txt create mode 100644 IO/PostgreSQL/module.cmake create mode 100644 IO/PostgreSQL/vtkIOPostgreSQL_AutoInit.cxx create mode 100644 IO/SQL/CMakeLists.txt create mode 100644 IO/SQL/Testing/Cxx/CMakeLists.txt create mode 100644 IO/SQL/module.cmake create mode 100644 IO/Video/CMakeLists.txt create mode 100644 IO/Video/module.cmake create mode 100644 IO/XML/CMakeLists.txt create mode 100644 IO/XML/Testing/Cxx/CMakeLists.txt create mode 100644 IO/XML/module.cmake create mode 100644 Imaging/Color/CMakeLists.txt create mode 100644 Imaging/Color/module.cmake create mode 100644 Imaging/Core/CMakeLists.txt create mode 100644 Imaging/Core/Testing/Cxx/CMakeLists.txt create mode 100644 Imaging/Core/module.cmake create mode 100644 Imaging/Fourier/CMakeLists.txt create mode 100644 Imaging/Fourier/module.cmake create mode 100644 Imaging/General/CMakeLists.txt create mode 100644 Imaging/General/module.cmake create mode 100644 Imaging/Hybrid/CMakeLists.txt create mode 100644 Imaging/Hybrid/module.cmake create mode 100644 Imaging/Math/CMakeLists.txt create mode 100644 Imaging/Math/module.cmake create mode 100644 Imaging/Morphological/CMakeLists.txt create mode 100644 Imaging/Morphological/module.cmake create mode 100644 Imaging/Sources/CMakeLists.txt create mode 100644 Imaging/Sources/module.cmake create mode 100644 Imaging/Statistics/CMakeLists.txt create mode 100644 Imaging/Statistics/module.cmake create mode 100644 Imaging/Stencil/CMakeLists.txt create mode 100644 Imaging/Stencil/module.cmake create mode 100644 Infovis/Boost/CMakeLists.txt create mode 100644 Infovis/Boost/Testing/Cxx/CMakeLists.txt create mode 100644 Infovis/Boost/module.cmake create mode 100644 Infovis/BoostGraphAlgorithms/CMakeLists.txt create mode 100644 Infovis/BoostGraphAlgorithms/Testing/Cxx/CMakeLists.txt create mode 100644 Infovis/BoostGraphAlgorithms/module.cmake create mode 100644 Infovis/Core/CMakeLists.txt create mode 100644 Infovis/Core/Testing/Cxx/CMakeLists.txt create mode 100644 Infovis/Core/module.cmake create mode 100644 Infovis/Layout/CMakeLists.txt create mode 100644 Infovis/Layout/Testing/Cxx/CMakeLists.txt create mode 100644 Infovis/Layout/module.cmake create mode 100644 Infovis/Parallel/CMakeLists.txt create mode 100644 Infovis/Parallel/module.cmake create mode 100644 Interaction/Style/CMakeLists.txt create mode 100644 Interaction/Style/module.cmake create mode 100644 Interaction/Widgets/CMakeLists.txt create mode 100644 Interaction/Widgets/module.cmake create mode 100644 Parallel/Core/CMakeLists.txt create mode 100644 Parallel/Core/module.cmake create mode 100644 Parallel/MPI/CMakeLists.txt create mode 100644 Parallel/MPI/module.cmake create mode 100644 Rendering/Annotation/CMakeLists.txt create mode 100644 Rendering/Annotation/Testing/Cxx/CMakeLists.txt create mode 100644 Rendering/Annotation/module.cmake create mode 100644 Rendering/Context2D/CMakeLists.txt create mode 100644 Rendering/Context2D/module.cmake create mode 100644 Rendering/Core/CMakeLists.txt create mode 100644 Rendering/Core/Testing/Cxx/CMakeLists.txt create mode 100644 Rendering/Core/module.cmake create mode 100644 Rendering/FreeType/CMakeLists.txt create mode 100644 Rendering/FreeType/module.cmake create mode 100644 Rendering/Image/CMakeLists.txt create mode 100644 Rendering/Image/module.cmake create mode 100644 Rendering/LOD/CMakeLists.txt create mode 100644 Rendering/LOD/module.cmake create mode 100644 Rendering/Label/CMakeLists.txt create mode 100644 Rendering/Label/module.cmake create mode 100644 Rendering/OpenGL/CMakeLists.txt create mode 100644 Rendering/OpenGL/module.cmake create mode 100644 Rendering/OpenGL/vtkRenderingOpenGLConfigure.h.in create mode 100644 Rendering/Parallel/CMakeLists.txt create mode 100644 Rendering/Parallel/module.cmake create mode 100644 Rendering/Qt/CMakeLists.txt create mode 100644 Rendering/Qt/module.cmake create mode 100644 Rendering/Volume/Testing/Cxx/CMakeLists.txt create mode 100644 Rendering/Volume/module.cmake create mode 100644 TODO-Modularization.txt create mode 100644 Testing/Core/CMakeLists.txt create mode 100644 Testing/Core/module.cmake create mode 100644 Testing/IOSQL/CMakeLists.txt create mode 100644 Testing/IOSQL/DatabaseSchemaWith2Tables.h create mode 100644 Testing/IOSQL/module.cmake create mode 100644 Testing/Rendering/CMakeLists.txt create mode 100644 Testing/Rendering/module.cmake create mode 100644 ThirdParty/Cosmo/module.cmake create mode 100644 ThirdParty/VPIC/module.cmake create mode 100644 ThirdParty/alglib/module.cmake create mode 100644 ThirdParty/exodusII/CMakeLists.txt create mode 100644 ThirdParty/exodusII/module.cmake create mode 100644 ThirdParty/expat/CMakeLists.txt create mode 100644 ThirdParty/expat/module.cmake create mode 100644 ThirdParty/freetype/CMakeLists.txt create mode 100644 ThirdParty/freetype/module.cmake create mode 100644 ThirdParty/ftgl/module.cmake create mode 100644 ThirdParty/gl2ps/CMakeLists.txt create mode 100644 ThirdParty/gl2ps/module.cmake create mode 100644 ThirdParty/hdf5/CMakeLists.txt create mode 100644 ThirdParty/hdf5/module.cmake create mode 100644 ThirdParty/jpeg/CMakeLists.txt create mode 100644 ThirdParty/jpeg/module.cmake create mode 100644 ThirdParty/libproj4/CMakeLists.txt create mode 100644 ThirdParty/libproj4/module.cmake create mode 100644 ThirdParty/libxml2/CMakeLists.txt create mode 100644 ThirdParty/libxml2/module.cmake create mode 100644 ThirdParty/mrmpi/module.cmake create mode 100644 ThirdParty/netcdf/CMakeLists.txt create mode 100644 ThirdParty/netcdf/module.cmake create mode 100644 ThirdParty/oggtheora/CMakeLists.txt create mode 100644 ThirdParty/oggtheora/module.cmake create mode 100644 ThirdParty/png/CMakeLists.txt create mode 100644 ThirdParty/png/module.cmake create mode 100644 ThirdParty/sqlite/CMakeLists.txt create mode 100644 ThirdParty/sqlite/module.cmake create mode 100644 ThirdParty/tiff/CMakeLists.txt create mode 100644 ThirdParty/tiff/module.cmake create mode 100644 ThirdParty/verdict/module.cmake create mode 100644 ThirdParty/zlib/CMakeLists.txt create mode 100644 ThirdParty/zlib/module.cmake create mode 100644 Utilities/DICOMParser/module.cmake create mode 100644 Utilities/EncodeString/module.cmake create mode 100644 Utilities/HashSource/module.cmake create mode 100644 Utilities/KWSys/CMakeLists.txt create mode 100644 Utilities/KWSys/module.cmake create mode 100644 Utilities/MaterialLibrary/module.cmake create mode 100644 Utilities/MetaIO/CMakeLists.txt create mode 100644 Utilities/MetaIO/module.cmake create mode 100644 Utilities/ParseOGLExt/module.cmake create mode 100644 Views/Context2D/CMakeLists.txt create mode 100644 Views/Context2D/module.cmake create mode 100644 Views/Core/CMakeLists.txt create mode 100644 Views/Core/module.cmake create mode 100644 Views/Geovis/CMakeLists.txt create mode 100644 Views/Geovis/module.cmake create mode 100644 Views/Infovis/CMakeLists.txt create mode 100644 Views/Infovis/module.cmake create mode 100644 Views/Qt/CMakeLists.txt create mode 100644 Views/Qt/module.cmake create mode 100644 Wrapping/JavaCore/CMakeLists.txt create mode 100644 Wrapping/JavaCore/module.cmake create mode 100644 Wrapping/Python/vtk/module.py.in create mode 100644 Wrapping/PythonCore/CMakeLists.txt create mode 100644 Wrapping/PythonCore/module.cmake diff --git a/.gitattributes b/.gitattributes index 21d8064aa28..5e4651be470 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,4 +14,4 @@ pre-commit crlf=input *.txt whitespace=tab-in-indent,-blank-at-eol *.cmake whitespace=tab-in-indent,-blank-at-eol -/Utilities/vtksqlite/vtk_sqlite3.c hooks.MaxObjectKiB=4096 +/ThirdParty/sqlite/vtksqlite/vtk_sqlite3.c hooks.MaxObjectKiB=4096 diff --git a/AMR/Core/CMakeLists.txt b/AMR/Core/CMakeLists.txt new file mode 100644 index 00000000000..f1bdc7182eb --- /dev/null +++ b/AMR/Core/CMakeLists.txt @@ -0,0 +1,32 @@ +set(Module_SRCS + vtkAMRBaseParticlesReader.cxx + vtkAMRBaseReader.cxx + vtkAMRCutPlane.cxx + vtkAMRDataSetCache.cxx + vtkAMREnzoParticlesReader.cxx + vtkAMREnzoReader.cxx + vtkAMREnzoReaderInternal.cxx + vtkAMRFlashParticlesReader.cxx + vtkAMRFlashReader.cxx + vtkAMRFlashReaderInternal.cxx + vtkAMRGaussianPulseSource.cxx + vtkAMRResampleFilter.cxx + vtkAMRSliceFilter.cxx + vtkAMRToMultiBlockFilter.cxx + vtkAMRUtilities.cxx + ) + +set_source_files_properties( + vtkAMRBaseReader + vtkAMRBaseParticlesReader + ABSTRACT + ) + +set_source_files_properties( + vtkAMREnzoReaderInternal + vtkAMRFlashReaderInternal + vtkAMRUtilities + WRAP_EXCLUDE + ) + +vtk_module_library(vtkAMRCore ${Module_SRCS}) diff --git a/AMR/Core/Testing/Cxx/CMakeLists.txt b/AMR/Core/Testing/Cxx/CMakeLists.txt index a63e7d45575..69464a6f4c2 100644 --- a/AMR/Core/Testing/Cxx/CMakeLists.txt +++ b/AMR/Core/Testing/Cxx/CMakeLists.txt @@ -1,22 +1,22 @@ -## Set the name of the KIT being tested -SET(KIT AMR) - ## List all test sources -SET(MyTests +set(MyTests TestFlashReader.cxx TestEnzoReader.cxx ) ## Create test source list -CREATE_TEST_SOURCELIST(Tests ${KIT}CxxTests.cxx +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx ${MyTests} EXTRA_INCLUDE vtkTestDriver.h ) -ADD_EXECUTABLE( ${KIT}CxxTests ${Tests}) -TARGET_LINK_LIBRARIES( ${KIT}CxxTests vtkAMR vtkFiltering vtkParallel ) +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) +set(TestsToRun ${Tests}) +remove(TestsToRun ${vtk-module}CxxTests.cxx) + ## Add all executables -FOREACH(test ${MyTests}) - GET_FILENAME_COMPONENT(t ${test} NAME_WE) - ADD_TEST(${t} ${CXX_TEST_PATH}/${KIT}CxxTests ${t} -D ${VTK_DATA_ROOT}) -ENDFOREACH(test) \ No newline at end of file +foreach(test ${TestsToRun}) + get_filename_component(t ${test} NAME_WE) + add_test(NAME ${vtk-module}Cxx-${t} + COMMAND ${vtk-module}CxxTests ${t} -D ${VTK_DATA_ROOT}) +endforeach() diff --git a/AMR/Core/module.cmake b/AMR/Core/module.cmake new file mode 100644 index 00000000000..f3f2eef346f --- /dev/null +++ b/AMR/Core/module.cmake @@ -0,0 +1,12 @@ +vtk_module(vtkAMRCore + GROUPS + StandAlone + DEPENDS + vtkParallelCore + vtkFiltersGeneral + vtkhdf5 + vtkIOXML + TEST_DEPENDS + vtkTestingCore + vtkTestingRendering + ) diff --git a/AMR/Core/vtkAMREnzoParticlesReader.cxx b/AMR/Core/vtkAMREnzoParticlesReader.cxx index f588aabf0f2..3512f2d20cb 100644 --- a/AMR/Core/vtkAMREnzoParticlesReader.cxx +++ b/AMR/Core/vtkAMREnzoParticlesReader.cxx @@ -27,7 +27,7 @@ #include "vtksys/SystemTools.hxx" #define H5_USE_16_API -#include <hdf5.h> // for the HDF data loading engine +#include "vtk_hdf5.h" // for the HDF data loading engine #include "vtkAMREnzoReaderInternal.h" diff --git a/AMR/Core/vtkAMREnzoReader.cxx b/AMR/Core/vtkAMREnzoReader.cxx index 2f26eee14c8..f8931f9f39f 100644 --- a/AMR/Core/vtkAMREnzoReader.cxx +++ b/AMR/Core/vtkAMREnzoReader.cxx @@ -37,7 +37,7 @@ #include "vtkUnsignedShortArray.h" #define H5_USE_16_API -#include <hdf5.h> +#include "vtk_hdf5.h" #include <sstream> #include <vector> diff --git a/AMR/Core/vtkAMREnzoReaderInternal.cxx b/AMR/Core/vtkAMREnzoReaderInternal.cxx index e2e4bde3c45..86b233c0332 100644 --- a/AMR/Core/vtkAMREnzoReaderInternal.cxx +++ b/AMR/Core/vtkAMREnzoReaderInternal.cxx @@ -15,7 +15,7 @@ #include "vtkAMREnzoReaderInternal.h" #define H5_USE_16_API -#include <hdf5.h> // for the HDF5 library +#include "vtk_hdf5.h" // for the HDF5 library #include "vtksys/SystemTools.hxx" #include "vtkCellData.h" diff --git a/AMR/Core/vtkAMRFlashParticlesReader.cxx b/AMR/Core/vtkAMRFlashParticlesReader.cxx index 1f9b72f03b8..da78c5ff669 100644 --- a/AMR/Core/vtkAMRFlashParticlesReader.cxx +++ b/AMR/Core/vtkAMRFlashParticlesReader.cxx @@ -25,7 +25,7 @@ #include "vtkAMRFlashReaderInternal.h" #define H5_USE_16_API -#include <hdf5.h> // for the HDF data loading engine +#include "vtk_hdf5.h" // for the HDF data loading engine #include <vector> #include <cassert> diff --git a/AMR/Core/vtkAMRFlashReader.cxx b/AMR/Core/vtkAMRFlashReader.cxx index af5b47a2b26..7d2b5a66c05 100644 --- a/AMR/Core/vtkAMRFlashReader.cxx +++ b/AMR/Core/vtkAMRFlashReader.cxx @@ -37,7 +37,7 @@ #include <map> #define H5_USE_16_API -#include <hdf5.h> +#include "vtk_hdf5.h" #include "vtkAMRFlashReaderInternal.h" diff --git a/AMR/Core/vtkAMRFlashReaderInternal.h b/AMR/Core/vtkAMRFlashReaderInternal.h index ccc6a366156..f9486f2409f 100644 --- a/AMR/Core/vtkAMRFlashReaderInternal.h +++ b/AMR/Core/vtkAMRFlashReaderInternal.h @@ -39,7 +39,7 @@ #include "vtkByteSwap.h" #define H5_USE_16_API -#include <hdf5.h> +#include "vtk_hdf5.h" //============================================================================== // I N T E R N A L F L A S H R E A D E R diff --git a/CMake/FindMPI.cmake b/CMake/FindMPI.cmake new file mode 100644 index 00000000000..ae50ca7b906 --- /dev/null +++ b/CMake/FindMPI.cmake @@ -0,0 +1,631 @@ +# - Find a Message Passing Interface (MPI) implementation +# The Message Passing Interface (MPI) is a library used to write +# high-performance distributed-memory parallel applications, and +# is typically deployed on a cluster. MPI is a standard interface +# (defined by the MPI forum) for which many implementations are +# available. All of them have somewhat different include paths, +# libraries to link against, etc., and this module tries to smooth +# out those differences. +# +# === Variables === +# +# This module will set the following variables per language in your project, +# where <lang> is one of C, CXX, or Fortran: +# MPI_<lang>_FOUND TRUE if FindMPI found MPI flags for <lang> +# MPI_<lang>_COMPILER MPI Compiler wrapper for <lang> +# MPI_<lang>_COMPILE_FLAGS Compilation flags for MPI programs +# MPI_<lang>_INCLUDE_PATH Include path(s) for MPI header +# MPI_<lang>_LINK_FLAGS Linking flags for MPI programs +# MPI_<lang>_LIBRARIES All libraries to link MPI programs against +# Additionally, FindMPI sets the following variables for running MPI +# programs from the command line: +# MPIEXEC Executable for running MPI programs +# MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving +# it the number of processors to run on +# MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly +# before the executable to run. +# MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags +# === Usage === +# +# To use this module, simply call FindMPI from a CMakeLists.txt file, or +# run find_package(MPI), then run CMake. If you are happy with the auto- +# detected configuration for your language, then you're done. If not, you +# have two options: +# 1. Set MPI_<lang>_COMPILER to the MPI wrapper (mpicc, etc.) of your +# choice and reconfigure. FindMPI will attempt to determine all the +# necessary variables using THAT compiler's compile and link flags. +# 2. If this fails, or if your MPI implementation does not come with +# a compiler wrapper, then set both MPI_<lang>_LIBRARIES and +# MPI_<lang>_INCLUDE_PATH. You may also set any other variables +# listed above, but these two are required. This will circumvent +# autodetection entirely. +# When configuration is successful, MPI_<lang>_COMPILER will be set to the +# compiler wrapper for <lang>, if it was found. MPI_<lang>_FOUND and other +# variables above will be set if any MPI implementation was found for <lang>, +# regardless of whether a compiler was found. +# +# When using MPIEXEC to execute MPI applications, you should typically use +# all of the MPIEXEC flags as follows: +# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS +# ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS +# where PROCS is the number of processors on which to execute the program, +# EXECUTABLE is the MPI program, and ARGS are the arguments to pass to the +# MPI program. +# +# === Backward Compatibility === +# +# For backward compatibility with older versions of FindMPI, these +# variables are set, but deprecated: +# MPI_FOUND MPI_COMPILER MPI_LIBRARY +# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_EXTRA_LIBRARY +# MPI_LINK_FLAGS MPI_LIBRARIES +# In new projects, please use the MPI_<lang>_XXX equivalents. + +#============================================================================= +# Copyright 2001-2011 Kitware, Inc. +# Copyright 2010-2011 Todd Gamblin tgamblin@llnl.gov +# Copyright 2001-2009 Dave Partyka +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# include this to handle the QUIETLY and REQUIRED arguments +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +include(GetPrerequisites) + +# +# This part detects MPI compilers, attempting to wade through the mess of compiler names in +# a sensible way. +# +# The compilers are detected in this order: +# +# 1. Try to find the most generic availble MPI compiler, as this is usually set up by +# cluster admins. e.g., if plain old mpicc is available, we'll use it and assume it's +# the right compiler. +# +# 2. If a generic mpicc is NOT found, then we attempt to find one that matches +# CMAKE_<lang>_COMPILER_ID. e.g. if you are using XL compilers, we'll try to find mpixlc +# and company, but not mpiicc. This hopefully prevents toolchain mismatches. +# +# If you want to force a particular MPI compiler other than what we autodetect (e.g. if you +# want to compile regular stuff with GNU and parallel stuff with Intel), you can always set +# your favorite MPI_<lang>_COMPILER explicitly and this stuff will be ignored. +# + +# Start out with the generic MPI compiler names, as these are most commonly used. +set(_MPI_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) +set(_MPI_CXX_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ + mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r) +set(_MPI_Fortran_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r + mpif90 mpif90_r mpf90 mpf90_r + mpif77 mpif77_r mpf77 mpf77_r) + +# GNU compiler names +set(_MPI_GNU_C_COMPILER_NAMES mpigcc mpgcc mpigcc_r mpgcc_r) +set(_MPI_GNU_CXX_COMPILER_NAMES mpig++ mpg++ mpig++_r mpg++_r) +set(_MPI_GNU_Fortran_COMPILER_NAMES mpigfortran mpgfortran mpigfortran_r mpgfortran_r + mpig77 mpig77_r mpg77 mpg77_r) + +# Intel MPI compiler names +set(_MPI_Intel_C_COMPILER_NAMES mpiicc) +set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++ mpiiCC) +set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77) + +# PGI compiler names +set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc) +set(_MPI_PGI_CXX_COMPILER_NAMES mpipgCC mppgCC) +set(_MPI_PGI_Fortran_COMPILER_NAMES mpipgf95 mpipgf90 mppgf95 mppgf90 mpipgf77 mppgf77) + +# XLC MPI Compiler names +set(_MPI_XL_C_COMPILER_NAMES mpxlc mpxlc_r mpixlc mpixlc_r) +set(_MPI_XL_CXX_COMPILER_NAMES mpixlcxx mpixlC mpixlc++ mpxlcxx mpxlc++ mpixlc++ mpxlCC + mpixlcxx_r mpixlC_r mpixlc++_r mpxlcxx_r mpxlc++_r mpixlc++_r mpxlCC_r) +set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95_r + mpixlf90 mpixlf90_r mpxlf90 mpxlf90_r + mpixlf77 mpixlf77_r mpxlf77 mpxlf77_r + mpixlf mpixlf_r mpxlf mpxlf_r) + +# append vendor-specific compilers to the list if we either don't know the compiler id, +# or if we know it matches the regular compiler. +foreach (lang C CXX Fortran) + foreach (id GNU Intel PGI XL) + if (NOT CMAKE_${lang}_COMPILER_ID OR "${CMAKE_${lang}_COMPILER_ID}" STREQUAL "${id}") + list(APPEND _MPI_${lang}_COMPILER_NAMES ${_MPI_${id}_${lang}_COMPILER_NAMES}) + endif() + unset(_MPI_${id}_${lang}_COMPILER_NAMES) # clean up the namespace here + endforeach() +endforeach() + + +# Names to try for MPI exec +set(_MPI_EXEC_NAMES mpiexec mpirun lamexec srun) + +# Grab the path to MPI from the registry if we're on windows. +set(_MPI_PREFIX_PATH) +if(WIN32) + list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/..") + list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]") + list(APPEND _MPI_PREFIX_PATH "$ENV{ProgramW6432}/MPICH2/") +endif() + +# Build a list of prefixes to search for MPI. +foreach(SystemPrefixDir ${CMAKE_SYSTEM_PREFIX_PATH}) + foreach(MpiPackageDir ${_MPI_PREFIX_PATH}) + if(EXISTS ${SystemPrefixDir}/${MpiPackageDir}) + list(APPEND _MPI_PREFIX_PATH "${SystemPrefixDir}/${MpiPackageDir}") + endif() + endforeach() +endforeach() + + +# +# interrogate_mpi_compiler(lang try_libs) +# +# Attempts to extract compiler and linker args from an MPI compiler. The arguments set +# by this function are: +# +# MPI_<lang>_INCLUDE_PATH MPI_<lang>_LINK_FLAGS MPI_<lang>_FOUND +# MPI_<lang>_COMPILE_FLAGS MPI_<lang>_LIBRARIES +# +# MPI_<lang>_COMPILER must be set beforehand to the absolute path to an MPI compiler for +# <lang>. Additionally, MPI_<lang>_INCLUDE_PATH and MPI_<lang>_LIBRARIES may be set +# to skip autodetection. +# +# If try_libs is TRUE, this will also attempt to find plain MPI libraries in the usual +# way. In general, this is not as effective as interrogating the compilers, as it +# ignores language-specific flags and libraries. However, some MPI implementations +# (Windows implementations) do not have compiler wrappers, so this approach must be used. +# +function (interrogate_mpi_compiler lang try_libs) + # MPI_${lang}_NO_INTERROGATE will be set to a compiler name when the *regular* compiler was + # discovered to be the MPI compiler. This happens on machines like the Cray XE6 that use + # modules to set cc, CC, and ftn to the MPI compilers. If the user force-sets another MPI + # compiler, MPI_${lang}_COMPILER won't be equal to MPI_${lang}_NO_INTERROGATE, and we'll + # inspect that compiler anew. This allows users to set new compilers w/o rm'ing cache. + string(COMPARE NOTEQUAL "${MPI_${lang}_NO_INTERROGATE}" "${MPI_${lang}_COMPILER}" interrogate) + + # If MPI is set already in the cache, don't bother with interrogating the compiler. + if (interrogate AND ((NOT MPI_${lang}_INCLUDE_PATH) OR (NOT MPI_${lang}_LIBRARIES))) + if (MPI_${lang}_COMPILER) + # Check whether the -showme:compile option works. This indicates that we have either OpenMPI + # or a newer version of LAM-MPI, and implies that -showme:link will also work. + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -showme:compile + OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE MPI_COMPILER_RETURN) + + if (MPI_COMPILER_RETURN EQUAL 0) + # If we appear to have -showme:compile, then we should + # also have -showme:link. Try it. + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -showme:link + OUTPUT_VARIABLE MPI_LINK_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_LINK_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE MPI_COMPILER_RETURN) + + if (MPI_COMPILER_RETURN EQUAL 0) + # We probably have -showme:incdirs and -showme:libdirs as well, + # so grab that while we're at it. + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -showme:incdirs + OUTPUT_VARIABLE MPI_INCDIRS OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_INCDIRS ERROR_STRIP_TRAILING_WHITESPACE) + + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -showme:libdirs + OUTPUT_VARIABLE MPI_LIBDIRS OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_LIBDIRS ERROR_STRIP_TRAILING_WHITESPACE) + + else() + # reset things here if something went wrong. + set(MPI_COMPILE_CMDLINE) + set(MPI_LINK_CMDLINE) + endif() + endif () + + # Older versions of LAM-MPI have "-showme". Try to find that. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -showme + OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE MPI_COMPILER_RETURN) + endif() + + # MVAPICH uses -compile-info and -link-info. Try them. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -compile-info + OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE MPI_COMPILER_RETURN) + + # If we have compile-info, also have link-info. + if (MPI_COMPILER_RETURN EQUAL 0) + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -link-info + OUTPUT_VARIABLE MPI_LINK_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_LINK_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE MPI_COMPILER_RETURN) + endif() + + # make sure we got compile and link. Reset vars if something's wrong. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + set(MPI_COMPILE_CMDLINE) + set(MPI_LINK_CMDLINE) + endif() + endif() + + # MPICH just uses "-show". Try it. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -show + OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE MPI_COMPILER_RETURN) + endif() + + if (MPI_COMPILER_RETURN EQUAL 0) + # We have our command lines, but we might need to copy MPI_COMPILE_CMDLINE + # into MPI_LINK_CMDLINE, if we didn't find the link line. + if (NOT MPI_LINK_CMDLINE) + set(MPI_LINK_CMDLINE ${MPI_COMPILE_CMDLINE}) + endif() + else() + message(STATUS "Unable to determine MPI from MPI driver ${MPI_${lang}_COMPILER}") + set(MPI_COMPILE_CMDLINE) + set(MPI_LINK_CMDLINE) + endif() + + # Here, we're done with the interrogation part, and we'll try to extract args we care + # about from what we learned from the compiler wrapper scripts. + + # If interrogation came back with something, extract our variable from the MPI command line + if (MPI_COMPILE_CMDLINE OR MPI_LINK_CMDLINE) + # Extract compile flags from the compile command line. + string(REGEX MATCHALL "(^| )-[Df]([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}") + set(MPI_COMPILE_FLAGS_WORK) + + foreach(FLAG ${MPI_ALL_COMPILE_FLAGS}) + if (MPI_COMPILE_FLAGS_WORK) + set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}") + else() + set(MPI_COMPILE_FLAGS_WORK ${FLAG}) + endif() + endforeach() + + # Extract include paths from compile command line + string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") + foreach(IPATH ${MPI_ALL_INCLUDE_PATHS}) + string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH}) + string(REGEX REPLACE "//" "/" IPATH ${IPATH}) + list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH}) + endforeach() + + # try using showme:incdirs if extracting didn't work. + if (NOT MPI_INCLUDE_PATH_WORK) + set(MPI_INCLUDE_PATH_WORK ${MPI_INCDIRS}) + separate_arguments(MPI_INCLUDE_PATH_WORK) + endif() + + # If all else fails, just search for mpi.h in the normal include paths. + if (NOT MPI_INCLUDE_PATH_WORK) + set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + find_path(MPI_HEADER_PATH mpi.h + HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} + PATH_SUFFIXES include) + set(MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) + endif() + + # Extract linker paths from the link command line + string(REGEX MATCHALL "(^| |-Wl,)-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}") + set(MPI_LINK_PATH) + foreach(LPATH ${MPI_ALL_LINK_PATHS}) + string(REGEX REPLACE "^(| |-Wl,)-L" "" LPATH ${LPATH}) + string(REGEX REPLACE "//" "/" LPATH ${LPATH}) + list(APPEND MPI_LINK_PATH ${LPATH}) + endforeach() + + # try using showme:libdirs if extracting didn't work. + if (NOT MPI_LINK_PATH) + set(MPI_LINK_PATH ${MPI_LIBDIRS}) + separate_arguments(MPI_LINK_PATH) + endif() + + # Extract linker flags from the link command line + string(REGEX MATCHALL "(^| )-Wl,([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") + set(MPI_LINK_FLAGS_WORK) + foreach(FLAG ${MPI_ALL_LINK_FLAGS}) + if (MPI_LINK_FLAGS_WORK) + set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}") + else() + set(MPI_LINK_FLAGS_WORK ${FLAG}) + endif() + endforeach() + + # Extract the set of libraries to link against from the link command + # line + string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") + # add the compiler implicit directories because some compilers + # such as the intel compiler have libraries that show up + # in the showme list that can only be found in the implicit + # link directories of the compiler. Do this for C++ and C + # compilers if the implicit link directories are defined. + if (DEFINED CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES) + set(MPI_LINK_PATH + "${MPI_LINK_PATH};${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}") + endif () + + if (DEFINED CMAKE_C_IMPLICIT_LINK_DIRECTORIES) + set(MPI_LINK_PATH + "${MPI_LINK_PATH};${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") + endif () + + # Determine full path names for all of the libraries that one needs + # to link against in an MPI program + foreach(LIB ${MPI_LIBNAMES}) + string(REGEX REPLACE "^ ?-l" "" LIB ${LIB}) + # MPI_LIB is cached by find_library, but we don't want that. Clear it first. + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + find_library(MPI_LIB NAMES ${LIB} HINTS ${MPI_LINK_PATH}) + + if (MPI_LIB) + list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB}) + elseif (NOT MPI_FIND_QUIETLY) + message(WARNING "Unable to find MPI library ${LIB}") + endif() + endforeach() + + # Sanity check MPI_LIBRARIES to make sure there are enough libraries + list(LENGTH MPI_LIBRARIES_WORK MPI_NUMLIBS) + list(LENGTH MPI_LIBNAMES MPI_NUMLIBS_EXPECTED) + if (NOT MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED) + set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND") + endif() + endif() + + elseif(try_libs) + # If we didn't have an MPI compiler script to interrogate, attempt to find everything + # with plain old find functions. This is nasty because MPI implementations have LOTS of + # different library names, so this section isn't going to be very generic. We need to + # make sure it works for MS MPI, though, since there are no compiler wrappers for that. + find_path(MPI_HEADER_PATH mpi.h + HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} + PATH_SUFFIXES include Inc) + set(MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) + + # Decide between 32-bit and 64-bit libraries for Microsoft's MPI + if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) + set(MS_MPI_ARCH_DIR amd64) + else() + set(MS_MPI_ARCH_DIR i386) + endif() + + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + find_library(MPI_LIB + NAMES mpi mpich mpich2 msmpi + HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} + PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR}) + set(MPI_LIBRARIES_WORK ${MPI_LIB}) + + # Right now, we only know about the extra libs for C++. + # We could add Fortran here (as there is usually libfmpich, etc.), but + # this really only has to work with MS MPI on Windows. + # Assume that other MPI's are covered by the compiler wrappers. + if (${lang} STREQUAL CXX) + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + find_library(MPI_LIB + NAMES mpi++ mpicxx cxx mpi_cxx + HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} + PATH_SUFFIXES lib) + if (MPI_LIBRARIES_WORK AND MPI_LIB) + list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB}) + endif() + endif() + + if (NOT MPI_LIBRARIES_WORK) + set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND") + endif() + endif() + + # If we found MPI, set up all of the appropriate cache entries + set(MPI_${lang}_COMPILE_FLAGS ${MPI_COMPILE_FLAGS_WORK} CACHE STRING "MPI ${lang} compilation flags" FORCE) + set(MPI_${lang}_INCLUDE_PATH ${MPI_INCLUDE_PATH_WORK} CACHE STRING "MPI ${lang} include path" FORCE) + set(MPI_${lang}_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI ${lang} linking flags" FORCE) + set(MPI_${lang}_LIBRARIES ${MPI_LIBRARIES_WORK} CACHE STRING "MPI ${lang} libraries to link against" FORCE) + mark_as_advanced(MPI_${lang}_COMPILE_FLAGS MPI_${lang}_INCLUDE_PATH MPI_${lang}_LINK_FLAGS MPI_${lang}_LIBRARIES) + + # clear out our temporary lib/header detectionv variable here. + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI lib detection" FORCE) + set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI header detection" FORCE) + endif() + + # finally set a found variable for each MPI language + if (MPI_${lang}_INCLUDE_PATH AND MPI_${lang}_LIBRARIES) + set(MPI_${lang}_FOUND TRUE PARENT_SCOPE) + else() + set(MPI_${lang}_FOUND FALSE PARENT_SCOPE) + endif() +endfunction() + + +# This function attempts to compile with the regular compiler, to see if MPI programs +# work with it. This is a last ditch attempt after we've tried interrogating mpicc and +# friends, and after we've tried to find generic libraries. Works on machines like +# Cray XE6, where the modules environment changes what MPI version cc, CC, and ftn use. +function(try_regular_compiler lang success) + set(scratch_directory ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}) + if (${lang} STREQUAL Fortran) + set(test_file ${scratch_directory}/cmake_mpi_test.f90) + file(WRITE ${test_file} + "program hello\n" + "include 'mpif.h'\n" + "integer ierror\n" + "call MPI_INIT(ierror)\n" + "call MPI_FINALIZE(ierror)\n" + "end\n") + else() + if (${lang} STREQUAL CXX) + set(test_file ${scratch_directory}/cmake_mpi_test.cpp) + else() + set(test_file ${scratch_directory}/cmake_mpi_test.c) + endif() + file(WRITE ${test_file} + "#include <mpi.h>\n" + "int main(int argc, char **argv) {\n" + " MPI_Init(&argc, &argv);\n" + " MPI_Finalize();\n" + "}\n") + endif() + try_compile(compiler_has_mpi ${scratch_directory} ${test_file}) + if (compiler_has_mpi) + set(MPI_${lang}_NO_INTERROGATE ${CMAKE_${lang}_COMPILER} CACHE STRING "Whether to interrogate MPI ${lang} compiler" FORCE) + set(MPI_${lang}_COMPILER ${CMAKE_${lang}_COMPILER} CACHE STRING "MPI ${lang} compiler" FORCE) + set(MPI_${lang}_COMPILE_FLAGS "" CACHE STRING "MPI ${lang} compilation flags" FORCE) + set(MPI_${lang}_INCLUDE_PATH "" CACHE STRING "MPI ${lang} include path" FORCE) + set(MPI_${lang}_LINK_FLAGS "" CACHE STRING "MPI ${lang} linking flags" FORCE) + set(MPI_${lang}_LIBRARIES "" CACHE STRING "MPI ${lang} libraries to link against" FORCE) + endif() + set(${success} ${compiler_has_mpi} PARENT_SCOPE) + unset(compiler_has_mpi CACHE) +endfunction() + +# End definitions, commence real work here. + +# Most mpi distros have some form of mpiexec which gives us something we can reliably look for. +find_program(MPIEXEC + NAMES ${_MPI_EXEC_NAMES} + PATHS ${_MPI_PREFIX_PATH} + PATH_SUFFIXES bin + DOC "Executable for running MPI programs.") + +# call get_filename_component twice to remove mpiexec and the directory it exists in (typically bin). +# This gives us a fairly reliable base directory to search for /bin /lib and /include from. +get_filename_component(_MPI_BASE_DIR "${MPIEXEC}" PATH) +get_filename_component(_MPI_BASE_DIR "${_MPI_BASE_DIR}" PATH) + +set(MPIEXEC_NUMPROC_FLAG "-np" CACHE STRING "Flag used by MPI to specify the number of processes for MPIEXEC; the next option will be the number of processes.") +set(MPIEXEC_PREFLAGS "" CACHE STRING "These flags will be directly before the executable that is being run by MPIEXEC.") +set(MPIEXEC_POSTFLAGS "" CACHE STRING "These flags will come after all flags given to MPIEXEC.") +set(MPIEXEC_MAX_NUMPROCS "2" CACHE STRING "Maximum number of processors available to run MPI applications.") +mark_as_advanced(MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS) + + +#============================================================================= +# Backward compatibility input hacks. Propagate the FindMPI hints to C and +# CXX if the respective new versions are not defined. Translate the old +# MPI_LIBRARY and MPI_EXTRA_LIBRARY to respective MPI_${lang}_LIBRARIES. +# +# Once we find the new variables, we translate them back into their old +# equivalents below. +foreach (lang C CXX) + # Old input variables. + set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) + + # Set new vars based on their old equivalents, if the new versions are not already set. + foreach (var ${_MPI_OLD_INPUT_VARS}) + if (NOT MPI_${lang}_${var} AND MPI_${var}) + set(MPI_${lang}_${var} "${MPI_${var}}") + endif() + endforeach() + + # Special handling for MPI_LIBRARY and MPI_EXTRA_LIBRARY, which we nixed in the + # new FindMPI. These need to be merged into MPI_<lang>_LIBRARIES + if (NOT MPI_${lang}_LIBRARIES AND (MPI_LIBRARY OR MPI_EXTRA_LIBRARY)) + set(MPI_${lang}_LIBRARIES ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY}) + endif() +endforeach() +#============================================================================= + + +# This loop finds the compilers and sends them off for interrogation. +foreach (lang C CXX Fortran) + if (CMAKE_${lang}_COMPILER_WORKS) + # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. + if (MPI_${lang}_COMPILER) + is_file_executable(MPI_${lang}_COMPILER MPI_COMPILER_IS_EXECUTABLE) + if (NOT MPI_COMPILER_IS_EXECUTABLE) + # Get rid of our default list of names and just search for the name the user wants. + set(_MPI_${lang}_COMPILER_NAMES ${MPI_${lang}_COMPILER}) + set(MPI_${lang}_COMPILER "MPI_${lang}_COMPILER-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + # If the user specifies a compiler, we don't want to try to search libraries either. + set(try_libs FALSE) + endif() + else() + set(try_libs TRUE) + endif() + + find_program(MPI_${lang}_COMPILER + NAMES ${_MPI_${lang}_COMPILER_NAMES} + PATHS "${MPI_HOME}/bin" "$ENV{MPI_HOME}/bin" ${_MPI_PREFIX_PATH}) + interrogate_mpi_compiler(${lang} ${try_libs}) + mark_as_advanced(MPI_${lang}_COMPILER) + + # last ditch try -- if nothing works so far, just try running the regular compiler and + # see if we can create an MPI executable. + set(regular_compiler_worked 0) + if (NOT MPI_${lang}_LIBRARIES OR NOT MPI_${lang}_INCLUDE_PATH) + try_regular_compiler(${lang} regular_compiler_worked) + endif() + + if (regular_compiler_worked) + find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_COMPILER) + else() + find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_LIBRARIES MPI_${lang}_INCLUDE_PATH) + endif() + endif() +endforeach() + + +#============================================================================= +# More backward compatibility stuff +# +# Bare MPI sans ${lang} vars are set to CXX then C, depending on what was found. +# This mimics the behavior of the old language-oblivious FindMPI. +set(_MPI_OLD_VARS FOUND COMPILER INCLUDE_PATH COMPILE_FLAGS LINK_FLAGS LIBRARIES) +if (MPI_CXX_FOUND) + foreach (var ${_MPI_OLD_VARS}) + set(MPI_${var} ${MPI_CXX_${var}}) + endforeach() +elseif (MPI_C_FOUND) + foreach (var ${_MPI_OLD_VARS}) + set(MPI_${var} ${MPI_C_${var}}) + endforeach() +else() + # Note that we might still have found Fortran, but you'll need to use MPI_Fortran_FOUND + set(MPI_FOUND FALSE) +endif() + +# Chop MPI_LIBRARIES into the old-style MPI_LIBRARY and MPI_EXTRA_LIBRARY, and set them in cache. +if (MPI_LIBRARIES) + list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK) + set(MPI_LIBRARY ${MPI_LIBRARY_WORK} CACHE FILEPATH "MPI library to link against" FORCE) +else() + set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND" CACHE FILEPATH "MPI library to link against" FORCE) +endif() + +list(LENGTH MPI_LIBRARIES MPI_NUMLIBS) +if (MPI_NUMLIBS GREATER 1) + set(MPI_EXTRA_LIBRARY_WORK ${MPI_LIBRARIES}) + list(REMOVE_AT MPI_EXTRA_LIBRARY_WORK 0) + set(MPI_EXTRA_LIBRARY ${MPI_EXTRA_LIBRARY_WORK} CACHE STRING "Extra MPI libraries to link against" FORCE) +else() + set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND" CACHE STRING "Extra MPI libraries to link against" FORCE) +endif() +#============================================================================= + +# unset these vars to cleanup namespace +unset(_MPI_OLD_VARS) +unset(_MPI_PREFIX_PATH) +unset(_MPI_BASE_DIR) +foreach (lang C CXX Fortran) + unset(_MPI_${lang}_COMPILER_NAMES) +endforeach() diff --git a/CMake/FindODBC.cmake b/CMake/FindODBC.cmake index 65e5ca40a6b..7f3c5193da6 100644 --- a/CMake/FindODBC.cmake +++ b/CMake/FindODBC.cmake @@ -30,7 +30,7 @@ FIND_PATH(ODBC_INCLUDE_DIRECTORIES sql.h ) FIND_LIBRARY( ODBC_LIBRARY - NAMES iodbc unixodbc + NAMES odbc iodbc unixodbc PATHS /usr/lib /usr/lib/odbc diff --git a/CMake/FindPackageHandleStandardArgs.cmake b/CMake/FindPackageHandleStandardArgs.cmake new file mode 100644 index 00000000000..cdcf9ca7c10 --- /dev/null +++ b/CMake/FindPackageHandleStandardArgs.cmake @@ -0,0 +1,296 @@ +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... ) +# +# This function is intended to be used in FindXXX.cmake modules files. +# It handles the REQUIRED, QUIET and version-related arguments to FIND_PACKAGE(). +# It also sets the <UPPERCASED_NAME>_FOUND variable. +# The package is considered found if all variables <var1>... listed contain +# valid results, e.g. valid filepaths. +# +# There are two modes of this function. The first argument in both modes is +# the name of the Find-module where it is called (in original casing). +# +# The first simple mode looks like this: +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> ) +# If the variables <var1> to <varN> are all valid, then <UPPERCASED_NAME>_FOUND +# will be set to TRUE. +# If DEFAULT_MSG is given as second argument, then the function will generate +# itself useful success and error messages. You can also supply a custom error message +# for the failure case. This is not recommended. +# +# The second mode is more powerful and also supports version checking: +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS <var1>...<varN>] +# [VERSION_VAR <versionvar>] +# [HANDLE_COMPONENTS] +# [CONFIG_MODE] +# [FAIL_MESSAGE "Custom failure message"] ) +# +# As above, if <var1> through <varN> are all valid, <UPPERCASED_NAME>_FOUND +# will be set to TRUE. +# After REQUIRED_VARS the variables which are required for this package are listed. +# Following VERSION_VAR the name of the variable can be specified which holds +# the version of the package which has been found. If this is done, this version +# will be checked against the (potentially) specified required version used +# in the find_package() call. The EXACT keyword is also handled. The default +# messages include information about the required version and the version +# which has been actually found, both if the version is ok or not. +# If the package supports components, use the HANDLE_COMPONENTS option to enable +# handling them. In this case, find_package_handle_standard_args() will report +# which components have been found and which are missing, and the <NAME>_FOUND +# variable will be set to FALSE if any of the required components (i.e. not the +# ones listed after OPTIONAL_COMPONENTS) are missing. +# Use the option CONFIG_MODE if your FindXXX.cmake module is a wrapper for +# a find_package(... NO_MODULE) call. In this case VERSION_VAR will be set +# to <NAME>_VERSION and the macro will automatically check whether the +# Config module was found. +# Via FAIL_MESSAGE a custom failure message can be specified, if this is not +# used, the default message will be displayed. +# +# Example for mode 1: +# +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) +# +# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and +# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE. +# If it is not found and REQUIRED was used, it fails with FATAL_ERROR, +# independent whether QUIET was used or not. +# If it is found, success will be reported, including the content of <var1>. +# On repeated Cmake runs, the same message won't be printed again. +# +# Example for mode 2: +# +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE +# VERSION_VAR BISON_VERSION) +# In this case, BISON is considered to be found if the variable(s) listed +# after REQUIRED_VAR are all valid, i.e. BISON_EXECUTABLE in this case. +# Also the version of BISON will be checked by using the version contained +# in BISON_VERSION. +# Since no FAIL_MESSAGE is given, the default messages will be printed. +# +# Another example for mode 2: +# +# FIND_PACKAGE(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4) +# FIND_PACKAGE_HANDLE_STANDARD_ARGS(Automoc4 CONFIG_MODE) +# In this case, FindAutmoc4.cmake wraps a call to FIND_PACKAGE(Automoc4 NO_MODULE) +# and adds an additional search directory for automoc4. +# The following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper +# success/error message. + +#============================================================================= +# Copyright 2007-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +INCLUDE(FindPackageMessage) +INCLUDE(CMakeParseArguments) + +# internal helper macro +MACRO(_FPHSA_FAILURE_MESSAGE _msg) + IF (${_NAME}_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "${_msg}") + ELSE (${_NAME}_FIND_REQUIRED) + IF (NOT ${_NAME}_FIND_QUIETLY) + MESSAGE(STATUS "${_msg}") + ENDIF (NOT ${_NAME}_FIND_QUIETLY) + ENDIF (${_NAME}_FIND_REQUIRED) +ENDMACRO(_FPHSA_FAILURE_MESSAGE _msg) + + +# internal helper macro to generate the failure message when used in CONFIG_MODE: +MACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) + # <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found: + IF(${_NAME}_CONFIG) + _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})") + ELSE(${_NAME}_CONFIG) + # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version. + # List them all in the error message: + IF(${_NAME}_CONSIDERED_CONFIGS) + SET(configsText "") + LIST(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount) + MATH(EXPR configsCount "${configsCount} - 1") + FOREACH(currentConfigIndex RANGE ${configsCount}) + LIST(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename) + LIST(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version) + SET(configsText "${configsText} ${filename} (version ${version})\n") + ENDFOREACH(currentConfigIndex) + _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}") + + ELSE(${_NAME}_CONSIDERED_CONFIGS) + # Simple case: No Config-file was found at all: + _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}") + ENDIF(${_NAME}_CONSIDERED_CONFIGS) + ENDIF(${_NAME}_CONFIG) +ENDMACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) + + +FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) + +# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in +# new extended or in the "old" mode: + SET(options CONFIG_MODE HANDLE_COMPONENTS) + SET(oneValueArgs FAIL_MESSAGE VERSION_VAR) + SET(multiValueArgs REQUIRED_VARS) + SET(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} ) + LIST(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX) + + IF(${INDEX} EQUAL -1) + SET(FPHSA_FAIL_MESSAGE ${_FIRST_ARG}) + SET(FPHSA_REQUIRED_VARS ${ARGN}) + SET(FPHSA_VERSION_VAR) + ELSE(${INDEX} EQUAL -1) + + CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN}) + + IF(FPHSA_UNPARSED_ARGUMENTS) + MESSAGE(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"") + ENDIF(FPHSA_UNPARSED_ARGUMENTS) + + IF(NOT FPHSA_FAIL_MESSAGE) + SET(FPHSA_FAIL_MESSAGE "DEFAULT_MSG") + ENDIF(NOT FPHSA_FAIL_MESSAGE) + ENDIF(${INDEX} EQUAL -1) + +# now that we collected all arguments, process them + + IF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG") + SET(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}") + ENDIF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG") + + # In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package() + # when it successfully found the config-file, including version checking: + IF(FPHSA_CONFIG_MODE) + LIST(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG) + LIST(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS) + SET(FPHSA_VERSION_VAR ${_NAME}_VERSION) + ENDIF(FPHSA_CONFIG_MODE) + + IF(NOT FPHSA_REQUIRED_VARS) + MESSAGE(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()") + ENDIF(NOT FPHSA_REQUIRED_VARS) + + LIST(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR) + + STRING(TOUPPER ${_NAME} _NAME_UPPER) + STRING(TOLOWER ${_NAME} _NAME_LOWER) + + # collect all variables which were not found, so they can be printed, so the + # user knows better what went wrong (#6375) + SET(MISSING_VARS "") + SET(DETAILS "") + SET(${_NAME_UPPER}_FOUND TRUE) + # check if all passed variables are valid + FOREACH(_CURRENT_VAR ${FPHSA_REQUIRED_VARS}) + IF(NOT ${_CURRENT_VAR}) + SET(${_NAME_UPPER}_FOUND FALSE) + SET(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}") + ELSE(NOT ${_CURRENT_VAR}) + SET(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]") + ENDIF(NOT ${_CURRENT_VAR}) + ENDFOREACH(_CURRENT_VAR) + + # component handling + UNSET(FOUND_COMPONENTS_MSG) + UNSET(MISSING_COMPONENTS_MSG) + + IF(FPHSA_HANDLE_COMPONENTS) + FOREACH(comp ${${_NAME}_FIND_COMPONENTS}) + IF(${_NAME}_${comp}_FOUND) + + IF(NOT DEFINED FOUND_COMPONENTS_MSG) + SET(FOUND_COMPONENTS_MSG "found components: ") + ENDIF() + SET(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}") + + ELSE() + + IF(NOT DEFINED MISSING_COMPONENTS_MSG) + SET(MISSING_COMPONENTS_MSG "missing components: ") + ENDIF() + SET(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}") + + IF(${_NAME}_FIND_REQUIRED_${comp}) + SET(${_NAME_UPPER}_FOUND FALSE) + SET(MISSING_VARS "${MISSING_VARS} ${comp}") + ENDIF() + + ENDIF() + ENDFOREACH(comp) + SET(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}") + SET(DETAILS "${DETAILS}[c${COMPONENT_MSG}]") + ENDIF(FPHSA_HANDLE_COMPONENTS) + + # version handling: + SET(VERSION_MSG "") + SET(VERSION_OK TRUE) + SET(VERSION ${${FPHSA_VERSION_VAR}} ) + IF (${_NAME}_FIND_VERSION) + + IF(VERSION) + + IF(${_NAME}_FIND_VERSION_EXACT) # exact version required + IF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}") + SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"") + SET(VERSION_OK FALSE) + ELSE (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}") + SET(VERSION_MSG "(found suitable exact version \"${VERSION}\")") + ENDIF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}") + + ELSE(${_NAME}_FIND_VERSION_EXACT) # minimum version specified: + IF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}") + SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"") + SET(VERSION_OK FALSE) + ELSE ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}") + SET(VERSION_MSG "(found suitable version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")") + ENDIF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}") + ENDIF(${_NAME}_FIND_VERSION_EXACT) + + ELSE(VERSION) + + # if the package was not found, but a version was given, add that to the output: + IF(${_NAME}_FIND_VERSION_EXACT) + SET(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")") + ELSE(${_NAME}_FIND_VERSION_EXACT) + SET(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")") + ENDIF(${_NAME}_FIND_VERSION_EXACT) + + ENDIF(VERSION) + ELSE (${_NAME}_FIND_VERSION) + IF(VERSION) + SET(VERSION_MSG "(found version \"${VERSION}\")") + ENDIF(VERSION) + ENDIF (${_NAME}_FIND_VERSION) + + IF(VERSION_OK) + SET(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]") + ELSE(VERSION_OK) + SET(${_NAME_UPPER}_FOUND FALSE) + ENDIF(VERSION_OK) + + + # print the result: + IF (${_NAME_UPPER}_FOUND) + FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}") + ELSE (${_NAME_UPPER}_FOUND) + + IF(FPHSA_CONFIG_MODE) + _FPHSA_HANDLE_FAILURE_CONFIG_MODE() + ELSE(FPHSA_CONFIG_MODE) + IF(NOT VERSION_OK) + _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})") + ELSE(NOT VERSION_OK) + _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}") + ENDIF(NOT VERSION_OK) + ENDIF(FPHSA_CONFIG_MODE) + + ENDIF (${_NAME_UPPER}_FOUND) + + SET(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE) + +ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG) diff --git a/CMake/FindPostgreSQL.cmake b/CMake/FindPostgreSQL.cmake new file mode 100644 index 00000000000..96b67411224 --- /dev/null +++ b/CMake/FindPostgreSQL.cmake @@ -0,0 +1,179 @@ +# - Find the PostgreSQL installation. +# Usage: +# In your CMakeLists.txt file do something like this: +# ... +# # PostgreSQL +# FIND_PACKAGE(PostgreSQL) +# ... +# if( PostgreSQL_FOUND ) +# include_directories(${PostgreSQL_INCLUDE_DIRS}) +# link_directories(${PostgreSQL_LIBRARY_DIRS}) +# endif( PostgreSQL_FOUND ) +# ... +# Remember to include ${PostgreSQL_LIBRARIES} in the target_link_libraries() statement. +# +# +# In Windows, we make the assumption that, if the PostgreSQL files are installed, the default directory +# will be C:\Program Files\PostgreSQL. +# + +#============================================================================= +# Copyright 2004-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# ---------------------------------------------------------------------------- +# History: +# This module is derived from the module originally found in the VTK source tree. +# +# ---------------------------------------------------------------------------- +# Note: +# PostgreSQL_ADDITIONAL_VERSIONS is a variable that can be used to set the +# version mumber of the implementation of PostgreSQL. +# In Windows the default installation of PostgreSQL uses that as part of the path. +# E.g C:\Program Files\PostgreSQL\8.4. +# Currently, the following version numbers are known to this module: +# "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0" +# +# To use this variable just do something like this: +# set(PostgreSQL_ADDITIONAL_VERSIONS "9.2" "8.4.4") +# before calling FIND_PACKAGE(PostgreSQL) in your CMakeLists.txt file. +# This will mean that the versions you set here will be found first in the order +# specified before the default ones are searched. +# +# ---------------------------------------------------------------------------- +# You may need to manually set: +# PostgreSQL_INCLUDE_DIR - the path to where the PostgreSQL include files are. +# PostgreSQL_LIBRARY_DIR - The path to where the PostgreSQL library files are. +# If FindPostgreSQL.cmake cannot find the include files or the library files. +# +# ---------------------------------------------------------------------------- +# The following variables are set if PostgreSQL is found: +# PostgreSQL_FOUND - Set to true when PostgreSQL is found. +# PostgreSQL_INCLUDE_DIRS - Include directories for PostgreSQL +# PostgreSQL_LIBRARY_DIRS - Link directories for PostgreSQL libraries +# PostgreSQL_LIBRARIES - The PostgreSQL libraries. +# +# ---------------------------------------------------------------------------- +# If you have installed PostgreSQL in a non-standard location. +# (Please note that in the following comments, it is assumed that <Your Path> +# points to the root directory of the include directory of PostgreSQL.) +# Then you have three options. +# 1) After CMake runs, set PostgreSQL_INCLUDE_DIR to <Your Path>/include and +# PostgreSQL_LIBRARY_DIR to wherever the library pq (or libpq in windows) is +# 2) Use CMAKE_INCLUDE_PATH to set a path to <Your Path>/PostgreSQL<-version>. This will allow find_path() +# to locate PostgreSQL_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g. In your CMakeLists.txt file +# SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "<Your Path>/include") +# 3) Set an environment variable called ${PostgreSQL_ROOT} that points to the root of where you have +# installed PostgreSQL, e.g. <Your Path>. +# +# ---------------------------------------------------------------------------- + +set(PostgreSQL_INCLUDE_PATH_DESCRIPTION "top-level directory containing the PostgreSQL include directories. E.g /usr/local/include/PostgreSQL/8.4 or C:/Program Files/PostgreSQL/8.4/include") +set(PostgreSQL_INCLUDE_DIR_MESSAGE "Set the PostgreSQL_INCLUDE_DIR cmake cache entry to the ${PostgreSQL_INCLUDE_PATH_DESCRIPTION}") +set(PostgreSQL_LIBRARY_PATH_DESCRIPTION "top-level directory containing the PostgreSQL libraries.") +set(PostgreSQL_LIBRARY_DIR_MESSAGE "Set the PostgreSQL_LIBRARY_DIR cmake cache entry to the ${PostgreSQL_LIBRARY_PATH_DESCRIPTION}") +set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to where PostgreSQL is found on the machine E.g C:/Program Files/PostgreSQL/8.4") + + +set(PostgreSQL_ROOT_DIRECTORIES $ENV{PostgreSQL_ROOT}) +if(PostgreSQL_ROOT_DIRECTORIES) + file(TO_CMAKE_PATH ${PostgreSQL_ROOT_DIRECTORIES} PostgreSQL_ROOT_DIRECTORIES) +endif(PostgreSQL_ROOT_DIRECTORIES) + +set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS} + "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0") + +# Define additional search paths for root directories. +if ( WIN32 ) + foreach (suffix ${PostgreSQL_KNOWN_VERSIONS} ) + set(PostgreSQL_ADDITIONAL_SEARCH_PATHS ${PostgreSQL_ADDITIONAL_SEARCH_PATHS} "C:/Program Files/PostgreSQL/${suffix}" ) + endforeach(suffix) +endif( WIN32 ) +set( PostgreSQL_ROOT_DIRECTORIES + ${PostgreSQL_ROOT_DIRECTORIES} + ${PostgreSQL_ROOT} + ${PostgreSQL_ADDITIONAL_SEARCH_PATHS} +) + +# +# Look for an installation. +# +find_path(PostgreSQL_INCLUDE_DIR + NAMES libpq-fe.h + PATHS + # Look in other places. + ${PostgreSQL_ROOT_DIRECTORIES} + PATH_SUFFIXES + postgresql + include + # Help the user find it if we cannot. + DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}" +) + +# The PostgreSQL library. +set (PostgreSQL_LIBRARY_TO_FIND pq) +# Setting some more prefixes for the library +set (PostgreSQL_LIB_PREFIX "") +if ( WIN32 ) + set (PostgreSQL_LIB_PREFIX ${PostgreSQL_LIB_PREFIX} "lib") + set ( PostgreSQL_LIBRARY_TO_FIND ${PostgreSQL_LIB_PREFIX}${PostgreSQL_LIBRARY_TO_FIND}) +endif() + +find_library( PostgreSQL_LIBRARY + NAMES ${PostgreSQL_LIBRARY_TO_FIND} + PATHS + ${PostgreSQL_ROOT_DIRECTORIES} + PATH_SUFFIXES + lib +) +get_filename_component(PostgreSQL_LIBRARY_DIR ${PostgreSQL_LIBRARY} PATH) + +# Did we find anything? +set( PostgreSQL_FOUND 0 ) +if ( EXISTS "${PostgreSQL_INCLUDE_DIR}" AND EXISTS "${PostgreSQL_LIBRARY_DIR}" ) + set( PostgreSQL_FOUND 1 ) +else ( EXISTS "${PostgreSQL_INCLUDE_DIR}" AND EXISTS "${PostgreSQL_LIBRARY_DIR}" ) + if ( POSTGRES_REQUIRED ) + message( FATAL_ERROR "PostgreSQL is required. ${PostgreSQL_ROOT_DIR_MESSAGE}" ) + endif ( POSTGRES_REQUIRED ) +endif (EXISTS "${PostgreSQL_INCLUDE_DIR}" AND EXISTS "${PostgreSQL_LIBRARY_DIR}" ) + +# Now try to get the include and library path. +if(PostgreSQL_FOUND) + + if(EXISTS "${PostgreSQL_INCLUDE_DIR}") + set(PostgreSQL_INCLUDE_DIRS + ${PostgreSQL_INCLUDE_DIR} + ) + endif(EXISTS "${PostgreSQL_INCLUDE_DIR}") + + if(EXISTS "${PostgreSQL_LIBRARY_DIR}") + set(PostgreSQL_LIBRARY_DIRS + ${PostgreSQL_LIBRARY_DIR} + ) + set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY_TO_FIND}) + endif(EXISTS "${PostgreSQL_LIBRARY_DIR}") + + #message("Final PostgreSQL include dir: ${PostgreSQL_INCLUDE_DIRS}") + #message("Final PostgreSQL library dir: ${PostgreSQL_LIBRARY_DIRS}") + #message("Final PostgreSQL libraries: ${PostgreSQL_LIBRARIES}") +endif(PostgreSQL_FOUND) + +if(NOT PostgreSQL_FOUND) + if(NOT PostgreSQL_FIND_QUIETLY) + message(STATUS "PostgreSQL was not found. ${PostgreSQL_DIR_MESSAGE}") + else(NOT PostgreSQL_FIND_QUIETLY) + if(PostgreSQL_FIND_REQUIRED) + message(FATAL_ERROR "PostgreSQL was not found. ${PostgreSQL_DIR_MESSAGE}") + endif(PostgreSQL_FIND_REQUIRED) + endif(NOT PostgreSQL_FIND_QUIETLY) +endif(NOT PostgreSQL_FOUND) diff --git a/CMake/GenerateExportHeader.cmake b/CMake/GenerateExportHeader.cmake new file mode 100644 index 00000000000..248e1192337 --- /dev/null +++ b/CMake/GenerateExportHeader.cmake @@ -0,0 +1,383 @@ +# - Function for generation of export macros for libraries +# This module provides the function GENERATE_EXPORT_HEADER() and the +# accompanying ADD_COMPILER_EXPORT_FLAGS() function. +# +# The GENERATE_EXPORT_HEADER function can be used to generate a file suitable +# for preprocessor inclusion which contains EXPORT macros to be used in +# library classes. +# +# GENERATE_EXPORT_HEADER( LIBRARY_TARGET +# [BASE_NAME <base_name>] +# [EXPORT_MACRO_NAME <export_macro_name>] +# [EXPORT_FILE_NAME <export_file_name>] +# [DEPRECATED_MACRO_NAME <deprecated_macro_name>] +# [NO_EXPORT_MACRO_NAME <no_export_macro_name>] +# [STATIC_DEFINE <static_define>] +# [NO_DEPRECATED_MACRO_NAME <no_deprecated_macro_name>] +# [DEFINE_NO_DEPRECATED] +# [PREFIX_NAME <prefix_name>] +# ) +# +# ADD_COMPILER_EXPORT_FLAGS( [FATAL_WARNINGS] ) +# +# By default GENERATE_EXPORT_HEADER() generates macro names in a file name +# determined by the name of the library. The ADD_COMPILER_EXPORT_FLAGS function +# adds -fvisibility=hidden to CMAKE_CXX_FLAGS if supported, and is a no-op on +# Windows which does not need extra compiler flags for exporting support. You +# may optionally pass a single argument to ADD_COMPILER_EXPORT_FLAGS that will +# be populated with the required CXX_FLAGS required to enable visibility support +# for the compiler/architecture in use. +# +# This means that in the simplest case, users of these functions will be +# equivalent to: +# +# add_compiler_export_flags() +# add_library(somelib someclass.cpp) +# generate_export_header(somelib) +# install(TARGETS somelib DESTINATION ${LIBRARY_INSTALL_DIR}) +# install(FILES +# someclass.h +# ${PROJECT_BINARY_DIR}/somelib_export.h DESTINATION ${INCLUDE_INSTALL_DIR} +# ) +# +# And in the ABI header files: +# +# #include "somelib_export.h" +# class SOMELIB_EXPORT SomeClass { +# ... +# }; +# +# The CMake fragment will generate a file in the ${CMAKE_CURRENT_BUILD_DIR} +# called somelib_export.h containing the macros SOMELIB_EXPORT, SOMELIB_NO_EXPORT, +# SOMELIB_DEPRECATED, SOMELIB_DEPRECATED_EXPORT and SOMELIB_DEPRECATED_NO_EXPORT. +# The resulting file should be installed with other headers in the library. +# Set variable <LIBRARY_TARGET>_EXPORT_CODE to specify custom content. +# +# The BASE_NAME argument can be used to override the file name and the names +# used for the macros +# +# add_library(somelib someclass.cpp) +# generate_export_header(somelib +# BASE_NAME other_name +# ) +# +# Generates a file called other_name_export.h containing the macros +# OTHER_NAME_EXPORT, OTHER_NAME_NO_EXPORT and OTHER_NAME_DEPRECATED etc. +# +# The BASE_NAME may be overridden by specifiying other options in the function. +# For example: +# +# add_library(somelib someclass.cpp) +# generate_export_header(somelib +# EXPORT_MACRO_NAME OTHER_NAME_EXPORT +# ) +# +# creates the macro OTHER_NAME_EXPORT instead of SOMELIB_EXPORT, but other macros +# and the generated file name is as default. +# +# add_library(somelib someclass.cpp) +# generate_export_header(somelib +# DEPRECATED_MACRO_NAME KDE_DEPRECATED +# ) +# +# creates the macro KDE_DEPRECATED instead of SOMELIB_DEPRECATED. +# +# If LIBRARY_TARGET is a static library, macros are defined without values. +# +# If the same sources are used to create both a shared and a static library, the +# uppercased symbol ${BASE_NAME}_STATIC_DEFINE should be used when building the +# static library +# +# add_library(shared_variant SHARED ${lib_SRCS}) +# add_library(static_variant ${lib_SRCS}) +# generate_export_header(shared_variant BASE_NAME libshared_and_static) +# set_target_properties(static_variant PROPERTIES +# COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE) +# +# This will cause the export macros to expand to nothing when building the +# static library. +# +# If DEFINE_NO_DEPRECATED is specified, then a macro ${BASE_NAME}_NO_DEPRECATED +# will be defined +# This macro can be used to remove deprecated code from preprocessor output. +# +# option(EXCLUDE_DEPRECATED "Exclude deprecated parts of the library" FALSE) +# if (EXCLUDE_DEPRECATED) +# set(NO_BUILD_DEPRECATED DEFINE_NO_DEPRECATED) +# endif() +# generate_export_header(somelib ${NO_BUILD_DEPRECATED}) +# +# And then in somelib: +# +# class SOMELIB_EXPORT SomeClass +# { +# public: +# #ifndef SOMELIB_NO_DEPRECATED +# SOMELIB_DEPRECATED void oldMethod(); +# #endif +# }; +# +# #ifndef SOMELIB_NO_DEPRECATED +# void SomeClass::oldMethod() { } +# #endif +# +# If PREFIX_NAME is specified, the argument will be used as a prefix to all +# generated macros. +# +# For example: +# +# generate_export_header(somelib PREFIX_NAME VTK_) +# +# Generates the macros VTK_SOMELIB_EXPORT etc. + +#============================================================================= +# Copyright 2011 Stephen Kelly <steveire@gmail.com> +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +include(CMakeParseArguments) +include(CheckCXXCompilerFlag) + +# TODO: Install this macro separately? +macro(_check_cxx_compiler_attribute _ATTRIBUTE _RESULT) + check_cxx_source_compiles("${_ATTRIBUTE} int somefunc() { return 0; } + int main() { return somefunc();}" ${_RESULT} + # Some compilers do not fail with a bad flag + FAIL_REGEX "unrecognized .*option" # GNU + FAIL_REGEX "ignoring unknown option" # MSVC + FAIL_REGEX "warning D9002" # MSVC, any lang + FAIL_REGEX "[Uu]nknown option" # HP + FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro + FAIL_REGEX "command option .* is not recognized" # XL + ) +endmacro() + +macro(_test_compiler_hidden_visibility) + + if(CMAKE_COMPILER_IS_GNUCXX) + exec_program(${CMAKE_C_COMPILER} ARGS --version + OUTPUT_VARIABLE _gcc_version_info) + string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]" + _gcc_version "${_gcc_version_info}") + # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the + # patch level, handle this here: + if(NOT _gcc_version) + string(REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" + _gcc_version "${_gcc_version_info}") + endif() + + if(${_gcc_version} VERSION_LESS "4.2") + set(GCC_TOO_OLD TRUE) + message(WARNING "GCC version older than 4.2") + endif() + endif() + + if(CMAKE_CXX_COMPILER_ID MATCHES Intel) + exec_program(${CMAKE_CXX_COMPILER} ARGS -V + OUTPUT_VARIABLE _intel_version_info) + string(REGEX REPLACE ".*Version ([0-9]+(\\.[0-9]+)+).*" "\\1" + _intel_version "${_intel_version_info}") + + if(${_intel_version} VERSION_LESS "12.0") + set(_INTEL_TOO_OLD TRUE) + message(WARNING "Intel compiler older than 12.0") + endif() + endif() + + + # Exclude XL here because it misinterprets -fvisibility=hidden even though + # the check_cxx_compiler_flag passes + # http://www.cdash.org/CDash/testDetails.php?test=109109951&build=1419259 + if(NOT GCC_TOO_OLD + AND NOT _INTEL_TOO_OLD + AND NOT WIN32 + AND NOT CYGWIN + AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES XL + AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES PGI + AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES Watcom) + check_cxx_compiler_flag(-fvisibility=hidden COMPILER_HAS_HIDDEN_VISIBILITY) + check_cxx_compiler_flag(-fvisibility-inlines-hidden + COMPILER_HAS_HIDDEN_INLINE_VISIBILITY) + option(USE_COMPILER_HIDDEN_VISIBILITY + "Use HIDDEN visibility support if available." ON) + mark_as_advanced(USE_COMPILER_HIDDEN_VISIBILITY) + endif() +endmacro() + +macro(_test_compiler_has_deprecated) + if("${CMAKE_CXX_COMPILER_ID}" MATCHES Borland + OR "${CMAKE_CXX_COMPILER_ID}" MATCHES HP + OR GCC_TOO_OLD + OR "${CMAKE_CXX_COMPILER_ID}" MATCHES PGI + OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Watcom) + set(COMPILER_HAS_DEPRECATED "" CACHE INTERNAL + "Compiler support for a deprecated attribute") + else() + _check_cxx_compiler_attribute("__attribute__((__deprecated__))" + COMPILER_HAS_DEPRECATED_ATTR) + if(COMPILER_HAS_DEPRECATED_ATTR) + set(COMPILER_HAS_DEPRECATED "${COMPILER_HAS_DEPRECATED_ATTR}" + CACHE INTERNAL "Compiler support for a deprecated attribute") + else() + _check_cxx_compiler_attribute("__declspec(deprecated)" + COMPILER_HAS_DEPRECATED) + endif() + endif() +endmacro() + +get_filename_component(_GENERATE_EXPORT_HEADER_MODULE_DIR + "${CMAKE_CURRENT_LIST_FILE}" PATH) + +macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY) + set(DEFINE_DEPRECATED) + set(DEFINE_EXPORT) + set(DEFINE_IMPORT) + set(DEFINE_NO_EXPORT) + + if (COMPILER_HAS_DEPRECATED_ATTR) + set(DEFINE_DEPRECATED "__attribute__ ((__deprecated__))") + elseif(COMPILER_HAS_DEPRECATED) + set(DEFINE_DEPRECATED "__declspec(deprecated)") + endif() + + get_property(type TARGET ${TARGET_LIBRARY} PROPERTY TYPE) + + if(NOT ${type} STREQUAL "STATIC_LIBRARY") + if(WIN32) + set(DEFINE_EXPORT "__declspec(dllexport)") + set(DEFINE_IMPORT "__declspec(dllimport)") + elseif(COMPILER_HAS_HIDDEN_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY) + set(DEFINE_EXPORT "__attribute__((visibility(\"default\")))") + set(DEFINE_IMPORT "__attribute__((visibility(\"default\")))") + set(DEFINE_NO_EXPORT "__attribute__((visibility(\"hidden\")))") + endif() + endif() +endmacro() + +macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY) + # Option overrides + set(options DEFINE_NO_DEPRECATED) + set(oneValueArgs PREFIX_NAME BASE_NAME EXPORT_MACRO_NAME EXPORT_FILE_NAME + DEPRECATED_MACRO_NAME NO_EXPORT_MACRO_NAME STATIC_DEFINE + NO_DEPRECATED_MACRO_NAME) + set(multiValueArgs) + + cmake_parse_arguments(_GEH "${options}" "${oneValueArgs}" "${multiValueArgs}" + ${ARGN}) + + set(BASE_NAME "${TARGET_LIBRARY}") + + if(_GEH_BASE_NAME) + set(BASE_NAME ${_GEH_BASE_NAME}) + endif() + + string(TOUPPER ${BASE_NAME} BASE_NAME_UPPER) + string(TOLOWER ${BASE_NAME} BASE_NAME_LOWER) + + # Default options + set(EXPORT_MACRO_NAME "${_GEH_PREFIX_NAME}${BASE_NAME_UPPER}_EXPORT") + set(NO_EXPORT_MACRO_NAME "${_GEH_PREFIX_NAME}${BASE_NAME_UPPER}_NO_EXPORT") + set(EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/${BASE_NAME_LOWER}_export.h") + set(DEPRECATED_MACRO_NAME "${_GEH_PREFIX_NAME}${BASE_NAME_UPPER}_DEPRECATED") + set(STATIC_DEFINE "${_GEH_PREFIX_NAME}${BASE_NAME_UPPER}_STATIC_DEFINE") + set(NO_DEPRECATED_MACRO_NAME + "${_GEH_PREFIX_NAME}${BASE_NAME_UPPER}_NO_DEPRECATED") + + if(_GEH_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown keywords given to GENERATE_EXPORT_HEADER(): \"${_GEH_UNPARSED_ARGUMENTS}\"") + endif() + + if(_GEH_EXPORT_MACRO_NAME) + set(EXPORT_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_EXPORT_MACRO_NAME}) + endif() + if(_GEH_EXPORT_FILE_NAME) + if(IS_ABSOLUTE _GEH_EXPORT_FILE_NAME) + set(EXPORT_FILE_NAME ${_GEH_EXPORT_FILE_NAME}) + else() + set(EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/${_GEH_EXPORT_FILE_NAME}") + endif() + endif() + if(_GEH_DEPRECATED_MACRO_NAME) + set(DEPRECATED_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_DEPRECATED_MACRO_NAME}) + endif() + if(_GEH_NO_EXPORT_MACRO_NAME) + set(NO_EXPORT_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_NO_EXPORT_MACRO_NAME}) + endif() + if(_GEH_STATIC_DEFINE) + set(STATIC_DEFINE ${_GEH_PREFIX_NAME}${_GEH_STATIC_DEFINE}) + endif() + if(DEFINED ${TARGET_LIBRARY}_EXPORT_CODE) + set(EXPORT_CODE "${${TARGET_LIBRARY}_EXPORT_CODE}") + else() + set(EXPORT_CODE "") + endif() + + if(_GEH_DEFINE_NO_DEPRECATED) + set(DEFINE_NO_DEPRECATED TRUE) + endif() + + if(_GEH_NO_DEPRECATED_MACRO_NAME) + set(NO_DEPRECATED_MACRO_NAME + ${_GEH_PREFIX_NAME}${_GEH_NO_DEPRECATED_MACRO_NAME}) + endif() + + set(INCLUDE_GUARD_NAME "${EXPORT_MACRO_NAME}_H") + + get_target_property(EXPORT_IMPORT_CONDITION ${TARGET_LIBRARY} DEFINE_SYMBOL) + + if(NOT EXPORT_IMPORT_CONDITION) + set(EXPORT_IMPORT_CONDITION ${TARGET_LIBRARY}_EXPORTS) + endif() + + configure_file("${_GENERATE_EXPORT_HEADER_MODULE_DIR}/exportheader.cmake.in" + "${EXPORT_FILE_NAME}" @ONLY) +endmacro() + +function(GENERATE_EXPORT_HEADER TARGET_LIBRARY) + get_property(type TARGET ${TARGET_LIBRARY} PROPERTY TYPE) + if(${type} STREQUAL "MODULE") + message(WARNING "This macro should not be used with libraries of type MODULE") + return() + endif() + if(NOT ${type} STREQUAL "STATIC_LIBRARY" AND NOT ${type} STREQUAL "SHARED_LIBRARY") + message(WARNING "This macro can only be used with libraries") + return() + endif() + _test_compiler_hidden_visibility() + _test_compiler_has_deprecated() + _do_set_macro_values(${TARGET_LIBRARY}) + _do_generate_export_header(${TARGET_LIBRARY} ${ARGN}) +endfunction() + +function(add_compiler_export_flags) + + _test_compiler_hidden_visibility() + _test_compiler_has_deprecated() + + if(NOT (USE_COMPILER_HIDDEN_VISIBILITY AND COMPILER_HAS_HIDDEN_VISIBILITY)) + # Just return if there are no flags to add. + return() + endif() + + set (EXTRA_FLAGS "-fvisibility=hidden") + + if(COMPILER_HAS_HIDDEN_INLINE_VISIBILITY) + set (EXTRA_FLAGS "${EXTRA_FLAGS} -fvisibility-inlines-hidden") + endif() + + # Either return the extra flags needed in the supplied argument, or to the + # CMAKE_CXX_FLAGS if no argument is supplied. + if(ARGV0) + set(${ARGV0} "${EXTRA_FLAGS}" PARENT_SCOPE) + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS}" PARENT_SCOPE) + endif() +endfunction() diff --git a/CMake/TopologicalSort.cmake b/CMake/TopologicalSort.cmake new file mode 100644 index 00000000000..e2eef66d8e1 --- /dev/null +++ b/CMake/TopologicalSort.cmake @@ -0,0 +1,140 @@ +# Perform a reverse topological sort on the given LIST. +# +# topological_sort(my_list "MY_" "_EDGES") +# +# LIST is the name of a variable containing a list of elements to be +# sorted in reverse topological order. Each element in the list has a +# set of outgoing edges (for example, those other list elements that +# it depends on). In the resulting reverse topological ordering +# (written back into the variable named LIST), an element will come +# later in the list than any of the elements that can be reached by +# following its outgoing edges and the outgoing edges of any vertices +# they target, recursively. Thus, if the edges represent dependencies +# on build targets, for example, the reverse topological ordering is +# the order in which one would build those targets. +# +# For each element E in this list, the edges for E are contained in +# the variable named ${PREFIX}${E}${SUFFIX}. If no such variable +# exists, then it is assumed that there are no edges. For example, if +# my_list contains a, b, and c, one could provide a dependency graph +# using the following variables: +# +# MY_A_EDGES b +# MY_B_EDGES +# MY_C_EDGES a b +# +# With the involcation of topological_sort shown above and these +# variables, the resulting reverse topological ordering will be b, a, +# c. + +############################################################################## +# Modified from Boost Utilities +# +# Copyright 2010 Kitware, Inc. +############################################################################## +# Copyright 2007 Douglas Gregor <doug.gregor@gmail.com> +# Copyright 2007 Troy Straszheim +# +# Distributed under the Boost Software License, Version 1.0. +############################################################################## +# Boost Software License - Version 1.0 - August 17th, 2003 +# +# Permission is hereby granted, free of charge, to any person or organization +# obtaining a copy of the software and accompanying documentation covered by +# this license (the "Software") to use, reproduce, display, distribute, +# execute, and transmit the Software, and to prepare derivative works of the +# Software, and to permit third-parties to whom the Software is furnished to +# do so, all subject to the following: +# +# The copyright notices in the Software and this entire statement, including +# the above license grant, this restriction and the following disclaimer, +# must be included in all copies of the Software, in whole or in part, and +# all derivative works of the Software, unless such copies or derivative +# works are solely in the form of machine-executable object code generated by +# a source language processor. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +############################################################################## + +function(topological_sort LIST PREFIX SUFFIX) + # Clear the stack and output variable + set(VERTICES "${${LIST}}") + set(STACK) + set(${LIST}) + + # Loop over all of the vertices, starting the topological sort from + # each one. + foreach(VERTEX ${VERTICES}) + + # If we haven't already processed this vertex, start a depth-first + # search from where. + if (NOT FOUND_${VERTEX}) + # Push this vertex onto the stack with all of its outgoing edges + string(REPLACE ";" " " NEW_ELEMENT + "${VERTEX};${${PREFIX}${VERTEX}${SUFFIX}}") + list(APPEND STACK ${NEW_ELEMENT}) + + # We've now seen this vertex + set(FOUND_${VERTEX} TRUE) + + # While the depth-first search stack is not empty + list(LENGTH STACK STACK_LENGTH) + while(STACK_LENGTH GREATER 0) + # Remove the vertex and its remaining out-edges from the top + # of the stack + list(GET STACK -1 OUT_EDGES) + list(REMOVE_AT STACK -1) + + # Get the source vertex and the list of out-edges + separate_arguments(OUT_EDGES) + list(GET OUT_EDGES 0 SOURCE) + list(REMOVE_AT OUT_EDGES 0) + + # While there are still out-edges remaining + list(LENGTH OUT_EDGES OUT_DEGREE) + while (OUT_DEGREE GREATER 0) + # Pull off the first outgoing edge + list(GET OUT_EDGES 0 TARGET) + list(REMOVE_AT OUT_EDGES 0) + + if (NOT FOUND_${TARGET}) + # We have not seen the target before, so we will traverse + # its outgoing edges before coming back to our + # source. This is the key to the depth-first traversal. + + # We've now seen this vertex + set(FOUND_${TARGET} TRUE) + + # Push the remaining edges for the current vertex onto the + # stack + string(REPLACE ";" " " NEW_ELEMENT + "${SOURCE};${OUT_EDGES}") + list(APPEND STACK ${NEW_ELEMENT}) + + # Setup the new source and outgoing edges + set(SOURCE ${TARGET}) + set(OUT_EDGES + ${${PREFIX}${SOURCE}${SUFFIX}}) + endif(NOT FOUND_${TARGET}) + + list(LENGTH OUT_EDGES OUT_DEGREE) + endwhile (OUT_DEGREE GREATER 0) + + # We have finished all of the outgoing edges for + # SOURCE; add it to the resulting list. + list(APPEND ${LIST} ${SOURCE}) + + # Check the length of the stack + list(LENGTH STACK STACK_LENGTH) + endwhile(STACK_LENGTH GREATER 0) + endif (NOT FOUND_${VERTEX}) + endforeach(VERTEX) + + set(${LIST} ${${LIST}} PARENT_SCOPE) +endfunction(topological_sort) diff --git a/CMake/UseVTK.cmake b/CMake/UseVTK.cmake new file mode 100644 index 00000000000..1aa2c7cef74 --- /dev/null +++ b/CMake/UseVTK.cmake @@ -0,0 +1,29 @@ + +# This file sets up include directories, link directories, and +# compiler settings for a project to use VTK. It should not be +# included directly, but rather through the VTK_USE_FILE setting +# obtained from VTKConfig.cmake. + +if(VTK_USE_FILE_INCLUDED) + return() +endif() +set(VTK_USE_FILE_INCLUDED 1) + +# Update CMAKE_MODULE_PATH so includes work. +list(APPEND CMAKE_MODULE_PATH ${VTK_CMAKE_DIR}) + +# Add compiler flags needed to use VTK. +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VTK_REQUIRED_C_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VTK_REQUIRED_CXX_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${VTK_REQUIRED_EXE_LINKER_FLAGS}") +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${VTK_REQUIRED_SHARED_LINKER_FLAGS}") +set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${VTK_REQUIRED_MODULE_LINKER_FLAGS}") + +# Add preprocessor definitions needed to use VTK. +set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${VTK_DEFINITIONS}) + +# Add include directories needed to use VTK. +include_directories(${VTK_INCLUDE_DIRS}) + +# Add link directories needed to use VTK. +link_directories(${VTK_LIBRARY_DIRS}) diff --git a/CMake/VTKConfig.cmake.in b/CMake/VTKConfig.cmake.in new file mode 100644 index 00000000000..5495206d250 --- /dev/null +++ b/CMake/VTKConfig.cmake.in @@ -0,0 +1,84 @@ +#----------------------------------------------------------------------------- +# +# VTKConfig.cmake - VTK CMake configuration file for external projects. +# +# This file is configured by VTK and used by the UseVTK.cmake module +# to load VTK's settings for an external project. +@VTK_CONFIG_CODE@ + +# The C and C++ flags added by VTK to the cmake-configured flags. +SET(VTK_REQUIRED_C_FLAGS "@VTK_REQUIRED_C_FLAGS@") +SET(VTK_REQUIRED_CXX_FLAGS "@VTK_REQUIRED_CXX_FLAGS@") +SET(VTK_REQUIRED_EXE_LINKER_FLAGS "@VTK_REQUIRED_EXE_LINKER_FLAGS@") +SET(VTK_REQUIRED_SHARED_LINKER_FLAGS "@VTK_REQUIRED_SHARED_LINKER_FLAGS@") +SET(VTK_REQUIRED_MODULE_LINKER_FLAGS "@VTK_REQUIRED_MODULE_LINKER_FLAGS@") + +# The VTK version number +SET(VTK_MAJOR_VERSION "@VTK_MAJOR_VERSION@") +SET(VTK_MINOR_VERSION "@VTK_MINOR_VERSION@") +SET(VTK_BUILD_VERSION "@VTK_BUILD_VERSION@") + +# The location of the UseVTK.cmake file. +SET(VTK_CMAKE_DIR "@VTK_CONFIG_CMAKE_DIR@") +SET(VTK_USE_FILE "${VTK_CMAKE_DIR}/UseVTK.cmake") + +#----------------------------------------------------------------------------- +# Load requested modules. + +# List of available VTK modules. +set(VTK_MODULES_ENABLED "@VTK_CONFIG_MODULES_ENABLED@") + +# Import VTK targets. +set(VTK_CONFIG_TARGETS_FILE "@VTK_CONFIG_TARGETS_FILE@") +if(NOT VTK_TARGETS_IMPORTED@VTK_CONFIG_TARGETS_CONDITION@) + set(VTK_TARGETS_IMPORTED 1) + include("${VTK_CONFIG_TARGETS_FILE}") +endif() + +# Load module interface macros. +include("@VTK_CONFIG_MODULE_API_FILE@") + +# Compute set of requested modules. +if(VTK_FIND_COMPONENTS) + # Specific modules requested by find_package(VTK). + set(VTK_MODULES_REQUESTED "${VTK_FIND_COMPONENTS}") +elseif(NOT "${CMAKE_VERSION}" VERSION_GREATER 2.8.4.20110407) + # CMake 2.8.4 and lower do not forward the components list through + # their FindVTK.cmake module, so unless the application called + # + # find_package(VTK NO_MODULE ...) + # + # then only the per-component variables VTK_FIND_REQUIRED_<mod> will + # have leaked through. + set(VTK_MODULES_REQUESTED "") + get_cmake_property(_vars VARIABLES) + foreach(v IN LISTS _vars) + if("x${v}" MATCHES "^xVTK_FIND_REQUIRED_" AND ${v}) + string(REGEX REPLACE "^VTK_FIND_REQUIRED_" "" _mod "${v}") + list(APPEND VTK_MODULES_REQUESTED ${_mod}) + endif() + endforeach() +endif() +if(NOT VTK_MODULES_REQUESTED) + # No specific modules requested. Use all of them. + set(VTK_MODULES_REQUESTED "${VTK_MODULES_ENABLED}") +endif() + +# Load requested modules and their dependencies into variables: +# VTK_DEFINITIONS = Preprocessor definitions +# VTK_LIBRARIES = Libraries to link +# VTK_INCLUDE_DIRS = Header file search path +# VTK_LIBRARY_DIRS = Library search path (for outside dependencies) +vtk_module_config(VTK ${VTK_MODULES_REQUESTED}) + +#----------------------------------------------------------------------------- + +# VTK global configuration options. +SET(VTK_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@") +SET(VTK_LEGACY_REMOVE "@VTK_LEGACY_REMOVE@") +SET(VTK_LEGACY_SILENT "@VTK_LEGACY_SILENT@") + +# Do not add options or information here that is specific to a +# particular module. Instead set <module>_EXPORT_OPTIONS and/or +# <module>_EXPORT_CODE_BUILD and <module>_EXPORT_CODE_INSTALL +# at the top of the module CMakeLists.txt file. diff --git a/CMake/exportheader.cmake.in b/CMake/exportheader.cmake.in new file mode 100644 index 00000000000..e7ea9c4491f --- /dev/null +++ b/CMake/exportheader.cmake.in @@ -0,0 +1,37 @@ + +#ifndef @INCLUDE_GUARD_NAME@ +#define @INCLUDE_GUARD_NAME@ + +#ifdef @STATIC_DEFINE@ +# define @EXPORT_MACRO_NAME@ +# define @NO_EXPORT_MACRO_NAME@ +#else +# ifndef @EXPORT_MACRO_NAME@ +# ifdef @EXPORT_IMPORT_CONDITION@ + /* We are building this library */ +# define @EXPORT_MACRO_NAME@ @DEFINE_EXPORT@ +# else + /* We are using this library */ +# define @EXPORT_MACRO_NAME@ @DEFINE_IMPORT@ +# endif +# endif + +# ifndef @NO_EXPORT_MACRO_NAME@ +# define @NO_EXPORT_MACRO_NAME@ @DEFINE_NO_EXPORT@ +# endif +#endif + +#ifndef @DEPRECATED_MACRO_NAME@ +# define @DEPRECATED_MACRO_NAME@ @DEFINE_DEPRECATED@ +# define @DEPRECATED_MACRO_NAME@_EXPORT @EXPORT_MACRO_NAME@ @DEFINE_DEPRECATED@ +# define @DEPRECATED_MACRO_NAME@_NO_EXPORT @NO_EXPORT_MACRO_NAME@ @DEFINE_DEPRECATED@ +#endif + +#cmakedefine01 DEFINE_NO_DEPRECATED +#if DEFINE_NO_DEPRECATED +# define @NO_DEPRECATED_MACRO_NAME@ +#endif + +@EXPORT_CODE@ + +#endif diff --git a/CMake/vtkBuildPath.cmake b/CMake/vtkBuildPath.cmake new file mode 100644 index 00000000000..4460e8fe3cb --- /dev/null +++ b/CMake/vtkBuildPath.cmake @@ -0,0 +1,36 @@ +# Attempt to build up the path/ld_library_path/python path needed to run VTK. +# On Windows simply executing the .bat file should be enough, on Linux/Mac the +# file can be sourced in the shell. You can also copy and paste the relevant +# parts into other files if preferred. +# +# Note: on Windows Debug and Release are added, if another build type is +# used, it would need to be added to the PATH too. + +set(VTK_PYTHONPATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") + +if(WIN32) + list(APPEND VTK_PYTHONPATH + "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/Debug" + "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/Release") +endif() + +set(VTK_LIBRARY_PATH + "${VTK_PYTHONPATH}") + +if(WIN32) + file(WRITE "${VTK_BINARY_DIR}/windows_path.bat" + "set PATH=${VTK_LIBRARY_PATH};%PATH% + set PYTHONPATH=${VTK_PYTHONPATH};%PYTHONPATH%") +elseif(UNIX) + # Replace the semicolons with colons for Unix operating systems + string(REPLACE ";" ":" VTK_LIBRARY_PATH "${VTK_LIBRARY_PATH}") + string(REPLACE ";" ":" VTK_PYTHONPATH "${VTK_PYTHONPATH}") + if(APPLE) + set(DYLD "DYLD") + else() + set(DYLD "LD") + endif() + file(WRITE "${VTK_BINARY_DIR}/unix_path.sh" + "export ${DYLD}_LIBRARY_PATH=${VTK_LIBRARY_PATH}:\${${DYLD}_LIBRARY_PATH} + export PYTHONPATH=${VTK_PYTHONPATH}:\${PYTHONPATH}\n") +endif() diff --git a/CMake/vtkCompilerExtras.cmake b/CMake/vtkCompilerExtras.cmake index 6811ac2597c..39ff9527d2f 100644 --- a/CMake/vtkCompilerExtras.cmake +++ b/CMake/vtkCompilerExtras.cmake @@ -13,28 +13,28 @@ if(CMAKE_COMPILER_IS_GNUCXX) endif() # If we are compiling on Linux then set some extra linker flags too - if(CMAKE_SYSTEM_NAME MATCHES Linux) - # set(CMAKE_SHARED_LINKER_FLAGS - # "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}") - # set(CMAKE_MODULE_LINKER_FLAGS - # "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}") - # set (CMAKE_EXE_LINKER_FLAGS - # "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}") + if(CMAKE_SYSTEM_NAME MATCHES Linux) + set(CMAKE_SHARED_LINKER_FLAGS + "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}") + set(CMAKE_MODULE_LINKER_FLAGS + "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}") + set (CMAKE_EXE_LINKER_FLAGS + "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}") endif() # Now check if we can use visibility to selectively export symbols exec_program(${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info) - string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]" + string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}") if(NOT _gcc_version) - string (REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" + string (REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" _gcc_version "${_gcc_version_info}") endif() - + # GCC visibility support, on by default and in testing. check_cxx_compiler_flag(-fvisibility=hidden HAVE_GCC_VISIBILITY) - option(VTK_USE_GCC_VISIBILITY "Use GCC visibility support if available." ON) + option(VTK_USE_GCC_VISIBILITY "Use GCC visibility support if available." OFF) mark_as_advanced(VTK_USE_GCC_VISIBILITY) if(${_gcc_version} VERSION_GREATER 4.2.0 AND BUILD_SHARED_LIBS diff --git a/CMake/vtkGroups.cmake b/CMake/vtkGroups.cmake new file mode 100644 index 00000000000..df95dcd1237 --- /dev/null +++ b/CMake/vtkGroups.cmake @@ -0,0 +1,38 @@ +# Default code to handle VTK module groups. The module.cmake files specify +# which groups the modules are in. We can specify some more specific +# documentation for groups in this file that will be displayed in cmake-gui and +# ccmake. + +# The StandAlone group is a special group of all modules that need no external +# dependencies, such as Boost, MPI, etc. It does include those that use OpenGL +# and the ones that rely in third party libraries VTK can build (by default). +set(VTK_Group_StandAlone_DOCS "Request building of all stand alone modules (no external dependencies required)") + +foreach(group ${VTK_GROUPS}) + message(STATUS "Group ${group} modules: ${VTK_GROUP_${group}_MODULES}") + # Set the default group option - Rendering ON, and all others OFF. + if(${group} MATCHES "^Rendering") + set(_default ON) + else() + set(_default OFF) + endif() + # Is there any custom documentation for the group? + if(VTK_Group_${group}_DOCS) + set(_group_docs ${VTK_Group_${group}_DOCS}) + else() + set(_group_docs "Request building ${group} modules") + endif() + option(VTK_Group_${group} "${_group_docs}" ${_default}) + # Now iterate through the modules, and request those that are depended on. + if(VTK_Group_${group}) + foreach(module ${VTK_GROUP_${group}_MODULES}) + list(APPEND VTK_MODULE_${module}_REQUEST_BY VTK_Group_${group}) + endforeach() + endif() + # Hide the group options if building all modules. + if(VTK_BUILD_ALL_MODULES) + set_property(CACHE VTK_Group_${group} PROPERTY TYPE INTERNAL) + else() + set_property(CACHE VTK_Group_${group} PROPERTY TYPE BOOL) + endif() +endforeach() diff --git a/CMake/vtkJavaWrapping.cmake b/CMake/vtkJavaWrapping.cmake new file mode 100644 index 00000000000..f6fd47fde21 --- /dev/null +++ b/CMake/vtkJavaWrapping.cmake @@ -0,0 +1,68 @@ +if(VTK_WRAP_JAVA) + set(VTK_WRAP_JAVA3_INIT_DIR "${VTK_SOURCE_DIR}/Wrapping") + find_package(Java) + find_package(JNI) + include(vtkWrapJava) + + IF(JAVA_AWT_LIBRARY) + FOREACH(__java_library ${JAVA_AWT_LIBRARY}) + GET_FILENAME_COMPONENT(JAVA_LIB_DIR ${__java_library} PATH) + IF(EXISTS ${JAVA_LIB_DIR}/xawt) + LINK_DIRECTORIES(${JAVA_LIB_DIR}/xawt) + ENDIF(EXISTS ${JAVA_LIB_DIR}/xawt) + IF(EXISTS ${JAVA_LIB_DIR}/client) + LINK_DIRECTORIES(${JAVA_LIB_DIR}/client) + ENDIF(EXISTS ${JAVA_LIB_DIR}/client) + IF(EXISTS ${JAVA_LIB_DIR}/server) + LINK_DIRECTORIES(${JAVA_LIB_DIR}/server) + ENDIF(EXISTS ${JAVA_LIB_DIR}/server) + ENDFOREACH(__java_library) + ENDIF(JAVA_AWT_LIBRARY) + + include_directories( + ${JAVA_INCLUDE_PATH} + ${JAVA_INCLUDE_PATH2} + ) +endif() + +function(vtk_add_java_wrapping module_name module_srcs) + + string(REGEX REPLACE "^vtk" "" wrap_name "${module_name}") + # FIXME: These must be here for now, should be fixed in the wrap hierarchy stuff + set(KIT_HIERARCHY_FILE ${CMAKE_CURRENT_BINARY_DIR}/${module_name}Hierarchy.txt) + + vtk_wrap_java3(vtk${wrap_name}Java ModuleJava_SRCS "${module_srcs};${Kit_JAVA_EXTRA_WRAP_SRCS}") + + add_library(vtk${wrap_name}Java SHARED ${ModuleJava_SRCS} ${Kit_JAVA_EXTRA_SRCS}) + # Force JavaClasses to build in the right order by adding a depenency. + add_dependencies(vtk${wrap_name}JavaJavaClasses vtk${wrap_name}Java) + if(VTK_MODULE_${module_name}_IMPLEMENTS) + set_property(TARGET ${module_name}Java PROPERTY COMPILE_DEFINITIONS + "${module_name}_AUTOINIT=1(${module_name})") + endif() + + target_link_libraries(vtk${wrap_name}Java ${module_name} vtkWrappingJavaCore) + include_directories(${vtkWrappingJavaCore_SOURCE_DIR} + ${vtkWrappingJavaCore_BINARY_DIR} + ) + + # Do we need to link to AWT? + if(${module_name} STREQUAL "vtkRenderingCore") + target_link_libraries(vtk${wrap_name}Java ${JAVA_AWT_LIBRARY}) + endif() + + foreach(dep ${VTK_MODULE_${module_name}_DEPENDS}) + if(NOT VTK_MODULE_${dep}_EXCLUDE_FROM_WRAPPING) + target_link_libraries(vtk${wrap_name}Java ${dep}Java) + endif() + endforeach() + + IF(NOT VTK_INSTALL_NO_LIBRARIES) + INSTALL(TARGETS vtk${wrap_name}Java + EXPORT ${VTK_INSTALL_EXPORT_NAME} + RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries + LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries + ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) + ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) + add_dependencies(vtk${wrap_name}Java vtk${wrap_name}) +endfunction() diff --git a/CMake/vtkModuleAPI.cmake b/CMake/vtkModuleAPI.cmake new file mode 100644 index 00000000000..5390bd970ca --- /dev/null +++ b/CMake/vtkModuleAPI.cmake @@ -0,0 +1,90 @@ + + +#----------------------------------------------------------------------------- +# Private helper macros. + +macro(_vtk_module_config_recurse ns mod) + if(NOT _${ns}_${dep}_USED) + set(_${ns}_${mod}_USED 1) + vtk_module_load("${mod}") + list(APPEND ${ns}_LIBRARIES ${${mod}_LIBRARIES}) + list(APPEND ${ns}_INCLUDE_DIRS ${${mod}_INCLUDE_DIRS}) + list(APPEND ${ns}_LIBRARY_DIRS ${${mod}_LIBRARY_DIRS}) + foreach(iface IN LISTS ${mod}_IMPLEMENTS) + list(APPEND _${ns}_AUTOINIT_${iface} ${mod}) + list(APPEND _${ns}_AUTOINIT ${iface}) + endforeach() + foreach(dep IN LISTS ${mod}_DEPENDS) + _vtk_module_config_recurse("${ns}" "${dep}") + endforeach() + endif() +endmacro() + +#----------------------------------------------------------------------------- +# Public interface macros. + +# vtk_module_load(<module>) +# +# Loads variables describing the given module: +# <module>_LOADED = True if the module has been loaded +# <module>_DEPENDS = List of dependencies on other modules +# <module>_LIBRARIES = Libraries to link +# <module>_INCLUDE_DIRS = Header search path +# <module>_LIBRARY_DIRS = Library search path (for outside dependencies) +macro(vtk_module_load mod) + if(NOT ${mod}_LOADED) + include("${VTK_MODULES_DIR}/${mod}.cmake" OPTIONAL) + if(NOT ${mod}_LOADED) + message(FATAL_ERROR "No such module: \"${mod}\"") + endif() + endif() +endmacro() + +# vtk_module_config(<namespace> [modules...]) +# +# Configures variables describing the given modules and their dependencies: +# <namespace>_DEFINITIONS = Preprocessor definitions +# <namespace>_LIBRARIES = Libraries to link +# <namespace>_INCLUDE_DIRS = Header search path +# <namespace>_LIBRARY_DIRS = Library search path (for outside dependencies) +# Do not name a module as the namespace. +macro(vtk_module_config ns) + set(${ns}_DEFINITIONS "") + set(${ns}_LIBRARIES "") + set(${ns}_INCLUDE_DIRS "") + set(${ns}_LIBRARY_DIRS "") + set(_${ns}_AUTOINIT "") + foreach(mod ${ARGN}) + _vtk_module_config_recurse("${ns}" "${mod}") + endforeach() + foreach(v ${ns}_LIBRARIES ${ns}_INCLUDE_DIRS ${ns}_LIBRARY_DIRS + _${ns}_AUTOINIT) + if(${v}) + list(REMOVE_DUPLICATES ${v}) + endif() + endforeach() + + list(SORT _${ns}_AUTOINIT) # Deterministic order. + foreach(mod ${_${ns}_AUTOINIT}) + list(SORT _${ns}_AUTOINIT_${mod}) # Deterministic order. + list(LENGTH _${ns}_AUTOINIT_${mod} _ai_len) + string(REPLACE ";" "," _ai "${_ai_len}(${_${ns}_AUTOINIT_${mod}})") + if(${_ai_len} GREATER 1 AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio") + # VS IDE project files cannot handle a comma (,) in a + # preprocessor definition value outside a quoted string. + # Generate a header file to do the definition and define + # ${mod}_INCLUDE to tell ${mod}Module.h to include it. + # Name the file after its content to guarantee uniqueness. + string(REPLACE ";" "_" _inc + "${CMAKE_BINARY_DIR}/CMakeFiles/${mod}_AUTOINIT_${_${ns}_AUTOINIT_${mod}}.h") + set(CMAKE_CONFIGURABLE_FILE_CONTENT "#define ${mod}_AUTOINIT ${_ai}") + configure_file(${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in ${_inc}) + list(APPEND ${ns}_DEFINITIONS "${mod}_INCLUDE=\"${_inc}\"") + else() + # Directly define ${mod}_AUTOINIT. + list(APPEND ${ns}_DEFINITIONS "${mod}_AUTOINIT=${_ai}") + endif() + unset(_${ns}_AUTOINIT_${mod}) + endforeach() + unset(_${ns}_AUTOINIT) +endmacro() diff --git a/CMake/vtkModuleInfo.cmake.in b/CMake/vtkModuleInfo.cmake.in new file mode 100644 index 00000000000..05cf6ca7a80 --- /dev/null +++ b/CMake/vtkModuleInfo.cmake.in @@ -0,0 +1,6 @@ +set(@vtk-module@_LOADED 1) +set(@vtk-module@_DEPENDS "@vtk-module-DEPENDS@") +set(@vtk-module@_LIBRARIES "@vtk-module-LIBRARIES@") +set(@vtk-module@_INCLUDE_DIRS "@vtk-module-INCLUDE_DIRS@") +set(@vtk-module@_LIBRARY_DIRS "@vtk-module-LIBRARY_DIRS@") +@vtk-module-EXPORT_CODE@ diff --git a/CMake/vtkModuleMacros.cmake b/CMake/vtkModuleMacros.cmake new file mode 100644 index 00000000000..ec430c7ebb6 --- /dev/null +++ b/CMake/vtkModuleMacros.cmake @@ -0,0 +1,398 @@ +get_filename_component(_VTKModuleMacros_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + +set(_VTKModuleMacros_DEFAULT_LABEL "VTKModular") + +include(${_VTKModuleMacros_DIR}/vtkModuleAPI.cmake) +include(GenerateExportHeader) +include(vtkWrapping) + +macro(vtk_module _name) + vtk_module_check_name(${_name}) + set(vtk-module ${_name}) + set(vtk-module-test ${_name}-Test) + set(_doing "") + set(VTK_MODULE_${vtk-module}_DECLARED 1) + set(VTK_MODULE_${vtk-module-test}_DECLARED 1) + set(VTK_MODULE_${vtk-module}_DEPENDS "") + set(VTK_MODULE_${vtk-module}_COMPILE_DEPENDS "") + set(VTK_MODULE_${vtk-module-test}_DEPENDS "${vtk-module}") + set(VTK_MODULE_${vtk-module}_IMPLEMENTS "") + set(VTK_MODULE_${vtk-module}_DESCRIPTION "description") + set(VTK_MODULE_${vtk-module}_EXCLUDE_FROM_ALL 0) + set(VTK_MODULE_${vtk-module}_EXCLUDE_FROM_WRAPPING 0) + foreach(arg ${ARGN}) + if("${arg}" MATCHES "^((|COMPILE_|TEST_|)DEPENDS|DESCRIPTION|IMPLEMENTS|DEFAULT|GROUPS)$") + set(_doing "${arg}") + elseif("${arg}" MATCHES "^EXCLUDE_FROM_ALL$") + set(_doing "") + set(VTK_MODULE_${vtk-module}_EXCLUDE_FROM_ALL 1) + elseif("${arg}" MATCHES "^EXCLUDE_FROM_WRAPPING$") + set(_doing "") + set(VTK_MODULE_${vtk-module}_EXCLUDE_FROM_WRAPPING 1) + elseif("${arg}" MATCHES "^[A-Z][A-Z][A-Z]$" AND + NOT "${arg}" MATCHES "^(ON|OFF|MPI)$") + set(_doing "") + message(AUTHOR_WARNING "Unknown argument [${arg}]") + elseif("${_doing}" MATCHES "^DEPENDS$") + list(APPEND VTK_MODULE_${vtk-module}_DEPENDS "${arg}") + elseif("${_doing}" MATCHES "^TEST_DEPENDS$") + list(APPEND VTK_MODULE_${vtk-module-test}_DEPENDS "${arg}") + elseif("${_doing}" MATCHES "^COMPILE_DEPENDS$") + list(APPEND VTK_MODULE_${vtk-module}_COMPILE_DEPENDS "${arg}") + elseif("${_doing}" MATCHES "^DESCRIPTION$") + set(_doing "") + set(VTK_MODULE_${vtk-module}_DESCRIPTION "${arg}") + elseif("${_doing}" MATCHES "^IMPLEMENTS$") + list(APPEND VTK_MODULE_${vtk-module}_DEPENDS "${arg}") + list(APPEND VTK_MODULE_${vtk-module}_IMPLEMENTS "${arg}") + elseif("${_doing}" MATCHES "^DEFAULT") + #message(FATAL_ERROR "Invalid argument [DEFAULT]") + # Ignore the default again - this should go once groups work. + #set(VTK_MODULE_${vtk-module}_DEFAULT "${arg}") + set(_doing "") + elseif("${_doing}" MATCHES "^GROUPS") + # Groups control larger groups of modules. + if(NOT DEFINED VTK_GROUP_${arg}_MODULES) + list(APPEND VTK_GROUPS ${arg}) + endif() + list(APPEND VTK_GROUP_${arg}_MODULES ${vtk-module}) + else() + set(_doing "") + message(AUTHOR_WARNING "Unknown argument [${arg}]") + endif() + endforeach() + list(SORT VTK_MODULE_${vtk-module}_DEPENDS) # Deterministic order. + set(VTK_MODULE_${vtk-module}_LINK_DEPENDS + "${VTK_MODULE_${vtk-module}_DEPENDS}") + list(APPEND VTK_MODULE_${vtk-module}_DEPENDS + ${VTK_MODULE_${vtk-module}_COMPILE_DEPENDS}) + unset(VTK_MODULE_${vtk-module}_COMPILE_DEPENDS) + list(SORT VTK_MODULE_${vtk-module}_DEPENDS) # Deterministic order. + list(SORT VTK_MODULE_${vtk-module-test}_DEPENDS) # Deterministic order. + list(SORT VTK_MODULE_${vtk-module}_IMPLEMENTS) # Deterministic order. +endmacro() + +macro(vtk_module_check_name _name) + if( NOT "${_name}" MATCHES "^[a-zA-Z][a-zA-Z0-9]*$") + message(FATAL_ERROR "Invalid module name: ${_name}") + endif() +endmacro() + +macro(vtk_module_impl) + include(module.cmake) # Load module meta-data + + vtk_module_config(_dep ${VTK_MODULE_${vtk-module}_DEPENDS}) + if(_dep_INCLUDE_DIRS) + include_directories(${_dep_INCLUDE_DIRS}) + endif() + if(_dep_LIBRARY_DIRS) + link_directories(${_dep_LIBRARY_DIRS}) + endif() + + if(NOT DEFINED ${vtk-module}_LIBRARIES) + set(${vtk-module}_LIBRARIES "") + foreach(dep IN LISTS VTK_MODULE_${vtk-module}_LINK_DEPENDS) + list(APPEND ${vtk-module}_LIBRARIES "${${dep}_LIBRARIES}") + endforeach() + if(${vtk-module}_LIBRARIES) + list(REMOVE_DUPLICATES ${vtk-module}_LIBRARIES) + endif() + endif() + + list(APPEND ${vtk-module}_INCLUDE_DIRS + ${${vtk-module}_BINARY_DIR} + ${${vtk-module}_SOURCE_DIR} + ) + + if(${vtk-module}_INCLUDE_DIRS) + include_directories(${${vtk-module}_INCLUDE_DIRS}) + endif() + if(${vtk-module}_SYSTEM_INCLUDE_DIRS) + include_directories(${${vtk-module}_SYSTEM_INCLUDE_DIRS}) + endif() + + if(${vtk-module}_SYSTEM_LIBRARY_DIRS) + link_directories(${${vtk-module}_SYSTEM_LIBRARY_DIRS}) + endif() + + if(${vtk-module}_THIRD_PARTY) + vtk_module_warnings_disable(C CXX) + endif() + + set(_code "") + foreach(opt ${${vtk-module}_EXPORT_OPTIONS}) + set(_code "${_code}set(${opt} \"${${opt}}\")\n") + endforeach() + if(VTK_MODULE_${vtk-module}_IMPLEMENTS) + set(_code "${_code}set(${vtk-module}_IMPLEMENTS \"${VTK_MODULE_${vtk-module}_IMPLEMENTS}\")\n") + endif() + set(vtk-module-EXPORT_CODE-build "${_code}${${vtk-module}_EXPORT_CODE_BUILD}") + set(vtk-module-EXPORT_CODE-install "${_code}${${vtk-module}_EXPORT_CODE_INSTALL}") + + set(vtk-module-DEPENDS "${VTK_MODULE_${vtk-module}_DEPENDS}") + set(vtk-module-LIBRARIES "${${vtk-module}_LIBRARIES}") + set(vtk-module-INCLUDE_DIRS-build "${${vtk-module}_INCLUDE_DIRS}") + set(vtk-module-INCLUDE_DIRS-install "\${VTK_INSTALL_PREFIX}/${VTK_INSTALL_INCLUDE_DIR}") + if(${vtk-module}_SYSTEM_INCLUDE_DIRS) + list(APPEND vtk-module-INCLUDE_DIRS-build "${${vtk-module}_SYSTEM_INCLUDE_DIRS}") + list(APPEND vtk-module-INCLUDE_DIRS-install "${${vtk-module}_SYSTEM_INCLUDE_DIRS}") + endif() + set(vtk-module-LIBRARY_DIRS "${${vtk-module}_SYSTEM_LIBRARY_DIRS}") + set(vtk-module-INCLUDE_DIRS "${vtk-module-INCLUDE_DIRS-build}") + set(vtk-module-EXPORT_CODE "${vtk-module-EXPORT_CODE-build}") + configure_file(${_VTKModuleMacros_DIR}/vtkModuleInfo.cmake.in ${VTK_MODULES_DIR}/${vtk-module}.cmake @ONLY) + set(vtk-module-INCLUDE_DIRS "${vtk-module-INCLUDE_DIRS-install}") + set(vtk-module-EXPORT_CODE "${vtk-module-EXPORT_CODE-install}") + configure_file(${_VTKModuleMacros_DIR}/vtkModuleInfo.cmake.in CMakeFiles/${vtk-module}.cmake @ONLY) + install(FILES + ${${vtk-module}_BINARY_DIR}/CMakeFiles/${vtk-module}.cmake + DESTINATION ${VTK_INSTALL_PACKAGE_DIR}/Modules + ) +endmacro() + +macro(vtk_module_test) + if(NOT vtk_module_test_called) + set(vtk_module_test_called 1) # Run once in a given scope. + include(../../module.cmake) # Load module meta-data + vtk_module_config(${vtk-module-test}-Cxx ${VTK_MODULE_${vtk-module-test}-Cxx_DEPENDS}) + if(${vtk-module-test}-Cxx_DEFINITIONS) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS + ${${vtk-module-test}-Cxx_DEFINITIONS}) + endif() + if(${vtk-module-test}-Cxx_INCLUDE_DIRS) + include_directories(${${vtk-module-test}-Cxx_INCLUDE_DIRS}) + endif() + if(${vtk-module-test}-Cxx_LIBRARY_DIRS) + link_directories(${${vtk-module-test}-Cxx_LIBRARY_DIRS}) + endif() + endif() +endmacro() + +macro(vtk_module_warnings_disable) + foreach(lang ${ARGN}) + if(MSVC) + string(REGEX REPLACE "(^| )[/-]W[0-4]( |$)" " " + CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -w") + elseif(BORLAND) + set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -w-") + else() + set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -w") + endif() + endforeach() +endmacro() + +macro(vtk_target_label _target_name) + if(vtk-module) + set(_label ${vtk-module}) + else() + set(_label ${_VTKModuleMacros_DEFAULT_LABEL}) + endif() + set_property(TARGET ${_target_name} PROPERTY LABELS ${_label}) +endmacro() + +macro(vtk_target_name _name) + set_property(TARGET ${_name} PROPERTY VERSION 1) + set_property(TARGET ${_name} PROPERTY SOVERSION 1) + if("${_name}" MATCHES "^[Vv][Tt][Kk]") + set(_vtk "") + else() + set(_vtk "vtk") + #message(AUTHOR_WARNING "Target [${_name}] does not start in 'vtk'.") + endif() + set_property(TARGET ${_name} PROPERTY OUTPUT_NAME ${_vtk}${_name}-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}) +endmacro() + +macro(vtk_target_export _name) + if(NOT VTK_INSTALL_NO_LIBRARIES) + set_property(GLOBAL APPEND PROPERTY VTK_TARGETS ${_name}) + endif() +endmacro() + +macro(vtk_target_install _name) + if(NOT VTK_INSTALL_NO_LIBRARIES) + install(TARGETS ${_name} + EXPORT ${VTK_INSTALL_EXPORT_NAME} + RUNTIME DESTINATION ${VTK_INSTALL_RUNTIME_DIR} COMPONENT RuntimeLibraries + LIBRARY DESTINATION ${VTK_INSTALL_LIBRARY_DIR} COMPONENT RuntimeLibraries + ARCHIVE DESTINATION ${VTK_INSTALL_ARCHIVE_DIR} COMPONENT Development + ) + endif() +endmacro() + +macro(vtk_target _name) + set(_install 1) + foreach(arg ${ARGN}) + if("${arg}" MATCHES "^(NO_INSTALL)$") + set(_install 0) + else() + message(FATAL_ERROR "Unknown argument [${arg}]") + endif() + endforeach() + vtk_target_name(${_name}) + vtk_target_label(${_name}) + vtk_target_export(${_name}) + if(_install) + vtk_target_install(${_name}) + endif() +endmacro() + +function(vtk_add_library name) + add_library(${name} ${ARGN} ${headers}) + vtk_target(${name}) +endfunction() + +function(vtk_add_executable name) + if(UNIX AND VTK_BUILD_FORWARDING_EXECUTABLES) + vtk_add_executable_with_forwarding(VTK_EXE_SUFFIX ${name} ${ARGN}) + set_property(GLOBAL APPEND PROPERTY VTK_TARGETS ${name}) + else() + add_executable(${name} ${ARGN}) + set_property(GLOBAL APPEND PROPERTY VTK_TARGETS ${name}) + endif() +endfunction() + +macro(vtk_module_test_executable test_exe_name) + vtk_module_test() + # No forwarding or export for test executables. + add_executable(${test_exe_name} ${ARGN}) + target_link_libraries(${test_exe_name} ${${vtk-module-test}-Cxx_LIBRARIES}) +endmacro() + +function(vtk_module_library name) + if(NOT "${name}" STREQUAL "${vtk-module}") + message(FATAL_ERROR "vtk_module_library must be invoked with module name") + endif() + + set(${vtk-module}_LIBRARIES ${vtk-module}) + vtk_module_impl() + + # Collect header files matching sources. + set(_hdrs "") + foreach(arg ${ARGN}) + get_filename_component(src "${arg}" ABSOLUTE) + string(REGEX REPLACE "\\.cxx$" ".h" hdr "${src}") + if("${hdr}" MATCHES "\\.h$") + if(EXISTS "${hdr}") + list(APPEND _hdrs "${hdr}") + endif() + endif() + endforeach() + list(APPEND _hdrs "${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}Module.h") + list(REMOVE_DUPLICATES _hdrs) + + vtk_add_library(${vtk-module} ${ARGN} ${_hdrs}) + foreach(dep IN LISTS VTK_MODULE_${vtk-module}_LINK_DEPENDS) + target_link_libraries(${vtk-module} ${${dep}_LIBRARIES}) + endforeach() + + # Generate the export macro header for symbol visibility/Windows DLL declspec + if(${vtk-module}_EXPORT_CODE) + set(${vtk-module}_EXPORT_CODE "${${vtk-module}_EXPORT_CODE}\n\n") + endif() + set(${vtk-module}_EXPORT_CODE + "${${vtk-module}_EXPORT_CODE}#if defined(${vtk-module}_INCLUDE) +# include ${vtk-module}_INCLUDE +#endif +#if defined(${vtk-module}_AUTOINIT) +# include \"vtkAutoInit.h\" +VTK_AUTOINIT(${vtk-module}) +#endif") + generate_export_header(${vtk-module} EXPORT_FILE_NAME ${vtk-module}Module.h) + add_compiler_export_flags(my_abi_flags) + set_property(TARGET ${vtk-module} APPEND + PROPERTY COMPILE_FLAGS "${VTK_ABI_CXX_FLAGS}") + + # Add the module to the list of wrapped modules if necessary + vtk_add_wrapping(${vtk-module} "${ARGN}") + + # Figure out which headers to install. + if(NOT VTK_INSTALL_NO_DEVELOPMENT AND _hdrs) + install(FILES ${_hdrs} + DESTINATION ${VTK_INSTALL_INCLUDE_DIR} + COMPONENT Development + ) + endif() +endfunction() + +macro(vtk_module_third_party _pkg) + string(TOLOWER "${_pkg}" _lower) + string(TOUPPER "${_pkg}" _upper) + + set(_includes "") + set(_libs "") + set(_nolibs 0) + set(_subdir 1) + set(_doing "") + foreach(arg ${ARGN}) + if("${arg}" MATCHES "^(LIBRARIES|INCLUDE_DIRS)$") + set(_doing "${arg}") + elseif("${arg}" MATCHES "^NO_ADD_SUBDIRECTORY$") + set(_doing "") + set(_subdir 0) + elseif("${arg}" MATCHES "^NO_LIBRARIES$") + set(_doing "") + set(_nolibs 1) + elseif("${_doing}" MATCHES "^LIBRARIES$") + list(APPEND _libs "${arg}") + elseif("${_doing}" MATCHES "^INCLUDE_DIRS$") + list(APPEND _includes "${arg}") + else() + set(_doing "") + message(AUTHOR_WARNING "Unknown argument [${arg}]") + endif() + endforeach() + if(_libs AND _nolibs) + message(FATAL_ERROR "Cannot specify both LIBRARIES and NO_LIBRARIES") + endif() + + option(VTK_USE_SYSTEM_${_upper} "Use system-installed ${_pkg}" OFF) + mark_as_advanced(VTK_USE_SYSTEM_${_upper}) + + if(VTK_USE_SYSTEM_${_upper}) + find_package(${_pkg} REQUIRED) + if(NOT ${_upper}_FOUND) + message(FATAL_ERROR "VTK_USE_SYSTEM_${_upper} is ON but ${_pkg} is not found!") + endif() + if(${_upper}_INCLUDE_DIRS) + set(vtk${_lower}_SYSTEM_INCLUDE_DIRS ${${_upper}_INCLUDE_DIRS}) + else() + set(vtk${_lower}_SYSTEM_INCLUDE_DIRS ${${_upper}_INCLUDE_DIR}) + endif() + set(vtk${_lower}_LIBRARIES "${${_upper}_LIBRARIES}") + set(vtk${_lower}_INCLUDE_DIRS "") + else() + if(_nolibs) + set(vtk${_lower}_LIBRARIES "") + elseif(_libs) + set(vtk${_lower}_LIBRARIES "${_libs}") + else() + set(vtk${_lower}_LIBRARIES vtk${_lower}) + endif() + set(vtk${_lower}_INCLUDE_DIRS "${_includes}") + endif() + + set(vtk${_lower}_THIRD_PARTY 1) + vtk_module_impl() + configure_file(vtk_${_lower}.h.in vtk_${_lower}.h) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/vtk_${_lower}.h + DESTINATION ${VTK_INSTALL_INCLUDE_DIR}) + + if(_subdir AND NOT VTK_USE_SYSTEM_${_upper}) + add_subdirectory(vtk${_lower}) + endif() +endmacro() + +macro(vtk_add_test_module _lang) + set(_test_module_name ${vtk-module-test}-${_lang}) + + list(APPEND VTK_MODULES_ALL ${_test_module_name}) + set(VTK_MODULE_${_test_module_name}_DEPENDS ${VTK_MODULE_${vtk-module-test}_DEPENDS}) + set(${_test_module_name}_SOURCE_DIR ${${vtk-module}_SOURCE_DIR}/Testing/${_lang}) + set(${_test_module_name}_BINARY_DIR ${${vtk-module}_BINARY_DIR}/Testing/${_lang}) + set(${_test_module_name}_IS_TEST 1) + list(APPEND ${vtk-module}_TESTED_BY ${_test_module_name}) + set(${_test_module_name}_TESTS_FOR ${vtk-module}) + set(VTK_MODULE_${_test_module_name}_DECLARED 1) + # Exclude test modules from wrapping + set(VTK_MODULE_${_test_module_name}_EXCLUDE_FROM_WRAPPING 1) +endmacro() diff --git a/CMake/vtkModuleTop.cmake b/CMake/vtkModuleTop.cmake new file mode 100644 index 00000000000..7b7526aef26 --- /dev/null +++ b/CMake/vtkModuleTop.cmake @@ -0,0 +1,275 @@ +#---------------------------------------------------------------------- +# Load the module DAG. +set(VTK_MODULES_ALL) +file(GLOB meta RELATIVE "${VTK_SOURCE_DIR}" + "${VTK_SOURCE_DIR}/*/*/module.cmake" # grouped modules + ) + +# Figure out which languages are being wrapped, and add them to the list. +set(_test_languages "Cxx") +if(VTK_WRAP_PYTHON) + list(APPEND _test_languages "Python") +endif() +if(VTK_WRAP_TCL) + list(APPEND _test_languages "Tcl") +endif() +if(VTK_WRAP_JAVA) + list(APPEND _test_languages "Java") +endif() + +# Assess modules, and tests in the repository. +foreach(f ${meta}) + unset(vtk-module) + include(${VTK_SOURCE_DIR}/${f}) + if(DEFINED vtk-module) + list(APPEND VTK_MODULES_ALL ${vtk-module}) + get_filename_component(${vtk-module}_BASE ${f} PATH) + set(${vtk-module}_SOURCE_DIR ${VTK_SOURCE_DIR}/${${vtk-module}_BASE}) + set(${vtk-module}_BINARY_DIR ${VTK_BINARY_DIR}/${${vtk-module}_BASE}) + if(BUILD_TESTING) + # Only add tests for languages that are wrapped. + foreach(_lang ${_test_languages}) + if(EXISTS ${${vtk-module}_SOURCE_DIR}/Testing/${_lang}/CMakeLists.txt) + vtk_add_test_module(${_lang}) + endif() + endforeach() + endif() + endif() +endforeach() +# Clear variables set later in each module. +unset(vtk-module) +unset(vtk-module-test) + +# Now include the module group logic. +include(vtkGroups) + +# Validate the module DAG. +macro(vtk_module_check vtk-module _needed_by stack) + if(NOT VTK_MODULE_${vtk-module}_DECLARED) + message(FATAL_ERROR "No such module \"${vtk-module}\" needed by \"${_needed_by}\"") + endif() + if(check_started_${vtk-module} AND NOT check_finished_${vtk-module}) + # We reached a module while traversing its own dependencies recursively. + set(msg "") + foreach(entry ${stack}) + set(msg " ${entry} =>${msg}") + if("${entry}" STREQUAL "${vtk-module}") + break() + endif() + endforeach() + message(FATAL_ERROR "Module dependency cycle detected:\n ${msg} ${vtk-module}") + elseif(NOT check_started_${vtk-module}) + # Traverse dependencies of this module. Mark the start and finish. + set(check_started_${vtk-module} 1) + foreach(dep IN LISTS VTK_MODULE_${vtk-module}_DEPENDS) + vtk_module_check(${dep} ${vtk-module} "${vtk-module};${stack}") + endforeach() + set(check_finished_${vtk-module} 1) + endif() +endmacro() + +foreach(vtk-module ${VTK_MODULES_ALL}) + vtk_module_check("${vtk-module}" "" "") +endforeach() + +#---------------------------------------------------------------------- + +# Provide an option for all modules. +option(VTK_BUILD_ALL_MODULES "Request to build all modules" OFF) + +# Provide an option for each module. +foreach(vtk-module ${VTK_MODULES_ALL}) + if(NOT ${vtk-module}_IS_TEST) + option(Module_${vtk-module} "Request building ${vtk-module}" + ${VTK_MODULE_${vtk-module}_DEFAULT}) + mark_as_advanced(Module_${vtk-module}) + if(VTK_MODULE_${vtk-module}_EXCLUDE_FROM_ALL) + set(VTK_MODULE_${vtk-module}_IN_ALL 0) + else() + set(VTK_MODULE_${vtk-module}_IN_ALL ${VTK_BUILD_ALL_MODULES}) + endif() + endif() +endforeach() + +# Follow dependencies. +macro(vtk_module_enable vtk-module _needed_by) + if(NOT Module_${vtk-module}) + list(APPEND VTK_MODULE_${vtk-module}_NEEDED_BY ${_needed_by}) + endif() + if(NOT ${vtk-module}_ENABLED) + set(${vtk-module}_ENABLED 1) + foreach(dep IN LISTS VTK_MODULE_${vtk-module}_DEPENDS) + vtk_module_enable(${dep} ${vtk-module}) + endforeach() + + foreach(test IN LISTS ${vtk-module}_TESTED_BY) + vtk_module_enable(${test} "") + endforeach() + endif() +endmacro() + +foreach(vtk-module ${VTK_MODULES_ALL}) + if(Module_${vtk-module} OR VTK_MODULE_${vtk-module}_IN_ALL) + vtk_module_enable("${vtk-module}" "") + elseif(VTK_MODULE_${vtk-module}_REQUEST_BY) + vtk_module_enable("${vtk-module}" "${VTK_MODULE_${vtk-module}_REQUEST_BY}") + endif() +endforeach() + +foreach(vtk-module ${VTK_MODULES_ALL}) + # Exclude modules that exist only to test this module + # from the report of modules that need this one. They + # are enabled exactly because this module is enabled. + if(VTK_MODULE_${vtk-module}_NEEDED_BY AND ${vtk-module}_TESTED_BY) + list(REMOVE_ITEM VTK_MODULE_${vtk-module}_NEEDED_BY "${${vtk-module}_TESTED_BY}") + endif() +endforeach() + +# Build final list of enabled modules. +set(VTK_MODULES_ENABLED "") +set(VTK_MODULES_DISABLED "") +foreach(vtk-module ${VTK_MODULES_ALL}) + if(${vtk-module}_ENABLED) + list(APPEND VTK_MODULES_ENABLED ${vtk-module}) + else() + list(APPEND VTK_MODULES_DISABLED ${vtk-module}) + endif() +endforeach() +list(SORT VTK_MODULES_ENABLED) # Deterministic order. +list(SORT VTK_MODULES_DISABLED) # Deterministic order. + +# Order list to satisfy dependencies. +include(CMake/TopologicalSort.cmake) +topological_sort(VTK_MODULES_ENABLED VTK_MODULE_ _DEPENDS) + +# Report what will be built. +foreach(vtk-module ${VTK_MODULES_ENABLED}) + if(NOT ${vtk-module}_IS_TEST) + if(Module_${vtk-module}) + set(_reason ", requested by Module_${vtk-module}") + elseif(VTK_MODULE_${vtk-module}_IN_ALL) + set(_reason ", requested by VTK_BUILD_ALL_MODULES") + else() + set(_reason ", needed by [${VTK_MODULE_${vtk-module}_NEEDED_BY}]") + endif() + message(STATUS "Enabled ${vtk-module}${_reason}.") + endif() +endforeach() + +# Hide options for modules that will build anyway. +foreach(vtk-module ${VTK_MODULES_ALL}) + if(NOT ${vtk-module}_IS_TEST) + if(VTK_MODULE_${vtk-module}_IN_ALL OR VTK_MODULE_${vtk-module}_NEEDED_BY) + set_property(CACHE Module_${vtk-module} PROPERTY TYPE INTERNAL) + else() + set_property(CACHE Module_${vtk-module} PROPERTY TYPE BOOL) + endif() + endif() +endforeach() + +if(NOT VTK_MODULES_ENABLED) + message(WARNING "No modules enabled!") + file(REMOVE "${VTK_BINARY_DIR}/VTKTargets.cmake") + return() +endif() + +file(WRITE "${VTK_BINARY_DIR}/VTKTargets.cmake" + "# Generated by CMake, do not edit!") + +macro(verify_vtk_module_is_set) + if("" STREQUAL "${vtk-module}") + message(FATAL_ERROR "CMake variable vtk-module is not set") + endif() +endmacro() + +macro(init_module_vars) + verify_vtk_module_is_set() + set(${vtk-module}-targets VTKTargets) + set(${vtk-module}-targets-install "${VTK_INSTALL_PACKAGE_DIR}/VTKTargets.cmake") + set(${vtk-module}-targets-build "${VTK_BINARY_DIR}/VTKTargets.cmake") +endmacro() + +# Build all modules. +foreach(vtk-module ${VTK_MODULES_ENABLED}) + + set(_module ${vtk-module}) + + if(NOT ${_module}_IS_TEST) + init_module_vars() + else() + set(vtk-module ${${_module}_TESTS_FOR}) + endif() + + include("${${_module}_SOURCE_DIR}/vtk-module-init.cmake" OPTIONAL) + add_subdirectory("${${_module}_SOURCE_DIR}" "${${_module}_BINARY_DIR}") +endforeach() + +#---------------------------------------------------------------------- +# Generate VTKConfig* files + +# Construct version numbers for VTKConfigVersion.cmake. +SET(_VTK_VERSION_MAJOR ${VTK_MAJOR_VERSION}) +SET(_VTK_VERSION_MINOR ${VTK_MINOR_VERSION}) +SET(_VTK_VERSION_PATCH ${VTK_BUILD_VERSION}) +# We use odd minor numbers for development versions. +# Use a date for the development patch level. +if("${_VTK_VERSION_MINOR}" MATCHES "[13579]$") + include(${VTK_SOURCE_DIR}/Utilities/KWSys/vtksys/kwsysDateStamp.cmake) + set(_VTK_VERSION_PATCH + "${KWSYS_DATE_STAMP_YEAR}${KWSYS_DATE_STAMP_MONTH}${KWSYS_DATE_STAMP_DAY}" + ) +endif() + +# Create list of available modules and libraries. +set(VTK_CONFIG_MODULES_ENABLED "") +foreach(vtk-module ${VTK_MODULES_ENABLED}) + if(NOT ${vtk-module}_IS_TEST) + list(APPEND VTK_CONFIG_MODULES_ENABLED ${vtk-module}) + endif() +endforeach() + +# Generate VTKConfig.cmake for the build tree. +set(VTK_CONFIG_CODE " +set(VTK_MODULES_DIR \"${VTK_MODULES_DIR}\")") +set(VTK_CONFIG_CMAKE_DIR "${VTK_SOURCE_DIR}/CMake") +set(VTK_CONFIG_TARGETS_CONDITION " AND NOT VTK_BINARY_DIR") +set(VTK_CONFIG_TARGETS_FILE "${VTK_BINARY_DIR}/VTKTargets.cmake") +set(VTK_CONFIG_MODULE_API_FILE "${VTK_SOURCE_DIR}/CMake/vtkModuleAPI.cmake") +configure_file(CMake/VTKConfig.cmake.in VTKConfig.cmake @ONLY) + +# Generate VTKConfig.cmake for the install tree. +set(VTK_CONFIG_CODE " +# Compute the installation prefix from this VTKConfig.cmake file location. +get_filename_component(VTK_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)") +# Construct the proper number of get_filename_component(... PATH) +# calls to compute the installation prefix. +string(REGEX REPLACE "/" ";" _count "${VTK_INSTALL_PACKAGE_DIR}") +foreach(p ${_count}) + set(VTK_CONFIG_CODE "${VTK_CONFIG_CODE} +get_filename_component(VTK_INSTALL_PREFIX \"\${VTK_INSTALL_PREFIX}\" PATH)") +endforeach(p) +set(VTK_CONFIG_CODE "${VTK_CONFIG_CODE} +set(VTK_MODULES_DIR \"\${VTK_INSTALL_PREFIX}/${VTK_INSTALL_PACKAGE_DIR}/Modules\")") +set(VTK_CONFIG_CMAKE_DIR "\${VTK_INSTALL_PREFIX}/${VTK_INSTALL_PACKAGE_DIR}") +set(VTK_CONFIG_TARGETS_CONDITION "") +set(VTK_CONFIG_TARGETS_FILE "\${VTK_INSTALL_PREFIX}/${VTK_INSTALL_PACKAGE_DIR}/VTKTargets.cmake") +set(VTK_CONFIG_MODULE_API_FILE "\${VTK_INSTALL_PREFIX}/${VTK_INSTALL_PACKAGE_DIR}/vtkModuleAPI.cmake") +configure_file(CMake/VTKConfig.cmake.in CMakeFiles/VTKConfig.cmake @ONLY) + +configure_file(CMake/VTKConfigVersion.cmake.in VTKConfigVersion.cmake @ONLY) + +install(FILES ${VTK_BINARY_DIR}/CMakeFiles/VTKConfig.cmake + ${VTK_BINARY_DIR}/VTKConfigVersion.cmake + CMake/vtkModuleAPI.cmake + CMake/UseVTK.cmake + DESTINATION ${VTK_INSTALL_PACKAGE_DIR}) +get_property(VTK_TARGETS GLOBAL PROPERTY VTK_TARGETS) +if(VTK_TARGETS) + install(EXPORT VTKTargets DESTINATION ${VTK_INSTALL_PACKAGE_DIR}) +else() + set(CMAKE_CONFIGURABLE_FILE_CONTENT "# No targets!") + configure_file(${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in + ${VTK_BINARY_DIR}/CMakeFiles/VTKTargets.cmake @ONLY) + install(FILES ${VTK_BINARY_DIR}/CMakeFiles/VTKTargets.cmake + DESTINATION ${VTK_INSTALL_PACKAGE_DIR}) +endif() diff --git a/CMake/vtkObjectFactory.cxx.in b/CMake/vtkObjectFactory.cxx.in new file mode 100644 index 00000000000..dd5117bd187 --- /dev/null +++ b/CMake/vtkObjectFactory.cxx.in @@ -0,0 +1,70 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: @vtk-module@ObjectFactory.cxx + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +#include "@vtk-module@ObjectFactory.h" +#include "vtkVersion.h" + +// Include all of the classes we want to create overrides for. +@_vtk_override_includes@ + +vtkStandardNewMacro(@vtk-module@ObjectFactory) + +// Now create the functions to create overrides with. +@_vtk_override_creates@ + +@vtk-module@ObjectFactory::@vtk-module@ObjectFactory() +{ +@_vtk_override_do@ +} + +const char * @vtk-module@ObjectFactory::GetVTKSourceVersion() +{ + return VTK_SOURCE_VERSION; +} + +void @vtk-module@ObjectFactory::PrintSelf(ostream &os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + os << indent << "Description: " << this->GetDescription() << endl; +} + +// Registration of object factories. +static unsigned int @vtk-module@Count; +static @vtk-module@ObjectFactory* Factory; + +struct @VTK-MODULE@_EXPORT @vtk-module@_AutoInit +{ + @vtk-module@_AutoInit(); + ~@vtk-module@_AutoInit(); +}; + +@vtk-module@_AutoInit::@vtk-module@_AutoInit() +{ + if(++@vtk-module@Count == 1) + { + Factory = @vtk-module@ObjectFactory::New(); + vtkObjectFactory::RegisterFactory(Factory); + } +} + +@vtk-module@_AutoInit::~@vtk-module@_AutoInit() +{ + if(--@vtk-module@Count == 0) + { + // Do not call vtkObjectFactory::UnRegisterFactory because + // vtkObjectFactory.cxx statically unregisters all factories. + Factory->Delete(); + } +} diff --git a/CMake/vtkObjectFactory.h.in b/CMake/vtkObjectFactory.h.in new file mode 100644 index 00000000000..bcd06ed4777 --- /dev/null +++ b/CMake/vtkObjectFactory.h.in @@ -0,0 +1,42 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: @vtk-module@ObjectFactory.h + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +#ifndef __@vtk-module@ObjectFactory_h +#define __@vtk-module@ObjectFactory_h + +#include "@vtk-module@Module.h" // For export macro +#include "vtkObjectFactory.h" + +class @VTK-MODULE@_EXPORT @vtk-module@ObjectFactory : public vtkObjectFactory +{ +public: + static @vtk-module@ObjectFactory * New(); + vtkTypeMacro(@vtk-module@ObjectFactory, vtkObjectFactory) + + const char * GetDescription() { return "@vtk-module@ factory overrides."; } + + const char * GetVTKSourceVersion(); + + void PrintSelf(ostream &os, vtkIndent indent); + +protected: + @vtk-module@ObjectFactory(); + +private: + @vtk-module@ObjectFactory(const @vtk-module@ObjectFactory&); // Not implemented + void operator=(const @vtk-module@ObjectFactory&); // Not implemented +}; + +#endif // __@vtk-module@ObjectFactory_h diff --git a/CMake/vtkPythonWrapping.cmake b/CMake/vtkPythonWrapping.cmake new file mode 100644 index 00000000000..2c78611dd68 --- /dev/null +++ b/CMake/vtkPythonWrapping.cmake @@ -0,0 +1,53 @@ +find_package(PythonLibs REQUIRED) +include(vtkWrapPython) + +function(vtk_add_python_wrapping module_name module_srcs) + if(NOT VTK_WRAP_PYTHON_INIT_EXE) + message(FATAL_ERROR "VTK must be built with Python wrapping turned on.") + endif() + # Need to add the Wrapping/Python to the include directory + include_directories( + ${VTK_SOURCE_DIR}/Wrapping/PythonCore + ${VTK_BINARY_DIR}/Wrapping/PythonCore + ${VTK_SOURCE_DIR}/Wrapping + ${VTK_BINARY_DIR}/Wrapping + ${PYTHON_INCLUDE_DIRS}) + + # FIXME: These must be here for now, should be fixed in the wrap hierarchy stuff + set(KIT_HIERARCHY_FILE ${CMAKE_CURRENT_BINARY_DIR}/${module_name}Hierarchy.txt) + string(REGEX REPLACE "^vtk" "" kit_name "${module_name}") + set(KIT ${kit_name}) + + # FIXME: Terrible temporary hack - add in the extra source file for CommonCore + if(${module_name} STREQUAL "vtkCommonCore") + set(extra_srcs vtkPythonCommand.cxx) + unset(extra_links) + else() + unset(extra_srcs) + # This contains the PyVTKClass.... + set(extra_links vtkCommonCorePythonD) + endif() + + # Figure out the dependent PythonD libraries for the module + foreach(dep ${VTK_MODULE_${vtk-module}_DEPENDS}) + if(NOT "${vtk-module}" STREQUAL "${dep}") + if(NOT VTK_MODULE_${dep}_EXCLUDE_FROM_WRAPPING) + list(APPEND extra_links ${dep}PythonD) + list(APPEND VTK_WRAP_INCLUDE_DIRS ${${dep}_SOURCE_DIR}) + endif() + endif() + endforeach() + + vtk_wrap_python3(${module_name}Python Python_SRCS "${module_srcs}") + vtk_add_library(${module_name}PythonD ${Python_SRCS} ${extra_srcs}) + if(VTK_MODULE_${module_name}_IMPLEMENTS) + set_property(TARGET ${module_name}PythonD PROPERTY COMPILE_DEFINITIONS + "${module_name}_AUTOINIT=1(${module_name})") + endif() + target_link_libraries(${module_name}PythonD ${module_name} + vtkWrappingPythonCore ${extra_links} ${VTK_PYTHON_LIBRARIES}) + python_add_module(${module_name}Python ${module_name}PythonInit.cxx) + if(PYTHON_ENABLE_MODULE_${module_name}Python) + target_link_libraries(${module_name}Python ${module_name}PythonD) + endif() +endfunction() diff --git a/CMake/vtkTclWrapping.cmake b/CMake/vtkTclWrapping.cmake new file mode 100644 index 00000000000..326e2ced98d --- /dev/null +++ b/CMake/vtkTclWrapping.cmake @@ -0,0 +1,66 @@ +# Make sure we find the required Tcl components. +if(VTK_WRAP_TCL) + set(VTK_WRAP_TCL_FIND_LIBS 1) + include(vtkWrapTcl) + include(vtkWrapHierarchy) +endif() + +function(vtk_add_tcl_wrapping module_name module_srcs) + if(NOT VTK_WRAP_TCL_INIT_EXE) + message(FATAL_ERROR "VTK must be built with Tcl wrapping turned on.") + endif() + # Need to add the Wrapping directory to the include directory + include_directories( + ${VTK_SOURCE_DIR}/Wrapping + ${VTK_BINARY_DIR}/Wrapping + ${TCL_INCLUDE_PATH}) + + # FIXME: These must be here for now, should be fixed in the wrap hierarchy stuff + set(KIT_HIERARCHY_FILE ${CMAKE_CURRENT_BINARY_DIR}/${module_name}Hierarchy.txt) + string(REGEX REPLACE "^vtk" "" kit_name "${module_name}") + set(KIT ${kit_name}) + + # Set up the include directories for the wrapping + set(VTK_WRAP_INCLUDE_DIRS + ${vtkCommonCore_SOURCE_DIR} + ${vtkCommonCore_BINARY_DIR} + ${VTK_SOURCE_DIR}/Utilities + ${VTK_BINARY_DIR}/Utilities + ${${vtk-module}_SOURCE_DIR} + ) + +# FIXME: Terrible temporary hack - add in the extra source file for CommonCore + if(${module_name} STREQUAL "vtkCommonCore") + set(extra_srcs ${VTK_SOURCE_DIR}/Wrapping/vtkTclUtil.cxx) + set(extra_links vtksys) + else() + unset(extra_srcs) + # This contains the vtkTclUtil class.... + set(extra_links vtkCommonCoreTCL) + endif() + + # Figure out the dependent Tcl libraries for the module + foreach(dep ${VTK_MODULE_${vtk-module}_DEPENDS}) + if(NOT "${vtk-module}" STREQUAL "${dep}") + if(NOT VTK_MODULE_${dep}_EXCLUDE_FROM_WRAPPING) + if("${dep}" STREQUAL "vtkRenderingContext2D") + set(dep "vtkRenderingContextIID") + endif() + list(APPEND extra_links ${dep}TCL) + list(APPEND VTK_WRAP_INCLUDE_DIRS ${${dep}_SOURCE_DIR}) + endif() + endif() + endforeach() + + # Tcl will not accept module names with numbers in. + set(tcl_module ${module_name}) + if("${tcl_module}" STREQUAL "vtkRenderingContext2D") + set(tcl_module "vtkRenderingContextIID") + elseif("${tcl_module}" STREQUAL "vtkViewsContext2D") + set(tcl_module "vtkViewsContextIID") + endif() + vtk_wrap_tcl3(${tcl_module}TCL Tcl_SRCS "${module_srcs}" "") + vtk_add_library(${tcl_module}TCL ${Tcl_SRCS} ${extra_srcs}) + target_link_libraries(${tcl_module}TCL ${module_name} + ${extra_links} ${VTK_TCL_LIBRARIES}) +endfunction() diff --git a/CMake/vtkThirdParty.cmake b/CMake/vtkThirdParty.cmake index 8e68792600a..8fd873b26de 100644 --- a/CMake/vtkThirdParty.cmake +++ b/CMake/vtkThirdParty.cmake @@ -1,67 +1,3 @@ -#----------------------------------------------------------------------------- -MACRO(VTK_THIRD_PARTY_OPTION upper lower) - OPTION(VTK_USE_SYSTEM_${upper} "Use the system's ${lower} library." OFF) - MARK_AS_ADVANCED(VTK_USE_SYSTEM_${upper}) - IF(VTK_USE_SYSTEM_${upper}) - IF(EXISTS ${CMAKE_ROOT}/Modules/Find${upper}.cmake) - INCLUDE(${CMAKE_ROOT}/Modules/Find${upper}.cmake) - ELSE(EXISTS ${CMAKE_ROOT}/Modules/Find${upper}.cmake) - INCLUDE(${VTK_CMAKE_DIR}/Find${upper}.cmake) - ENDIF(EXISTS ${CMAKE_ROOT}/Modules/Find${upper}.cmake) - MARK_AS_ADVANCED(${upper}_INCLUDE_DIR ${upper}_LIBRARY) - IF(${upper}_FOUND) - SET(VTK_${upper}_LIBRARIES ${${upper}_LIBRARIES}) - IF("${upper}" MATCHES "^PNG$") - SET(PNG_INCLUDE_DIR ${PNG_PNG_INCLUDE_DIR}) - MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR) - ENDIF("${upper}" MATCHES "^PNG$") - ELSE(${upper}_FOUND) - MESSAGE(SEND_ERROR "VTK_USE_SYSTEM_${upper} is ON, but ${upper}_LIBRARY is NOTFOUND.") - ENDIF(${upper}_FOUND) - ELSE(VTK_USE_SYSTEM_${upper}) - SET(VTK_${upper}_LIBRARIES vtk${lower}) - ENDIF(VTK_USE_SYSTEM_${upper}) -ENDMACRO(VTK_THIRD_PARTY_OPTION) - -#----------------------------------------------------------------------------- -MACRO(VTK_THIRD_PARTY_INCLUDE upper lower) - IF(VTK_USE_SYSTEM_${upper}) - IF(${upper}_INCLUDE_DIR) - SET(VTK_INCLUDE_DIRS_SYSTEM ${VTK_INCLUDE_DIRS_SYSTEM} ${${upper}_INCLUDE_DIR}) - SET(VTK_${upper}_INCLUDE_DIR ${${upper}_INCLUDE_DIR}) - ENDIF(${upper}_INCLUDE_DIR) - ELSE(VTK_USE_SYSTEM_${upper}) - SET(VTK_INCLUDE_DIRS_SOURCE_TREE ${VTK_INCLUDE_DIRS_SOURCE_TREE} - ${VTK_BINARY_DIR}/Utilities/${lower} - ${VTK_SOURCE_DIR}/Utilities/${lower} - ) - SET(VTK_${upper}_INCLUDE_DIR - ${VTK_BINARY_DIR}/Utilities/${lower} - ${VTK_SOURCE_DIR}/Utilities/${lower} - ) - ENDIF(VTK_USE_SYSTEM_${upper}) -ENDMACRO(VTK_THIRD_PARTY_INCLUDE) - -MACRO(VTK_THIRD_PARTY_INCLUDE2 upper) - IF(VTK_USE_SYSTEM_${upper}) - IF(${upper}_INCLUDE_DIR) - SET(VTK_INCLUDE_DIRS_SYSTEM ${VTK_INCLUDE_DIRS_SYSTEM} ${${upper}_INCLUDE_DIR}) - ENDIF(${upper}_INCLUDE_DIR) - ENDIF(VTK_USE_SYSTEM_${upper}) -ENDMACRO(VTK_THIRD_PARTY_INCLUDE2) - -#----------------------------------------------------------------------------- -MACRO(VTK_THIRD_PARTY_SUBDIR upper lower) - IF(NOT VTK_USE_SYSTEM_${upper}) - # we don't want to build third party tests. - SET(__vtk_build_testing ${BUILD_TESTING}) - SET(BUILD_TESTING OFF) - ADD_SUBDIRECTORY(${lower}) - # restore BUILD_TESTING - SET (BUILD_TESTING ${__vtk_build_testing}) - ENDIF(NOT VTK_USE_SYSTEM_${upper}) -ENDMACRO(VTK_THIRD_PARTY_SUBDIR) - #----------------------------------------------------------------------------- MACRO(VTK_THIRD_PARTY_WARNING_SUPPRESS upper lang) IF(NOT ${upper}_WARNINGS_ALLOW) diff --git a/CMake/vtkWrapHierarchy.cmake b/CMake/vtkWrapHierarchy.cmake index 3dc7cd9b194..a045bda082f 100644 --- a/CMake/vtkWrapHierarchy.cmake +++ b/CMake/vtkWrapHierarchy.cmake @@ -1,170 +1,154 @@ # # a cmake macro to generate a text file with the class hierarchy # -MACRO(VTK_WRAP_HIERARCHY TARGET OUTPUT_DIR SOURCES) - IF(NOT VTK_WRAP_HIERARCHY_EXE) - MESSAGE(SEND_ERROR "VTK_WRAP_HIERARCHY_EXE not specified when calling VTK_WRAP_HIERARCHY") - ENDIF(NOT VTK_WRAP_HIERARCHY_EXE) +macro(VTK_WRAP_HIERARCHY TARGET OUTPUT_DIR SOURCES) + if(NOT VTK_WRAP_HIERARCHY_EXE) + message(SEND_ERROR "VTK_WRAP_HIERARCHY_EXE not specified when calling VTK_WRAP_HIERARCHY") + endif() # The shell into which nmake.exe executes the custom command has some issues # with mixing quoted and unquoted arguments :( Let's help. - - IF(CMAKE_GENERATOR MATCHES "NMake Makefiles") - SET(verbatim "") - SET(quote "\"") - ELSE(CMAKE_GENERATOR MATCHES "NMake Makefiles") - SET(verbatim "VERBATIM") - SET(quote "") - ENDIF(CMAKE_GENERATOR MATCHES "NMake Makefiles") + if(CMAKE_GENERATOR MATCHES "NMake Makefiles") + set(verbatim "") + set(quote "\"") + else() + set(verbatim "VERBATIM") + set(quote "") + endif() # all the compiler "-D" args - GET_DIRECTORY_PROPERTY(TMP_DEF_LIST DEFINITION COMPILE_DEFINITIONS) - SET(TMP_DEFINITIONS) - FOREACH(TMP_DEF ${TMP_DEF_LIST}) - SET(TMP_DEFINITIONS ${TMP_DEFINITIONS} -D "${quote}${TMP_DEF}${quote}") - ENDFOREACH(TMP_DEF ${TMP_DEF_LIST}) + get_directory_property(TMP_DEF_LIST + DIRECTORY ${${vtk-module}_SOURCE_DIR} + DEFINITION COMPILE_DEFINITIONS) + set(TMP_DEFINITIONS) + foreach(TMP_DEF ${TMP_DEF_LIST}) + set(TMP_DEFINITIONS ${TMP_DEFINITIONS} -D "${quote}${TMP_DEF}${quote}") + endforeach() # all the include directories - IF(VTK_WRAP_INCLUDE_DIRS) - SET(TMP_INCLUDE_DIRS ${VTK_WRAP_INCLUDE_DIRS}) - ELSE(VTK_WRAP_INCLUDE_DIRS) - SET(TMP_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}) - ENDIF(VTK_WRAP_INCLUDE_DIRS) - SET(TMP_INCLUDE) - FOREACH(INCLUDE_DIR ${TMP_INCLUDE_DIRS}) - SET(TMP_INCLUDE ${TMP_INCLUDE} -I "${quote}${INCLUDE_DIR}${quote}") - ENDFOREACH(INCLUDE_DIR ${TMP_INCLUDE_DIRS}) - - # be bold and parse all files, not just indicated ones - SET(IGNORE_WRAP_EXCLUDE ON) + if(VTK_WRAP_INCLUDE_DIRS) + set(TMP_INCLUDE_DIRS ${VTK_WRAP_INCLUDE_DIRS}) + else() + set(TMP_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}) + endif() + set(TMP_INCLUDE) + foreach(INCLUDE_DIR ${TMP_INCLUDE_DIRS}) + set(TMP_INCLUDE ${TMP_INCLUDE} -I "${quote}${INCLUDE_DIR}${quote}") + endforeach() # list of all files to wrap - SET(VTK_WRAPPER_INIT_DATA) - + set(VTK_WRAPPER_INIT_DATA) # list of used files - SET(INPUT_FILES) + set(INPUT_FILES) # For each class - FOREACH(FILE ${SOURCES}) + foreach(FILE ${SOURCES}) # should we wrap the file? - GET_SOURCE_FILE_PROPERTY(TMP_WRAP_EXCLUDE ${FILE} WRAP_EXCLUDE) - GET_SOURCE_FILE_PROPERTY(TMP_WRAP_SPECIAL ${FILE} WRAP_SPECIAL) - GET_SOURCE_FILE_PROPERTY(TMP_ABSTRACT ${FILE} ABSTRACT) + get_property(TMP_WRAP_EXCLUDE + SOURCE ${FILE} + PROPERTY WRAP_EXCLUDE) + get_source_file_property(TMP_WRAP_SPECIAL ${FILE} WRAP_SPECIAL) + get_source_file_property(TMP_ABSTRACT ${FILE} ABSTRACT) # if we should wrap it - IF (IGNORE_WRAP_EXCLUDE OR TMP_WRAP_SPECIAL OR NOT TMP_WRAP_EXCLUDE) + if(TMP_WRAP_SPECIAL OR NOT TMP_WRAP_EXCLUDE) # what is the filename without the extension - GET_FILENAME_COMPONENT(TMP_FILENAME ${FILE} NAME_WE) + get_filename_component(TMP_FILENAME ${FILE} NAME_WE) # the input file might be full path so handle that - GET_FILENAME_COMPONENT(TMP_FILEPATH ${FILE} PATH) + get_filename_component(TMP_FILEPATH ${FILE} PATH) # compute the input filename - IF (TMP_FILEPATH) - SET(TMP_INPUT ${TMP_FILEPATH}/${TMP_FILENAME}.h) - ELSE (TMP_FILEPATH) - SET(TMP_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/${TMP_FILENAME}.h) - ENDIF (TMP_FILEPATH) - - IF(NOT "${KIT}" STREQUAL "Rendering" OR - (NOT "${TMP_FILENAME}" STREQUAL "vtkgl" AND - NOT "${TMP_FILENAME}" STREQUAL "vtkOpenGLState")) - IF(NOT "${KIT}" STREQUAL "Filtering" OR - NOT "${TMP_FILENAME}" STREQUAL "vtkInformation") + if(TMP_FILEPATH) + set(TMP_INPUT ${TMP_FILEPATH}/${TMP_FILENAME}.h) + else() + # This should be the case, and we use the module path. + set(TMP_INPUT ${${vtk-module}_SOURCE_DIR}/${TMP_FILENAME}.h) + endif() + + # Exclude huge generated headers that aren't relevant to wrappers. + if(NOT "${TMP_FILENAME}" STREQUAL "vtkgl" AND + NOT "${TMP_FILENAME}" STREQUAL "vtkOpenGLState") # add to the INPUT_FILES - SET(INPUT_FILES ${INPUT_FILES} ${TMP_INPUT}) + list(APPEND INPUT_FILES ${TMP_INPUT}) # add the info to the init file - SET(VTK_WRAPPER_INIT_DATA - "${VTK_WRAPPER_INIT_DATA}${TMP_INPUT};vtk${KIT}") + set(VTK_WRAPPER_INIT_DATA + "${VTK_WRAPPER_INIT_DATA}${TMP_INPUT};${vtk-module}") - IF (TMP_ABSTRACT) - SET(VTK_WRAPPER_INIT_DATA "${VTK_WRAPPER_INIT_DATA};ABSTRACT") - ENDIF (TMP_ABSTRACT) + if(TMP_ABSTRACT) + set(VTK_WRAPPER_INIT_DATA "${VTK_WRAPPER_INIT_DATA};ABSTRACT") + endif() - IF (TMP_WRAP_EXCLUDE) - SET(VTK_WRAPPER_INIT_DATA "${VTK_WRAPPER_INIT_DATA};WRAP_EXCLUDE") - ENDIF (TMP_WRAP_EXCLUDE) + if(TMP_WRAP_EXCLUDE) + set(VTK_WRAPPER_INIT_DATA "${VTK_WRAPPER_INIT_DATA};WRAP_EXCLUDE") + endif() - IF (TMP_WRAP_SPECIAL) - SET(VTK_WRAPPER_INIT_DATA "${VTK_WRAPPER_INIT_DATA};WRAP_SPECIAL") - ENDIF (TMP_WRAP_SPECIAL) + if(TMP_WRAP_SPECIAL) + set(VTK_WRAPPER_INIT_DATA "${VTK_WRAPPER_INIT_DATA};WRAP_SPECIAL") + endif() - SET(VTK_WRAPPER_INIT_DATA "${VTK_WRAPPER_INIT_DATA}\n") + set(VTK_WRAPPER_INIT_DATA "${VTK_WRAPPER_INIT_DATA}\n") - ENDIF(NOT "${KIT}" STREQUAL "Filtering" OR - NOT "${TMP_FILENAME}" STREQUAL "vtkInformation") - ENDIF(NOT "${KIT}" STREQUAL "Rendering" OR - (NOT "${TMP_FILENAME}" STREQUAL "vtkgl" AND - NOT "${TMP_FILENAME}" STREQUAL "vtkOpenGLState")) - ENDIF (IGNORE_WRAP_EXCLUDE OR TMP_WRAP_SPECIAL OR NOT TMP_WRAP_EXCLUDE) - ENDFOREACH(FILE) + endif() + endif() + endforeach() # finish the data file for the init file - CONFIGURE_FILE( + configure_file( ${VTK_CMAKE_DIR}/vtkWrapperInit.data.in ${OUTPUT_DIR}/${TARGET}.data COPY_ONLY IMMEDIATE ) - # find out what kits this kit depends on - SET(TMP_KIT_DEPENDS ${KIT_INTERFACE_LIBRARIES} ${KIT_LIBS}) - - # search through the libs to find kits we depend on - SET(OTHER_HIERARCHY_FILES) - SET(OTHER_HIERARCHY_TARGETS) - FOREACH (TMP_LIB ${TMP_KIT_DEPENDS}) - STRING(REGEX REPLACE "vtk(.*)" "\\1" TMP_KIT "${TMP_LIB}") - IF(NOT "${TMP_KIT}" STREQUAL "${KIT}") - STRING(TOUPPER "${TMP_KIT}" TMP_KIT_UPPER) - FOREACH (TMP_KIT_CHECK ${VTK_KITS}) - STRING(REPLACE "_" "" TMP_KIT_CHECK_UPPER ${TMP_KIT_CHECK}) - IF("${TMP_KIT_UPPER}" STREQUAL "${TMP_KIT_CHECK_UPPER}") - SET(OTHER_HIERARCHY_FILES ${OTHER_HIERARCHY_FILES} - "${quote}${VTK_BINARY_DIR}/${TMP_KIT}/vtk${TMP_KIT}Hierarchy.txt${quote}") - SET(OTHER_HIERARCHY_TARGETS ${OTHER_HIERARCHY_TARGETS} - vtk${TMP_KIT}) - ENDIF("${TMP_KIT_UPPER}" STREQUAL "${TMP_KIT_CHECK_UPPER}") - ENDFOREACH (TMP_KIT_CHECK ${VTK_KITS}) - ENDIF(NOT "${TMP_KIT}" STREQUAL "${KIT}") - ENDFOREACH (TMP_LIB ${TMP_KIT_DEPENDS}) - - IF(NOT CMAKE_GENERATOR MATCHES "Visual Studio.*") - # Build the hierarchy file when the kit library is built, this - # ensures that the file is built when kits in other libraries - # need it (i.e. they depend on this kits library, but if this - # kits library is built, then the hierarchy file is also built). - ADD_CUSTOM_COMMAND( - TARGET vtk${KIT} POST_BUILD - + # search through the deps to find modules we depend on + set(OTHER_HIERARCHY_FILES) + set(OTHER_HIERARCHY_TARGETS) + foreach(dep ${VTK_MODULE_${vtk-module}_DEPENDS}) + if(NOT "${vtk-module}" STREQUAL "${dep}") + if(NOT VTK_MODULE_${dep}_EXCLUDE_FROM_WRAPPING) + list(APPEND OTHER_HIERARCHY_FILES + "${quote}${${dep}_BINARY_DIR}/${dep}Hierarchy.txt${quote}") + list(APPEND OTHER_HIERARCHY_TARGETS ${dep}) + endif() + endif() + endforeach() + + if(NOT CMAKE_GENERATOR MATCHES "Visual Studio.*") + # Build the hierarchy file when the module library is built, this + # ensures that the file is built when modules in other libraries + # need it (i.e. they depend on this module's library, but if this + # module's library is built, then the hierarchy file is also built). + add_custom_command( + TARGET ${vtk-module} POST_BUILD COMMAND ${VTK_WRAP_HIERARCHY_EXE} - ${TMP_DEFINITIONS} - ${TMP_INCLUDE} - "-o" "${quote}${OUTPUT_DIR}/vtk${KIT}Hierarchy.txt${quote}" - "${quote}${OUTPUT_DIR}/${TARGET}.data${quote}" - ${OTHER_HIERARCHY_FILES} + ${TMP_DEFINITIONS} + ${TMP_INCLUDE} + "-o" "${quote}${OUTPUT_DIR}/${vtk-module}Hierarchy.txt${quote}" + "${quote}${OUTPUT_DIR}/${TARGET}.data${quote}" + ${OTHER_HIERARCHY_FILES} COMMAND ${CMAKE_COMMAND} - "-E" "touch" "${quote}${OUTPUT_DIR}/${TARGET}.target${quote}" + "-E" "touch" "${quote}${OUTPUT_DIR}/${TARGET}.target${quote}" - COMMENT "For vtk${KIT} - updating vtk${KIT}Hierarchy.txt" - ${verbatim} + COMMENT "For ${vtk-module} - updating ${vtk-module}Hierarchy.txt" + ${verbatim} ) # Force the above custom command to execute if hierarchy tool changes - ADD_DEPENDENCIES(vtk${KIT} vtkWrapHierarchy) + add_dependencies(${vtk-module} vtkWrapHierarchy) # Add a custom-command for when the hierarchy file is needed - # within its own kit. A dummy target is needed because the + # within its own module. A dummy target is needed because the # vtkWrapHierarchy tool only changes the timestamp on the # hierarchy file if the VTK hierarchy actually changes. - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${OUTPUT_DIR}/${TARGET}.target - ${OUTPUT_DIR}/vtk${KIT}Hierarchy.txt + ${OUTPUT_DIR}/${vtk-module}Hierarchy.txt DEPENDS ${VTK_WRAP_HIERARCHY_EXE} ${OUTPUT_DIR}/${TARGET}.data ${INPUT_FILES} @@ -174,32 +158,32 @@ MACRO(VTK_WRAP_HIERARCHY TARGET OUTPUT_DIR SOURCES) COMMAND ${VTK_WRAP_HIERARCHY_EXE} ${TMP_DEFINITIONS} ${TMP_INCLUDE} - "-o" "${quote}${OUTPUT_DIR}/vtk${KIT}Hierarchy.txt${quote}" + "-o" "${quote}${OUTPUT_DIR}/${vtk-module}Hierarchy.txt${quote}" "${quote}${OUTPUT_DIR}/${TARGET}.data${quote}" ${OTHER_HIERARCHY_FILES} - COMMENT "Hierarchy Wrapping - updating vtk${KIT}Hierarchy.txt" + COMMENT "Hierarchy Wrapping - updating ${vtk-module}Hierarchy.txt" ${verbatim} ) - ELSE(NOT CMAKE_GENERATOR MATCHES "Visual Studio.*") + else() # On Visual Studio builds, the target-timestamp trick does not work, # so only build hierarchy files when library is built. - ADD_CUSTOM_COMMAND( - TARGET vtk${KIT} POST_BUILD + add_custom_command( + TARGET ${vtk-module} POST_BUILD COMMAND ${VTK_WRAP_HIERARCHY_EXE} ${TMP_DEFINITIONS} ${TMP_INCLUDE} - "-o" "${quote}${OUTPUT_DIR}/vtk${KIT}Hierarchy.txt${quote}" + "-o" "${quote}${OUTPUT_DIR}/${vtk-module}Hierarchy.txt${quote}" "${quote}${OUTPUT_DIR}/${TARGET}.data${quote}" ${OTHER_HIERARCHY_FILES} - COMMENT "Updating vtk${KIT}Hierarchy.txt" + COMMENT "Updating ${vtk-module}Hierarchy.txt" ${verbatim} ) # Set target-level dependencies so that everything builds in the # correct order, particularly the libraries. - ADD_DEPENDENCIES(vtk${KIT} vtkWrapHierarchy ${OTHER_HIERARCHY_TARGETS}) - ENDIF(NOT CMAKE_GENERATOR MATCHES "Visual Studio.*") + add_dependencies(${vtk-module} vtkWrapHierarchy ${OTHER_HIERARCHY_TARGETS}) + endif() -ENDMACRO(VTK_WRAP_HIERARCHY) +endmacro() diff --git a/CMake/vtkWrapJava.cmake b/CMake/vtkWrapJava.cmake index ba25180b11b..a1f2f75f50b 100644 --- a/CMake/vtkWrapJava.cmake +++ b/CMake/vtkWrapJava.cmake @@ -4,10 +4,10 @@ MACRO(VTK_WRAP_JAVA2 TARGET SOURCE_LIST_NAME) # convert to the WRAP3 signature - VTK_WRAP_JAVA3(${TARGET} ${SOURCE_LIST_NAME} "${ARGN}") + vtk_wrap_java3(${TARGET} ${SOURCE_LIST_NAME} "${ARGN}") ENDMACRO(VTK_WRAP_JAVA2) -MACRO(VTK_WRAP_JAVA3 TARGET SRC_LIST_NAME SOURCES) +macro(vtk_wrap_java3 TARGET SRC_LIST_NAME SOURCES) IF(NOT VTK_PARSE_JAVA_EXE) MESSAGE(SEND_ERROR "VTK_PARSE_JAVA_EXE not specified when calling VTK_WRAP_JAVA3") ENDIF(NOT VTK_PARSE_JAVA_EXE) @@ -51,7 +51,7 @@ MACRO(VTK_WRAP_JAVA3 TARGET SRC_LIST_NAME SOURCES) ELSE (VTK_WRAP_HINTS) SET(TMP_HINTS) ENDIF (VTK_WRAP_HINTS) - + IF (KIT_HIERARCHY_FILE) SET(TMP_HIERARCHY "--types" "${quote}${KIT_HIERARCHY_FILE}${quote}") ELSE (KIT_HIERARCHY_FILE) @@ -63,10 +63,13 @@ MACRO(VTK_WRAP_JAVA3 TARGET SRC_LIST_NAME SOURCES) # For each class FOREACH(FILE ${SOURCES}) # should we wrap the file? - GET_SOURCE_FILE_PROPERTY(TMP_WRAP_EXCLUDE ${FILE} WRAP_EXCLUDE) + get_source_file_property(TMP_WRAP_EXCLUDE ${FILE} WRAP_EXCLUDE) + + # we don't wrap the headers in Java + get_source_file_property(TMP_WRAP_HEADER ${FILE} WRAP_HEADER) # if we should wrap it - IF (NOT TMP_WRAP_EXCLUDE) + IF (NOT TMP_WRAP_EXCLUDE AND NOT TMP_WRAP_HEADER) # what is the filename without the extension GET_FILENAME_COMPONENT(TMP_FILENAME ${FILE} NAME_WE) @@ -145,7 +148,7 @@ MACRO(VTK_WRAP_JAVA3 TARGET SRC_LIST_NAME SOURCES) SET(VTK_WRAP_JAVA_CUSTOM_COUNT) ENDIF(VTK_WRAP_JAVA_CUSTOM_COUNT MATCHES "^${VTK_WRAP_JAVA_CUSTOM_LIMIT}$") ENDIF(VTK_WRAP_JAVA_NEED_CUSTOM_TARGETS) - ENDIF (NOT TMP_WRAP_EXCLUDE) + ENDIF () ENDFOREACH(FILE) ADD_CUSTOM_TARGET("${TARGET}JavaClasses" ALL DEPENDS ${VTK_JAVA_DEPENDENCIES}) @@ -155,7 +158,7 @@ MACRO(VTK_WRAP_JAVA3 TARGET SRC_LIST_NAME SOURCES) ENDIF(VTK_WRAP_JAVA3_INIT_DIR) CONFIGURE_FILE("${dir}/JavaDependencies.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/JavaDependencies.cmake" IMMEDIATE @ONLY) -ENDMACRO(VTK_WRAP_JAVA3) +endmacro() # VS 6 does not like needing to run a huge number of custom commands # when building a single target. Generate some extra custom targets @@ -188,7 +191,7 @@ MACRO(VTK_GENERATE_JAVA_DEPENDENCIES TARGET) # get the classes for this lib FOREACH(srcName ${ARGN}) - + # what is the filename without the extension GET_FILENAME_COMPONENT(srcNameWe ${srcName} NAME_WE) @@ -217,4 +220,4 @@ MACRO(VTK_GENERATE_JAVA_DEPENDENCIES TARGET) IMMEDIATE ) -ENDMACRO(VTK_GENERATE_JAVA_DEPENDENCIES) +ENDMACRO() diff --git a/CMake/vtkWrapPython.cmake b/CMake/vtkWrapPython.cmake index 645556dfaa7..2ed96ba16d8 100644 --- a/CMake/vtkWrapPython.cmake +++ b/CMake/vtkWrapPython.cmake @@ -1,226 +1,211 @@ # # a cmake implementation of the Wrap Python command # -MACRO(VTK_WRAP_PYTHON2 TARGET SOURCE_LIST_NAME) +macro(VTK_WRAP_PYTHON2 TARGET SOURCE_LIST_NAME) # convert to the WRAP3 signature - VTK_WRAP_PYTHON3(${TARGET} ${SOURCE_LIST_NAME} "${ARGN}") -ENDMACRO(VTK_WRAP_PYTHON2) - -MACRO(VTK_WRAP_PYTHON3 TARGET SRC_LIST_NAME SOURCES) - IF(NOT VTK_WRAP_PYTHON_INIT_EXE) - MESSAGE(SEND_ERROR "VTK_WRAP_PYTHON_INIT_EXE not specified when calling VTK_WRAP_PYTHON3") - ENDIF(NOT VTK_WRAP_PYTHON_INIT_EXE) - IF(NOT VTK_WRAP_PYTHON_EXE) - MESSAGE(SEND_ERROR "VTK_WRAP_PYTHON_EXE not specified when calling VTK_WRAP_PYTHON3") - ENDIF(NOT VTK_WRAP_PYTHON_EXE) + vtk_wrap_python3(${TARGET} ${SOURCE_LIST_NAME} "${ARGN}") +endmacro() + +macro(VTK_WRAP_PYTHON3 TARGET SRC_LIST_NAME SOURCES) + if(NOT VTK_WRAP_PYTHON_INIT_EXE) + message(SEND_ERROR + "VTK_WRAP_PYTHON_INIT_EXE not specified when calling VTK_WRAP_PYTHON3") + endif() + if(NOT VTK_WRAP_PYTHON_EXE) + message(SEND_ERROR + "VTK_WRAP_PYTHON_EXE not specified when calling VTK_WRAP_PYTHON3") + endif() # The shell into which nmake.exe executes the custom command has some issues # with mixing quoted and unquoted arguments :( Let's help. - - IF(CMAKE_GENERATOR MATCHES "NMake Makefiles") - SET(verbatim "") - SET(quote "\"") - ELSE(CMAKE_GENERATOR MATCHES "NMake Makefiles") - SET(verbatim "VERBATIM") - SET(quote "") - ENDIF(CMAKE_GENERATOR MATCHES "NMake Makefiles") + if(CMAKE_GENERATOR MATCHES "NMake Makefiles") + set(verbatim "") + set(quote "\"") + else() + set(verbatim "VERBATIM") + set(quote "") + endif() # Initialize the custom target counter. - IF(VTK_WRAP_PYTHON_NEED_CUSTOM_TARGETS) - SET(VTK_WRAP_PYTHON_CUSTOM_COUNT "") - SET(VTK_WRAP_PYTHON_CUSTOM_NAME ${TARGET}) - SET(VTK_WRAP_PYTHON_CUSTOM_LIST) - ENDIF(VTK_WRAP_PYTHON_NEED_CUSTOM_TARGETS) + if(VTK_WRAP_PYTHON_NEED_CUSTOM_TARGETS) + set(VTK_WRAP_PYTHON_CUSTOM_COUNT "") + set(VTK_WRAP_PYTHON_CUSTOM_NAME ${TARGET}) + set(VTK_WRAP_PYTHON_CUSTOM_LIST) + endif() # start writing the input file for the init file - SET(VTK_WRAPPER_INIT_DATA "${TARGET}") - - GET_DIRECTORY_PROPERTY(TMP_DEF_LIST DEFINITION COMPILE_DEFINITIONS) - SET(TMP_DEFINITIONS) - FOREACH(TMP_DEF ${TMP_DEF_LIST}) - SET(TMP_DEFINITIONS ${TMP_DEFINITIONS} -D "${quote}${TMP_DEF}${quote}") - ENDFOREACH(TMP_DEF ${TMP_DEF_LIST}) - - IF(VTK_WRAP_INCLUDE_DIRS) - SET(TMP_INCLUDE_DIRS ${VTK_WRAP_INCLUDE_DIRS}) - ELSE(VTK_WRAP_INCLUDE_DIRS) - SET(TMP_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}) - ENDIF(VTK_WRAP_INCLUDE_DIRS) - SET(TMP_INCLUDE) - FOREACH(INCLUDE_DIR ${TMP_INCLUDE_DIRS}) - SET(TMP_INCLUDE ${TMP_INCLUDE} -I "${quote}${INCLUDE_DIR}${quote}") - ENDFOREACH(INCLUDE_DIR ${TMP_INCLUDE_DIRS}) - - IF (VTK_WRAP_HINTS) - SET(TMP_HINTS "--hints" "${quote}${VTK_WRAP_HINTS}${quote}") - ELSE (VTK_WRAP_HINTS) - SET(TMP_HINTS) - ENDIF (VTK_WRAP_HINTS) - - IF (KIT_HIERARCHY_FILE) - SET(TMP_HIERARCHY "--types" "${quote}${KIT_HIERARCHY_FILE}${quote}") - ELSE (KIT_HIERARCHY_FILE) - SET(TMP_HIERARCHY) - ENDIF (KIT_HIERARCHY_FILE) + set(VTK_WRAPPER_INIT_DATA "${TARGET}") + + get_directory_property(TMP_DEF_LIST DEFINITION COMPILE_DEFINITIONS) + set(TMP_DEFINITIONS) + foreach(TMP_DEF ${TMP_DEF_LIST}) + set(TMP_DEFINITIONS ${TMP_DEFINITIONS} -D "${quote}${TMP_DEF}${quote}") + endforeach() + + if(VTK_WRAP_INCLUDE_DIRS) + set(TMP_INCLUDE_DIRS ${VTK_WRAP_INCLUDE_DIRS}) + else() + set(TMP_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}) + endif() + set(TMP_INCLUDE) + foreach(INCLUDE_DIR ${TMP_INCLUDE_DIRS}) + set(TMP_INCLUDE ${TMP_INCLUDE} -I "${quote}${INCLUDE_DIR}${quote}") + endforeach() + + if(VTK_WRAP_HINTS) + set(TMP_HINTS "--hints" "${quote}${VTK_WRAP_HINTS}${quote}") + else() + unset(TMP_HINTS) + endif() + + if(KIT_HIERARCHY_FILE) + set(TMP_HIERARCHY "--types" "${quote}${KIT_HIERARCHY_FILE}${quote}") + else(K) + unset(TMP_HIERARCHY) + endif() # For each class - FOREACH(FILE ${SOURCES}) + foreach(FILE ${SOURCES}) # should we wrap the file? - GET_SOURCE_FILE_PROPERTY(TMP_WRAP_EXCLUDE ${FILE} WRAP_EXCLUDE) - GET_SOURCE_FILE_PROPERTY(TMP_WRAP_SPECIAL ${FILE} WRAP_SPECIAL) + get_source_file_property(TMP_WRAP_EXCLUDE ${FILE} WRAP_EXCLUDE) + get_source_file_property(TMP_WRAP_SPECIAL ${FILE} WRAP_SPECIAL) # if we should wrap it - IF (TMP_WRAP_SPECIAL OR NOT TMP_WRAP_EXCLUDE) + if(TMP_WRAP_SPECIAL OR NOT TMP_WRAP_EXCLUDE) # what is the filename without the extension - GET_FILENAME_COMPONENT(TMP_FILENAME ${FILE} NAME_WE) + get_filename_component(TMP_FILENAME ${FILE} NAME_WE) # the input file might be full path so handle that - GET_FILENAME_COMPONENT(TMP_FILEPATH ${FILE} PATH) + get_filename_component(TMP_FILEPATH ${FILE} PATH) # compute the input filename - IF (TMP_FILEPATH) - SET(TMP_INPUT ${TMP_FILEPATH}/${TMP_FILENAME}.h) - ELSE (TMP_FILEPATH) - SET(TMP_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/${TMP_FILENAME}.h) - ENDIF (TMP_FILEPATH) + if(TMP_FILEPATH) + set(TMP_INPUT ${TMP_FILEPATH}/${TMP_FILENAME}.h) + else() + set(TMP_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/${TMP_FILENAME}.h) + endif() # is it abstract? - GET_SOURCE_FILE_PROPERTY(TMP_ABSTRACT ${FILE} ABSTRACT) - IF (TMP_ABSTRACT) - SET(TMP_CONCRETE "--abstract") - ELSE (TMP_ABSTRACT) - SET(TMP_CONCRETE "--concrete") - ENDIF (TMP_ABSTRACT) + get_source_file_property(TMP_ABSTRACT ${FILE} ABSTRACT) + if(TMP_ABSTRACT) + set(TMP_CONCRETE "--abstract") + else() + set(TMP_CONCRETE "--concrete") + endif() # is it special? - IF (TMP_WRAP_SPECIAL) - SET(TMP_SPECIAL "--special") - ELSE (TMP_WRAP_SPECIAL) - SET(TMP_SPECIAL "--vtkobject") - ENDIF (TMP_WRAP_SPECIAL) + if(TMP_WRAP_SPECIAL) + set(TMP_SPECIAL "--special") + else() + set(TMP_SPECIAL "--vtkobject") + endif() # add the info to the init file - SET(VTK_WRAPPER_INIT_DATA + set(VTK_WRAPPER_INIT_DATA "${VTK_WRAPPER_INIT_DATA}\n${TMP_FILENAME}") # new source file is namePython.cxx, add to resulting list - SET(${SRC_LIST_NAME} ${${SRC_LIST_NAME}} + set(${SRC_LIST_NAME} ${${SRC_LIST_NAME}} ${TMP_FILENAME}Python.cxx) # add custom command to output - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}Python.cxx DEPENDS ${VTK_WRAP_PYTHON_EXE} ${VTK_WRAP_HINTS} ${TMP_INPUT} - ${KIT_HIERARCHY_FILE} + ${KIT_HIERARCHY_FILE} COMMAND ${VTK_WRAP_PYTHON_EXE} - ARGS - ${TMP_CONCRETE} - ${TMP_SPECIAL} - ${TMP_HINTS} - ${TMP_HIERARCHY} - ${TMP_DEFINITIONS} - ${TMP_INCLUDE} - "${quote}${TMP_INPUT}${quote}" - "${quote}${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}Python.cxx${quote}" + ARGS + ${TMP_CONCRETE} + ${TMP_SPECIAL} + ${TMP_HINTS} + ${TMP_HIERARCHY} + ${TMP_DEFINITIONS} + ${TMP_INCLUDE} + "${quote}${TMP_INPUT}${quote}" + "${quote}${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}Python.cxx${quote}" COMMENT "Python Wrapping - generating ${TMP_FILENAME}Python.cxx" - ${verbatim} + ${verbatim} ) # Add this output to a custom target if needed. - IF(VTK_WRAP_PYTHON_NEED_CUSTOM_TARGETS) - SET(VTK_WRAP_PYTHON_CUSTOM_LIST ${VTK_WRAP_PYTHON_CUSTOM_LIST} + if(VTK_WRAP_PYTHON_NEED_CUSTOM_TARGETS) + set(VTK_WRAP_PYTHON_CUSTOM_LIST ${VTK_WRAP_PYTHON_CUSTOM_LIST} ${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}Python.cxx) - SET(VTK_WRAP_PYTHON_CUSTOM_COUNT ${VTK_WRAP_PYTHON_CUSTOM_COUNT}x) - IF(VTK_WRAP_PYTHON_CUSTOM_COUNT MATCHES "^${VTK_WRAP_PYTHON_CUSTOM_LIMIT}$") - SET(VTK_WRAP_PYTHON_CUSTOM_NAME ${VTK_WRAP_PYTHON_CUSTOM_NAME}Hack) - ADD_CUSTOM_TARGET(${VTK_WRAP_PYTHON_CUSTOM_NAME} DEPENDS ${VTK_WRAP_PYTHON_CUSTOM_LIST}) - SET(KIT_PYTHON_DEPS ${VTK_WRAP_PYTHON_CUSTOM_NAME}) - SET(VTK_WRAP_PYTHON_CUSTOM_LIST) - SET(VTK_WRAP_PYTHON_CUSTOM_COUNT) - ENDIF(VTK_WRAP_PYTHON_CUSTOM_COUNT MATCHES "^${VTK_WRAP_PYTHON_CUSTOM_LIMIT}$") - ENDIF(VTK_WRAP_PYTHON_NEED_CUSTOM_TARGETS) - ENDIF (TMP_WRAP_SPECIAL OR NOT TMP_WRAP_EXCLUDE) - ENDFOREACH(FILE) + set(VTK_WRAP_PYTHON_CUSTOM_COUNT ${VTK_WRAP_PYTHON_CUSTOM_COUNT}x) + if(VTK_WRAP_PYTHON_CUSTOM_COUNT MATCHES "^${VTK_WRAP_PYTHON_CUSTOM_LIMIT}$") + set(VTK_WRAP_PYTHON_CUSTOM_NAME ${VTK_WRAP_PYTHON_CUSTOM_NAME}Hack) + add_custom_target(${VTK_WRAP_PYTHON_CUSTOM_NAME} + DEPENDS ${VTK_WRAP_PYTHON_CUSTOM_LIST}) + set(KIT_PYTHON_DEPS ${VTK_WRAP_PYTHON_CUSTOM_NAME}) + set(VTK_WRAP_PYTHON_CUSTOM_LIST) + set(VTK_WRAP_PYTHON_CUSTOM_COUNT) + endif() + endif() + endif() + endforeach() # finish the data file for the init file - CONFIGURE_FILE( + configure_file( ${VTK_CMAKE_DIR}/vtkWrapperInit.data.in ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.data COPY_ONLY IMMEDIATE ) - ADD_CUSTOM_COMMAND( + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.cxx DEPENDS ${VTK_WRAP_PYTHON_INIT_EXE} - ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.data + ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.data COMMAND ${VTK_WRAP_PYTHON_INIT_EXE} ARGS - "${quote}${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.data${quote}" - "${quote}${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.cxx${quote}" + "${quote}${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.data${quote}" + "${quote}${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.cxx${quote}" COMMENT "Python Wrapping - generating ${TARGET}Init.cxx" - ${verbatim} + ${verbatim} ) # Create the Init File - SET(${SRC_LIST_NAME} ${${SRC_LIST_NAME}} ${TARGET}Init.cxx) + set(${SRC_LIST_NAME} ${${SRC_LIST_NAME}} ${TARGET}Init.cxx) -ENDMACRO(VTK_WRAP_PYTHON3) +endmacro(VTK_WRAP_PYTHON3) -IF(VTK_WRAP_PYTHON_FIND_LIBS) - GET_FILENAME_COMPONENT(_CURRENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) - INCLUDE(FindPythonLibs) +if(VTK_WRAP_PYTHON_FIND_LIBS) + get_filename_component(_CURRENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + find_package(PythonLibs) # Use separate debug/optimized libraries if they are different. - IF(PYTHON_DEBUG_LIBRARY) - IF("${PYTHON_DEBUG_LIBRARY}" STREQUAL "${PYTHON_LIBRARY}") - SET(VTK_PYTHON_LIBRARIES ${PYTHON_LIBRARY}) - ELSE("${PYTHON_DEBUG_LIBRARY}" STREQUAL "${PYTHON_LIBRARY}") - SET(VTK_PYTHON_LIBRARIES + if(PYTHON_DEBUG_LIBRARY) + if("${PYTHON_DEBUG_LIBRARY}" STREQUAL "${PYTHON_LIBRARY}") + set(VTK_PYTHON_LIBRARIES ${PYTHON_LIBRARY}) + else() + set(VTK_PYTHON_LIBRARIES optimized ${PYTHON_LIBRARY} debug ${PYTHON_DEBUG_LIBRARY}) - ENDIF("${PYTHON_DEBUG_LIBRARY}" STREQUAL "${PYTHON_LIBRARY}") - SET(VTK_WINDOWS_PYTHON_DEBUGGABLE 0) - IF(WIN32) - IF(PYTHON_DEBUG_LIBRARY MATCHES "_d") - SET(VTK_WINDOWS_PYTHON_DEBUGGABLE 1) - ENDIF(PYTHON_DEBUG_LIBRARY MATCHES "_d") - ENDIF(WIN32) - ELSE(PYTHON_DEBUG_LIBRARY) - SET(VTK_PYTHON_LIBRARIES ${PYTHON_LIBRARY}) - ENDIF(PYTHON_DEBUG_LIBRARY) + endif() + set(VTK_WINDOWS_PYTHON_DEBUGGABLE 0) + if(WIN32) + if(PYTHON_DEBUG_LIBRARY MATCHES "_d") + set(VTK_WINDOWS_PYTHON_DEBUGGABLE 1) + endif() + endif() + else() + set(VTK_PYTHON_LIBRARIES ${PYTHON_LIBRARY}) + endif() # Some python installations on UNIX need to link to extra libraries # such as zlib (-lz). It is hard to automatically detect the needed # libraries so instead just give the user an easy way to specify # the libraries. This should be needed only rarely. It should # also be moved to the CMake FindPython.cmake module at some point. - IF(UNIX) - IF(NOT DEFINED PYTHON_EXTRA_LIBS) - SET(PYTHON_EXTRA_LIBS "" CACHE STRING + if(UNIX) + if(NOT DEFINED PYTHON_EXTRA_LIBS) + set(PYTHON_EXTRA_LIBS "" CACHE STRING "Extra libraries to link when linking to python (such as \"z\" for zlib). Separate multiple libraries with semicolons.") - MARK_AS_ADVANCED(PYTHON_EXTRA_LIBS) - ENDIF(NOT DEFINED PYTHON_EXTRA_LIBS) - ENDIF(UNIX) + mark_as_advanced(PYTHON_EXTRA_LIBS) + endif() + endif() # Include any extra libraries for python. - SET(VTK_PYTHON_LIBRARIES ${VTK_PYTHON_LIBRARIES} ${PYTHON_EXTRA_LIBS}) -ENDIF(VTK_WRAP_PYTHON_FIND_LIBS) - -# VS 6 does not like needing to run a huge number of custom commands -# when building a single target. Generate some extra custom targets -# that run the custom commands before the main target is built. This -# is a hack to work-around the limitation. The test to enable it is -# done here since it does not need to be done for every macro -# invocation. -IF(CMAKE_GENERATOR MATCHES "^Visual Studio 6$") - SET(VTK_WRAP_PYTHON_NEED_CUSTOM_TARGETS 1) - SET(VTK_WRAP_PYTHON_CUSTOM_LIMIT x) - # Limit the number of custom commands in each target - # to 2^7. - FOREACH(t 1 2 3 4 5 6 7) - SET(VTK_WRAP_PYTHON_CUSTOM_LIMIT - ${VTK_WRAP_PYTHON_CUSTOM_LIMIT}${VTK_WRAP_PYTHON_CUSTOM_LIMIT}) - ENDFOREACH(t) -ENDIF(CMAKE_GENERATOR MATCHES "^Visual Studio 6$") + set(VTK_PYTHON_LIBRARIES ${VTK_PYTHON_LIBRARIES} ${PYTHON_EXTRA_LIBS}) +endif() diff --git a/CMake/vtkWrapping.cmake b/CMake/vtkWrapping.cmake new file mode 100644 index 00000000000..54b1bc31294 --- /dev/null +++ b/CMake/vtkWrapping.cmake @@ -0,0 +1,61 @@ +# This file ensures that any module that should be wrapped has the +# vtkWrapHierarchy command executed on it, and also dispatches to the language +# specific wrapping for each module. + +# First, ensure we include the correct CMake code so that we can wrap. +if(VTK_WRAP_PYTHON) + include(vtkPythonWrapping) +endif() +if(VTK_WRAP_TCL) + include(vtkTclWrapping) +endif() +if(VTK_WRAP_JAVA) + include(vtkJavaWrapping) +endif() + +include(vtkWrapHierarchy) + +# This is the main function, always called from the vtk_module_library function +# when a new module library is added. +function(vtk_add_wrapping module_name module_srcs) + if(NOT VTK_MODULE_${module_name}_EXCLUDE_FROM_WRAPPING) + set(_wrap_module FALSE) + if(VTK_WRAP_PYTHON) + set(_wrap_module TRUE) + set_property(GLOBAL APPEND PROPERTY VTK_PYTHON_WRAPPED ${module_name}) + endif() + if(VTK_WRAP_TCL) + set(_wrap_module TRUE) + set_property(GLOBAL APPEND PROPERTY VTK_TCL_WRAPPED ${module_name}) + endif() + if(VTK_WRAP_JAVA) + set(_wrap_module TRUE) + set_property(GLOBAL APPEND PROPERTY VTK_JAVA_WRAPPED ${module_name}) + endif() + if(_wrap_module) + # The module is wrapped by at least one language - invoke wrap hierarchy. + # Set up the include directories for the wrapping + set(VTK_WRAP_INCLUDE_DIRS + ${vtkCommonCore_SOURCE_DIR} + ${vtkCommonCore_BINARY_DIR} + ${VTK_SOURCE_DIR}/Utilities + ${VTK_BINARY_DIR}/Utilities + ${${vtk-module}_SOURCE_DIR} + ) + + vtk_wrap_hierarchy(${module_name}Hierarchy ${CMAKE_CURRENT_BINARY_DIR} + "${module_srcs}") + + # Now to wrap the languages that are on. + if(VTK_WRAP_PYTHON) + vtk_add_python_wrapping(${module_name} "${module_srcs}") + endif() + if(VTK_WRAP_TCL) + vtk_add_tcl_wrapping(${module_name} "${module_srcs}") + endif() + if(VTK_WRAP_JAVA) + vtk_add_java_wrapping(${module_name} "${module_srcs}") + endif() + endif() + endif() +endfunction() diff --git a/CMakeLists.txt b/CMakeLists.txt index 36a53e6506f..4e63201d575 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,39 +1,98 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR) -FOREACH(policy CMP0012 CMP0013 CMP0014) - IF(POLICY ${policy}) - CMAKE_POLICY(SET ${policy} NEW) - ENDIF() -ENDFOREACH() +project(VTK) -FOREACH(policy CMP0017) - IF(POLICY ${policy}) - CMAKE_POLICY(SET ${policy} OLD) - ENDIF() -ENDFOREACH() +set(VTK_CMAKE_DIR "${VTK_SOURCE_DIR}/CMake") +set(CMAKE_MODULE_PATH ${VTK_CMAKE_DIR} ${CMAKE_MODULE_PATH}) +SET(VTK_ENCODESTRING_EXE vtkEncodeString) + +include(vtkModuleMacros) + +# Set a default build type if none was specified +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to 'Debug' as none was specified.") + set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" + "MinSizeRel" "RelWithDebInfo") +endif() + +# Set up our directory structure for output libraries and binaries +if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${VTK_BINARY_DIR}/bin" + CACHE PATH "Runtime output directory") +endif() +if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY) + if(UNIX) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${VTK_BINARY_DIR}/lib" + CACHE PATH "Library output directory") + else() + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${VTK_BINARY_DIR}/bin" + CACHE PATH "Library output directory") + endif() +endif() +if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${VTK_BINARY_DIR}/lib" + CACHE PATH "Archive output directory") +endif() +mark_as_advanced(CMAKE_RUNTIME_OUTPUT_DIRECTORY + CMAKE_LIBRARY_OUTPUT_DIRECTORY + CMAKE_ARCHIVE_OUTPUT_DIRECTORY + ) + +# FIXME: LIBRARY_OUTPUT_PATH and EXECUTABLE_OUTPUT_PATH useage is scattered about VTK. +# when we can patch everything they should simply be replaced with CMAKE_<blah>_OUTPUT_DIRECTORY variables. +IF(NOT LIBRARY_OUTPUT_PATH) + SET(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} CACHE INTERNAL "Single output directory for building all libraries.") +ENDIF(NOT LIBRARY_OUTPUT_PATH) +IF(NOT EXECUTABLE_OUTPUT_PATH) + SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} CACHE INTERNAL "Single output directory for building all executables.") +ENDIF(NOT EXECUTABLE_OUTPUT_PATH) -PROJECT(VTK) +# Choose static or shared libraries. +option(BUILD_SHARED_LIBS "Build VTK with shared libraries." ON) +set(VTK_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) -# Objective C compile flags, future CMake versions might make this obsolete -IF(APPLE) - STRING(REGEX REPLACE "^.*MacOSX([0-9]*\\.[0-9]*)\\.sdk$" "\\1" - OSX_SDK_VERSION "${CMAKE_OSX_SYSROOT}") - SET(VTK_OBJCXX_FLAGS_DEFAULT) - IF(OSX_SDK_VERSION) - IF(${OSX_SDK_VERSION} VERSION_GREATER "10.4") - SET(VTK_OBJCXX_FLAGS_DEFAULT "-fobjc-gc") - ENDIF(${OSX_SDK_VERSION} VERSION_GREATER "10.4") - ENDIF(OSX_SDK_VERSION) - SET(VTK_REQUIRED_OBJCXX_FLAGS ${VTK_OBJCXX_FLAGS_DEFAULT} CACHE STRING "Extra flags for Objective C compilation") - MARK_AS_ADVANCED(VTK_REQUIRED_OBJCXX_FLAGS) -ENDIF(APPLE) +#----------------------------------------------------------------------------- +# VTK version number. An even minor number corresponds to releases. +set(VTK_MAJOR_VERSION 6) +set(VTK_MINOR_VERSION 0) +set(VTK_BUILD_VERSION 0) +set(VTK_VERSION + "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}") -# The Cygwin maintainers have requested that we not define WIN32. Thus developers -# must use the X11 packages to build cygwin vtk. -IF(CYGWIN) - unset(WIN32) -ENDIF() +# VTK installation structure +if(NOT VTK_INSTALL_RUNTIME_DIR) + set(VTK_INSTALL_RUNTIME_DIR bin) +endif() +if(NOT VTK_INSTALL_LIBRARY_DIR) + set(VTK_INSTALL_LIBRARY_DIR lib) +endif() +if(NOT VTK_INSTALL_ARCHIVE_DIR) + set(VTK_INSTALL_ARCHIVE_DIR lib) +endif() +if(NOT VTK_INSTALL_INCLUDE_DIR) + set(VTK_INSTALL_INCLUDE_DIR include/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}) +endif() +if(NOT VTK_INSTALL_DATA_DIR) + set(VTK_INSTALL_DATA_DIR share/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}) +endif() +if(NOT VTK_INSTALL_DOC_DIR) + set(VTK_INSTALL_DOC_DIR share/doc/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}) +endif() +if(NOT VTK_INSTALL_PACKAGE_DIR) + set(VTK_INSTALL_PACKAGE_DIR "lib/cmake/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}") +endif() +if(NOT VTK_INSTALL_TCL_DIR) + # tclsh searches <prefix>/lib/tcltk and its subdirectories for pkgIndex.tcl files + set(VTK_INSTALL_TCL_DIR lib/tcltk/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}) +endif() +if(NOT VTK_INSTALL_EXPORT_NAME) + set(VTK_INSTALL_EXPORT_NAME VTKTargets) +endif() +set(VTK_MODULES_DIR "${VTK_BINARY_DIR}/${VTK_INSTALL_PACKAGE_DIR}/Modules") +# FIXME: Used by HashSource # the following lines are for cross compiling support # we may get here also from ParaView, in this case don't change the filename IF(NOT EXPORT_EXECUTABLES_FILE) @@ -48,100 +107,23 @@ IF(NOT EXPORT_EXECUTABLES_FILE) FILE(WRITE "${EXPORT_EXECUTABLES_FILE}" "#generated by VTK, do not edit\n") ENDIF(NOT EXPORT_EXECUTABLES_FILE) -GET_PROPERTY(VTK_TARGET_SUPPORTS_SHARED_LIBS - GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS) - -# Warn when using "old style" CMake install commands... But only when -# building VTK itself. -# -IF("${VTK_BINARY_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") - MACRO(INSTALL_TARGETS) - MESSAGE(FATAL_ERROR "Somebody is calling old INSTALL_TARGETS command with arguments: ${ARGV}") - ENDMACRO(INSTALL_TARGETS) - MACRO(INSTALL_PROGRAMS) - MESSAGE(FATAL_ERROR "Somebody is calling old INSTALL_PROGRAMS command with arguments: ${ARGV}") - ENDMACRO(INSTALL_PROGRAMS) - MACRO(INSTALL_FILES) - MESSAGE(FATAL_ERROR "Somebody is calling old INSTALL_FILES command with arguments: ${ARGV}") - ENDMACRO(INSTALL_FILES) -ENDIF("${VTK_BINARY_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") - -SET(VTK_CMAKE_DIR "${VTK_SOURCE_DIR}/CMake") -SET(CMAKE_MODULE_PATH "${VTK_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH}) - -# Add supplemental compiler warnings, and GCC visibility support. -INCLUDE(vtkCompilerExtras) - -# Check the source tree - right now just for local Git hooks. -INCLUDE(vtkCheckSourceTree) - -# Set a default build type if none was specified -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "Setting build type to 'Debug' as none was specified.") - set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE) - # Set the possible values of build type for cmake-gui - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" - "MinSizeRel" "RelWithDebInfo") -endif() - -#----------------------------------------------------------------------------- -# VTK version number. An even minor number corresponds to releases. -SET(VTK_MAJOR_VERSION 6) -SET(VTK_MINOR_VERSION 0) -SET(VTK_BUILD_VERSION 0) -SET(VTK_VERSION - "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}") - -# Append the library version information to the library target -# properties. A parent project may set its own properties and/or may -# block this. -IF(NOT VTK_NO_LIBRARY_VERSION) - SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} - VERSION "${VTK_VERSION}" - SOVERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" - ) -ENDIF(NOT VTK_NO_LIBRARY_VERSION) - -INCLUDE(vtkTargetExportMacros) +# FIXME: These will be removed, used by vtkzlib etc +set(VTK_INSTALL_BIN_DIR_CM24 ${VTK_INSTALL_RUNTIME_DIR}) +set(VTK_INSTALL_LIB_DIR_CM24 ${VTK_INSTALL_LIBRARY_DIR}) +set(VTK_INSTALL_PACKAGE_DIR_CM24 ${VTK_INSTALL_PACKAGE_DIR}) +set(VTK_INSTALL_INCLUDE_DIR_CM24 ${VTK_INSTALL_INCLUDE_DIR}) +set(VTK_INSTALL_DOXYGEN_DIR_CM24 ${VTK_INSTALL_DATA_DIR}/doxygen) #----------------------------------------------------------------------------- -# Determine whether we are being built by CTest and if so the version. -# For CTest 2.2 and higher this will contain the version number. For -# earlier CTest versions this will contain just "1". If not -# configuring from CTest this should be empty, so set the result to a -# literal "0" (helps with numerical comparisons). -SET(VTK_TEST_FROM_CTEST "$ENV{DASHBOARD_TEST_FROM_CTEST}") -IF(NOT VTK_TEST_FROM_CTEST) - SET(VTK_TEST_FROM_CTEST 0) -ENDIF(NOT VTK_TEST_FROM_CTEST) - -# Determine whether tests requiring the configuration type to be known -# can be run. Start by assuming the configuration type is known. -# This is the case when using a generator supporting only one -# configuration type. -SET(VTK_TEST_CONFIG_TYPE_KNOWN 1) -IF(CMAKE_CONFIGURATION_TYPES) - # When there are multiple configuration types we must be running - # tests with a CTest that knows how to give the configuration type - # to the test when it runs. This requires CTest 2.2 or higher. - IF(VTK_TEST_FROM_CTEST LESS "2.2") - # This is either a CTest older than 2.2 or not a CTest. - # The configuration type will not be known when running the tests. - SET(VTK_TEST_CONFIG_TYPE_KNOWN 0) - ENDIF(VTK_TEST_FROM_CTEST LESS "2.2") -ENDIF(CMAKE_CONFIGURATION_TYPES) +# The third party macros are still used in one or two third party builds. +include(vtkThirdParty) #----------------------------------------------------------------------------- -# Load some macros. -INCLUDE(vtkDependentOption) -INCLUDE(vtkThirdParty) -INCLUDE(vtkExportKit) -INCLUDE(vtkMakeInstantiator) -INCLUDE(CMakeExportBuildSettings) +include(vtkCompilerExtras) +include(vtkBuildPath) #----------------------------------------------------------------------------- -# Choose static or shared libraries. -INCLUDE(vtkSelectSharedLibraries) +include(CTest) #----------------------------------------------------------------------------- # Does VTK require support for 64 bit file systems @@ -155,8 +137,8 @@ SET(VTK_REQUIRE_LARGE_FILE_SUPPORT ${CMAKE_REQUIRE_LARGE_FILE_SUPPORT}) #----------------------------------------------------------------------------- # Does the const_reverse_iterator have the comparison operators? Before GCC # 4.1 they were not present. -INCLUDE(CheckCXXSourceCompiles) -SET(VTK_CONST_REVERSE_ITERATOR_COMPARISON_FILE +include(CheckCXXSourceCompiles) +set(VTK_CONST_REVERSE_ITERATOR_COMPARISON_FILE "#include <vector> int main() { @@ -165,353 +147,57 @@ int main() it != test.rend(); return 0; }") -CHECK_CXX_SOURCE_COMPILES("${VTK_CONST_REVERSE_ITERATOR_COMPARISON_FILE}" +check_cxx_source_compiles("${VTK_CONST_REVERSE_ITERATOR_COMPARISON_FILE}" VTK_CONST_REVERSE_ITERATOR_COMPARISON) -#----------------------------------------------------------------------------- -# Discover the name of the runtime library path environment variable -# and put the result in SHARED_LIBRARY_PATH_VAR_NAME. -# The result depends on the platform and on some platforms it depends on -# the compiler options (32-bit vs. 64-bit). - -INCLUDE(SharedLibraryPathVarName) - -#----------------------------------------------------------------------------- -# Output directories. -IF(NOT LIBRARY_OUTPUT_PATH) - SET(LIBRARY_OUTPUT_PATH ${VTK_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.") -ENDIF(NOT LIBRARY_OUTPUT_PATH) -IF(NOT EXECUTABLE_OUTPUT_PATH) - SET(EXECUTABLE_OUTPUT_PATH ${VTK_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.") -ENDIF(NOT EXECUTABLE_OUTPUT_PATH) - -#----------------------------------------------------------------------------- -# Directories with the configuration subdir, for advanced use only. -# These are only used when passing arguments to custom commands, -# or when writing config files for use by external projects. -# In other circumstances, the build system will handle the config -# subdirectory automatically. - -IF("${CMAKE_CFG_INTDIR}" STREQUAL ".") - SET(VTK_LIBRARY_DIR ${LIBRARY_OUTPUT_PATH}) - SET(VTK_EXECUTABLE_DIR ${EXECUTABLE_OUTPUT_PATH}) -ELSE("${CMAKE_CFG_INTDIR}" STREQUAL ".") - SET(VTK_LIBRARY_DIR ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}) - SET(VTK_EXECUTABLE_DIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}) -ENDIF("${CMAKE_CFG_INTDIR}" STREQUAL ".") - -#----------------------------------------------------------------------------- -# Where the cxx tests are, for use in ADD_TEST -SET(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH}) -IF(CMAKE_CONFIGURATION_TYPES) - SET(CXX_TEST_CONFIG /\${CTEST_CONFIGURATION_TYPE}) -ELSE() - SET(CXX_TEST_CONFIG "") -ENDIF() - -#----------------------------------------------------------------------------- -# Configure install locations. This allows parent projects to modify -# the install location. Optionally allow the project to specify a -# single VTK_INSTALL_ROOT which basically adds to its install prefix -# for VTK only. - -# The location in which to install VTK executables. -IF(NOT VTK_INSTALL_BIN_DIR) - SET(VTK_INSTALL_BIN_DIR ${VTK_INSTALL_ROOT}/bin) -ENDIF(NOT VTK_INSTALL_BIN_DIR) - -# The location in which to install VTK header files. -IF(NOT VTK_INSTALL_INCLUDE_DIR) - SET(VTK_INSTALL_INCLUDE_DIR - ${VTK_INSTALL_ROOT}/include/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} - ) -ENDIF(NOT VTK_INSTALL_INCLUDE_DIR) - -# The location in which to install VTK libraries. -IF(NOT VTK_INSTALL_LIB_DIR) - SET(VTK_INSTALL_LIB_DIR - ${VTK_INSTALL_ROOT}/lib/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} - ) -ENDIF(NOT VTK_INSTALL_LIB_DIR) - -# The location in which to install misc VTK files -IF(NOT VTK_INSTALL_SHARE_DIR) - SET(VTK_INSTALL_SHARE_DIR - ${VTK_INSTALL_ROOT}/share/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} - ) -ENDIF(NOT VTK_INSTALL_SHARE_DIR) - -# The location in which to install CMake scripts for packaging VTK. -IF(NOT VTK_INSTALL_PACKAGE_DIR) - SET(VTK_INSTALL_PACKAGE_DIR ${VTK_INSTALL_LIB_DIR}) -ENDIF(NOT VTK_INSTALL_PACKAGE_DIR) - -# The location in which to install VTK doxygen documentation helper -# files. -IF(NOT VTK_INSTALL_DOXYGEN_DIR) - SET(VTK_INSTALL_DOXYGEN_DIR ${VTK_INSTALL_PACKAGE_DIR}/doxygen) -ENDIF(NOT VTK_INSTALL_DOXYGEN_DIR) - -# The location in which to install VTK documentation files that -# are not automatically generated. -IF(NOT VTK_INSTALL_DOC_DIR) - SET(VTK_INSTALL_DOC_DIR ${VTK_INSTALL_PACKAGE_DIR}/doc) -ENDIF(NOT VTK_INSTALL_DOC_DIR) - -# Compute the proper location for installing the Tcl package. This -# must be a fixed relative path below the library install location and -# is therefore not settable by parent projects. -SET(VTK_INSTALL_TCL_DIR ${VTK_INSTALL_LIB_DIR}) - -IF(NOT VTK_INSTALL_JAVA_DIR) - SET(VTK_INSTALL_JAVA_DIR ${VTK_INSTALL_PACKAGE_DIR}/java) -ENDIF(NOT VTK_INSTALL_JAVA_DIR) - -OPTION(VTK_INSTALL_THIRD_PARTY_LIBRARIES "Use fixup bundle to install vtk and vtkpython dependencies." OFF) -MARK_AS_ADVANCED(VTK_INSTALL_THIRD_PARTY_LIBRARIES) - -# There are three basic components to the VTK installation: runtime, -# development, and documentation. Install rules for each component -# are surrounded by blockers. Parent projects or users can specify -# VTK_INSTALL_NO_RUNTIME, VTK_INSTALL_NO_DEVELOPMENT, or -# VTK_INSTALL_NO_DOCUMENTATION to avoid installation of the -# corresponding component. - -# Shared libraries are considered both runtime and development and -# static libraries are considered development only. In order to -# switch library installation on and off correctly we make the -# decision here. -SET(VTK_INSTALL_NO_LIBRARIES) - -IF(BUILD_SHARED_LIBS) - IF(VTK_INSTALL_NO_RUNTIME AND VTK_INSTALL_NO_DEVELOPMENT) - SET(VTK_INSTALL_NO_LIBRARIES ON) - ENDIF(VTK_INSTALL_NO_RUNTIME AND VTK_INSTALL_NO_DEVELOPMENT) -ELSE(BUILD_SHARED_LIBS) - IF(VTK_INSTALL_NO_DEVELOPMENT) - SET(VTK_INSTALL_NO_LIBRARIES ON) - ENDIF(VTK_INSTALL_NO_DEVELOPMENT) -ENDIF(BUILD_SHARED_LIBS) - -# Because INSTALL_* commands require a leading / and because INSTALL (cmake 2.4 -# and newer) requires no leading / to install under INSTALL_PREFIX, we -# are stripping the leading /. In the future, there should be no leading -# / in any install directory variables -STRING(REGEX REPLACE "^/" "" VTK_INSTALL_LIB_DIR_CM24 "${VTK_INSTALL_LIB_DIR}") -STRING(REGEX REPLACE "^/" "" VTK_INSTALL_BIN_DIR_CM24 "${VTK_INSTALL_BIN_DIR}") -STRING(REGEX REPLACE "^/" "" VTK_INSTALL_SHARE_DIR_CM24 "${VTK_INSTALL_SHARE_DIR}") -STRING(REGEX REPLACE "^/" "" VTK_INSTALL_INCLUDE_DIR_CM24 "${VTK_INSTALL_INCLUDE_DIR}") -STRING(REGEX REPLACE "^/" "" VTK_INSTALL_PACKAGE_DIR_CM24 "${VTK_INSTALL_PACKAGE_DIR}") -STRING(REGEX REPLACE "^/" "" VTK_INSTALL_DOXYGEN_DIR_CM24 "${VTK_INSTALL_DOXYGEN_DIR}") -STRING(REGEX REPLACE "^/" "" VTK_INSTALL_DOC_DIR_CM24 "${VTK_INSTALL_DOC_DIR}") -STRING(REGEX REPLACE "^/" "" VTK_INSTALL_TCL_DIR_CM24 "${VTK_INSTALL_TCL_DIR}") -STRING(REGEX REPLACE "^/" "" VTK_INSTALL_JAVA_DIR_CM24 "${VTK_INSTALL_JAVA_DIR}") - -#----------------------------------------------------------------------------- -# Provide option to build executables as forwarding executables where by a launcher that -# sets the appropriate environment is installed in /bin/ which then 'launches' the 'real' -# executable under lib. -if(UNIX) - OPTION(VTK_BUILD_FORWARDING_EXECUTABLES "Build forwarding executables for vtk, vtkpython, etc." OFF) - INCLUDE(vtkForwardingExecutable) - MARK_AS_ADVANCED(VTK_BUILD_FORWARDING_EXECUTABLES) -endif() - -#----------------------------------------------------------------------------- -# Save the compiler settings so another project can import them. -CMAKE_EXPORT_BUILD_SETTINGS(${VTK_BINARY_DIR}/VTKBuildSettings.cmake) -IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - INSTALL(FILES "${VTK_BINARY_DIR}/VTKBuildSettings.cmake" - DESTINATION ${VTK_INSTALL_PACKAGE_DIR_CM24} - COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) - #----------------------------------------------------------------------------- # Provide compatibility options. -OPTION(VTK_LEGACY_REMOVE "Remove all legacy code completely." OFF) -OPTION(VTK_LEGACY_SILENT "Silence all legacy code messages." OFF) -MARK_AS_ADVANCED(VTK_LEGACY_REMOVE VTK_LEGACY_SILENT) - -#----------------------------------------------------------------------------- -OPTION(VTK_USE_METAIO "Build metaio" ON) -MARK_AS_ADVANCED(VTK_USE_METAIO) - -# Determine the set of VTK kits that should be built. -OPTION(VTK_USE_RENDERING "Build the vtkRendering kit. Needed for displaying data or using widgets." ON) -OPTION(VTK_USE_INFOVIS "Build the vtkInfovis kit. Needed for performing information visualization." ON) - -VTK_DEPENDENT_OPTION(VTK_USE_PARALLEL "Build the vtkParallel kit." OFF "" OFF) -VTK_DEPENDENT_OPTION(VTK_USE_VIEWS "Build the vtkViews kit. Needed for creating packaged and linked views." ON - "VTK_USE_RENDERING;VTK_USE_INFOVIS" OFF) -VTK_DEPENDENT_OPTION(VTK_USE_GEOVIS "Build the vtkGeovis kit. Needed for performing geographic visualization." ON - "VTK_USE_VIEWS" OFF) - -OPTION(VTK_USE_N_WAY_ARRAYS "Add support for arbitrary-dimension sparse and dense arrays." ON) - -# Determine Shading Support -VTK_DEPENDENT_OPTION(VTK_USE_CG_SHADERS "Build pixel and vertex shader support for Cg." OFF - "VTK_USE_RENDERING" OFF) -VTK_DEPENDENT_OPTION(VTK_USE_GLSL_SHADERS "Build pixel and vertex shader support for GLSL." ON - "VTK_USE_RENDERING" OFF) - -VTK_DEPENDENT_OPTION(VTK_USE_CHARTS "Build VTK chart support (OpenGL based)" ON - "VTK_USE_RENDERING;VTK_USE_VIEWS" OFF) - -VTK_DEPENDENT_OPTION(VTK_USE_CHEMISTRY "Build VTK chemistry support" OFF - "VTK_USE_RENDERING" OFF) - -SET(VTK_DEFAULT_SHADERS_DIR - "${VTK_BINARY_DIR}/Utilities/MaterialLibrary/Repository" - CACHE INTERNAL - "The directory in which code for Shaders is provided.") - -SET(VTK_MATERIALS_DIRS - ${VTK_DEFAULT_SHADERS_DIR} - CACHE STRING - "; separated directories to search for materials/shaders") - -MARK_AS_ADVANCED(VTK_USE_CG_SHADERS VTK_USE_GLSL_SHADERS VTK_MATERIALS_DIRS) - -# Add Option to enable Qt Support. -OPTION(VTK_USE_QT "Build Qt support" OFF) - -IF(VTK_USE_QT) -# Now require Qt 4.5.0 or later - SET(QT_MIN_VERSION "4.5.0") - SET(QT_OFFICIAL_VERSION "4.5") - SET(QT_REQUIRED TRUE) - SET(QT_USE_QTSQL 1) - FIND_PACKAGE(Qt4) - IF(NOT QT4_FOUND) - MESSAGE(SEND_ERROR "Qt ${QT_MIN_VERSION} or greater not found. Please check the QT_QMAKE_EXECUTABLE variable.") - ELSE(NOT QT4 FOUND) - # enforce Carbon or Cocoa in VTK for Qt/Mac if we are not building with X11 explicitly turned on - IF(Q_WS_MAC AND NOT VTK_USE_X) - IF(QT_MAC_USE_COCOA) - SET(VTK_USE_CARBON OFF CACHE BOOL "Build VTK with Carbon" FORCE) - SET(VTK_USE_COCOA ON CACHE BOOL "Build VTK with Cocoa" FORCE) - ELSE(QT_MAC_USE_COCOA) - SET(VTK_USE_CARBON ON CACHE BOOL "Build VTK with Carbon" FORCE) - SET(VTK_USE_COCOA OFF CACHE BOOL "Build VTK with Cocoa" FORCE) - ENDIF(QT_MAC_USE_COCOA) - ENDIF(Q_WS_MAC AND NOT VTK_USE_X) - ENDIF(NOT QT4_FOUND) -ENDIF(VTK_USE_QT) - -# Determine GUI Support. -VTK_DEPENDENT_OPTION(VTK_USE_GUISUPPORT "Build VTK with GUI Support" OFF - "VTK_USE_RENDERING" OFF) -MARK_AS_ADVANCED(VTK_USE_GUISUPPORT) -IF(VTK_USE_QT AND VTK_USE_RENDERING) - SET(VTK_USE_GUISUPPORT 1 CACHE BOOL "Build VTK with GUI Support" FORCE) -ENDIF() - -# Determing Qt GUI. This is no longer a user settable option. It's value depends -# on whether VTK_USE_GUISUPPORT and VTK_USE_RENDERING and VTK_USE_QT are all -# set to ON. -IF (VTK_USE_QT AND VTK_USE_GUISUPPORT AND VTK_USE_RENDERING) - SET (VTK_USE_QVTK ON CACHE INTERNAL "Build QVTK widget and plugin for Qt" FORCE) -ELSE (VTK_USE_QT AND VTK_USE_GUISUPPORT AND VTK_USE_RENDERING) - SET (VTK_USE_QVTK OFF CACHE INTERNAL "Build QVTK widget and plugin for Qt" FORCE) -ENDIF (VTK_USE_QT AND VTK_USE_GUISUPPORT AND VTK_USE_RENDERING) - -# Remove old options from an existing cache. -IF(NOT "VTK_USE_HYBRID" MATCHES "^VTK_USE_HYBRID$") - SET(VTK_USE_HYBRID "" CACHE INTERNAL "Hiding old option") -ENDIF(NOT "VTK_USE_HYBRID" MATCHES "^VTK_USE_HYBRID$") -IF(NOT "VTK_USE_PATENTED" MATCHES "^VTK_USE_PATENTED$") - SET(VTK_USE_PATENTED "" CACHE INTERNAL "Hiding old option") -ENDIF(NOT "VTK_USE_PATENTED" MATCHES "^VTK_USE_PATENTED$") -IF(NOT "VTK_USE_VOLUMERENDERING" MATCHES "^VTK_USE_VOLUMERENDERING$") - SET(VTK_USE_VOLUMERENDERING "" CACHE INTERNAL "Hiding old option") -ENDIF(NOT "VTK_USE_VOLUMERENDERING" MATCHES "^VTK_USE_VOLUMERENDERING$") - -SET(VTK_KITS COMMON FILTERING IO GRAPHICS GENERIC_FILTERING IMAGING) - -# Include Rendering in module path to find vtkTestingObjectFactory -IF(VTK_USE_RENDERING) - SET(CMAKE_MODULE_PATH "${VTK_SOURCE_DIR}/Rendering/" ${CMAKE_MODULE_PATH}) -ENDIF() - -IF(VTK_USE_RENDERING) - SET(VTK_KITS ${VTK_KITS} RENDERING) - SET(VTK_KITS ${VTK_KITS} VOLUMERENDERING) - SET(VTK_KITS ${VTK_KITS} HYBRID) - SET(VTK_KITS ${VTK_KITS} WIDGETS) -ENDIF(VTK_USE_RENDERING) - -IF(VTK_USE_PARALLEL) - SET(VTK_KITS ${VTK_KITS} PARALLEL) - SET(VTK_KITS ${VTK_KITS} AMR) -ENDIF(VTK_USE_PARALLEL) - -IF(VTK_USE_INFOVIS) - SET(VTK_KITS ${VTK_KITS} INFOVIS) -ENDIF(VTK_USE_INFOVIS) - -IF(VTK_USE_GEOVIS) - SET(VTK_KITS ${VTK_KITS} GEOVIS) -ENDIF(VTK_USE_GEOVIS) - -IF(VTK_USE_VIEWS) - SET(VTK_KITS ${VTK_KITS} VIEWS) -ENDIF(VTK_USE_VIEWS) - -# from GUISupport -IF(VTK_USE_QVTK) - SET(VTK_KITS ${VTK_KITS} QVTK) -ENDIF(VTK_USE_QVTK) - -IF(VTK_USE_MFC) - SET(VTK_KITS ${VTK_KITS} MFC) -ENDIF(VTK_USE_MFC) - -IF(VTK_USE_CHARTS) - SET(VTK_KITS ${VTK_KITS} CHARTS) -ENDIF(VTK_USE_CHARTS) - -IF(VTK_USE_CHEMISTRY) - SET(VTK_KITS ${VTK_KITS} CHEMISTRY) -ENDIF(VTK_USE_CHEMISTRY) +option(VTK_LEGACY_REMOVE "Remove all legacy code completely." ON) +option(VTK_LEGACY_SILENT "Silence all legacy code messages." OFF) +mark_as_advanced(VTK_LEGACY_REMOVE VTK_LEGACY_SILENT) #----------------------------------------------------------------------------- -# Determine GUI. - -IF (NOT VTK_DONT_INCLUDE_USE_X) - # We moved VTK_USE_X option code into a separate file so that - # projects including VTK can include this cmake script and use - # the option themselves, in which case, they set the VTK_DONT_INCLUDE_USE_X - # variable to ensure that VTK doesn't set up the option again. - INCLUDE(vtkUseX) -ENDIF (NOT VTK_DONT_INCLUDE_USE_X) - -VTK_DEPENDENT_OPTION(VTK_USE_CARBON "Build classes using Carbon API." OFF - "APPLE;VTK_USE_RENDERING" OFF) -VTK_DEPENDENT_OPTION(VTK_USE_COCOA "Build classes using Cocoa API." ON - "APPLE;VTK_USE_RENDERING" OFF) +# VTK requires special compiler flags on some platforms. +include(vtkDetermineCompilerFlags) -IF(VTK_USE_CARBON AND VTK_USE_COCOA) - MESSAGE(SEND_ERROR "Only one of VTK_USE_CARBON and VTK_USE_COCOA may be ON.") - # Since Cocoa is the default, assume user wants to switch to Carbon - SET(VTK_USE_COCOA OFF) -ENDIF(VTK_USE_CARBON AND VTK_USE_COCOA) +# Tell VTK source files they are being built inside VTK. +add_definitions(-DVTK_IN_VTK) #----------------------------------------------------------------------------- -# Determine whether to use the experimental Ogg/Theora writer. -OPTION(VTK_USE_OGGTHEORA_ENCODER "Build experimental Ogg/Theora support" OFF) -MARK_AS_ADVANCED(VTK_USE_OGGTHEORA_ENCODER) +# Configure the default VTK_DATA_ROOT for the location of VTKData. To get +# the VTKData repository from git, issue the following command: +# +# git clone git://vtk.org/VTKData.git +# +# To see the web hosted repository, visit http://vtk.org/VTKData.git +FIND_PATH(VTK_DATA_ROOT VTKData.readme + ${VTK_SOURCE_DIR}/VTKData + ${VTK_SOURCE_DIR}/../VTKData + ${VTK_SOURCE_DIR}/../../VTKData + $ENV{VTK_DATA_ROOT} + DOC "The repository for data used for testing. To obtain from git: \"git clone git://vtk.org/VTKData.git\"" + ) +mark_as_advanced(VTK_DATA_ROOT) #----------------------------------------------------------------------------- -# VTK requires special compiler flags on some platforms. -INCLUDE(vtkDetermineCompilerFlags) - -# Tell VTK source files they are being built inside VTK. -ADD_DEFINITIONS(-DVTK_IN_VTK) +# Configure the default VTK_LARGE_DATA_ROOT for the location of VTKLargeData. +# To get the VTKLargeData repository from git, issue the following command: +# +# git clone git://vtk.org/VTKLargeData.git +# +# To see the web hosted repository, visit http://vtk.org/VTKLargeData.git +FIND_PATH(VTK_LARGE_DATA_ROOT VTKLargeData.readme + ${VTK_SOURCE_DIR}/VTKLargeData + ${VTK_SOURCE_DIR}/../VTKLargeData + ${VTK_SOURCE_DIR}/../../VTKLargeData + $ENV{VTK_LARGE_DATA_ROOT} + DOC "The repository for large data used for testing. To obtain from git: \"git clone git://vtk.org/VTKLargeData.git\"" + ) +mark_as_advanced(VTK_LARGE_DATA_ROOT) #----------------------------------------------------------------------------- # Platform configuration tests. - -INCLUDE (TestBigEndian) +include(TestBigEndian) TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN) include(FindThreads) @@ -536,142 +222,28 @@ set(VTK_MAX_THREADS "64" CACHE STRING "Max number of threads vktMultiThreader will allocate.") mark_as_advanced(VTK_MAX_THREADS) -INCLUDE(TestForANSIStreamHeaders) +include(TestForANSIStreamHeaders) +include(TestForSTDNamespace) +include(TestForANSIForScope) +include(CheckTypeSize) # Simulate old CMakeBackwardCompatibilityCXX test. -INCLUDE(TestForSSTREAM) +include(TestForSSTREAM) # Tests for various integer, bool and float types -INCLUDE(vtkTestTypes) +include(vtkTestTypes) # Socket tests etc. -INCLUDE(Parallel/VTKParallelCMakeTests.cmake) +#INCLUDE(Parallel/VTKParallelCMakeTests.cmake) # Check for full template specialization support by compiler. -INCLUDE(vtkTestFullSpecialization) +include(vtkTestFullSpecialization) # Check for explicit template instantiation support by compiler. -INCLUDE(vtkTestExplicitInstantiation) +include(vtkTestExplicitInstantiation) # Test for atomics and other compiler intrinsics -INCLUDE(vtkTestBuiltins) - -# Setup clean configuration of vtkConfigure.h and vtkToolkits.h. -MACRO(VTK_PREPARE_CMAKEDEFINE not invar outvar) - IF(${not} ${invar}) - SET(${outvar} 1) - ELSE(${not} ${invar}) - SET(${outvar}) - ENDIF(${not} ${invar}) -ENDMACRO(VTK_PREPARE_CMAKEDEFINE) - -VTK_PREPARE_CMAKEDEFINE("" CMAKE_WORDS_BIGENDIAN VTK_WORDS_BIGENDIAN) -VTK_PREPARE_CMAKEDEFINE("" CMAKE_NO_ANSI_STRING_STREAM VTK_NO_ANSI_STRING_STREAM) -VTK_PREPARE_CMAKEDEFINE(NOT VTK_EXPLICIT_TEMPLATES - VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION) -VTK_PREPARE_CMAKEDEFINE(NOT VTK_COMPILER_HAS_FULL_SPECIALIZATION - VTK_NO_FULL_TEMPLATE_SPECIALIZATION) - -#----------------------------------------------------------------------------- -# Include file dependency tracking regular expression. -SET(VTK_REGEX "vtk[^.]*\\.([^t]|t[^x]|tx[^x]|cxx|hxx)") -IF(VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION) - # Track all .txx file dependencies. - SET(VTK_REGEX_TXX "vtk[^.]*\\.txx") -ELSE(VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION) - # Track all .txx file dependencies except *Implicit.txx files. - SET(VTK_REGEX_TXX "vtk[^.]*([^t]|[^i]t|[^c]it|[^i]cit|[^l]icit|[^p]licit|[^m]plicit|[^I]mplicit)\\.txx") -ENDIF(VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION) -INCLUDE_REGULAR_EXPRESSION("(^|/)((lex|png|j|z|t|Test|D|Q|verdict).*|${VTK_REGEX}|${VTK_REGEX_TXX})$") - -#----------------------------------------------------------------------------- -# Determine the set of language wrappers that should be built. -OPTION(VTK_WRAP_TCL "Wrap VTK classes into the TCL language." OFF) -OPTION(VTK_WRAP_PYTHON "Wrap VTK classes into the Python language." OFF) -OPTION(VTK_WRAP_JAVA "Wrap VTK classes into the Java language." OFF) -OPTION(VTK_WRAP_PYTHON_SIP "Make python wrapped classes available to SIP/PyQt." OFF) -IF(VTK_WRAP_PYTHON_SIP) - FIND_PROGRAM(SIP_EXECUTABLE NAMES sip DOC "Path to sip executable") - FIND_PATH(SIP_INCLUDE_DIR NAMES sip.h - PATHS "${PYTHON_INCLUDE_PATH}" "${PYTHON_INCLUDE_PATH}/../Lib/site-packages/PyQt4/include") -ENDIF(VTK_WRAP_PYTHON_SIP) - -# Python requires shared libraries. -IF(VTK_WRAP_PYTHON AND VTK_TARGET_SUPPORTS_SHARED_LIBS AND NOT BUILD_SHARED_LIBS ) - MESSAGE(SEND_ERROR "VTK_WRAP_PYTHON requires BUILD_SHARED_LIBS to be ON.") - SET(VTK_WRAP_PYTHON 0) -ENDIF(VTK_WRAP_PYTHON AND VTK_TARGET_SUPPORTS_SHARED_LIBS AND NOT BUILD_SHARED_LIBS ) - -# Java requires shared libraries on Windows. -IF(VTK_WRAP_JAVA AND WIN32 AND NOT BUILD_SHARED_LIBS) - MESSAGE(SEND_ERROR "VTK_WRAP_JAVA requires BUILD_SHARED_LIBS to be ON.") - SET(VTK_WRAP_JAVA 0) -ENDIF(VTK_WRAP_JAVA AND WIN32 AND NOT BUILD_SHARED_LIBS) - -SET(VTK_LANGUAGES "") -IF(VTK_WRAP_TCL) - SET(VTK_LANGUAGES ${VTK_LANGUAGES} TCL) -ENDIF(VTK_WRAP_TCL) -IF(VTK_WRAP_PYTHON) - SET(VTK_LANGUAGES ${VTK_LANGUAGES} PYTHON) -ENDIF(VTK_WRAP_PYTHON) -IF(VTK_WRAP_JAVA) - SET(VTK_LANGUAGES ${VTK_LANGUAGES} JAVA) -ENDIF(VTK_WRAP_JAVA) - -#----------------------------------------------------------------------------- -# Configure testing support. -INCLUDE(CTest) -MARK_AS_ADVANCED(DART_ROOT TCL_TCLSH CVSCOMMAND CVS_UPDATE_OPTIONS DART_TESTING_TIMEOUT) -IF(BUILD_TESTING) - ENABLE_TESTING() -ENDIF(BUILD_TESTING) -CONFIGURE_FILE(${VTK_CMAKE_DIR}/CTestCustom.ctest.in - ${VTK_BINARY_DIR}/CMake/CTestCustom.ctest @ONLY) -FILE(WRITE ${VTK_BINARY_DIR}/CTestCustom.cmake - "INCLUDE(\"${VTK_BINARY_DIR}/CMake/CTestCustom.ctest\")\n") - -OPTION(VTK_USE_DISPLAY "Turn this option off and tests and warning/error macros will not popup windows" ON) -MARK_AS_ADVANCED(VTK_USE_DISPLAY) - -#------------------------------------------------------------------------------ -# Options for C++ test driver - -# locale -OPTION(VTK_TESTING_USE_LOCALE "VTK c++ tests will start with specified locale." OFF) -MARK_AS_ADVANCED(VTK_TESTING_USE_LOCALE) -SET(VTK_TESTING_LOCALE "" CACHE STRING "Locale for VTK C++ tests. Example fr_FR.utf8, empty string for env variable.") -MARK_AS_ADVANCED(VTK_TESTING_LOCALE) - -# Leave this option ON by default. It helps to catch floating point math -# exceptions early on nightly dashboard runs. -# -OPTION(VTK_TESTING_USE_FPE "VTK tests call vtkFloatingPointExceptions::Enable()" ON) -MARK_AS_ADVANCED(VTK_TESTING_USE_FPE) - - -SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN) - -IF(VTK_TESTING_USE_LOCALE) - SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "${CMAKE_TESTDRIVER_BEFORE_TESTMAIN} - setlocale(LC_ALL,\"${VTK_TESTING_LOCALE}\"); - std::locale::global(std::locale(\"${VTK_TESTING_LOCALE}\"));") -ENDIF(VTK_TESTING_USE_LOCALE) - -IF(VTK_TESTING_USE_FPE) - SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "${CMAKE_TESTDRIVER_BEFORE_TESTMAIN} - vtkFloatingPointExceptions::Enable();\n") -ENDIF(VTK_TESTING_USE_FPE) - -SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "${CMAKE_TESTDRIVER_BEFORE_TESTMAIN} - try {") - -SET(CMAKE_TESTDRIVER_AFTER_TESTMAIN " } - catch(std::exception& e) - { - fprintf(stderr, \"Test driver caught exception: [%s]\\n\", e.what()); - result = -1; - }") +include(vtkTestBuiltins) #----------------------------------------------------------------------------- # Select a streams library. @@ -687,221 +259,16 @@ IF(VTK_USE_RENDERING AND WIN32) INCLUDE(vtkTestVideoForWindows) ENDIF(VTK_USE_RENDERING AND WIN32) -#----------------------------------------------------------------------------- -# Configure KWSys to be named "vtksys". -SET(KWSYS_NAMESPACE vtksys) -SET(KWSYS_USE_Base64 1) -SET(KWSYS_USE_CommandLineArguments 1) -SET(KWSYS_USE_DynamicLoader 1) -SET(KWSYS_USE_Process 1) -SET(KWSYS_USE_RegularExpression 1) -SET(KWSYS_USE_SystemTools 1) -SET(KWSYS_USE_SystemInformation 1) -SET(KWSYS_USE_FundamentalType 1) -SET(KWSYS_USE_MD5 1) -SET(KWSYS_USE_Glob 1) -SET(KWSYS_USE_DateStamp 1) -SET(KWSYS_HEADER_ROOT ${VTK_BINARY_DIR}/Utilities) -SET(KWSYS_PROPERTIES_CXX ${VTK_LIBRARY_PROPERTIES}) -SET(KWSYS_INSTALL_EXPORT_NAME ${VTK_INSTALL_EXPORT_NAME}) - -IF(NOT VTK_USE_ANSI_STDLIB) - SET(KWSYS_IOS_FORCE_OLD 1) -ENDIF(NOT VTK_USE_ANSI_STDLIB) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - SET(KWSYS_LIBRARY_INSTALL_DIR ${VTK_INSTALL_LIB_DIR}) - SET(KWSYS_INSTALL_BIN_DIR ${VTK_INSTALL_BIN_DIR_CM24}) - SET(KWSYS_INSTALL_LIB_DIR ${VTK_INSTALL_LIB_DIR_CM24}) - SET(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME RuntimeLibraries) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) -IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - SET(KWSYS_INSTALL_INCLUDE_DIR ${VTK_INSTALL_INCLUDE_DIR_CM24}) - SET(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT Development) -ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) - #----------------------------------------------------------------------------- # Dispatch the build into the proper subdirectories. - - SET(VTK_HAS_EXODUS 1) #----------------------------------------------------------------------------- # Provide a few configuration options. OPTION(BUILD_EXAMPLES "Build VTK examples." OFF) -IF("${CMAKE_SIZEOF_VOID_P}" GREATER 4) - SET(VTK_USE_64BIT_IDS_DEFAULT ON) -ELSE("${CMAKE_SIZEOF_VOID_P}" GREATER 4) - SET(VTK_USE_64BIT_IDS_DEFAULT OFF) -ENDIF("${CMAKE_SIZEOF_VOID_P}" GREATER 4) -OPTION(VTK_USE_64BIT_IDS "Build VTK with 64 bit ids" - ${VTK_USE_64BIT_IDS_DEFAULT}) - -OPTION(VTK_DEBUG_LEAKS "Build leak checking support into VTK." OFF) -MARK_AS_ADVANCED(VTK_DEBUG_LEAKS VTK_USE_64BIT_IDS) - -VTK_DEPENDENT_OPTION(VTK_OPENGL_HAS_OSMESA - "The opengl library being used supports off screen Mesa calls." OFF - "VTK_USE_RENDERING;UNIX" OFF) - - -SET(VTK_CAN_DO_OFF_SCREEN) -IF(VTK_OPENGL_HAS_OSMESA OR WIN32) - SET(VTK_CAN_DO_OFF_SCREEN 1) -ENDIF(VTK_OPENGL_HAS_OSMESA OR WIN32) - -VTK_DEPENDENT_OPTION(VTK_USE_OFFSCREEN - "Use off screen calls by default." OFF - "VTK_CAN_DO_OFF_SCREEN" OFF) -VTK_DEPENDENT_OPTION(VTK_USE_MPI - "Use Message Passing Interface (MPI) library for parallel support." OFF - "VTK_USE_PARALLEL" OFF) -VTK_DEPENDENT_OPTION(VTK_USE_MATROX_IMAGING - "Use Matrox Imaging Library for video input." OFF - "VTK_USE_RENDERING;WIN32" OFF) -VTK_DEPENDENT_OPTION(VTK_USE_GL2PS "Build VTK with gl2ps support." OFF - "VTK_USE_RENDERING" ON) -VTK_DEPENDENT_OPTION(VTK_USE_PARALLEL_BGL - "Use the Parallel Boost Graph Library" - OFF - "VTK_USE_BOOST;VTK_USE_MPI;VTK_USE_PARALLEL;VTK_USE_64BIT_IDS" - OFF) - -SET(VTK_CAN_USE_TK OFF) -SET(VTK_USE_TK_DEFAULT ON) -IF(VTK_WRAP_PYTHON OR VTK_WRAP_TCL) - IF(NOT VTK_DISABLE_TK_INIT) - SET(VTK_CAN_USE_TK ON) - IF(APPLE) - IF (OSX_SDK_VERSION) - IF (${OSX_SDK_VERSION} VERSION_LESS "10.6") - # Until OS X 10.6, building Tk with Cocoa was not possible - IF (VTK_USE_COCOA) - SET(VTK_CAN_USE_TK OFF) - ENDIF (VTK_USE_COCOA) - ELSE (${OSX_SDK_VERSION} VERSION_LESS "10.6") - # For OS X 10.6, the default system Tk is Cocoa, not Carbon - IF (VTK_USE_CARBON) - SET(VTK_USE_TK_DEFAULT OFF) - ENDIF (VTK_USE_CARBON) - ENDIF (${OSX_SDK_VERSION} VERSION_LESS "10.6") - ENDIF (OSX_SDK_VERSION) - ENDIF(APPLE) - ENDIF(NOT VTK_DISABLE_TK_INIT) -ENDIF(VTK_WRAP_PYTHON OR VTK_WRAP_TCL) -VTK_DEPENDENT_OPTION(VTK_USE_TK "Build VTK with Tk support" - ${VTK_USE_TK_DEFAULT} "VTK_CAN_USE_TK" OFF) - -MARK_AS_ADVANCED(VTK_OPENGL_HAS_OSMESA - VTK_USE_OFFSCREEN - VTK_USE_TK - VTK_USE_GL2PS - VTK_USE_MATROX_IMAGING - VTK_USE_MPI - VTK_USE_PARALLEL_BGL) - -#----------------------------------------------------------------------------- -# Provide options to use system versions of third-party libraries. -VTK_THIRD_PARTY_OPTION(ZLIB zlib) - -set(HDF5_FIND_COMPONENTS "HL;C") -VTK_THIRD_PARTY_OPTION(HDF5 hdf5) -INCLUDE(vtkHDF5Library) - -IF(VTK_USE_GL2PS) -VTK_THIRD_PARTY_OPTION(GL2PS gl2ps) -ENDIF(VTK_USE_GL2PS) -VTK_THIRD_PARTY_OPTION(JPEG jpeg) -VTK_THIRD_PARTY_OPTION(PNG png) -VTK_THIRD_PARTY_OPTION(TIFF tiff) -VTK_THIRD_PARTY_OPTION(EXPAT expat) -VTK_THIRD_PARTY_OPTION(FREETYPE freetype) -VTK_THIRD_PARTY_OPTION(LIBXML2 libxml2) -VTK_THIRD_PARTY_OPTION(LIBPROJ4 proj4) -if(VTK_USE_OGGTHEORA_ENCODER) - VTK_THIRD_PARTY_OPTION(OGGTHEORA oggtheora) -endif(VTK_USE_OGGTHEORA_ENCODER) - -#----------------------------------------------------------------------------- -# Configure OpenGL support. -IF(VTK_USE_RENDERING) - # At the moment CMake's FindOpenGL considers OpenGL should be found - # in the framework version on OSX. This is a reasonable assumption for - # few people are going to use X. The module warns that if X is to be - # used, one has to set the libs and include dir manually, which is - # exactly what we are going to do below. - IF(APPLE AND VTK_USE_X) - FIND_PATH(OPENGL_INCLUDE_DIR GL/gl.h - /usr/X11R6/include) - FIND_PATH(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h - /usr/X11R6/include) - FIND_LIBRARY(OPENGL_gl_LIBRARY NAMES GL MesaGL - PATHS /usr/lib /usr/local/lib /usr/X11R6/lib) - FIND_LIBRARY(OPENGL_glu_LIBRARY NAMES GLU MesaGLU - PATHS ${OPENGL_gl_LIBRARY} /usr/lib /usr/local/lib /usr/X11R6/lib) - ENDIF(APPLE AND VTK_USE_X) - FIND_PACKAGE(OpenGL) - - FIND_PACKAGE(DirectX QUIET) - if(DirectX_FOUND) - set(VTK_USE_DIRECTX 1) - endif(DirectX_FOUND) - - find_package(ApplicationServices) - find_package(IOKit) - if(ApplicationServices_FOUND AND IOKit_FOUND) - set(VTK_USE_CORE_GRAPHICS 1) - endif(ApplicationServices_FOUND AND IOKit_FOUND) - - if(VTK_USE_X) - option(VTK_USE_NVCONTROL "Use NVIDIAs X server extension NVCONTROL." OFF) - if(VTK_USE_NVCONTROL) - find_package(NVCtrlLib REQUIRED) - endif(VTK_USE_NVCONTROL) - mark_as_advanced(VTK_USE_NVCONTROL) - endif(VTK_USE_X) - -ENDIF(VTK_USE_RENDERING) - -VTK_PREPARE_CMAKEDEFINE("" OPENGL_LIBRARY VTK_USE_OPENGL_LIBRARY) - -#----------------------------------------------------------------------------- -# Configure Off-Screen MESA support. -# If rendering is enabled, but there is no graphics system enabled, enforce osmesa -IF(VTK_USE_RENDERING AND NOT WIN32 AND NOT APPLE AND NOT VTK_USE_X) - SET(VTK_OPENGL_HAS_OSMESA ON CACHE BOOL "Forced to ON since neither OPEN_gl_LIBRARY nor MangledMesa were found" FORCE) -ENDIF(VTK_USE_RENDERING AND NOT WIN32 AND NOT APPLE AND NOT VTK_USE_X) - -IF(VTK_OPENGL_HAS_OSMESA) - FIND_PACKAGE(OSMesa) -ENDIF(VTK_OPENGL_HAS_OSMESA) - -#----------------------------------------------------------------------------- -# Configure CG-Shading support. -IF(VTK_USE_CG_SHADERS) - FIND_PACKAGE(Cg) - MARK_AS_ADVANCED(CG_COMPILER CG_INCLUDE_PATH CG_LIBRARY CG_GL_LIBRARY) -ENDIF(VTK_USE_CG_SHADERS) - -#----------------------------------------------------------------------------- -# Configure GLSL-Shading support. -# TODO: Should verify that GL2.0 is supported. - -#----------------------------------------------------------------------------- -# Configure Matrox Imaging support. -IF(VTK_USE_MATROX_IMAGING) - FIND_LIBRARY(MIL_LIBRARY MIL - "C:/Program Files/Matrox Imaging/mil/library/winnt/msc/dll" - "C:/Program Files/Matrox Imaging/mil/library/windows/msc/dll" - ) - FIND_PATH(MIL_INCLUDE_PATH mil.h - "C:/Program Files/Matrox Imaging/mil/include" - ) -ENDIF(VTK_USE_MATROX_IMAGING) - IF(VTK_USE_MPI) - FIND_PACKAGE(MPI REQUIRED) + FIND_PACKAGE(MPI) ENDIF(VTK_USE_MPI) #----------------------------------------------------------------------------- @@ -915,12 +282,11 @@ ENDIF(VTK_USE_MPI) # So, tests will be run something like this: # ${VTK_MPIRUN_EXE} ${VTK_MPI_PRENUMPROC_FLAGS} ${VTK_MPI_NUMPROC_FLAG} 2 ${VTK_MPI_PREFLAGS} executable ${VTK_MPI_POSTFLAGS} # - IF(VTK_USE_MPI) # Use MPI variables defined in the CMake (2.8) FindMPI module. IF(${MPIEXEC}) - SET(VTK_MPIRUN_EXE ${MPIEXEC} CACHE FILEPATH "" FORCE) + SET(VTK_MPIRUN_EXE CACHE FILEPATH ${MPIEXEC} FORCE) SET(VTK_MPI_PRENUMPROC_FLAGS ${MPIEXEC_PREFLAGS} CACHE STRING "These flags will be directly before the number of processess flag (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)" FORCE) IF(NOT ${MPI_NUMPROC_FLAG}) SET(VTK_MPI_NUMPROC_FLAG "-np" CACHE STRING "Flag used by mpi to specify the number of processes, the next option will be the number of processes. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)" FORCE) @@ -947,587 +313,89 @@ IF(VTK_USE_MPI) SEPARATE_ARGUMENTS(VTK_MPI_POSTFLAGS) ENDIF(VTK_USE_MPI) -#----------------------------------------------------------------------------- -# Create STL header wrappers to block warnings in the STL headers. -# This is now deprecated, and should not be used. Kept for backwards compat. -# Should be completely removed before VTK 6.0 is tagged. -IF(NOT VTK_LEGACY_REMOVE) - FOREACH(header - algorithm - deque - exception - functional - iterator - limits - list - map - memory - new - numeric - queue - set - stack - stdexcept - string - utility - vector - ) - SET(VTK_STL_HEADER "${header}") - CONFIGURE_FILE(${VTK_SOURCE_DIR}/Utilities/vtkstd.h.in - ${VTK_BINARY_DIR}/vtkstd/${header} @ONLY IMMEDIATE) - IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - INSTALL(FILES ${VTK_BINARY_DIR}/vtkstd/${header} - DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24}/vtkstd - COMPONENT Development) - ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) - ENDFOREACH(header) -ENDIF() - -#----------------------------------------------------------------------------- -# VTK utility script locations. -SET(VTK_DOXYGEN_HOME ${VTK_SOURCE_DIR}/Utilities/Doxygen) -SET(VTK_HEADER_TESTING_PY ${VTK_SOURCE_DIR}/Common/Testing/HeaderTesting.py) -SET(VTK_FIND_STRING_TCL ${VTK_SOURCE_DIR}/Common/Testing/Tcl/FindString.tcl) -SET(VTK_PRINT_SELF_CHECK_TCL ${VTK_SOURCE_DIR}/Common/Testing/Tcl/PrintSelfCheck.tcl) -SET(VTK_RT_IMAGE_TEST_TCL ${VTK_SOURCE_DIR}/Common/Testing/Tcl/rtImageTest.tcl) -IF(VTK_USE_PARALLEL) - SET(VTK_PRT_IMAGE_TEST_TCL ${VTK_SOURCE_DIR}/Common/Testing/Tcl/prtImageTest.tcl) -ENDIF(VTK_USE_PARALLEL) - - - -#----------------------------------------------------------------------------- -# Configure the python executable for use by testing. -# Python executable is used by some tests whether VTK_WRAP_PYTHON is -# on or not. -# If VTK_WRAP_PYTHON is on, then we need python executable to compile -# scripts. -IF(BUILD_TESTING OR VTK_WRAP_PYTHON) - FIND_PACKAGE(PythonInterp QUIET) - MARK_AS_ADVANCED(PYTHON_EXECUTABLE) -ENDIF(BUILD_TESTING OR VTK_WRAP_PYTHON) - -#----------------------------------------------------------------------------- -# Configure the default VTK_DATA_ROOT for the location of VTKData. To get -# the VTKData repository from git, issue the following command: -# -# git clone git://vtk.org/VTKData.git -# -# To see the web hosted repository, visit http://vtk.org/VTKData.git -FIND_PATH(VTK_DATA_ROOT VTKData.readme - ${VTK_SOURCE_DIR}/VTKData - ${VTK_SOURCE_DIR}/../VTKData - ${VTK_SOURCE_DIR}/../../VTKData - $ENV{VTK_DATA_ROOT} - DOC "The repository for data used for testing. To obtain from git: \"git clone git://vtk.org/VTKData.git\"" - ) - -#----------------------------------------------------------------------------- -# Configure the default VTK_LARGE_DATA_ROOT for the location of VTKLargeData. -# To get the VTKLargeData repository from git, issue the following command: -# -# git clone git://vtk.org/VTKLargeData.git -# -# To see the web hosted repository, visit http://vtk.org/VTKLargeData.git -FIND_PATH(VTK_LARGE_DATA_ROOT VTKLargeData.readme - ${VTK_SOURCE_DIR}/VTKLargeData - ${VTK_SOURCE_DIR}/../VTKLargeData - ${VTK_SOURCE_DIR}/../../VTKLargeData - $ENV{VTK_LARGE_DATA_ROOT} - DOC "The repository for large data used for testing. To obtain from git: \"git clone git://vtk.org/VTKLargeData.git\"" - ) - -#----------------------------------------------------------------------------- -# FFMPEG -# If the ffmpeg library is available, use it. -OPTION (VTK_USE_FFMPEG_ENCODER "If the FFMPEG library is available, should VTK use it for saving .avi animation files?" FALSE) -MARK_AS_ADVANCED(VTK_USE_FFMPEG_ENCODER) -IF (VTK_USE_FFMPEG_ENCODER) - FIND_PACKAGE(FFMPEG) - MARK_AS_ADVANCED(CLEAR - FFMPEG_INCLUDE_DIR - FFMPEG_avformat_LIBRARY - FFMPEG_avcodec_LIBRARY - FFMPEG_avutil_LIBRARY - ) -ENDIF (VTK_USE_FFMPEG_ENCODER) - -#----------------------------------------------------------------------------- -# MPEG2 -# -# Portions of the mpeg2 library are patented. VTK does not enable linking to -# this library by default so VTK can remain "patent free". Users who wish to -# link in mpeg2 functionality must build that library separately and then -# turn on VTK_USE_MPEG2_ENCODER when configuring VTK. After turning on -# VTK_USE_MPEG2_ENCODER, you must also set the CMake variables -# vtkMPEG2Encode_INCLUDE_PATH and vtkMPEG2Encode_LIBRARIES. -# -# To use the patented mpeg2 library, first build it, then set the following -# CMake variables during the VTK configure step: -# VTK_USE_MPEG2_ENCODER = ON -# vtkMPEG2Encode_INCLUDE_PATH = /path/to/vtkmpeg2encode;/path/to/vtkmpeg2encode-bin -# vtkMPEG2Encode_LIBRARIES = /path/to/vtkmpeg2encode-bin/vtkMPEG2Encode.lib -# -# Or using -D args on the cmake/ccmake command line: -# -DVTK_USE_MPEG2_ENCODER:BOOL=ON -# "-DvtkMPEG2Encode_INCLUDE_PATH:PATH=/path/to/vtkmpeg2encode;/path/to/vtkmpeg2encode-bin" -# "-DvtkMPEG2Encode_LIBRARIES:STRING=/path/to/vtkmpeg2encode-bin/vtkMPEG2Encode.lib" -# -# You are solely responsible for any legal issues associated with using -# patented code in your software. -# Ref: http://www.vtk.org/get-software.php#addons -# -OPTION (VTK_USE_MPEG2_ENCODER - "Enable use of the patented mpeg2 library. You are solely responsible for any legal issues associated with using patented code in your software." - OFF) -MARK_AS_ADVANCED(VTK_USE_MPEG2_ENCODER) -IF (VTK_USE_MPEG2_ENCODER) - FIND_PACKAGE(MPEG2) -ENDIF (VTK_USE_MPEG2_ENCODER) - #----------------------------------------------------------------------------- # Configure files with settings for use by the build. -CONFIGURE_FILE(${VTK_SOURCE_DIR}/vtkConfigure.h.in - ${VTK_BINARY_DIR}/vtkConfigure.h @ONLY IMMEDIATE) - -CONFIGURE_FILE(${VTK_SOURCE_DIR}/UseVTK.cmake.in - ${VTK_BINARY_DIR}/UseVTK.cmake COPYONLY IMMEDIATE) - -CONFIGURE_FILE(${VTK_SOURCE_DIR}/vtkToolkits.h.in - ${VTK_BINARY_DIR}/vtkToolkits.h @ONLY) - - -#----------------------------------------------------------------------------- - -IF(VTK_WRAP_TCL OR VTK_WRAP_PYTHON) - IF(VTK_WRAP_TCL) - SET(VTK_INCLUDE_NEED_TCL 1) - ENDIF(VTK_WRAP_TCL) - IF(VTK_USE_RENDERING AND VTK_USE_TK) - SET(VTK_INCLUDE_NEED_TK 1) - SET(VTK_INCLUDE_NEED_TCL 1) - ENDIF(VTK_USE_RENDERING AND VTK_USE_TK) -ENDIF(VTK_WRAP_TCL OR VTK_WRAP_PYTHON) - -#----------------------------------------------------------------------------- -# search Python, Tcl and Java - -IF(VTK_WRAP_PYTHON) - # Tell vtkWrapPython.cmake to set VTK_PYTHON_LIBRARIES for us. - SET(VTK_WRAP_PYTHON_FIND_LIBS 1) - INCLUDE(vtkWrapPython) -ENDIF(VTK_WRAP_PYTHON) - -IF(VTK_WRAP_TCL OR VTK_INCLUDE_NEED_TK) - # Tell vtkWrapTcl.cmake to set VTK_TCL_LIBRARIES for us. - SET(VTK_WRAP_TCL_FIND_LIBS 1) - INCLUDE(vtkWrapTcl) -ENDIF(VTK_WRAP_TCL OR VTK_INCLUDE_NEED_TK) - -IF(VTK_WRAP_JAVA) - SET(VTK_WRAP_JAVA3_INIT_DIR "${VTK_SOURCE_DIR}/Wrapping") - INCLUDE(vtkWrapJava) - FIND_PACKAGE(Java) - FIND_PACKAGE(JNI) - # Some platforms have libjvm in a subdirectory from - # the rest of the java libraries and are missing the symlink. - IF(JAVA_AWT_LIBRARY) - FOREACH(__java_library ${JAVA_AWT_LIBRARY}) - GET_FILENAME_COMPONENT(JAVA_LIB_DIR ${__java_library} PATH) - IF(EXISTS ${JAVA_LIB_DIR}/xawt) - LINK_DIRECTORIES(${JAVA_LIB_DIR}/xawt) - ENDIF(EXISTS ${JAVA_LIB_DIR}/xawt) - IF(EXISTS ${JAVA_LIB_DIR}/client) - LINK_DIRECTORIES(${JAVA_LIB_DIR}/client) - ENDIF(EXISTS ${JAVA_LIB_DIR}/client) - IF(EXISTS ${JAVA_LIB_DIR}/server) - LINK_DIRECTORIES(${JAVA_LIB_DIR}/server) - ENDIF(EXISTS ${JAVA_LIB_DIR}/server) - ENDFOREACH(__java_library) - ENDIF(JAVA_AWT_LIBRARY) -ENDIF(VTK_WRAP_JAVA) - - - -#----------------------------------------------------------------------------- -# The entire VTK tree should use the same include path. - -# Create the list of include directories needed for VTK header files. -INCLUDE(${VTK_SOURCE_DIR}/vtkIncludeDirectories.cmake) - -# This should be the only INCLUDE_DIRECTORIES command in the entire -# tree, except for the CMake, Utilities, and Examples directories. We -# need to do this in one place to make sure the order is correct. -# (isn't the order now handled automatically by cmake, i.e. build dir before source dir ?, Alex) -INCLUDE_DIRECTORIES( - ${VTK_INCLUDE_DIRS_BUILD_TREE} - ${VTK_INCLUDE_DIRS_SOURCE_TREE} - ${VTK_INCLUDE_DIRS_BUILD_TREE_CXX} - ${VTK_INCLUDE_DIRS_SYSTEM} -) - -#----------------------------------------------------------------------------- -# Allow local additions to this file without CVS conflicts. -INCLUDE(${VTK_BINARY_DIR}/LocalUserOptions.cmake OPTIONAL) -INCLUDE(${VTK_SOURCE_DIR}/LocalUserOptions.cmake OPTIONAL) - - -# Utility libraries and executables. -ADD_SUBDIRECTORY(Wrapping) - -#----------------------------------------------------------------------------- -# Wrapping hints used by all Tcl, Python and Java wrapping. -# It can also be used by external wrapping tools. -FIND_FILE(VTK_WRAP_HINTS hints ${VTK_SOURCE_DIR}/Wrapping NO_CMAKE_FIND_ROOT_PATH) -MARK_AS_ADVANCED(VTK_WRAP_HINTS) - -#----------------------------------------------------------------------------- -SET(VTK_IGNORE_BTX ON) -SET(VTK_IGNORE_BTX ${VTK_IGNORE_BTX} CACHE BOOL "Ignore BTX and ETX in header files." FORCE) -#OPTION(VTK_IGNORE_BTX "Ignore BTX and ETX in header files." ON) -MARK_AS_ADVANCED(VTK_IGNORE_BTX) - -#----------------------------------------------------------------------------- -# Hierarchy wrapping for type checking in the wrapper generators -IF(VTK_IGNORE_BTX) -IF(VTK_WRAP_TCL OR VTK_WRAP_PYTHON OR VTK_WRAP_JAVA) - # CMake macro - INCLUDE(vtkWrapHierarchy) - SET(VTK_WRAP_HIERARCHY_EXE vtkWrapHierarchy) -ENDIF(VTK_WRAP_TCL OR VTK_WRAP_PYTHON OR VTK_WRAP_JAVA) -ENDIF(VTK_IGNORE_BTX) - -#----------------------------------------------------------------------------- -# Configure Tcl wrapping support, setup executables -IF(VTK_WRAP_TCL) - # Wrapping executables. - SET(VTK_WRAP_TCL_EXE vtkWrapTcl) - SET(VTK_WRAP_TCL_INIT_EXE vtkWrapTclInit) - - # VTK tcl executables. - SET(VTK_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/vtk) - IF(VTK_USE_PARALLEL AND VTK_USE_MPI) - SET(PVTK_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/pvtk) - ENDIF(VTK_USE_PARALLEL AND VTK_USE_MPI) - - # Tcl package location. - SET(VTK_TCL_HOME ${VTK_BINARY_DIR}/Wrapping/Tcl) - - OPTION(VTK_TCL_TK_STATIC "Build with static Tcl/Tk support. TCL_LIBRARY and TK_LIBRARY must point to the corresponding Tcl/Tk static libraries (example, tcl84sx.lib, tk84sx.lib)." OFF) - MARK_AS_ADVANCED(VTK_TCL_TK_STATIC) -ENDIF(VTK_WRAP_TCL) - -#----------------------------------------------------------------------------- -# Configure Python wrapping support, setup the wrapper executables -IF(VTK_WRAP_PYTHON) - SET(VTK_WRAP_PYTHON_EXE vtkWrapPython) - SET(VTK_WRAP_PYTHON_INIT_EXE vtkWrapPythonInit) - - # VTK python executables. - SET(VTK_PYTHON_EXE ${EXECUTABLE_OUTPUT_PATH}/vtkpython) - IF(VTK_USE_PARALLEL AND VTK_USE_MPI) - SET(PVTK_PYTHON_EXE ${EXECUTABLE_OUTPUT_PATH}/pvtkpython) - ENDIF(VTK_USE_PARALLEL AND VTK_USE_MPI) -ENDIF(VTK_WRAP_PYTHON) +# Include the sockets test. +# FIXME: The test should be moved and rewritten. +include(VTKParallelCMakeTests) + +# Add the option for build the Python wrapping to VTK. +option(VTK_WRAP_PYTHON "Should VTK Python wrapping be built?" OFF) + +# Add the option for build the Python wrapping to VTK. +option(VTK_WRAP_JAVA "Should VTK Java wrapping be built?" OFF) + +# FIXME: This variable should not be necessary once we are done +set(VTK_IGNORE_BTX ON CACHE INTERNAL "VTK modular always ignores BTX") + +find_file(VTK_WRAP_HINTS hints ${VTK_SOURCE_DIR}/Wrapping + NO_CMAKE_FIND_ROOT_PATH) +mark_as_advanced(VTK_WRAP_HINTS) + +if(VTK_WRAP_PYTHON) + find_package(PythonInterp QUIET) + mark_as_advanced(PYTHON_EXECUTABLE) + set(VTK_WRAP_PYTHON_EXE vtkWrapPython) + set(VTK_WRAP_PYTHON_INIT_EXE vtkWrapPythonInit) + set(VTK_PYTHON_EXE vtkpython) + # Force the PythonCore module to on if wrapping is on + set(Module_vtkWrappingPythonCore ON CACHE BOOL "Core Python wrapping library" + FORCE) +else() + # if wrapping is not on then force PythonCore module to be off + set(Module_vtkWrappingPythonCore OFF CACHE BOOL "Core Python wrapping library" + FORCE) +endif() -#----------------------------------------------------------------------------- -# Configure Java wrapping support, setup executables -IF(VTK_WRAP_JAVA) +if(VTK_WRAP_JAVA) + set(VTK_WRAP_JAVA3_INIT_DIR "${VTK_SOURCE_DIR}/Wrapping") # Wrapping executables. - SET(VTK_WRAP_JAVA_EXE vtkWrapJava) - SET(VTK_PARSE_JAVA_EXE vtkParseJava) + set(VTK_WRAP_JAVA_EXE vtkWrapJava) + set(VTK_PARSE_JAVA_EXE vtkParseJava) + set(Module_vtkWrappingJavaCore ON CACHE BOOL "Core Java wrapping library" + FORCE) # Java package location. - SET(VTK_JAVA_JAR ${LIBRARY_OUTPUT_PATH}/vtk.jar) - SET(VTK_JAVA_HOME ${VTK_BINARY_DIR}/java/vtk) - MAKE_DIRECTORY(${VTK_JAVA_HOME}) -ENDIF(VTK_WRAP_JAVA) - -VTK_PREPARE_CMAKEDEFINE("" JAVA_AWT_INCLUDE_PATH VTK_USE_JAWT) - -#----------------------------------------------------------------------------- -# Set the encoder for shader programs -SET(VTK_ENCODESTRING_EXE vtkEncodeString) - -#----------------------------------------------------------------------------- -# Add the option to use Boost -OPTION(VTK_USE_BOOST "Use Boost libraries for graph algorithms - www.boost.org." OFF) -MARK_AS_ADVANCED(VTK_USE_BOOST) - -# Look for Boost only if using Boost -IF(VTK_USE_BOOST) - if (VTK_USE_PARALLEL_BGL) - CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0) - if (MSVC) - set(Boost_USE_STATIC_LIBS ON) - endif (MSVC) - SET(Boost_ADDITIONAL_VERSIONS "1.40" "1.40.0" "1.39" "1.39.0") - # TODO: Change to Boost 1.40.0 when that version is released. - # PBGL is in Boost SVN Head, but will first appear in 1.40 release. - FIND_PACKAGE(Boost 1.39.0 REQUIRED - COMPONENTS mpi serialization filesystem system graph_parallel) - - # A note to user, until Boost 1.40 is released to use SVN Head if using PBGL - if (NOT Boost_GRAPH_PARALLEL_FOUND) - message("Could not find Parallel Boost Graph Library components, please - use Boost 1.40 or the latest development snapshop from the Boost - SVN.") - endif (NOT Boost_GRAPH_PARALLEL_FOUND) - - else (VTK_USE_PARALLEL_BGL) - FIND_PACKAGE(Boost REQUIRED) - endif (VTK_USE_PARALLEL_BGL) - - INCLUDE(ExtractBoostVersion) - -# We need Boost 1.32 or later - if (BOOST_VERSION LESS 103200) - MESSAGE(SEND_ERROR "Incompatible Boost version. Boost 1.32.0 or later is required.") - endif (BOOST_VERSION LESS 103200) - -ENDIF(VTK_USE_BOOST) - -#----------------------------------------------------------------------------- -# Add the option to use Matlab Mex and Matlab Engine -OPTION(VTK_USE_MATLAB_MEX "Use Matlab Engine and Matlab Mex files. Requires valid Matlab installation." OFF) -MARK_AS_ADVANCED(VTK_USE_MATLAB_MEX) -IF(VTK_USE_MATLAB_MEX) - IF(NOT VTK_USE_N_WAY_ARRAYS) - MESSAGE(SEND_ERROR "VTK_USE_N_WAY_ARRAYS must be enabled to build Matlab Engine and Matlab Mex interface.") - ENDIF(NOT VTK_USE_N_WAY_ARRAYS) - IF(NOT VTK_USE_INFOVIS) - MESSAGE(SEND_ERROR "VTK_USE_INFOVIS must be enabled to build Matlab Engine and Matlab Mex interface.") - ENDIF(NOT VTK_USE_INFOVIS) - FIND_PACKAGE(MatlabMex) -ENDIF(VTK_USE_MATLAB_MEX) - -#----------------------------------------------------------------------------- -# Add the option to use Gnu R interface for VTK -OPTION(VTK_USE_GNU_R "Use Gnu R interface for VTK. Requires Gnu R installation." OFF) -MARK_AS_ADVANCED(VTK_USE_GNU_R) -IF(VTK_USE_GNU_R) - SET(VTK_TESTING_USE_FPE OFF CACHE BOOL "Disable FPE as it breaks GNU R Testing" FORCE) - IF(NOT VTK_USE_N_WAY_ARRAYS) - MESSAGE(SEND_ERROR "VTK_USE_N_WAY_ARRAYS must be enabled to build Gnu R interface.") - ENDIF(NOT VTK_USE_N_WAY_ARRAYS) - IF(NOT VTK_USE_INFOVIS) - MESSAGE(SEND_ERROR "VTK_USE_INFOVIS must be enabled to build Gnu R interface.") - ENDIF(NOT VTK_USE_INFOVIS) - FIND_PACKAGE(R) -ENDIF(VTK_USE_GNU_R) - -#----------------------------------------------------------------------------- -# Some classes require vtkTypeUInt64Array to be defined. -# Make a flag for it here. -SET(VTK_HAS_UINT64_ARRAY 0) -IF(VTK_SIZEOF_LONG_LONG MATCHES "^8$") - SET(VTK_HAS_UINT64_ARRAY 1) -ELSE(VTK_SIZEOF_LONG_LONG MATCHES "^8$") - IF(VTK_SIZEOF_LONG MATCHES "^8$") - SET(VTK_HAS_UINT64_ARRAY 1) - ELSE(VTK_SIZEOF_LONG MATCHES "^8$") - IF(VTK_SIZEOF___INT64 MATCHES "^8$") - IF(VTK_TYPE_CONVERT_UI64_TO_DOUBLE) - SET(VTK_HAS_UINT64_ARRAY 1) - ENDIF(VTK_TYPE_CONVERT_UI64_TO_DOUBLE) - ENDIF(VTK_SIZEOF___INT64 MATCHES "^8$") - ENDIF(VTK_SIZEOF_LONG MATCHES "^8$") -ENDIF(VTK_SIZEOF_LONG_LONG MATCHES "^8$") - -################################### - -ADD_SUBDIRECTORY(Utilities) - -# Build the subdirector for each kit. -ADD_SUBDIRECTORY(Common) -ADD_SUBDIRECTORY(Filtering) -ADD_SUBDIRECTORY(Imaging) -ADD_SUBDIRECTORY(Graphics) -ADD_SUBDIRECTORY(GenericFiltering) -ADD_SUBDIRECTORY(IO) - -IF(VTK_USE_RENDERING) - ADD_SUBDIRECTORY(Rendering) - ADD_SUBDIRECTORY(VolumeRendering) - ADD_SUBDIRECTORY(Hybrid) - ADD_SUBDIRECTORY(Widgets) -ENDIF(VTK_USE_RENDERING) -IF(VTK_USE_PARALLEL) - ADD_SUBDIRECTORY(Parallel) - ADD_SUBDIRECTORY(AMR) -ENDIF(VTK_USE_PARALLEL) -IF(VTK_USE_INFOVIS) - ADD_SUBDIRECTORY(Infovis) -ENDIF(VTK_USE_INFOVIS) -IF(VTK_USE_GEOVIS) - ADD_SUBDIRECTORY(Geovis) -ENDIF(VTK_USE_GEOVIS) -IF(VTK_USE_VIEWS) - ADD_SUBDIRECTORY(Views) -ENDIF(VTK_USE_VIEWS) -IF(VTK_USE_GUISUPPORT) - ADD_SUBDIRECTORY(GUISupport) -ENDIF(VTK_USE_GUISUPPORT) -IF(VTK_USE_CHARTS) - ADD_SUBDIRECTORY(Charts) -ENDIF(VTK_USE_CHARTS) -IF(VTK_USE_CHEMISTRY) - ADD_SUBDIRECTORY(Chemistry) -ENDIF(VTK_USE_CHEMISTRY) - -# Wrapping. -IF(VTK_WRAP_TCL) - ADD_SUBDIRECTORY(Wrapping/Tcl) -ENDIF(VTK_WRAP_TCL) -IF(VTK_WRAP_PYTHON) - ADD_SUBDIRECTORY(Wrapping/Python) -ENDIF(VTK_WRAP_PYTHON) -IF(VTK_WRAP_JAVA) - ADD_SUBDIRECTORY(Wrapping/Java) -ENDIF(VTK_WRAP_JAVA) - -# Testing. -IF(BUILD_TESTING) - MAKE_DIRECTORY(${VTK_BINARY_DIR}/Testing/Temporary) - # Build scripts to convert tcl tests to python - ADD_SUBDIRECTORY(Utilities/vtkTclTest2Py) - ADD_SUBDIRECTORY(Common/Testing) - ADD_SUBDIRECTORY(Filtering/Testing) - ADD_SUBDIRECTORY(Graphics/Testing) - ADD_SUBDIRECTORY(GenericFiltering/Testing) - ADD_SUBDIRECTORY(Imaging/Testing) - ADD_SUBDIRECTORY(IO/Testing) - IF(VTK_USE_RENDERING) - ADD_SUBDIRECTORY(Rendering/Testing) - ADD_SUBDIRECTORY(VolumeRendering/Testing) - ADD_SUBDIRECTORY(Hybrid/Testing) - ADD_SUBDIRECTORY(Widgets/Testing) - ENDIF(VTK_USE_RENDERING) - IF(VTK_USE_PARALLEL) - ADD_SUBDIRECTORY(Parallel/Testing) - ADD_SUBDIRECTORY(AMR/Testing) - ENDIF(VTK_USE_PARALLEL) - IF(VTK_USE_INFOVIS) - ADD_SUBDIRECTORY(Infovis/Testing) - ENDIF(VTK_USE_INFOVIS) - IF(VTK_USE_GEOVIS) - ADD_SUBDIRECTORY(Geovis/Testing) - ENDIF(VTK_USE_GEOVIS) - IF(VTK_USE_VIEWS) - ADD_SUBDIRECTORY(Views/Testing) - ENDIF(VTK_USE_VIEWS) - IF(VTK_USE_CHARTS) - ADD_SUBDIRECTORY(Charts/Testing) - ENDIF(VTK_USE_CHARTS) - IF(VTK_USE_CHEMISTRY) - ADD_SUBDIRECTORY(Chemistry/Testing) - ENDIF(VTK_USE_CHEMISTRY) -ENDIF(BUILD_TESTING) - -# Include the examples if they are enabled. Note that the in-tree -# build adds tests and a custom target to build the examples project -# in a separate build tree. The examples are not directly included in -# the VTK build. Doing so will not work because they are designed to -# be built out-of-tree. -IF(BUILD_EXAMPLES) - ADD_SUBDIRECTORY(Examples) -ENDIF(BUILD_EXAMPLES) - -#----------------------------------------------------------------------------- -# Help other projects use VTK. - -IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - # Install the instantiator headers. - SET(__inst_files - ${VTK_BINARY_DIR}/vtkCommonInstantiator.h - ${VTK_BINARY_DIR}/vtkFilteringInstantiator.h - ${VTK_BINARY_DIR}/vtkIOInstantiator.h - ${VTK_BINARY_DIR}/vtkImagingInstantiator.h - ${VTK_BINARY_DIR}/vtkGraphicsInstantiator.h - ${VTK_BINARY_DIR}/vtkGenericFilteringInstantiator.h) - IF(VTK_USE_RENDERING) - SET(__inst_files ${__inst_files} ${VTK_BINARY_DIR}/vtkRenderingInstantiator.h) - SET(__inst_files ${__inst_files} ${VTK_BINARY_DIR}/vtkVolumeRenderingInstantiator.h) - SET(__inst_files ${__inst_files} ${VTK_BINARY_DIR}/vtkHybridInstantiator.h) - SET(__inst_files ${__inst_files} ${VTK_BINARY_DIR}/vtkWidgetsInstantiator.h) - ENDIF(VTK_USE_RENDERING) - IF(VTK_USE_PARALLEL) - SET(__inst_files ${__inst_files} ${VTK_BINARY_DIR}/vtkParallelInstantiator.h) - ENDIF(VTK_USE_PARALLEL) - IF(VTK_USE_INFOVIS) - SET(__inst_files ${__inst_files} ${VTK_BINARY_DIR}/vtkInfovisInstantiator.h) - ENDIF(VTK_USE_INFOVIS) - IF(VTK_USE_GEOVIS) - SET(__inst_files ${__inst_files} ${VTK_BINARY_DIR}/vtkGeovisInstantiator.h) - ENDIF(VTK_USE_GEOVIS) - IF(VTK_USE_VIEWS) - SET(__inst_files ${__inst_files} ${VTK_BINARY_DIR}/vtkViewsInstantiator.h) - ENDIF(VTK_USE_VIEWS) - - # Install cmake extensions so user projects can load them. - INSTALL(FILES ${__inst_files} - DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24} - COMPONENT Development) - - # Install the instantiator headers. - SET(__inst_files - ${VTK_CMAKE_DIR}/vtkMakeInstantiator.cmake - ${VTK_CMAKE_DIR}/vtkMakeInstantiator.h.in - ${VTK_CMAKE_DIR}/vtkMakeInstantiator.cxx.in) - INSTALL(FILES ${__inst_files} - DESTINATION ${VTK_INSTALL_PACKAGE_DIR_CM24}/CMake - COMPONENT Development) - -ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) - - -# Install some files. -IF(NOT VTK_INSTALL_NO_DEVELOPMENT) + set(VTK_JAVA_JAR ${LIBRARY_OUTPUT_PATH}/vtk.jar) + set(VTK_JAVA_HOME ${VTK_BINARY_DIR}/java/vtk) + file(MAKE_DIRECTORY ${VTK_JAVA_HOME}) +else() + set(Module_vtkWrappingJavaCore OFF CACHE BOOL "Core Java wrapping library" + FORCE) +endif() - INSTALL(FILES - ${VTK_CMAKE_DIR}/FindMySQL.cmake - ${VTK_CMAKE_DIR}/FindTCL.cmake - ${VTK_CMAKE_DIR}/FindPythonLibs.cmake - ${VTK_CMAKE_DIR}/vtkTclTkMacros.cmake - ${VTK_CMAKE_DIR}/vtkExportKit.cmake - ${VTK_CMAKE_DIR}/vtkKit.cmake.in - ${VTK_CMAKE_DIR}/vtkWrapTcl.cmake - ${VTK_CMAKE_DIR}/vtkWrapJava.cmake - ${VTK_CMAKE_DIR}/vtkWrapPython.cmake - ${VTK_CMAKE_DIR}/vtkWrapperInit.data.in - ${VTK_CMAKE_DIR}/VTKVersionMacros.cmake - DESTINATION ${VTK_INSTALL_PACKAGE_DIR_CM24}/CMake - COMPONENT Development - ) +# Now for Tcl wrapping. +option(VTK_WRAP_TCL "Should VTK Tcl wrapping be built?" OFF) +if(VTK_WRAP_TCL) + set(VTK_WRAP_TCL_EXE vtkWrapTcl) + set(VTK_WRAP_TCL_INIT_EXE vtkWrapTclInit) + set(VTK_TCL_EXE vtk) + # Tcl package location. + set(VTK_TCL_HOME ${VTK_BINARY_DIR}/Wrapping/Tcl) +endif() - SET(__inst_files - ${VTK_BINARY_DIR}/vtkConfigure.h - ${VTK_BINARY_DIR}/vtkToolkits.h) - INSTALL(FILES ${__inst_files} - DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24} - COMPONENT Development) +if(VTK_WRAP_PYTHON OR VTK_WRAP_TCL OR VTK_WRAP_JAVA) + set(VTK_WRAP_HIERARCHY_EXE vtkWrapHierarchy) +endif() - SET(__inst_files - ${VTK_BINARY_DIR}/UseVTK.cmake) - IF(VTK_WRAP_HINTS) - SET(__inst_files ${__inst_files} ${VTK_WRAP_HINTS}) - ENDIF(VTK_WRAP_HINTS) - INSTALL(FILES ${__inst_files} - DESTINATION ${VTK_INSTALL_PACKAGE_DIR_CM24} - COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) +#---------------------------------------------------------------------- +# Load the module DAG. +include(vtkModuleTop) -# Use fixup_bundle to pull in vtk and vtkpython dependencies -IF(VTK_INSTALL_THIRD_PARTY_LIBRARIES AND NOT APPLE) - ADD_SUBDIRECTORY(Utilities/Release) -ENDIF() +# The wrapping must come after all other modules are processed. +if(VTK_WRAP_PYTHON OR VTK_WRAP_TCL OR VTK_WRAP_JAVA) + add_subdirectory(Wrapping) +endif() -# Setup CPack -INCLUDE(VTKCPack.cmake) +if(VTK_WRAP_JAVA) + add_subdirectory(Wrapping/Java) +endif() #----------------------------------------------------------------------------- # The commands in this directory are intended to be executed as # the end of the whole configuration process, as a "last step". -# This directory is typically the last add_subdirectory in the main CMakeLists.txt. -ADD_SUBDIRECTORY(Utilities/LastConfigureStep) +# This directory is typically the last add_subdirectory in the main CMakeLists. +# It must be an add_subdirectory rather than include to assure that the install +# command is processed after all of the other install commands. +add_subdirectory(Utilities/LastConfigureStep) diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 43f381aba19..1147cfd1b3c 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -1,10 +1,13 @@ -set(CTEST_PROJECT_NAME "VTK") +## This file should be placed in the root directory of your project. +## Then modify the CMakeLists.txt file in the root directory of your +## project to incorporate the testing dashboard. +## # The following are required to uses Dart and the Cdash dashboard +## ENABLE_TESTING() +## INCLUDE(CTest) +set(CTEST_PROJECT_NAME "VTKModular") set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") - - set(CTEST_DROP_METHOD "http") - set(CTEST_DROP_SITE "www.cdash.org") -set(CTEST_DROP_LOCATION "/CDash/submit.php?project=VTK") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=VTKModular") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Charts/Core/CMakeLists.txt b/Charts/Core/CMakeLists.txt new file mode 100644 index 00000000000..444f0788a8e --- /dev/null +++ b/Charts/Core/CMakeLists.txt @@ -0,0 +1,44 @@ +set(Module_SRCS + vtkAxis.cxx + vtkAxisExtended.cxx + vtkChart.cxx + vtkChartHistogram2D.cxx + vtkChartLegend.cxx + vtkChartMatrix.cxx + vtkChartParallelCoordinates.cxx + vtkChartPie.cxx + vtkChartXY.cxx + vtkChartXYZ.cxx + vtkColorLegend.cxx + vtkColorSeries.cxx + vtkColorTransferControlPointsItem.cxx + vtkColorTransferFunctionItem.cxx + vtkCompositeControlPointsItem.cxx + vtkCompositeTransferFunctionItem.cxx + vtkControlPointsItem.cxx + vtkLookupTableItem.cxx + vtkPiecewiseControlPointsItem.cxx + vtkPiecewiseFunctionItem.cxx + vtkPiecewisePointHandleItem.cxx + vtkPlot.cxx + vtkPlotBar.cxx + vtkPlotGrid.cxx + vtkPlotHistogram2D.cxx + vtkPlotLine.cxx + vtkPlotParallelCoordinates.cxx # This adds a vtkInfovisCore dep for one class... + vtkPlotPie.cxx + vtkPlotPoints.cxx + vtkPlotStacked.cxx + vtkScalarsToColorsItem.cxx + vtkScatterPlotMatrix.cxx + ) + +set_source_files_properties( + vtkChart + vtkControlPointsItem + vtkPlot + vtkScalarsToColorsItem + ABSTRACT + ) + +vtk_module_library(vtkChartsCore ${Module_SRCS}) diff --git a/Charts/Core/Testing/Cxx/CMakeLists.txt b/Charts/Core/Testing/Cxx/CMakeLists.txt index a5ea7d2fb5a..82e5225e6d1 100644 --- a/Charts/Core/Testing/Cxx/CMakeLists.txt +++ b/Charts/Core/Testing/Cxx/CMakeLists.txt @@ -1,18 +1,14 @@ # if we have rendering and views add the following tests -IF(VTK_USE_RENDERING AND VTK_USE_VIEWS) - - SET(KIT Charts) # add tests that do not require data - SET(MyTests + set(MyTests TestContextScene.cxx TestControlPointsItem.cxx TestControlPointsItemEvents.cxx ) - IF (VTK_DATA_ROOT) + if(VTK_DATA_ROOT) # add tests that require data - SET(MyTests ${MyTests} - #TestContextUnicode.cxx # Disabled until Freetype unicode works + set(MyTests ${MyTests} TestBarGraph.cxx TestBarGraphHorizontal.cxx TestColorTransferFunction.cxx @@ -23,8 +19,6 @@ IF(VTK_USE_RENDERING AND VTK_USE_VIEWS) TestContextImage.cxx TestControlPointsHandleItem.cxx TestDiagram.cxx - #TestFreeTypeContextUnicode.cxx - #TestFreeTypeRender.cxx TestHistogram2D.cxx TestLegendHiddenPlots.cxx TestLinePlot.cxx @@ -46,63 +40,42 @@ IF(VTK_USE_RENDERING AND VTK_USE_VIEWS) TestStackedBarGraph.cxx TestStackedPlot.cxx ) - IF(VTK_USE_GLSL_SHADERS) - SET(MyTests ${MyTests} - TestGLSL.cxx - ) - ENDIF(VTK_USE_GLSL_SHADERS) # Set the tolerance higher for a few tests that need it set(TestGLSLError 12) set(TestChartsOn3DError 16) - SET(TestLinePlotError 25) - SET(TestLinePlot2Error 25) - SET(TestLinePlotInteractionError 25) - SET(TestMultipleRenderersError 25) - SET(TestMultipleScalarsToColorsError 25) - SET(TestParallelCoordinatesError 15) - SET(TestControlPointsHandleItemError 30) - ENDIF (VTK_DATA_ROOT) + set(TestLinePlotError 25) + set(TestLinePlot2Error 25) + set(TestLinePlotInteractionError 25) + set(TestMultipleRenderersError 25) + set(TestMultipleScalarsToColorsError 25) + set(TestParallelCoordinatesError 15) + set(TestControlPointsHandleItemError 30) + endif() - IF (VTK_USE_QT) - #add tests that require Qt - INCLUDE(${QT_USE_FILE}) - IF (VTK_DATA_ROOT) - SET(MyTests ${MyTests} - #TestQtDiagram.cxx - #TestQtContextUnicode.cxx - ) - SET(TestQtDiagramError 25) - SET(TestQtContextUnicodeError 30) - ENDIF (VTK_DATA_ROOT) - ENDIF(VTK_USE_QT) # Use the testing object factory, to reduce boilerplate code in tests. - INCLUDE("${VTK_SOURCE_DIR}/Rendering/vtkTestingObjectFactory.cmake") - ADD_EXECUTABLE(${KIT}CxxTests ${Tests}) - TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkCharts) - - IF(VTK_USE_QT) - TARGET_LINK_LIBRARIES(${KIT}CxxTests ${QT_LIBRARIES}) - ENDIF(VTK_USE_QT) + include("${VTK_SOURCE_DIR}/Testing/Rendering/vtkTestingObjectFactory.cmake") + vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) - SET (TestsToRun ${Tests}) - REMOVE (TestsToRun ${KIT}CxxTests.cxx) + set(TestsToRun ${Tests}) + remove(TestsToRun CxxTests.cxx) # Add all the executables - FOREACH (test ${TestsToRun}) - GET_FILENAME_COMPONENT(TName ${test} NAME_WE) - IF (VTK_DATA_ROOT) - IF(${${TName}Error}) - SET(_error_threshold ${${TName}Error}) - ELSE() - SET(_error_threshold 10) - ENDIF() - ADD_TEST(Charts-${TName} ${CXX_TEST_PATH}/${KIT}CxxTests ${TName} - -D ${VTK_DATA_ROOT} - -T ${VTK_BINARY_DIR}/Testing/Temporary - -V Baseline/${KIT}/${TName}.png - -E ${_error_threshold}) - ELSE (VTK_DATA_ROOT) - ADD_TEST(Charts-${TName} ${CXX_TEST_PATH}/${KIT}CxxTests ${TName}) - ENDIF (VTK_DATA_ROOT) - ENDFOREACH (test) -ENDIF (VTK_USE_RENDERING AND VTK_USE_VIEWS) + foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + if(${${TName}Error}) + set(_error_threshold ${${TName}Error}) + else() + set(_error_threshold 10) + endif() + add_test(NAME Charts-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Charts/${TName}.png + -E ${_error_threshold}) + else() + add_test(NAME Charts-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() + endforeach() diff --git a/Charts/Core/Testing/Python/CMakeLists.txt b/Charts/Core/Testing/Python/CMakeLists.txt new file mode 100644 index 00000000000..28189f57347 --- /dev/null +++ b/Charts/Core/Testing/Python/CMakeLists.txt @@ -0,0 +1,33 @@ +if(VTK_PYTHON_EXE) + set(tests) + if(VTK_DATA_ROOT) + # Tests written in Python that require VTKData + # These tests should use vtk.test.Testing. + set(tests + ${tests} + TestBarGraph + TestLinePlot + TestStackedPlot + TestLinePlotColors + TestParallelCoordinatesColors + TestScatterPlotColors + ) + else() + # Tests written in Python that do NOT require VTKData + # These tests should use vtk.test.Testing. + set(tests + ${tests} + ) + endif() + if(tests) + foreach(tfile ${tests}) + add_test(NAME ${vtk-module}Python-${tfile} + COMMAND ${VTK_PYTHON_EXE} + ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py + -D ${VTK_DATA_ROOT} + -B ${VTK_DATA_ROOT}/Baseline/Charts) + endforeach() + endif() +else() + message(FATAL_ERROR "No Python tests added!") +endif() diff --git a/Charts/Core/module.cmake b/Charts/Core/module.cmake new file mode 100644 index 00000000000..8088a053cc2 --- /dev/null +++ b/Charts/Core/module.cmake @@ -0,0 +1,12 @@ +vtk_module(vtkChartsCore + GROUPS + StandAlone + DEPENDS + vtkRenderingContext2D + vtkInfovisCore # Needed for plot parallel coordinates vtkStringToCategory + TEST_DEPENDS + vtkTestingCore + vtkTestingRendering + vtkViewsContext2D + vtkIOInfovis + ) diff --git a/Chemistry/Core/CMakeLists.txt b/Chemistry/Core/CMakeLists.txt index 469d44e770f..da691507632 100644 --- a/Chemistry/Core/CMakeLists.txt +++ b/Chemistry/Core/CMakeLists.txt @@ -1,13 +1,4 @@ -SET(KIT Chemistry) -SET(UKIT CHEMISTRY) - -SET(KIT_TCL_LIBS vtkFilteringTCL vtkRenderingTCL vtkVolumeRenderingTCL) -SET(KIT_PYTHON_LIBS vtkFilteringPythonD vtkRenderingPythonD vtkVolumeRenderingPythonD) -SET(KIT_JAVA_LIBS vtkFilteringJava vtkRenderingJava vtkVolumeRenderingJava) -SET(KIT_INTERFACE_LIBRARIES vtkFiltering vtkRendering vtkVolumeRendering) - -SET(Kit_SRCS - vtkAbstractElectronicData.cxx +set(Module_SRCS vtkBlueObeliskData.cxx vtkBlueObeliskDataParser.cxx vtkCMLMoleculeReader.cxx @@ -21,51 +12,19 @@ SET(Kit_SRCS vtkSimpleBondPerceiver.cxx ) -SET_SOURCE_FILES_PROPERTIES( - vtkAbstractElectronicData.cxx +set_source_files_properties( vtkMoleculeToPolyDataFilter.cxx ABSTRACT ) -SET(Kit_EXTRA_SRCS) -SET(Kit_EXTRA_CMDS) -SET(Kit_TCL_EXTRA_SRCS) -SET(Kit_PYTHON_EXTRA_SRCS) -SET(Kit_JAVA_EXTRA_SRCS) -SET(KIT_TCL_DEPS) -SET(KIT_PYTHON_DEPS) -SET(KIT_JAVA_DEPS) - -# OpenQube setup -FIND_PACKAGE(OpenQube QUIET) -IF(OpenQube_FOUND) - FIND_PACKAGE(Eigen2 QUIET) - FIND_PACKAGE(Qt4 COMPONENTS QtCore REQUIRED QUIET) -ENDIF(OpenQube_FOUND) -VTK_DEPENDENT_OPTION(VTK_USE_OPENQUBE - "Compile OpenQube support into vtkChemistry." - ON "OpenQube_FOUND;EIGEN2_FOUND" OFF) -IF(VTK_USE_OPENQUBE) - INCLUDE(${QT_USE_FILE}) - INCLUDE_DIRECTORIES(${OpenQube_INCLUDE_DIRS} ${EIGEN2_INCLUDE_DIR}) - SET(KIT_LIBS ${KIT_LIBS} OpenQube) - SET(Kit_SRCS - ${Kit_SRCS} - vtkOpenQubeElectronicData.cxx - vtkOpenQubeMoleculeSource.cxx - ) -ENDIF(VTK_USE_OPENQUBE) - -#----------------------------------------------------------------------------- -# Include CMake code common to all kits. -INCLUDE(${VTK_CMAKE_DIR}/KitCommonBlock.cmake) -#----------------------------------------------------------------------------- - -# Install Blue Obelisk Data Repository files -INSTALL(DIRECTORY vtkBODRData - DESTINATION ${VTK_INSTALL_SHARE_DIR_CM24}/vtkChemistry +set_source_files_properties( + vtkBlueObeliskData.cxx + vtkBlueObeliskDataParser.cxx + WRAP_EXCLUDE ) # Generate configured header file -CONFIGURE_FILE(${VTK_SOURCE_DIR}/Chemistry/vtkChemistryConfigure.h.in - ${VTK_BINARY_DIR}/Chemistry/vtkChemistryConfigure.h IMMEDIATE) +configure_file(${vtkChemistryCore_SOURCE_DIR}/vtkChemistryConfigure.h.in + ${vtkChemistryCore_BINARY_DIR}/vtkChemistryConfigure.h IMMEDIATE) + +vtk_module_library(vtkChemistryCore ${Module_SRCS}) diff --git a/Chemistry/Core/Testing/Cxx/CMakeLists.txt b/Chemistry/Core/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..520f5d69761 --- /dev/null +++ b/Chemistry/Core/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,52 @@ +set(MyTests + TestBallAndStick.cxx + TestBondColorModeDiscreteByAtom.cxx + TestBondColorModeSingleColor.cxx + TestCompositeRender.cxx + TestFastRender.cxx + TestLiquoriceSticks.cxx + TestMolecule.cxx + TestMoleculeSelection.cxx + TestMultiCylinderOn.cxx + TestMultiCylinderOff.cxx + TestPeriodicTable.cxx + TestProgrammableElectronicData.cxx + TestSimpleBondPerceiver.cxx + TestVDWSpheres.cxx + ) + +# Tests with data +if(VTK_DATA_ROOT) + set(MyTests + ${MyTests} + TestCMLMoleculeReader.cxx + ) +endif() + +# Use the testing object factory, to reduce boilerplate code in tests. +include("${VTK_SOURCE_DIR}/Testing/Rendering/vtkTestingObjectFactory.cmake") +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +remove(TestsToRun CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + if(${${TName}Error}) + set(_error_threshold ${${TName}Error}) + else() + set(_error_threshold 10) + endif() + add_test(NAME Chemistry-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Chemistry/${TName}.png + -E ${_error_threshold}) + else() + add_test(NAME Chemistry-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach () diff --git a/Chemistry/Core/module.cmake b/Chemistry/Core/module.cmake new file mode 100644 index 00000000000..92ad498d0d0 --- /dev/null +++ b/Chemistry/Core/module.cmake @@ -0,0 +1,13 @@ +vtk_module(vtkChemistryCore + GROUPS + StandAlone + DEPENDS + vtkCommonDataModel + vtkIOXML + vtkRenderingCore + TEST_DEPENDS + vtkTestingCore + vtkTestingRendering + vtkInteractionStyle + vtkRenderingOpenGL + ) diff --git a/Chemistry/Core/vtkChemistryConfigure.h.in b/Chemistry/Core/vtkChemistryConfigure.h.in index d67e57f8f1e..45c91f6a221 100644 --- a/Chemistry/Core/vtkChemistryConfigure.h.in +++ b/Chemistry/Core/vtkChemistryConfigure.h.in @@ -18,9 +18,6 @@ /* Where the Blue Obelisk Data Repository files are installed */ #define VTK_BODR_DATA_PATH "@CMAKE_INSTALL_PREFIX@/@VTK_INSTALL_SHARE_DIR_CM24@/vtkChemistry/vtkBODRData" -#define VTK_BODR_DATA_PATH_BUILD "@VTK_SOURCE_DIR@/Chemistry/vtkBODRData" - -/* Whether OpenQube is enabled */ -#cmakedefine VTK_USE_OPENQUBE +#define VTK_BODR_DATA_PATH_BUILD "@VTK_SOURCE_DIR@/Chemistry/Core" #endif diff --git a/Common/ComputationalGeometry/CMakeLists.txt b/Common/ComputationalGeometry/CMakeLists.txt new file mode 100644 index 00000000000..e6afe57930a --- /dev/null +++ b/Common/ComputationalGeometry/CMakeLists.txt @@ -0,0 +1,27 @@ +set(Module_SRCS + vtkCardinalSpline.cxx + vtkKochanekSpline.cxx + vtkParametricBoy.cxx + vtkParametricConicSpiral.cxx + vtkParametricCrossCap.cxx + vtkParametricDini.cxx + vtkParametricEllipsoid.cxx + vtkParametricEnneper.cxx + vtkParametricFigure8Klein.cxx + vtkParametricFunction.cxx + vtkParametricKlein.cxx + vtkParametricMobius.cxx + vtkParametricRandomHills.cxx + vtkParametricRoman.cxx + vtkParametricSpline.cxx + vtkParametricSuperEllipsoid.cxx + vtkParametricSuperToroid.cxx + vtkParametricTorus.cxx + ) + +set_source_files_properties( + vtkParametricFunction + ABSTRACT +) + +vtk_module_library(vtkCommonComputationalGeometry ${Module_SRCS}) diff --git a/Common/ComputationalGeometry/Testing/Tcl/CMakeLists.txt b/Common/ComputationalGeometry/Testing/Tcl/CMakeLists.txt new file mode 100644 index 00000000000..fbae710408f --- /dev/null +++ b/Common/ComputationalGeometry/Testing/Tcl/CMakeLists.txt @@ -0,0 +1,34 @@ +if (VTK_USE_RENDERING AND VTK_USE_DISPLAY) + # + # Add tests, with the data + # + if(VTK_DATA_ROOT) + foreach( tfile + CSpline + KSpline + closedSplines + ) + add_test(${tfile}-image ${VTK_EXECUTABLE} + ${VTK_SOURCE_DIR}/Common/Testing/Tcl/rtImageTest.tcl + ${vtkCommonComputationalGeometry_SOURCE_DIR}/Testing/Tcl/${tfile}.tcl + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Filtering/${tfile}.png + -A ${VTK_SOURCE_DIR}/Wrapping/Tcl) + endforeach() + if(VTK_USE_TK) + add_test(squadViewer-image ${VTK_EXECUTABLE} + ${VTK_SOURCE_DIR}/Common/Testing/Tcl/rtImageTest.tcl + ${VTK_SOURCE_DIR}/Filtering/Testing/Tcl/squadViewer.tcl + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Filtering/squadViewer.png + -A ${VTK_SOURCE_DIR}/Wrapping/Tcl) + endif() + # + # If we do not have the data, still run the tests that we can + # + else() + endif() + +endif() diff --git a/Common/ComputationalGeometry/module.cmake b/Common/ComputationalGeometry/module.cmake new file mode 100644 index 00000000000..0a3dffb21e9 --- /dev/null +++ b/Common/ComputationalGeometry/module.cmake @@ -0,0 +1,6 @@ +vtk_module(vtkCommonComputationalGeometry + DEPENDS + vtkCommonSystem + vtkCommonMath + vtkCommonDataModel + ) diff --git a/Common/Core/CMakeLists.txt b/Common/Core/CMakeLists.txt index c475d2ae768..5a1a7940e1c 100644 --- a/Common/Core/CMakeLists.txt +++ b/Common/Core/CMakeLists.txt @@ -1,652 +1,438 @@ -SET(KIT Common) -SET(UKIT COMMON) -SET(KIT_TCL_LIBS ${VTK_TCL_LIBRARIES}) -SET(KIT_PYTHON_LIBS) -SET(KIT_JAVA_LIBS) -SET(KIT_INTERFACE_LIBRARIES ${KWSYS_NAMESPACE}) - -IF(WIN32) - IF (NOT VTK_USE_X) - SET(VTK_OWP_ENCODED_C vtkWin32OutputWindowProcessEncoded.c) - SET_SOURCE_FILES_PROPERTIES(${VTK_OWP_ENCODED_C} PROPERTIES WRAP_EXCLUDE 1) - ENDIF (NOT VTK_USE_X) -ENDIF(WIN32) - -IF (UNIX) - SET(KIT_LIBS ${KIT_LIBS} ${CMAKE_THREAD_LIBS} ${CMAKE_DL_LIBS}) - SET(KIT_INTERFACE_LIBRARIES ${KWSYS_NAMESPACE} -lm) -ENDIF (UNIX) - -SET( Kit_SRCS -vtkAbstractArray.cxx -vtkAbstractTransform.cxx -vtkAmoebaMinimizer.cxx -vtkAnimationCue.cxx -vtkAnimationScene.cxx -vtkArrayIterator.cxx -vtkAssemblyNode.cxx -vtkAssemblyPath.cxx -vtkAssemblyPaths.cxx -vtkBitArray.cxx -vtkBitArrayIterator.cxx -vtkBoundingBox.cxx -vtkBox.cxx -vtkBoxMuellerRandomSequence.cxx -vtkBreakPoint.cxx -vtkByteSwap.cxx -vtkCallbackCommand.cxx -vtkCharArray.cxx -vtkClientSocket.cxx -vtkCollection.cxx -vtkCollectionIterator.cxx -vtkColor.h -vtkCommand.cxx -vtkCommonInformationKeyManager.cxx -vtkConditionVariable.cxx -vtkContourValues.cxx -vtkCriticalSection.cxx -vtkCylindricalTransform.cxx -vtkDataArray.cxx -vtkDataArrayCollection.cxx -vtkDataArrayCollectionIterator.cxx -vtkDataArraySelection.cxx -vtkDebugLeaks.cxx -vtkDebugLeaksManager.cxx -vtkDirectory.cxx -vtkDoubleArray.cxx -vtkDynamicLoader.cxx -vtkEdgeTable.cxx -vtkErrorCode.cxx -vtkEventForwarderCommand.cxx -vtkExtentRCBPartitioner.cxx -vtkExtentSplitter.cxx -vtkExtentTranslator.cxx -vtkFastNumericConversion.cxx -vtkFileOutputWindow.cxx -vtkFloatArray.cxx -vtkFloatingPointExceptions.cxx -vtkFunctionParser.cxx -vtkFunctionSet.cxx -vtkGarbageCollector.cxx -vtkGarbageCollectorManager.cxx -vtkGaussianRandomSequence.cxx -vtkGeneralTransform.cxx -vtkGhostArray.cxx -vtkHeap.cxx -vtkHomogeneousTransform.cxx -vtkIOStream.cxx -vtkIdList.cxx -vtkIdListCollection.cxx -vtkIdTypeArray.cxx -vtkIdentityTransform.cxx -vtkImplicitFunction.cxx -vtkImplicitFunctionCollection.cxx -vtkIndent.cxx -vtkInformation.cxx -vtkInformationDataObjectKey.cxx -vtkInformationDoubleKey.cxx -vtkInformationDoubleVectorKey.cxx -vtkInformationIdTypeKey.cxx -vtkInformationInformationKey.cxx -vtkInformationInformationVectorKey.cxx -vtkInformationIntegerKey.cxx -vtkInformationIntegerPointerKey.cxx -vtkInformationIntegerVectorKey.cxx -vtkInformationIterator.cxx -vtkInformationKey.cxx -vtkInformationKeyVectorKey.cxx -vtkInformationObjectBaseKey.cxx -vtkInformationObjectBaseVectorKey.cxx -vtkInformationQuadratureSchemeDefinitionVectorKey.cxx -vtkInformationRequestKey.cxx -vtkInformationStringKey.cxx -vtkInformationStringVectorKey.cxx -vtkInformationUnsignedLongKey.cxx -vtkInformationVector.cxx -vtkInitialValueProblemSolver.cxx -vtkInstantiator.cxx -vtkIntArray.cxx -vtkLargeInteger.cxx -vtkLinearTransform.cxx -vtkLogLookupTable.cxx -vtkLongArray.cxx -vtkLookupTable.cxx -vtkLookupTableWithEnabling.cxx -vtkMath.cxx -vtkMathUtilities.h -vtkMatrix3x3.cxx -vtkMatrix4x4.cxx -vtkMatrixToHomogeneousTransform.cxx -vtkMatrixToLinearTransform.cxx -vtkMinimalStandardRandomSequence.cxx -vtkMultiThreader.cxx -vtkMutexLock.cxx -vtkOStrStreamWrapper.cxx -vtkOStreamWrapper.cxx -vtkObject.cxx -vtkObjectBase.cxx -vtkObjectFactory.cxx -vtkObjectFactoryCollection.cxx -vtkOldStyleCallbackCommand.cxx -vtkOnePieceExtentTranslator.cxx -vtkOutputWindow.cxx -vtkOverrideInformation.cxx -vtkOverrideInformationCollection.cxx -vtkParametricBoy.cxx -vtkParametricConicSpiral.cxx -vtkParametricCrossCap.cxx -vtkParametricDini.cxx -vtkParametricEllipsoid.cxx -vtkParametricEnneper.cxx -vtkParametricFigure8Klein.cxx -vtkParametricFunction.cxx -vtkParametricKlein.cxx -vtkParametricMobius.cxx -vtkParametricRandomHills.cxx -vtkParametricRoman.cxx -vtkParametricSuperEllipsoid.cxx -vtkParametricSuperToroid.cxx -vtkParametricTorus.cxx -vtkPerspectiveTransform.cxx -vtkPlane.cxx -vtkPlaneCollection.cxx -vtkPlanes.cxx -vtkPoints.cxx -vtkPoints2D.cxx -vtkPolynomialSolversUnivariate.cxx -vtkPriorityQueue.cxx -vtkProp.cxx -vtkPropCollection.cxx -vtkProperty2D.cxx -vtkQuadratureSchemeDefinition.cxx -vtkQuadric.cxx -vtkRandomSequence.cxx -vtkRect.h -vtkReferenceCount.cxx -vtkRungeKutta2.cxx -vtkRungeKutta4.cxx -vtkRungeKutta45.cxx -vtkScalarsToColors.cxx -vtkServerSocket.cxx -vtkShortArray.cxx -vtkSignedCharArray.cxx -vtkSmartPointerBase.cxx -vtkSocket.cxx -vtkSocketCollection.cxx -vtkSortDataArray.cxx -vtkSphericalTransform.cxx -vtkStdString.cxx -vtkStringArray.cxx -vtkStructuredData.cxx -vtkStructuredExtent.cxx -vtkStructuredVisibilityConstraint.cxx -vtkTableExtentTranslator.cxx -vtkTensor.cxx -vtkThreadMessager.cxx -vtkTimePointUtility.cxx -vtkTimeStamp.cxx -vtkTimerLog.cxx -vtkTransform2D.cxx -vtkTransform.cxx -vtkTransformCollection.cxx -vtkUnicodeString.cxx -vtkUnicodeStringArray.cxx -vtkUnsignedCharArray.cxx -vtkUnsignedIntArray.cxx -vtkUnsignedLongArray.cxx -vtkUnsignedShortArray.cxx -vtkVariant.cxx -vtkVariantArray.cxx -vtkVector.h -vtkTuple.h -vtkVersion.cxx -vtkVoidArray.cxx -vtkWarpTransform.cxx -vtkWeakPointerBase.cxx -vtkWindow.cxx -vtkWindowLevelLookupTable.cxx -vtkXMLDataElement.cxx -vtkXMLFileOutputWindow.cxx -) +# Core configuration options. +if("${CMAKE_SIZEOF_VOID_P}" GREATER 4) + set(VTK_USE_64BIT_IDS_DEFAULT ON) +else() + set(VTK_USE_64BIT_IDS_DEFAULT OFF) +endif() + +option(VTK_USE_64BIT_IDS "Build VTK with 64 bit ids" + ${VTK_USE_64BIT_IDS_DEFAULT}) + +option(VTK_DEBUG_LEAKS "Build leak checking support into VTK." OFF) +mark_as_advanced(VTK_DEBUG_LEAKS VTK_USE_64BIT_IDS) + +set(vtkCommonCore_EXPORT_OPTIONS + VTK_DEBUG_LEAKS + VTK_USE_64BIT_IDS + ) -# Generate data for folding Unicode strings -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/vtkUnicodeString.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/vtkUnicodeString.cmake @ONLY) +#----------------------------------------------------------------------------- -ADD_CUSTOM_COMMAND( +include_directories(${VTK_SOURCE_DIR}/ThirdParty/utf8/source) + +SET(Module_SRCS + vtkAbstractArray.cxx + vtkAnimationCue.cxx + vtkArrayCoordinates.cxx + vtkArray.cxx + vtkArrayExtents.cxx + vtkArrayExtentsList.cxx + vtkArrayIterator.cxx + vtkArrayRange.cxx + vtkArraySort.cxx + vtkArrayWeights.cxx + vtkBitArray.cxx + vtkBitArrayIterator.cxx + vtkBoxMuellerRandomSequence.cxx + vtkBreakPoint.cxx + vtkByteSwap.cxx + vtkCallbackCommand.cxx + vtkCharArray.cxx + vtkCollection.cxx + vtkCollectionIterator.cxx + vtkCommand.cxx + vtkCommonInformationKeyManager.cxx + vtkConditionVariable.cxx + vtkCriticalSection.cxx + vtkDataArrayCollection.cxx + vtkDataArrayCollectionIterator.cxx + vtkDataArray.cxx + vtkDataArraySelection.cxx + vtkDebugLeaks.cxx + vtkDebugLeaksManager.cxx + vtkDoubleArray.cxx + vtkDynamicLoader.cxx + vtkEventForwarderCommand.cxx + vtkFileOutputWindow.cxx + vtkFloatArray.cxx + vtkFloatingPointExceptions.cxx + vtkGarbageCollector.cxx + vtkGarbageCollectorManager.cxx + vtkGaussianRandomSequence.cxx + vtkIdListCollection.cxx + vtkIdList.cxx + vtkIdTypeArray.cxx + vtkIndent.cxx + vtkInformation.cxx + vtkInformationDataObjectKey.cxx + vtkInformationDoubleKey.cxx + vtkInformationDoubleVectorKey.cxx + vtkInformationIdTypeKey.cxx + vtkInformationInformationKey.cxx + vtkInformationInformationVectorKey.cxx + vtkInformationIntegerKey.cxx + vtkInformationIntegerPointerKey.cxx + vtkInformationIntegerVectorKey.cxx + vtkInformationIterator.cxx + vtkInformationKey.cxx + vtkInformationKeyVectorKey.cxx + vtkInformationObjectBaseKey.cxx + vtkInformationObjectBaseVectorKey.cxx + vtkInformationRequestKey.cxx + vtkInformationStringKey.cxx + vtkInformationStringVectorKey.cxx + vtkInformationUnsignedLongKey.cxx + vtkInformationVector.cxx + vtkInstantiator.cxx + vtkIntArray.cxx + vtkIOStream.cxx + vtkLargeInteger.cxx + vtkLongArray.cxx + vtkLookupTable.cxx + vtkMath.cxx + vtkMinimalStandardRandomSequence.cxx + vtkMultiThreader.cxx + vtkMutexLock.cxx + vtkObjectBase.cxx + vtkObject.cxx + vtkObjectFactoryCollection.cxx + vtkObjectFactory.cxx + vtkOldStyleCallbackCommand.cxx + vtkOStreamWrapper.cxx + vtkOStrStreamWrapper.cxx + vtkOutputWindow.cxx + vtkOverrideInformationCollection.cxx + vtkOverrideInformation.cxx + vtkPoints2D.cxx + vtkPoints.cxx + vtkPriorityQueue.cxx + vtkRandomSequence.cxx + vtkReferenceCount.cxx + vtkScalarsToColors.cxx + vtkShortArray.cxx + vtkSignedCharArray.cxx + vtkSmartPointerBase.cxx + vtkSortDataArray.cxx + vtkStdString.cxx + vtkStringArray.cxx + vtkTimePointUtility.cxx + vtkTimeStamp.cxx + vtkUnicodeStringArray.cxx + vtkUnicodeString.cxx + vtkUnsignedCharArray.cxx + vtkUnsignedIntArray.cxx + vtkUnsignedLongArray.cxx + vtkUnsignedShortArray.cxx + vtkVariantArray.cxx + vtkVariant.cxx + vtkVersion.cxx + vtkVoidArray.cxx + vtkWeakPointerBase.cxx + vtkWindow.cxx + vtkXMLFileOutputWindow.cxx + vtkDenseArray.h + vtkSparseArray.h + vtkTypedArray.h + vtkTypeTemplate.h + vtkSystemIncludes.h + vtkType.h + ${CMAKE_CURRENT_BINARY_DIR}/vtkMathConfigure.h + ${CMAKE_CURRENT_BINARY_DIR}/vtkConfigure.h + ) + +if(vtkCommonDataModel_ENABLED) + include_directories(${VTK_BINARY_DIR}/Common/DataModel) + set_property(SOURCE vtkInformationDataObjectKey.cxx + PROPERTY COMPILE_DEFINITIONS vtkCommonDataModel_ENABLED) +endif() + +# __int64 seems to be platform specific, turning on if +if(HAVE_VTK_SIZEOF__INT64) + list(APPEND Module_SRCS + vtkUnsigned__Int64Array.cxx + vtk__Int64Array.cxx + ) +endif() + +if(WIN32) + # TODO: VTK_USE_X was once tested here but is now in another module + list(APPEND Module_SRCS + vtkWin32OutputWindow.cxx + vtkWin32OutputWindowProcessEncoded.c + vtkWin32ProcessOutputWindow.cxx + ) + set_property(SOURCE vtkWin32OutputWindowProcessEncoded.c PROPERTY WRAP_EXCLUDE 1) +endif() + +# Generate data for folding Unicode strings +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkUnicodeString.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/vtkUnicodeString.cmake @ONLY) + +# Setup clean configuration of vtkConfigure.h and vtkToolkits.h. +macro(VTK_PREPARE_CMAKEDEFINE not invar outvar) + if(${not} ${invar}) + set(${outvar} 1) + else() + set(${outvar}) + endif() +endmacro() + +vtk_prepare_cmakedefine("" CMAKE_WORDS_BIGENDIAN VTK_WORDS_BIGENDIAN) +vtk_prepare_cmakedefine("" CMAKE_USE_PTHREADS VTK_USE_PTHREADS) +vtk_prepare_cmakedefine("" CMAKE_USE_SPROC VTK_USE_SPROC) +vtk_prepare_cmakedefine("" CMAKE_HP_PTHREADS VTK_HP_PTHREADS) +vtk_prepare_cmakedefine("" CMAKE_USE_WIN32_THREADS VTK_USE_WIN32_THREADS) +vtk_prepare_cmakedefine("" CMAKE_NO_ANSI_STRING_STREAM VTK_NO_ANSI_STRING_STREAM) +vtk_prepare_cmakedefine("" CMAKE_NO_STD_NAMESPACE VTK_NO_STD_NAMESPACE) +vtk_prepare_cmakedefine(NOT CMAKE_ANSI_FOR_SCOPE VTK_NO_FOR_SCOPE) +vtk_prepare_cmakedefine(NOT VTK_EXPLICIT_TEMPLATES + VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION) +vtk_prepare_cmakedefine(NOT VTK_COMPILER_HAS_FULL_SPECIALIZATION + VTK_NO_FULL_TEMPLATE_SPECIALIZATION) +vtk_prepare_cmakedefine("" OPENGL_LIBRARY VTK_USE_OPENGL_LIBRARY) + +configure_file(vtkConfigure.h.in vtkConfigure.h @ONLY) +configure_file(vtkToolkits.h.in vtkToolkits.h @ONLY) + +add_custom_command( DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/CaseFolding.txt DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vtkUnicodeString.cmake COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/vtkUnicodeString.cmake OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vtkUnicodeCaseFoldData.h ) -IF(VTK_HAVE_SYNC_BUILTINS) - SET_SOURCE_FILES_PROPERTIES( - vtkTimeStamp.cxx - PROPERTIES - COMPILE_DEFINITIONS VTK_HAVE_SYNC_BUILTINS - ) -ENDIF(VTK_HAVE_SYNC_BUILTINS) - -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( vtkUnicodeString.cxx OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vtkUnicodeCaseFoldData.h ) -IF(CMAKE_COMPILER_IS_GNUCXX) - SET_SOURCE_FILES_PROPERTIES( - vtkPolynomialSolversUnivariate.cxx - PROPERTIES - COMPILE_FLAGS -O0 - ) -ENDIF(CMAKE_COMPILER_IS_GNUCXX) - -IF(VTK_TYPE_USE_LONG_LONG) - SET(Kit_SRCS ${Kit_SRCS} +if(VTK_TYPE_USE_LONG_LONG) + list(APPEND Module_SRCS vtkLongLongArray.cxx vtkUnsignedLongLongArray.cxx ) -ENDIF(VTK_TYPE_USE_LONG_LONG) -IF(VTK_TYPE_USE___INT64) - SET(Kit_SRCS ${Kit_SRCS} vtk__Int64Array.cxx) - IF(VTK_TYPE_CONVERT_UI64_TO_DOUBLE) - SET(Kit_SRCS ${Kit_SRCS} vtkUnsigned__Int64Array.cxx) - ENDIF(VTK_TYPE_CONVERT_UI64_TO_DOUBLE) -ENDIF(VTK_TYPE_USE___INT64) +endif() + +if(VTK_TYPE_USE___INT64) + list(APPEND Module_SRCS vtk__Int64Array.cxx) + if(VTK_TYPE_CONVERT_UI64_TO_DOUBLE) + list(APPEND Module_SRCS vtkUnsigned__Int64Array.cxx) + endif() +endif() # Configure data arrays for platform-independent fixed-size types. # Match the type selection here to that in vtkType.h. -IF(VTK_TYPE_CHAR_IS_SIGNED) - SET(VTK_TYPE_NATIVE_Int8 Char) -ELSE(VTK_TYPE_CHAR_IS_SIGNED) - SET(VTK_TYPE_NATIVE_Int8 SignedChar) -ENDIF(VTK_TYPE_CHAR_IS_SIGNED) -SET(VTK_TYPE_NATIVE_Int16 Short) -SET(VTK_TYPE_NATIVE_Int32 Int) -SET(VTK_TYPE_NATIVE_UInt8 UnsignedChar) -SET(VTK_TYPE_NATIVE_UInt16 UnsignedShort) -SET(VTK_TYPE_NATIVE_UInt32 UnsignedInt) - -IF(VTK_SIZEOF_LONG_LONG MATCHES "^8$") - SET(VTK_TYPE_NATIVE_Int64 LongLong) - SET(VTK_TYPE_NATIVE_UInt64 UnsignedLongLong) -ELSE(VTK_SIZEOF_LONG_LONG MATCHES "^8$") - IF(VTK_SIZEOF_LONG MATCHES "^8$") - SET(VTK_TYPE_NATIVE_Int64 Long) - SET(VTK_TYPE_NATIVE_UInt64 UnsignedLong) - ELSE(VTK_SIZEOF_LONG MATCHES "^8$") - IF(VTK_SIZEOF___INT64 MATCHES "^8$") - SET(VTK_TYPE_NATIVE_Int64 __Int64) - IF(VTK_TYPE_CONVERT_UI64_TO_DOUBLE) - SET(VTK_TYPE_NATIVE_UInt64 Unsigned__Int64) - ENDIF(VTK_TYPE_CONVERT_UI64_TO_DOUBLE) - ENDIF(VTK_SIZEOF___INT64 MATCHES "^8$") - ENDIF(VTK_SIZEOF_LONG MATCHES "^8$") -ENDIF(VTK_SIZEOF_LONG_LONG MATCHES "^8$") -SET(VTK_TYPE_NATIVE_Float32 Float) -SET(VTK_TYPE_NATIVE_Float64 Double) -FOREACH(t Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 Float32 Float64) - SET(VTK_TYPE_NAME ${t}) - SET(VTK_TYPE_NATIVE ${VTK_TYPE_NATIVE_${t}}) - IF(VTK_TYPE_NATIVE) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/vtkTypedArray.h.in +if(VTK_TYPE_CHAR_IS_SIGNED) + set(VTK_TYPE_NATIVE_Int8 Char) +else() + set(VTK_TYPE_NATIVE_Int8 SignedChar) +endif() +set(VTK_TYPE_NATIVE_Int16 Short) +set(VTK_TYPE_NATIVE_Int32 Int) +set(VTK_TYPE_NATIVE_UInt8 UnsignedChar) +set(VTK_TYPE_NATIVE_UInt16 UnsignedShort) +set(VTK_TYPE_NATIVE_UInt32 UnsignedInt) + +if(VTK_SIZEOF_LONG_LONG MATCHES "^8$") + set(VTK_TYPE_NATIVE_Int64 LongLong) + set(VTK_TYPE_NATIVE_UInt64 UnsignedLongLong) +else() + if(VTK_SIZEOF_LONG MATCHES "^8$") + set(VTK_TYPE_NATIVE_Int64 Long) + set(VTK_TYPE_NATIVE_UInt64 UnsignedLong) + else() + if(VTK_SIZEOF___INT64 MATCHES "^8$") + set(VTK_TYPE_NATIVE_Int64 __Int64) + if(VTK_TYPE_CONVERT_UI64_TO_DOUBLE) + set(VTK_TYPE_NATIVE_UInt64 Unsigned__Int64) + endif() + endif() + endif() +endif() +set(VTK_TYPE_NATIVE_Float32 Float) +set(VTK_TYPE_NATIVE_Float64 Double) +foreach(t Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 Float32 Float64) + set(VTK_TYPE_NAME ${t}) + set(VTK_TYPE_NATIVE ${VTK_TYPE_NATIVE_${t}}) + if(VTK_TYPE_NATIVE) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkTypedArray.h.in ${CMAKE_CURRENT_BINARY_DIR}/vtkType${t}Array.h @ONLY IMMEDIATE) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/vtkTypedArray.cxx.in + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkTypedArray.cxx.in ${CMAKE_CURRENT_BINARY_DIR}/vtkType${t}Array.cxx @ONLY IMMEDIATE) - SET(Kit_SRCS ${Kit_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/vtkType${t}Array.cxx) - ENDIF(VTK_TYPE_NATIVE) -ENDFOREACH(t) + set(Module_SRCS ${Module_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/vtkType${t}Array.cxx) + endif() +endforeach() # Figure out if isnan and isinf functions are present. -INCLUDE(CheckSymbolExists) -INCLUDE(CheckIncludeFile) - -IF (NOT HAVE_FLOAT_H) - CHECK_INCLUDE_FILE("float.h" HAVE_FLOAT_H) -ENDIF(NOT HAVE_FLOAT_H) - -IF (HAVE_FLOAT_H) - CHECK_SYMBOL_EXISTS(isnan "float.h" VTK_HAS_ISNAN) - IF (NOT VTK_HAS_ISNAN) - CHECK_SYMBOL_EXISTS(_isnan "float.h" VTK_HAS__ISNAN) - ENDIF (NOT VTK_HAS_ISNAN) - CHECK_SYMBOL_EXISTS(isinf "float.h" VTK_HAS_ISINF) - IF (NOT VTK_HAS_ISINF) - CHECK_FUNCTION_EXISTS(_isinf "float.h" VTK_HAS__ISINF) - ENDIF (NOT VTK_HAS_ISINF) -ENDIF (HAVE_FLOAT_H) - -CONFIGURE_FILE( +include(CheckSymbolExists) +include(CheckFunctionExists) +include(CheckIncludeFile) + +if(NOT HAVE_FLOAT_H) + check_include_file("float.h" HAVE_FLOAT_H) +endif() + +if(HAVE_FLOAT_H) + check_symbol_exists(isnan "float.h" VTK_HAS_ISNAN) + if(NOT VTK_HAS_ISNAN) + check_symbol_exists(_isnan "float.h" VTK_HAS__ISNAN) + endif() + check_symbol_exists(isinf "float.h" VTK_HAS_ISINF) + if(NOT VTK_HAS_ISINF) + check_function_exists(_isinf "float.h" VTK_HAS__ISINF) + endif() +endif() + +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/vtkMathConfigure.h.in ${CMAKE_CURRENT_BINARY_DIR}/vtkMathConfigure.h ) # Figure out if feenableexcept and fedisableexcept functions are present -CHECK_INCLUDE_FILE("fenv.h" HAVE_FENV_H) -IF (HAVE_FENV_H) - SET(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) - IF(UNIX) - SET(CMAKE_REQUIRED_LIBRARIES m) - ENDIF(UNIX) - CHECK_SYMBOL_EXISTS(feenableexcept "fenv.h" VTK_HAS_FEENABLEEXCEPT) - SET(CMAKE_REQUIRED_LIBRARIES) -ENDIF (HAVE_FENV_H) - -CONFIGURE_FILE( +check_include_file("fenv.h" HAVE_FENV_H) +if(HAVE_FENV_H) + set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) + if(UNIX) + set(CMAKE_REQUIRED_LIBRARIES m) + endif() + check_symbol_exists(feenableexcept "fenv.h" VTK_HAS_FEENABLEEXCEPT) + set(CMAKE_REQUIRED_LIBRARIES) +endif() + +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/vtkFloatingPointExceptionsConfigure.h.in ${CMAKE_CURRENT_BINARY_DIR}/vtkFloatingPointExceptionsConfigure.h ) # header files that have constants that can be wrapped -SET(Kit_WRAP_HEADERS +set_source_files_properties( vtkSystemIncludes.h vtkType.h ${CMAKE_CURRENT_BINARY_DIR}/vtkMathConfigure.h - ${VTK_BINARY_DIR}/vtkConfigure.h + ${CMAKE_CURRENT_BINARY_DIR}/vtkConfigure.h + PROPERTIES WRAP_HEADER 1 ) -SET_SOURCE_FILES_PROPERTIES( -# vtkObjectBase is marked ABSTRACT so that instantiators are happy. -vtkAbstractArray -vtkArrayIterator -vtkArrayIteratorTemplate -vtkAbstractTransform -vtkCallbackCommand -vtkCommand -vtkCommonInformationKeyManager -vtkDataArray -vtkEventForwarderCommand -vtkFloatingPointExceptions -vtkFunctionSet -vtkGaussianRandomSequence -vtkHomogeneousTransform -vtkImplicitFunction -vtkInformationDataObjectKey -vtkInformationDoubleKey -vtkInformationDoubleVectorKey -vtkInformationIdTypeKey -vtkInformationInformationKey -vtkInformationInformationVectorKey -vtkInformationIntegerKey -vtkInformationIntegerPointerKey -vtkInformationIntegerVectorKey -vtkInformationKey -vtkInformationKeyVectorKey -vtkInformationObjectBaseKey -vtkInformationObjectBaseVectorKey -vtkInformationQuadratureSchemeDefinitionVectorKey -vtkInformationRequestKey -vtkInformationStringKey -vtkInformationStringVectorKey -vtkInformationUnsignedLongKey -vtkInitialValueProblemSolver -vtkLinearTransform -vtkObjectBase -vtkObjectFactory -vtkOldStyleCallbackCommand -vtkOverrideInformation -vtkOverrideInformationCollection -vtkParametricFunction -vtkProp -vtkRandomSequence -vtkScalarsToColors -vtkSocket -vtkStructuredData -vtkWarpTransform -vtkWindow -ABSTRACT -) - -SET_SOURCE_FILES_PROPERTIES( - vtkColor - vtkMathUtilities - vtkRect - vtkVector - vtkTuple - HEADER_FILE_ONLY -) +set_source_files_properties( + # vtkObjectBase is marked ABSTRACT so that instantiators are happy. + vtkAbstractArray + vtkArrayIterator + vtkArrayIteratorTemplate + vtkArray + vtkCallbackCommand + vtkCommand + vtkCommonInformationKeyManager + vtkDataArray + vtkEventForwarderCommand + vtkFloatingPointExceptions + vtkFunctionSet + vtkGaussianRandomSequence + vtkInformationDataObjectKey + vtkInformationDoubleKey + vtkInformationDoubleVectorKey + vtkInformationIdTypeKey + vtkInformationInformationKey + vtkInformationInformationVectorKey + vtkInformationIntegerKey + vtkInformationIntegerPointerKey + vtkInformationIntegerVectorKey + vtkInformationKey + vtkInformationKeyVectorKey + vtkInformationObjectBaseKey + vtkInformationObjectBaseVectorKey + vtkInformationQuadratureSchemeDefinitionVectorKey + vtkInformationRequestKey + vtkInformationStringKey + vtkInformationStringVectorKey + vtkInformationUnsignedLongKey + vtkObjectBase + vtkObjectFactory + vtkOldStyleCallbackCommand + vtkOverrideInformation + vtkOverrideInformationCollection + vtkRandomSequence + vtkScalarsToColors + vtkWindow + # Not sure if this is the correct place for them - Tcl wrapping + vtkSystemIncludes + vtkMathConfigure + vtkType + vtkConfigure + ABSTRACT + ) -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( + vtkArrayCoordinates.cxx + vtkArrayExtents.cxx + vtkArrayExtentsList.cxx vtkArrayIteratorTemplate.txx + vtkArrayRange.cxx + vtkArraySort.cxx + vtkArrayWeights.cxx vtkBoundingBox.cxx vtkBreakPoint.cxx vtkCallbackCommand.cxx - vtkColor.h vtkCommonInformationKeyManager.cxx vtkDebugLeaksManager.cxx - vtkErrorCode.cxx vtkEventForwarderCommand.cxx vtkFloatingPointExceptions vtkGarbageCollectorManager.cxx vtkIOStream.cxx vtkIndent.cxx vtkLargeInteger.cxx - vtkMathUtilities.h vtkOStrStreamWrapper.cxx vtkOStreamWrapper.cxx vtkOldStyleCallbackCommand.cxx - vtkRect.h vtkSmartPointerBase.cxx vtkStdString.cxx vtkTimeStamp.cxx vtkVariant.cxx vtkWeakPointerBase.cxx vtkUnicodeString.cxx - vtkVector.h - vtkTuple.h - + vtkDenseArray.h + vtkSparseArray.h + vtkTypedArray.h + vtkTypeTemplate.h WRAP_EXCLUDE -) + ) + +set_source_files_properties( + vtkDenseArray.h + vtkSparseArray.h + vtkTypedArray.h + vtkTypeTemplate.h + HEADER_FILE_ONLY + ) -SET_SOURCE_FILES_PROPERTIES( - vtkColor.h - vtkRect.h +set_source_files_properties( + vtkArrayCoordinates.cxx + vtkArrayExtents.cxx + vtkArrayExtentsList.cxx + vtkArrayRange.cxx + vtkArraySort.cxx + vtkArrayWeights.cxx + vtkDenseArray.h + vtkSparseArray.h + vtkTypedArray.h + vtkTypeTemplate.h vtkTimeStamp.cxx vtkVariant.cxx - vtkVector.h - vtkTuple.h - PROPERTIES WRAP_SPECIAL 1 ) # Activate code in "vtkVariant.cxx". See the comment in the source. -SET_SOURCE_FILES_PROPERTIES(vtkVariant.cxx PROPERTIES +set_source_files_properties(vtkVariant.cxx PROPERTIES COMPILE_FLAGS -DVTK_VARIANT_IMPL) - -IF(VTK_USE_N_WAY_ARRAYS) - - SET(Kit_SRCS - ${Kit_SRCS} - vtkArray.cxx - vtkArrayCoordinates.cxx - vtkArrayExtents.cxx - vtkArrayExtentsList.cxx - vtkArrayRange.cxx - vtkArraySort.cxx - vtkArrayWeights.cxx - vtkDenseArray.h - vtkSparseArray.h - vtkTypedArray.h - vtkTypeTemplate.h - ) - - SET_SOURCE_FILES_PROPERTIES( - vtkArray.cxx - ABSTRACT - ) - - SET_SOURCE_FILES_PROPERTIES( - vtkArrayCoordinates.cxx - vtkArrayExtents.cxx - vtkArrayExtentsList.cxx - vtkArrayRange.cxx - vtkArraySort.cxx - vtkArrayWeights.cxx - vtkDenseArray.h - vtkSparseArray.h - vtkTypedArray.h - vtkTypeTemplate.h - WRAP_EXCLUDE - ) - - SET_SOURCE_FILES_PROPERTIES( - vtkDenseArray.h - vtkSparseArray.h - vtkTypedArray.h - vtkTypeTemplate.h - HEADER_FILE_ONLY - ) - - SET_SOURCE_FILES_PROPERTIES( - vtkArrayCoordinates.cxx - vtkArrayExtents.cxx - vtkArrayExtentsList.cxx - vtkArrayRange.cxx - vtkArraySort.cxx - vtkArrayWeights.cxx - vtkDenseArray.h - vtkSparseArray.h - vtkTypedArray.h - vtkTypeTemplate.h - PROPERTIES WRAP_SPECIAL 1 - ) - -ENDIF(VTK_USE_N_WAY_ARRAYS) - -SET(Kit_EXTRA_SRCS) -SET(Kit_EXTRA_CMDS) -SET(Kit_TCL_EXTRA_SRCS vtkTclUtil.cxx) -SET(Kit_PYTHON_EXTRA_SRCS vtkPythonCommand.cxx) -SET(Kit_JAVA_EXTRA_SRCS vtkJavaUtil.cxx) -SET(KIT_TCL_DEPS) -SET(KIT_PYTHON_DEPS) -SET(KIT_JAVA_DEPS) - -IF (WIN32) - IF (NOT VTK_USE_X) - SET(Kit_SRCS ${Kit_SRCS} vtkWin32OutputWindow.cxx - vtkWin32ProcessOutputWindow.cxx) - SET(Kit_EXTRA_SRCS ${Kit_EXTRA_SRCS} vtkWin32OutputWindowProcessEncoded.c) - SET_SOURCE_FILES_PROPERTIES(vtkWin32OutputWindowProcessEncoded.c - PROPERTIES WRAP_EXCLUDE 1) - ENDIF (NOT VTK_USE_X) -ENDIF (WIN32) - -IF (WIN32) - IF (NOT BORLAND) - SET(KIT_LIBS ${KIT_LIBS} wsock32) - ENDIF (NOT BORLAND) -ENDIF (WIN32) - -IF(NOT HAVE_SOCKETS) - # Tell vtkSocket.cxx that there are no sockets on this platform. - SET_SOURCE_FILES_PROPERTIES(vtkSocket.cxx PROPERTIES - COMPILE_FLAGS -DVTK_SOCKET_FAKE_API) -ENDIF(NOT HAVE_SOCKETS) - # Need nsl to resolve gethostbyname on SunOS-5.8 # and socket also -IF(CMAKE_SYSTEM MATCHES "SunOS.*") - SET(KIT_LIBS ${KIT_LIBS} socket nsl) -ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*") - -#----------------------------------------------------------------------------- -# Include CMake code common to all kits. -INCLUDE(${VTK_CMAKE_DIR}/KitCommonBlock.cmake) -#----------------------------------------------------------------------------- +if(CMAKE_SYSTEM MATCHES "SunOS.*") + set(KIT_LIBS ${KIT_LIBS} socket nsl) +endif() -IF(CMAKE_COMPILER_IS_GNUCXX AND MINGW) - # MinGW fails to dllexport the explicit instantiations of - # vtkDataArrayTemplate, so we must export all symbols. - GET_TARGET_PROPERTY(VTK_COMMON_LINK_FLAGS vtkCommon LINK_FLAGS) - IF(VTK_COMMON_LINK_FLAGS) - SET(VTK_COMMON_LINK_FLAGS "${VTK_COMMON_LINK_FLAGS} ") - ELSE(VTK_COMMON_LINK_FLAGS) - SET(VTK_COMMON_LINK_FLAGS) - ENDIF(VTK_COMMON_LINK_FLAGS) - SET_TARGET_PROPERTIES(vtkCommon PROPERTIES - LINK_FLAGS "${VTK_COMMON_LINK_FLAGS}-Wl,--export-all-symbols") -ENDIF(CMAKE_COMPILER_IS_GNUCXX AND MINGW) - -IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - SET(__inst_files - vtkABI.h - vtkArrayIteratorTemplate.h - vtkDataArrayTemplate.h - vtkIOStream.h - vtkIOStreamFwd.h - vtkNew.h - vtkSetGet.h - vtkSmartPointer.h - vtkSystemIncludes.h - vtkTemplateAliasMacro.h - vtkType.h - vtkTypeTraits.h - vtkVariantCast.h - vtkVariantInlineOperators.h - vtkVariantCreate.h - vtkWeakPointer.h - vtkWin32Header.h - vtkWindows.h - ${CMAKE_CURRENT_SOURCE_DIR}/Testing/Cxx/vtkTestDriver.h - ${CMAKE_CURRENT_BINARY_DIR}/vtkMathConfigure.h - ) +vtk_module_library(vtkCommonCore ${Module_SRCS}) - IF(VTK_WRAP_TCL) - SET(__inst_files ${__inst_files} - vtkTcl.h - vtkTclUtil.h - vtkTk.h - ) - ENDIF(VTK_WRAP_TCL) - IF(VTK_WRAP_PYTHON) - SET(__inst_files ${__inst_files} - vtkPythonCommand.h - ) - IF (TK_FOUND) - IF(VTK_USE_TK) - SET(__inst_files ${__inst_files} - vtkTcl.h - vtkTk.h - ) - ENDIF(VTK_USE_TK) - ENDIF (TK_FOUND) - ENDIF(VTK_WRAP_PYTHON) - IF(VTK_WRAP_JAVA) - SET(__inst_files ${__inst_files} - vtkJavaUtil.h - ) - ENDIF(VTK_WRAP_JAVA) - - SET(__inst_files ${__inst_files} - vtkArrayIteratorTemplate.txx - vtkArrayIteratorTemplateImplicit.txx - vtkDataArrayTemplate.txx - vtkDataArrayTemplateImplicit.txx - vtkDenseArray.txx - vtkTypedArray.txx - ${VTK_SOURCE_DIR}/${KIT}/Testing/Cxx/vtkTestUtilities.h) - - INSTALL(FILES ${__inst_files} - DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24} - COMPONENT Development) - - SET(__inst_files - ${VTK_SOURCE_DIR}/${KIT}/Testing/HeaderTesting.py - ${VTK_SOURCE_DIR}/${KIT}/Testing/WindowsMangleList.py - ${VTK_SOURCE_DIR}/${KIT}/Testing/Tcl/FindString.tcl - ${VTK_SOURCE_DIR}/${KIT}/Testing/Tcl/PrintSelfCheck.tcl - ${VTK_SOURCE_DIR}/${KIT}/Testing/Tcl/rtImageTest.tcl - ${VTK_SOURCE_DIR}/${KIT}/Testing/Tcl/TestSetGet.tcl - ) - IF(VTK_USE_PARALLEL) - SET(__inst_files ${__inst_files} - ${VTK_SOURCE_DIR}/${KIT}/Testing/Tcl/prtImageTest.tcl) - ENDIF(VTK_USE_PARALLEL) - - INSTALL(FILES ${__inst_files} - DESTINATION ${VTK_INSTALL_PACKAGE_DIR_CM24}/testing - COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) +target_link_libraries(vtkCommonCore ${CMAKE_THREAD_LIBS_INIT}) +set_target_properties(vtkCommonCore PROPERTIES LINK_INTERFACE_LIBRARIES "") diff --git a/Common/Core/Testing/Cxx/CMakeLists.txt b/Common/Core/Testing/Cxx/CMakeLists.txt index ccfde5ac1e6..0bf3574aeaf 100644 --- a/Common/Core/Testing/Cxx/CMakeLists.txt +++ b/Common/Core/Testing/Cxx/CMakeLists.txt @@ -1,129 +1,54 @@ -SET(KIT Common) -CREATE_TEST_SOURCELIST(Tests ${KIT}CxxTests.cxx - TestObjectFactory.cxx - otherArrays.cxx - otherTimerLog.cxx - otherLookupTable.cxx - otherLookupTableWithEnabling.cxx - otherByteSwap.cxx - otherStringArray.cxx - TestAmoebaMinimizer.cxx +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestArrayAPI.cxx + TestArrayAPIConvenience.cxx + TestArrayAPIDense.cxx + TestArrayAPISparse.cxx + TestArrayBool.cxx + # TestArrayCasting.cxx # Uses Boost in its own separate test. + TestArrayExtents.cxx + TestArrayInterpolationDense.cxx TestArrayLookup.cxx + TestArrayNullValues.cxx + TestArraySize.cxx + TestArrayUserTypes.cxx + TestArrayVariants.cxx TestConditionVariable.cxx - TestGarbageCollector.cxx - TestGhostArray.cxx + # TestCxxFeatures.cxx # This is in its own exe too. TestDataArray.cxx - TestDataArrayComponentNames.cxx - TestDirectory.cxx - TestFastNumericConversion.cxx + TestDataArrayComponentNames.cxx + TestGarbageCollector.cxx + # TestInstantiator.cxx # Have not enabled instantiators. TestMath.cxx - TestMatrix3x3.cxx TestMinimalStandardRandomSequence.cxx TestNew.cxx + TestObjectFactory.cxx TestObservers.cxx - TestPlane.cxx - TestBoundingBox.cxx - TestPolynomialSolversUnivariate.cxx TestSmartPointer.cxx TestSortDataArray.cxx - TestStructuredData.cxx + TestSparseArrayValidation.cxx TestUnicodeStringAPI.cxx TestUnicodeStringArrayAPI.cxx TestVariantComparison.cxx - TestVector.cxx - TestVectorOperators.cxx TestWeakPointer.cxx - TestSystemInformation.cxx + otherArrays.cxx + otherByteSwap.cxx + # These two need vtkLookupTableWithEnabling/vtkLogLookupTable - move + # them to RenderingCore or somewhere out there. + #otherLookupTable.cxx + #otherLookupTableWithEnabling.cxx + otherStringArray.cxx + EXTRA_INCLUDE vtkTestDriver.h ) -ADD_EXECUTABLE(${KIT}CxxTests ${Tests} vtkTestNewVar.cxx) -TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkCommon) - -SET (TestsToRun ${Tests}) -REMOVE (TestsToRun ${KIT}CxxTests.cxx) +vtk_module_test_executable(${vtk-module}CxxTests ${Tests} + vtkTestNewVar.cxx) -# Configure a header needed by SystemInformation. -CONFIGURE_FILE("${VTK_SOURCE_DIR}/Common/Testing/Cxx/SystemInformation.h.in" - "${VTK_BINARY_DIR}/Common/Testing/Cxx/SystemInformation.h" - @ONLY IMMEDIATE) +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) -# # Add all the executables -FOREACH (test ${TestsToRun}) - GET_FILENAME_COMPONENT(TName ${test} NAME_WE) - ADD_TEST(${TName} ${CXX_TEST_PATH}/${KIT}CxxTests ${TName}) -ENDFOREACH (test) - -# -# Add the TestCxxFeatures test by itself so that if it doesn't compile -# we don't lose all the tests for common -# -ADD_EXECUTABLE(TestCxxFeatures TestCxxFeatures.cxx) -TARGET_LINK_LIBRARIES(TestCxxFeatures vtkCommon) -ADD_TEST(TestCxxFeatures ${CXX_TEST_PATH}/TestCxxFeatures) - -# -# Add the TestInstantiator test by itself because it is designed to -# test pulling in all class's symbols. We don't want the other tests -# to draw in symbols. -# -ADD_EXECUTABLE(TestInstantiator TestInstantiator.cxx) -TARGET_LINK_LIBRARIES(TestInstantiator vtkCommon) -ADD_TEST(TestInstantiator ${CXX_TEST_PATH}/TestInstantiator) - -# -# Add a test that spits out the cygwin installation info if building -# with cygwin: -# -IF(CYGWIN) - EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/SystemInformation-cygcheck.sh - ${CMAKE_CURRENT_BINARY_DIR}/SystemInformation-cygcheck.sh) - EXECUTE_PROCESS(COMMAND dos2unix - ${CMAKE_CURRENT_BINARY_DIR}/SystemInformation-cygcheck.sh) - ADD_TEST(SystemInformation-cygcheck - "${CMAKE_CURRENT_BINARY_DIR}/SystemInformation-cygcheck.sh") -ENDIF(CYGWIN) - -IF(VTK_USE_N_WAY_ARRAYS) - - CREATE_TEST_SOURCELIST(ArrayTests ArrayCxxTests.cxx - TestArrayAPI.cxx - TestArrayAPIConvenience.cxx - TestArrayAPIDense.cxx - TestArrayAPISparse.cxx - TestArrayBool.cxx - TestArrayInterpolationDense.cxx - TestArrayNullValues.cxx - TestArrayExtents.cxx - TestArrayUserTypes.cxx - TestArrayVariants.cxx - TestArraySize.cxx - TestSparseArrayValidation.cxx - EXTRA_INCLUDE vtkTestDriver.h - ) - - ADD_EXECUTABLE(ArrayCxxTests ${ArrayTests}) - TARGET_LINK_LIBRARIES(ArrayCxxTests vtkCommon) - - SET(ArrayTestsToRun ${ArrayTests}) - REMOVE(ArrayTestsToRun ArrayCxxTests.cxx) - - FOREACH(test ${ArrayTestsToRun}) - GET_FILENAME_COMPONENT(TName ${test} NAME_WE) - ADD_TEST(Array-${TName} ${CXX_TEST_PATH}/ArrayCxxTests ${TName}) - ENDFOREACH(test) - - IF(VTK_USE_BOOST) - INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) - ADD_EXECUTABLE(TestArrayCasting TestArrayCasting.cxx) - TARGET_LINK_LIBRARIES(TestArrayCasting vtkCommon) - ADD_TEST(Array-TestArrayCasting ${CXX_TEST_PATH}/TestArrayCasting) - ENDIF() - -ENDIF(VTK_USE_N_WAY_ARRAYS) - -# TestConditionVariable will attempt to allocate a thread for each available core -# and thus should not be run in parallel. -set_tests_properties(TestConditionVariable PROPERTIES RUN_SERIAL ON) +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + add_test(NAME ${vtk-module}-${TName} COMMAND ${vtk-module}CxxTests ${TName}) +endforeach() diff --git a/Common/Core/Testing/Python/CMakeLists.txt b/Common/Core/Testing/Python/CMakeLists.txt new file mode 100644 index 00000000000..86d470f4406 --- /dev/null +++ b/Common/Core/Testing/Python/CMakeLists.txt @@ -0,0 +1,22 @@ +if(VTK_PYTHON_EXE) + foreach(tfile + PythonSmoke + TestArrayArguments + TestExecuteMethodFinalizeCrash + TestGhost + TestIgnoreBTX + TestMutable + TestNumpySupport + TestOperators + TestStrings + TestSubClass + TestTerminationCrash + TestVariant + TestWeakref + TestCommand + ) + add_test(NAME ${vtk-module}Python-${tfile} + COMMAND ${VTK_PYTHON_EXE} + ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py) + endforeach() +endif() diff --git a/Common/Core/Testing/Tcl/CMakeLists.txt b/Common/Core/Testing/Tcl/CMakeLists.txt new file mode 100644 index 00000000000..f4882e5f1a2 --- /dev/null +++ b/Common/Core/Testing/Tcl/CMakeLists.txt @@ -0,0 +1,26 @@ +add_test(TestSetObjectMacro-Common ${TCL_TCLSH} + ${vtkCommonCore_SOURCE_DIR}/Testing/Tcl/FindString.tcl + "${VTK_SOURCE_DIR}/Common/Core/vtk\\\\*.h" + "vtkSetObjectMacro" + ${VTK_SOURCE_DIR}/Common/Core/vtkSetGet.h + ) +add_test(PrintSelf-CommonCore ${TCL_TCLSH} + ${${vtk-module}_SOURCE_DIR}/Testing/Tcl/PrintSelfCheck.tcl + ${VTK_SOURCE_DIR}/Common/Core) + +set(tests + TestArrays + TestEmptyInput + TestSetGet + TestString + TestIgnoreBTX + otherInterp + otherPrint + ) + +foreach(test ${tests}) + add_test(NAME ${vtk-module}-${test}TCL + COMMAND ${VTK_TCL_EXE} + ${CMAKE_CURRENT_SOURCE_DIR}/${test}.tcl + -A ${VTK_SOURCE_DIR}/Wrapping/Tcl) +endforeach() diff --git a/Common/Core/Testing/Tcl/TestString.tcl b/Common/Core/Testing/Tcl/TestString.tcl index 21f7d96a800..667d3dc1154 100644 --- a/Common/Core/Testing/Tcl/TestString.tcl +++ b/Common/Core/Testing/Tcl/TestString.tcl @@ -5,8 +5,8 @@ for {set i 0} {$i < [expr $argc - 1]} {incr i} { } package require vtk -package require vtkcommon -package require vtkio +package require vtkcommoncore +package require vtkiocore # Pass and return a string by value. vtkDelimitedTextWriter r1 diff --git a/Common/Core/module.cmake b/Common/Core/module.cmake new file mode 100644 index 00000000000..549cd56b9bc --- /dev/null +++ b/Common/Core/module.cmake @@ -0,0 +1,8 @@ +vtk_module(vtkCommonCore + DEPENDS + vtksys + TEST_DEPENDS + vtkTestingCore + vtkCommonSystem + vtkCommonTransforms + ) diff --git a/Common/Core/vtkAutoInit.h b/Common/Core/vtkAutoInit.h new file mode 100644 index 00000000000..9c3ab3f8222 --- /dev/null +++ b/Common/Core/vtkAutoInit.h @@ -0,0 +1,36 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkAutoInit.h + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#ifndef __vtkAutoInit_h +#define __vtkAutoInit_h + +#include "vtkDebugLeaksManager.h" // DebugLeaks exists longer. + +#define VTK_AUTOINIT(M) VTK_AUTOINIT0(M##_AUTOINIT) +#define VTK_AUTOINIT0(T) VTK_AUTOINIT1(T) +#define VTK_AUTOINIT1(T) VTK_AUTOINIT_##T +#define VTK_AUTOINIT_0() +#define VTK_AUTOINIT_1(t1) VTK_AUTOINIT_0() VTK_AUTOINIT_IMPL(t1) +#define VTK_AUTOINIT_2(t1,t2) VTK_AUTOINIT_1(t1) VTK_AUTOINIT_IMPL(t2) +#define VTK_AUTOINIT_3(t1,t2,t3) VTK_AUTOINIT_2(t1,t2) VTK_AUTOINIT_IMPL(t3) +#define VTK_AUTOINIT_4(t1,t2,t3,t4) VTK_AUTOINIT_3(t1,t2,t3) VTK_AUTOINIT_IMPL(t4) +#define VTK_AUTOINIT_5(t1,t2,t3,t4,t5) VTK_AUTOINIT_4(t1,t2,t3,t4) VTK_AUTOINIT_IMPL(t5) +#define VTK_AUTOINIT_6(t1,t2,t3,t4,t5,t6) VTK_AUTOINIT_5(t1,t2,t3,t4,t5) VTK_AUTOINIT_IMPL(t6) +#define VTK_AUTOINIT_7(t1,t2,t3,t4,t5,t6,t7) VTK_AUTOINIT_6(t1,t2,t3,t4,t5,t6) VTK_AUTOINIT_IMPL(t7) +#define VTK_AUTOINIT_8(t1,t2,t3,t4,t5,t6,t7,t8) VTK_AUTOINIT_7(t1,t2,t3,t4,t5,t6,t7) VTK_AUTOINIT_IMPL(t8) +#define VTK_AUTOINIT_9(t1,t2,t3,t4,t5,t6,t7,t8,t9) VTK_AUTOINIT_8(t1,t2,t3,t4,t5,t6,t7,t8) VTK_AUTOINIT_IMPL(t9) +#define VTK_AUTOINIT_IMPL(M) \ + struct M##_AutoInit { M##_AutoInit(); ~M##_AutoInit(); }; static M##_AutoInit M##_AutoInit_Instance; + +#endif diff --git a/Common/Core/vtkConfigure.h.in b/Common/Core/vtkConfigure.h.in index a564d09b396..7c36d57d522 100644 --- a/Common/Core/vtkConfigure.h.in +++ b/Common/Core/vtkConfigure.h.in @@ -124,10 +124,6 @@ /* Whether we are using ANSI C++ streams (or old-style streams). */ #cmakedefine VTK_USE_ANSI_STDLIB -/* Whether VTK was built to support Carbon or Cocoa on the Mac. */ -#cmakedefine VTK_USE_CARBON -#cmakedefine VTK_USE_COCOA - /* Whether we are linking to Tcl/Tk statically. */ #cmakedefine VTK_TCL_TK_STATIC diff --git a/Common/Core/vtkInformationDataObjectKey.cxx b/Common/Core/vtkInformationDataObjectKey.cxx index ff88b719d8f..d8afeeac8dd 100644 --- a/Common/Core/vtkInformationDataObjectKey.cxx +++ b/Common/Core/vtkInformationDataObjectKey.cxx @@ -14,7 +14,9 @@ =========================================================================*/ #include "vtkInformationDataObjectKey.h" -#include "vtkDataObject.h" +#if defined(vtkCommonDataModel_ENABLED) +# include "../DataModel/vtkDataObject.h" +#endif //---------------------------------------------------------------------------- @@ -39,13 +41,19 @@ void vtkInformationDataObjectKey::PrintSelf(ostream& os, vtkIndent indent) void vtkInformationDataObjectKey::Set(vtkInformation* info, vtkDataObject* value) { +#if defined(vtkCommonDataModel_ENABLED) this->SetAsObjectBase(info, value); +#endif } //---------------------------------------------------------------------------- vtkDataObject* vtkInformationDataObjectKey::Get(vtkInformation* info) { +#if defined(vtkCommonDataModel_ENABLED) return static_cast<vtkDataObject *>(this->GetAsObjectBase(info)); +#else + return 0; +#endif } //---------------------------------------------------------------------------- diff --git a/Common/Core/vtkOStreamWrapper.h b/Common/Core/vtkOStreamWrapper.h index ac24908350d..f560fce01a6 100644 --- a/Common/Core/vtkOStreamWrapper.h +++ b/Common/Core/vtkOStreamWrapper.h @@ -24,6 +24,8 @@ #ifndef __vtkOStreamWrapper_h #define __vtkOStreamWrapper_h +#include "vtkCommonCoreModule.h" + #ifndef __VTK_SYSTEM_INCLUDES__INSIDE Do_not_include_vtkOStreamWrapper_directly__vtkSystemIncludes_includes_it; #endif @@ -34,7 +36,7 @@ class vtkLargeInteger; class vtkSmartPointerBase; class vtkStdString; -class VTK_COMMON_EXPORT vtkOStreamWrapper +class VTKCOMMONCORE_EXPORT vtkOStreamWrapper { public: // Description: diff --git a/Common/Core/vtkToolkits.h.in b/Common/Core/vtkToolkits.h.in index b5bd1b38eaf..ce552059206 100644 --- a/Common/Core/vtkToolkits.h.in +++ b/Common/Core/vtkToolkits.h.in @@ -17,40 +17,12 @@ /* This header is configured by VTK's build process. */ -/*--------------------------------------------------------------------------*/ -/* Selected VTK Toolkits */ - -#cmakedefine VTK_USE_VIEWS -#cmakedefine VTK_USE_GEOVIS -#cmakedefine VTK_USE_INFOVIS -#cmakedefine VTK_USE_N_WAY_ARRAYS -#cmakedefine VTK_USE_PARALLEL -#cmakedefine VTK_USE_RENDERING -#cmakedefine VTK_USE_GL2PS - /* The Hybrid and VolumeRendering kits are now switched with Rendering. */ #ifdef VTK_USE_RENDERING # define VTK_USE_HYBRID # define VTK_USE_VOLUMERENDERING #endif -/*--------------------------------------------------------------------------*/ -/* Rendering Configuration */ - -#cmakedefine VTK_USE_X -#cmakedefine VTK_USE_OPENGL_LIBRARY -#cmakedefine VTK_OPENGL_HAS_OSMESA -#cmakedefine VTK_USE_OFFSCREEN - -#cmakedefine VTK_USE_CG_SHADERS -#cmakedefine VTK_USE_GLSL_SHADERS - -#cmakedefine VTK_MATERIALS_DIRS -#ifdef VTK_MATERIALS_DIRS -# undef VTK_MATERIALS_DIRS -# define VTK_MATERIALS_DIRS "@VTK_MATERIALS_DIRS@" -#endif - #cmakedefine VTK_USE_VOLUMEPRO_1000 /*--------------------------------------------------------------------------*/ @@ -67,16 +39,6 @@ /* Whether we are building MPI support. */ #cmakedefine VTK_USE_MPI -/* Should VTK use the display? */ -#cmakedefine VTK_USE_DISPLAY - -/* Is VTK_DATA_ROOT defined? */ -#cmakedefine VTK_DATA_ROOT -#ifdef VTK_DATA_ROOT -# undef VTK_DATA_ROOT -# define VTK_DATA_ROOT "@VTK_DATA_ROOT@" -#endif - /* Should VTK use PostgreSQL? */ #cmakedefine VTK_USE_POSTGRES @@ -124,26 +86,4 @@ /* Whether the user has built the MetaIO library or not */ #cmakedefine VTK_USE_METAIO -/* Options for GPUInfo */ -#cmakedefine VTK_USE_DIRECTX -#cmakedefine VTK_USE_CORE_GRAPHICS -#cmakedefine VTK_USE_NVCONTROL - -/*--------------------------------------------------------------------------*/ -/* Setup VTK based on platform features and configuration. */ - -/* OGLR */ -/* OGLR is for GLX. It can be on Unix, Mac or Windows */ -#if ((defined(VTK_USE_OPENGL_LIBRARY) && defined(VTK_USE_X) && \ - !defined(_WIN32)) || \ - (defined(VTK_USE_X) && defined(_WIN32))) && \ - !(defined (VTK_USE_CARBON) || defined(VTK_USE_COCOA)) -# define VTK_USE_OGLR -#endif - -#if (defined(VTK_OPENGL_HAS_OSMESA) && !defined(VTK_USE_OGLR) && \ - !defined(_WIN32) && !defined(VTK_USE_CARBON) && !defined(VTK_USE_COCOA)) -# define VTK_USE_OSMESA -#endif - #endif diff --git a/Common/DataModel/CMakeLists.txt b/Common/DataModel/CMakeLists.txt new file mode 100644 index 00000000000..f0522e87457 --- /dev/null +++ b/Common/DataModel/CMakeLists.txt @@ -0,0 +1,256 @@ +set(Module_SRCS + vtkAbstractCellLocator.cxx + vtkAbstractInterpolatedVelocityField.cxx + vtkAbstractPointLocator.cxx + vtkAdjacentVertexIterator.cxx + vtkAMRBox.cxx + vtkAnimationScene.cxx + vtkAnnotation.cxx + vtkAnnotationLayers.cxx + vtkArrayData.cxx + vtkAttributesErrorMetric.cxx + vtkBiQuadraticQuad.cxx + vtkBiQuadraticQuadraticHexahedron.cxx + vtkBiQuadraticQuadraticWedge.cxx + vtkBiQuadraticTriangle.cxx + vtkBox.cxx + vtkBSPCuts.cxx + vtkBSPIntersections.cxx + vtkCell3D.cxx + vtkCellArray.cxx + vtkCell.cxx + vtkCellData.cxx + vtkCellLinks.cxx + vtkCellLocator.cxx + vtkCellTypes.cxx + vtkCompositeDataIterator.cxx + vtkCompositeDataSet.cxx + vtkCone.cxx + vtkConvexPointSet.cxx + vtkCubicLine.cxx + vtkCylinder.cxx + vtkDataObjectCollection.cxx + vtkDataObject.cxx + vtkDataObjectTypes.cxx + vtkDataSetAttributes.cxx + vtkDataSetCollection.cxx + vtkDataSet.cxx + vtkDirectedAcyclicGraph.cxx + vtkDirectedGraph.cxx + vtkDistributedGraphHelper.cxx + vtkEdgeListIterator.cxx + vtkEdgeTable.cxx + vtkEmptyCell.cxx + vtkExplicitCell.cxx + vtkFieldData.cxx + vtkGenericAdaptorCell.cxx + vtkGenericAttributeCollection.cxx + vtkGenericAttribute.cxx + vtkGenericCell.cxx + vtkGenericCellIterator.cxx + vtkGenericCellTessellator.cxx + vtkGenericDataSet.cxx + vtkGenericEdgeTable.cxx + vtkGenericInterpolatedVelocityField.cxx + vtkGenericPointIterator.cxx + vtkGenericSubdivisionErrorMetric.cxx + vtkGeometricErrorMetric.cxx + vtkGraph.cxx + vtkGraphEdge.cxx + vtkGraphInternals.cxx + vtkHexagonalPrism.cxx + vtkHexahedron.cxx + vtkHierarchicalBoxDataIterator.cxx + vtkHierarchicalBoxDataSet.cxx + vtkHyperOctreeCursor.cxx + vtkHyperOctree.cxx + vtkHyperOctreePointsGrabber.cxx + vtkImageData.cxx + vtkImageIterator.cxx + vtkImplicitBoolean.cxx + vtkImplicitDataSet.cxx + vtkImplicitFunctionCollection.cxx + vtkImplicitFunction.cxx + vtkImplicitHalo.cxx + vtkImplicitSelectionLoop.cxx + vtkImplicitSum.cxx + vtkImplicitVolume.cxx + vtkImplicitWindowFunction.cxx + vtkIncrementalOctreeNode.cxx + vtkIncrementalOctreePointLocator.cxx + vtkIncrementalPointLocator.cxx + vtkInEdgeIterator.cxx + vtkInformationQuadratureSchemeDefinitionVectorKey.cxx + vtkInterpolatedVelocityField.cxx + vtkIterativeClosestPointTransform.cxx + vtkKdNode.cxx + vtkKdTree.cxx + vtkKdTreePointLocator.cxx + vtkLine.cxx + vtkLocator.cxx + vtkMarchingSquaresLineCases.cxx + vtkMarchingCubesTriangleCases.cxx + vtkMeanValueCoordinatesInterpolator.cxx + vtkMergePoints.cxx + vtkMultiBlockDataSet.cxx + vtkMultiPieceDataSet.cxx + vtkMutableDirectedGraph.cxx + vtkMutableUndirectedGraph.cxx + vtkNonLinearCell.cxx + vtkNonMergingPointLocator.cxx + vtkOctreePointLocator.cxx + vtkOctreePointLocatorNode.cxx + vtkOrderedTriangulator.cxx + vtkOutEdgeIterator.cxx + vtkPentagonalPrism.cxx + vtkPerlinNoise.cxx + vtkPiecewiseFunction.cxx + vtkPixel.cxx + vtkPlaneCollection.cxx + vtkPlane.cxx + vtkPlanes.cxx + vtkPlanesIntersection.cxx + vtkPointData.cxx + vtkPointLocator.cxx + vtkPointSet.cxx + vtkPointsProjectedHull.cxx + vtkPolyDataCollection.cxx + vtkPolyData.cxx + vtkPolygon.cxx + vtkPolyhedron.cxx + vtkPolyLine.cxx + vtkPolyPlane.cxx + vtkPolyVertex.cxx + vtkPyramid.cxx + vtkQuad.cxx + vtkQuadraticEdge.cxx + vtkQuadraticHexahedron.cxx + vtkQuadraticLinearQuad.cxx + vtkQuadraticLinearWedge.cxx + vtkQuadraticPyramid.cxx + vtkQuadraticQuad.cxx + vtkQuadraticTetra.cxx + vtkQuadraticTriangle.cxx + vtkQuadraticWedge.cxx + vtkQuadratureSchemeDefinition.cxx + vtkQuadric.cxx + vtkRectilinearGrid.cxx + vtkReebGraph.cxx + vtkReebGraphSimplificationMetric.cxx + vtkSelection.cxx + vtkSelectionNode.cxx + vtkSimpleCellTessellator.cxx + vtkSmoothErrorMetric.cxx + vtkSphere.cxx + vtkSpline.cxx + vtkStructuredData.cxx + vtkStructuredExtent.cxx + vtkStructuredGrid.cxx + vtkStructuredPointsCollection.cxx + vtkStructuredPoints.cxx + vtkStructuredVisibilityConstraint.cxx + vtkSuperquadric.cxx + vtkTable.cxx + vtkTemporalDataSet.cxx + vtkTensor.cxx + vtkTetra.cxx + vtkTreeBFSIterator.cxx + vtkTree.cxx + vtkTreeDFSIterator.cxx + vtkTriangle.cxx + vtkTriangleStrip.cxx + vtkTriQuadraticHexahedron.cxx + vtkUndirectedGraph.cxx + vtkUniformGrid.cxx + vtkUnstructuredGrid.cxx + vtkVertex.cxx + vtkVertexListIterator.cxx + vtkVoxel.cxx + vtkWedge.cxx + vtkXMLDataElement.cxx + vtkTreeIterator.cxx + vtkBoundingBox.cxx + vtkAtom.cxx + vtkBond.cxx + vtkMolecule.cxx + vtkAbstractElectronicData.cxx + + # Header only classes + vtkTuple.h + vtkVector.h + vtkColor.h + vtkRect.h + + # New classes for AMR + vtkNonOverlappingAMR.cxx + vtkOverlappingAMR.cxx + vtkUniformGridAMR.cxx + vtkUniformGridAMRDataIterator.cxx + ) + +include_directories( + ${vtkCommonExecutionModel_SOURCE_DIR} + ${vtkCommonExecutionModel_BINARY_DIR} + ) + +set_source_files_properties( + vtkAbstractCellLocator + vtkAbstractInterpolatedVelocityField + vtkAbstractPointLocator + vtkCell + vtkCell3D + vtkCompositeDataIterator + vtkCompositeDataSet + vtkAbstractElectronicData + vtkDataSet + vtkDataSetGhostGenerator + vtkDistributedGraphHelper + vtkExplicitCell + vtkGenericAttribute + vtkGenericAdaptorCell + vtkGenericCellIterator + vtkGenericCellTessellator + vtkGenericDataSet + vtkGenericPointIterator + vtkGenericSubdivisionErrorMetric + vtkGraph + vtkHyperOctreeCursor + vtkHyperOctreePointsGrabber + vtkImplicitFunction + vtkIncrementalPointLocator + vtkInformationQuadratureSchemeDefinitionVectorKey + vtkLocator + vtkNonLinearCell + vtkPointSet + vtkSpline + vtkStructuredData + vtkTreeIterator + vtkUniformGridAMR + ABSTRACT + ) + +set_source_files_properties( + vtkAMRBox + vtkAtom + vtkBond + vtkBoundingBox + vtkMarchingSquaresLineCases + vtkMarchingCubesTriangleCases + vtkImageIterator + vtkImageProgressIterator + vtkTuple + vtkVector + vtkColor + vtkRect + WRAP_EXCLUDE + ) + +set_source_files_properties( + vtkColor.h + vtkRect.h + vtkVector.h + vtkTuple.h + PROPERTIES WRAP_SPECIAL 1 + ) + +vtk_module_library(vtkCommonDataModel ${Module_SRCS}) diff --git a/Common/DataModel/Testing/Cxx/CMakeLists.txt b/Common/DataModel/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..786b7a4f185 --- /dev/null +++ b/Common/DataModel/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,47 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestVector.cxx + TestVectorOperators.cxx + TestAMRBox.cxx + TestGenericCell.cxx + TestGraph.cxx + TestHigherOrderCell.cxx + TestImageDataFindCell.cxx + TestImageDataInterpolation.cxx + TestImageIterator.cxx + TestInterpolationDerivs.cxx + TestInterpolationFunctions.cxx + TestPointLocators.cxx + TestPolyDataRemoveCell.cxx + TestPolygon.cxx + TestSelectionSubtract.cxx + TestTreeBFSIterator.cxx + TestTreeDFSIterator.cxx + TestTriangle.cxx + otherCellArray.cxx + otherCellBoundaries.cxx + otherCellPosition.cxx + otherCellTypes.cxx + otherColorTransferFunction.cxx + otherEmptyCell.cxx + otherFieldData.cxx + otherRectilinearGrid.cxx + otherStructuredGrid.cxx + quadCellConsistency.cxx + quadraticEvaluation.cxx + TestBoundingBox.cxx + TestPlane.cxx + TestStructuredData.cxx + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach (test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) +endforeach() diff --git a/Common/DataModel/Testing/Python/CMakeLists.txt b/Common/DataModel/Testing/Python/CMakeLists.txt new file mode 100644 index 00000000000..a7bf95740a1 --- /dev/null +++ b/Common/DataModel/Testing/Python/CMakeLists.txt @@ -0,0 +1,9 @@ +if(VTK_PYTHON_EXE) + foreach(tfile + TestTemplates + ) + add_test(NAME ${vtk-module}Python-${tfile} + COMMAND ${VTK_PYTHON_EXE} + ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py) + endforeach() +endif() diff --git a/Common/DataModel/Testing/Tcl/CMakeLists.txt b/Common/DataModel/Testing/Tcl/CMakeLists.txt new file mode 100644 index 00000000000..2215f7849a8 --- /dev/null +++ b/Common/DataModel/Testing/Tcl/CMakeLists.txt @@ -0,0 +1,35 @@ +if (VTK_USE_RENDERING AND VTK_USE_DISPLAY) + # + # Add tests, with the data + # + if(VTK_DATA_ROOT) + foreach( tfile + ImplicitSum + PerlinNoise + SelectionLoop + otherDataSetAttributes + ) + add_test(${tfile}-image ${VTK_EXECUTABLE} + ${VTK_SOURCE_DIR}/Common/Testing/Tcl/rtImageTest.tcl + ${vtkCommonDataModel_SOURCE_DIR}/Testing/Tcl/${tfile}.tcl + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Filtering/${tfile}.png + -A ${VTK_SOURCE_DIR}/Wrapping/Tcl) + endforeach() + if(VTK_USE_TK) + add_test(squadViewer-image ${VTK_EXECUTABLE} + ${VTK_SOURCE_DIR}/Common/Testing/Tcl/rtImageTest.tcl + ${VTK_SOURCE_DIR}/Filtering/Testing/Tcl/squadViewer.tcl + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Filtering/squadViewer.png + -A ${VTK_SOURCE_DIR}/Wrapping/Tcl) + endif() + # + # If we do not have the data, still run the tests that we can + # + else() + endif() + +endif() diff --git a/Common/DataModel/module.cmake b/Common/DataModel/module.cmake new file mode 100644 index 00000000000..785fa6287b3 --- /dev/null +++ b/Common/DataModel/module.cmake @@ -0,0 +1,12 @@ +vtk_module(vtkCommonDataModel + DEPENDS + vtkCommonSystem + vtkCommonMath + vtkCommonMisc + vtkCommonTransforms + TEST_DEPENDS + vtkTestingCore + vtkCommonExecutionModel + vtkIOGeometry + vtkRenderingCore + ) diff --git a/Common/DataModel/vtkDataObjectTypes.cxx b/Common/DataModel/vtkDataObjectTypes.cxx index a7910742b21..7196b87972f 100644 --- a/Common/DataModel/vtkDataObjectTypes.cxx +++ b/Common/DataModel/vtkDataObjectTypes.cxx @@ -48,13 +48,8 @@ PURPOSE. See the above copyright notice for more information. #include "vtkUniformGrid.h" #include "vtkUnstructuredGrid.h" -#ifdef VTK_USE_N_WAY_ARRAYS #include "vtkArrayData.h" -#endif - -#ifdef VTK_USE_CHEMISTRY #include "vtkMolecule.h" -#endif vtkStandardNewMacro(vtkDataObjectTypes); @@ -94,9 +89,7 @@ static const char* vtkDataObjectTypesStrings[] = { "vtkUniformGridAMR", "vtkNonOverlappingAMR", "vtkOverlappingAMR", -#ifdef VTK_USE_CHEMISTRY "vtkMolecule", -#endif NULL }; @@ -264,18 +257,14 @@ vtkDataObject* vtkDataObjectTypes::NewDataObject(const char* type) { return vtkReebGraph::New(); } -#ifdef VTK_USE_CHEMISTRY else if(strcmp(type, "vtkMolecule") == 0) { return vtkMolecule::New(); } -#endif -#ifdef VTK_USE_N_WAY_ARRAYS else if(strcmp(type, "vtkArrayData") == 0) { return vtkArrayData::New(); } -#endif else if(vtkObject* obj = vtkInstantiator::CreateInstance(type)) { vtkDataObject* data = vtkDataObject::SafeDownCast(obj); diff --git a/Common/DataModel/vtkImageIterator.cxx b/Common/DataModel/vtkImageIterator.cxx index 1147b85d520..42dc3067aa7 100644 --- a/Common/DataModel/vtkImageIterator.cxx +++ b/Common/DataModel/vtkImageIterator.cxx @@ -17,24 +17,24 @@ #ifndef VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION -template class VTK_FILTERING_EXPORT vtkImageIterator<signed char>; -template class VTK_FILTERING_EXPORT vtkImageIterator<char>; -template class VTK_FILTERING_EXPORT vtkImageIterator<int>; -template class VTK_FILTERING_EXPORT vtkImageIterator<long>; -template class VTK_FILTERING_EXPORT vtkImageIterator<short>; -template class VTK_FILTERING_EXPORT vtkImageIterator<float>; -template class VTK_FILTERING_EXPORT vtkImageIterator<double>; -template class VTK_FILTERING_EXPORT vtkImageIterator<unsigned long>; -template class VTK_FILTERING_EXPORT vtkImageIterator<unsigned short>; -template class VTK_FILTERING_EXPORT vtkImageIterator<unsigned char>; -template class VTK_FILTERING_EXPORT vtkImageIterator<unsigned int>; +template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator<signed char>; +template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator<char>; +template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator<int>; +template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator<long>; +template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator<short>; +template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator<float>; +template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator<double>; +template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator<unsigned long>; +template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator<unsigned short>; +template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator<unsigned char>; +template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator<unsigned int>; #if defined(VTK_TYPE_USE_LONG_LONG) -template class VTK_FILTERING_EXPORT vtkImageIterator<long long>; -template class VTK_FILTERING_EXPORT vtkImageIterator<unsigned long long>; +template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator<long long>; +template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator<unsigned long long>; #endif #if defined(VTK_TYPE_USE___INT64) -template class VTK_FILTERING_EXPORT vtkImageIterator<__int64>; -template class VTK_FILTERING_EXPORT vtkImageIterator<unsigned __int64>; +template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator<__int64>; +template class VTKCOMMONDATAMODEL_EXPORT vtkImageIterator<unsigned __int64>; #endif #endif diff --git a/Common/ExecutionModel/CMakeLists.txt b/Common/ExecutionModel/CMakeLists.txt new file mode 100644 index 00000000000..bd7ea3bb122 --- /dev/null +++ b/Common/ExecutionModel/CMakeLists.txt @@ -0,0 +1,80 @@ +SET(Module_SRCS + vtkAlgorithm.cxx + vtkAlgorithmOutput.cxx + vtkAnnotationLayersAlgorithm.cxx + vtkArrayDataAlgorithm.cxx + vtkCachedStreamingDemandDrivenPipeline.cxx + vtkCastToConcrete.cxx + vtkCompositeDataPipeline.cxx + vtkCompositeDataSetAlgorithm.cxx + vtkComputingResources.cxx + vtkDataObjectAlgorithm.cxx + vtkDataSetAlgorithm.cxx + vtkDemandDrivenPipeline.cxx + vtkDirectedGraphAlgorithm.cxx + vtkExecutionScheduler.cxx + vtkExecutionSchedulerManager.cxx + vtkExecutiveCollection.cxx + vtkExecutive.cxx + vtkExtentSplitter.cxx + vtkExtentTranslator.cxx + vtkFilteringInformationKeyManager.cxx + vtkGraphAlgorithm.cxx + vtkHierarchicalBoxDataSetAlgorithm.cxx + vtkHyperOctreeAlgorithm.cxx + vtkImageAlgorithm.cxx + vtkImageInPlaceFilter.cxx + vtkImageProgressIterator.cxx + vtkImageToStructuredGrid.cxx + vtkImageToStructuredPoints.cxx + vtkInformationExecutivePortKey.cxx + vtkInformationExecutivePortVectorKey.cxx + vtkMultiBlockDataSetAlgorithm.cxx + vtkOnePieceExtentTranslator.cxx + vtkPassInputTypeAlgorithm.cxx + vtkPiecewiseFunctionAlgorithm.cxx + vtkPiecewiseFunctionShiftScale.cxx + vtkPointSetAlgorithm.cxx + vtkPolyDataAlgorithm.cxx + vtkRectilinearGridAlgorithm.cxx + vtkScalarTree.cxx + vtkSimpleImageToImageFilter.cxx + vtkSimpleScalarTree.cxx + vtkStreamingDemandDrivenPipeline.cxx + vtkStructuredGridAlgorithm.cxx + vtkTableAlgorithm.cxx + vtkTableExtentTranslator.cxx + vtkTemporalDataSetAlgorithm.cxx + vtkThreadedImageAlgorithm.cxx + vtkThreadedStreamingPipeline.cxx + vtkTreeAlgorithm.cxx + vtkTrivialProducer.cxx + vtkUndirectedGraphAlgorithm.cxx + vtkUnstructuredGridAlgorithm.cxx + vtkSelectionAlgorithm.cxx + vtkLinearSelector.cxx + vtkExtentRCBPartitioner.cxx + vtkUniformGridPartitioner.cxx + ) + +set_source_files_properties( + vtkExecutive + vtkHyperOctreeAlgorithm + vtkImageAlgorithm + vtkImageInPlaceFilter + vtkInformationExecutivePortKey + vtkInformationExecutivePortVectorKey + vtkScalarTree + vtkSimpleImageToImageFilter + vtkThreadedImageAlgorithm + ABSTRACT + ) + +set_source_files_properties( + vtkExecutionSchedulerManager + vtkFilteringInformationKeyManager + vtkImageProgressIterator + WRAP_EXCLUDE + ) + +vtk_module_library(vtkCommonExecutionModel ${Module_SRCS}) diff --git a/Common/ExecutionModel/Testing/Cxx/CMakeLists.txt b/Common/ExecutionModel/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..f4ddf303df3 --- /dev/null +++ b/Common/ExecutionModel/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,30 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestImageDataToStructuredGrid.cxx + TestLinearSelector2D.cxx + TestLinearSelector3D.cxx + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach (test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + + if(VTK_DATA_ROOT) + add_test(NAME ${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/${vtk-module}/${TName}.png) + else() + add_test(NAME ${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -T ${VTK_BINARY_DIR}/Testing/Temporary + ) + endif() +endforeach() diff --git a/Common/ExecutionModel/module.cmake b/Common/ExecutionModel/module.cmake new file mode 100644 index 00000000000..2e35121cd96 --- /dev/null +++ b/Common/ExecutionModel/module.cmake @@ -0,0 +1,11 @@ +vtk_module(vtkCommonExecutionModel + DEPENDS + vtkCommonDataModel + COMPILE_DEPENDS + vtkCommonMisc + TEST_DEPENDS + vtkTestingCore + vtkIOCore + vtkIOGeometry + vtkFiltersExtraction + ) diff --git a/Common/ExecutionModel/vtkImageProgressIterator.cxx b/Common/ExecutionModel/vtkImageProgressIterator.cxx index ceec6a5aaad..b128984b8d8 100644 --- a/Common/ExecutionModel/vtkImageProgressIterator.cxx +++ b/Common/ExecutionModel/vtkImageProgressIterator.cxx @@ -32,24 +32,24 @@ #ifndef VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION -template class VTK_FILTERING_EXPORT vtkImageProgressIterator<signed char>; -template class VTK_FILTERING_EXPORT vtkImageProgressIterator<char>; -template class VTK_FILTERING_EXPORT vtkImageProgressIterator<int>; -template class VTK_FILTERING_EXPORT vtkImageProgressIterator<long>; -template class VTK_FILTERING_EXPORT vtkImageProgressIterator<short>; -template class VTK_FILTERING_EXPORT vtkImageProgressIterator<float>; -template class VTK_FILTERING_EXPORT vtkImageProgressIterator<double>; -template class VTK_FILTERING_EXPORT vtkImageProgressIterator<unsigned long>; -template class VTK_FILTERING_EXPORT vtkImageProgressIterator<unsigned short>; -template class VTK_FILTERING_EXPORT vtkImageProgressIterator<unsigned char>; -template class VTK_FILTERING_EXPORT vtkImageProgressIterator<unsigned int>; +template class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageProgressIterator<signed char>; +template class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageProgressIterator<char>; +template class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageProgressIterator<int>; +template class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageProgressIterator<long>; +template class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageProgressIterator<short>; +template class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageProgressIterator<float>; +template class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageProgressIterator<double>; +template class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageProgressIterator<unsigned long>; +template class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageProgressIterator<unsigned short>; +template class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageProgressIterator<unsigned char>; +template class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageProgressIterator<unsigned int>; #if defined(VTK_TYPE_USE_LONG_LONG) -template class VTK_FILTERING_EXPORT vtkImageProgressIterator<long long>; -template class VTK_FILTERING_EXPORT vtkImageProgressIterator<unsigned long long>; +template class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageProgressIterator<long long>; +template class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageProgressIterator<unsigned long long>; #endif #if defined(VTK_TYPE_USE___INT64) -template class VTK_FILTERING_EXPORT vtkImageProgressIterator<__int64>; -template class VTK_FILTERING_EXPORT vtkImageProgressIterator<unsigned __int64>; +template class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageProgressIterator<__int64>; +template class VTKCOMMONEXECUTIONMODEL_EXPORT vtkImageProgressIterator<unsigned __int64>; #endif #endif diff --git a/Common/Math/CMakeLists.txt b/Common/Math/CMakeLists.txt new file mode 100644 index 00000000000..a8effd24685 --- /dev/null +++ b/Common/Math/CMakeLists.txt @@ -0,0 +1,26 @@ +set(Module_SRCS + vtkAmoebaMinimizer.cxx + vtkFastNumericConversion.cxx + vtkFunctionSet.cxx + vtkInitialValueProblemSolver.cxx + vtkMatrix3x3.cxx + vtkMatrix4x4.cxx + vtkPolynomialSolversUnivariate.cxx + vtkQuaternionInterpolator.cxx + vtkRungeKutta2.cxx + vtkRungeKutta4.cxx + vtkRungeKutta45.cxx + ) + +if(CMAKE_COMPILER_IS_GNUCXX) + set_source_files_properties(vtkPolynomialSolversUnivariate.cxx + PROPERTIES COMPILE_FLAGS -O0) +endif() + +set_source_files_properties( + vtkFunctionSet + vtkInitialValueProblemSolver + ABSTRACT + ) + +vtk_module_library(vtkCommonMath ${Module_SRCS}) diff --git a/Common/Math/Testing/Cxx/CMakeLists.txt b/Common/Math/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..a404a96b332 --- /dev/null +++ b/Common/Math/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,18 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestAmoebaMinimizer.cxx + TestFastNumericConversion.cxx + TestMatrix3x3.cxx + TestPolynomialSolversUnivariate.cxx + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach (test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + add_test(NAME ${vtk-module}Cxx-${TName} COMMAND ${vtk-module}CxxTests ${TName}) +endforeach() diff --git a/Common/Math/Testing/Tcl/CMakeLists.txt b/Common/Math/Testing/Tcl/CMakeLists.txt new file mode 100644 index 00000000000..8cfb9cef36c --- /dev/null +++ b/Common/Math/Testing/Tcl/CMakeLists.txt @@ -0,0 +1,10 @@ +set(tests + TestAmoebaMinimizer + ) + +foreach(test ${tests}) + add_test(NAME ${vtk-module}-${test}TCL + COMMAND ${VTK_TCL_EXE} + ${CMAKE_CURRENT_SOURCE_DIR}/${test}.tcl + -A ${VTK_SOURCE_DIR}/Wrapping/Tcl) +endforeach() diff --git a/Common/Math/module.cmake b/Common/Math/module.cmake new file mode 100644 index 00000000000..9105d311efd --- /dev/null +++ b/Common/Math/module.cmake @@ -0,0 +1,8 @@ +vtk_module(vtkCommonMath + DEPENDS + vtkCommonCore + TEST_DEPENDS + vtkTestingCore + vtkCommonSystem + vtkCommonTransforms + ) diff --git a/Common/Misc/CMakeLists.txt b/Common/Misc/CMakeLists.txt new file mode 100644 index 00000000000..e37f4c9a035 --- /dev/null +++ b/Common/Misc/CMakeLists.txt @@ -0,0 +1,13 @@ +set(Module_SRCS + vtkContourValues.cxx + vtkErrorCode.cxx + vtkFunctionParser.cxx + vtkHeap.cxx + ) + +set_source_files_properties( + vtkErrorCode.cxx + WRAP_EXCLUDE + ) + +vtk_module_library(vtkCommonMisc ${Module_SRCS}) diff --git a/Common/Misc/module.cmake b/Common/Misc/module.cmake new file mode 100644 index 00000000000..783f53aa8ee --- /dev/null +++ b/Common/Misc/module.cmake @@ -0,0 +1,6 @@ +vtk_module(vtkCommonMisc + GROUPS + StandAlone + DEPENDS + vtkCommonMath + ) diff --git a/Common/Misc/vtkHeap.cxx b/Common/Misc/vtkHeap.cxx index 4487926365d..d2234669cc1 100644 --- a/Common/Misc/vtkHeap.cxx +++ b/Common/Misc/vtkHeap.cxx @@ -12,6 +12,7 @@ PURPOSE. See the above copyright notice for more information. =========================================================================*/ +#include "vtkCommonMiscModule.h" // For export macro #include "vtkHeap.h" #include "vtkObjectFactory.h" @@ -35,7 +36,7 @@ static int vtkGetLongAlignment() return (p2 - p1); // Get member offset/alignment } -class VTK_COMMON_EXPORT vtkHeapBlock +class VTKCOMMONMISC_EXPORT vtkHeapBlock { public: char* Data; diff --git a/Common/System/CMakeLists.txt b/Common/System/CMakeLists.txt new file mode 100644 index 00000000000..df33e3ca9b7 --- /dev/null +++ b/Common/System/CMakeLists.txt @@ -0,0 +1,26 @@ +set(Module_SRCS + vtkClientSocket.cxx + vtkDirectory.cxx + vtkServerSocket.cxx + vtkSocket.cxx + vtkSocketCollection.cxx + vtkThreadMessager.cxx + vtkTimerLog.cxx + ) + +set_source_files_properties( + vtkSocket + ABSTRACT +) + +if(NOT HAVE_SOCKETS) + # Tell vtkSocket.cxx that there are no sockets on this platform. + set_source_files_properties(vtkSocket.cxx PROPERTIES + COMPILE_FLAGS -DVTK_SOCKET_FAKE_API) +endif() + +if(WIN32 AND NOT BORLAND) + set(KIT_LIBS ${KIT_LIBS} wsock32) +endif() + +vtk_module_library(vtkCommonSystem ${Module_SRCS}) diff --git a/Common/System/Testing/Cxx/CMakeLists.txt b/Common/System/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..025f974073f --- /dev/null +++ b/Common/System/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,16 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestDirectory.cxx + otherTimerLog.cxx + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach (test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + add_test(NAME ${TName} COMMAND ${vtk-module}CxxTests ${TName}) +endforeach() diff --git a/Common/System/module.cmake b/Common/System/module.cmake new file mode 100644 index 00000000000..7bae06768c5 --- /dev/null +++ b/Common/System/module.cmake @@ -0,0 +1,9 @@ +vtk_module(vtkCommonSystem + GROUPS + StandAlone + DEPENDS + vtkCommonCore + vtksys + TEST_DEPENDS + vtkTestingCore + ) diff --git a/Common/Transforms/CMakeLists.txt b/Common/Transforms/CMakeLists.txt new file mode 100644 index 00000000000..cb8466ba3a7 --- /dev/null +++ b/Common/Transforms/CMakeLists.txt @@ -0,0 +1,28 @@ +set(Module_SRCS + vtkAbstractTransform.cxx + vtkCylindricalTransform.cxx + vtkGeneralTransform.cxx + vtkHomogeneousTransform.cxx + vtkIdentityTransform.cxx + vtkLinearTransform.cxx + vtkMatrixToHomogeneousTransform.cxx + vtkMatrixToLinearTransform.cxx + vtkPerspectiveTransform.cxx + vtkSphericalTransform.cxx + vtkThinPlateSplineTransform.cxx + vtkTransform2D.cxx + vtkTransformCollection.cxx + vtkTransform.cxx + vtkWarpTransform.cxx + vtkLandmarkTransform.cxx + ) + +set_source_files_properties( + vtkAbstractTransform + vtkHomogeneousTransform + vtkLinearTransform + vtkWarpTransform + ABSTRACT + ) + +vtk_module_library(vtkCommonTransforms ${Module_SRCS}) diff --git a/Common/Transforms/module.cmake b/Common/Transforms/module.cmake new file mode 100644 index 00000000000..cdedc0b3f36 --- /dev/null +++ b/Common/Transforms/module.cmake @@ -0,0 +1,4 @@ +vtk_module(vtkCommonTransforms + DEPENDS + vtkCommonMath + ) diff --git a/Examples/Statistics/CMakeLists.txt b/Examples/Statistics/CMakeLists.txt new file mode 100644 index 00000000000..5d9dc3eff13 --- /dev/null +++ b/Examples/Statistics/CMakeLists.txt @@ -0,0 +1,19 @@ + +cmake_minimum_required(VERSION 2.8) + +project(VTKStatExample) + +if(NOT VTK_BINARY_DIR) + find_package(VTK REQUIRED) + include(${VTK_USE_FILE}) +endif(NOT VTK_BINARY_DIR) + +link_directories(${VTK_LIBRARY_DIRS}) + +# Add example use of vtkDescriptiveStatistics +add_executable(ExampleDescriptiveStatistics ExampleDescriptiveStatistics.cxx) +target_link_libraries(ExampleDescriptiveStatistics vtkCommonCore vtkCommonSystem vtkCommonDataModel vtkFiltersStatistics) + +# Add example use of vtkKMeansStatistics +add_executable(ExampleKMeansStatistics ExampleKMeansStatistics.cxx) +target_link_libraries(ExampleKMeansStatistics vtkCommonCore vtkCommonSystem vtkCommonDataModel vtkFiltersStatistics) diff --git a/Examples/Statistics/ExampleDescriptiveStatistics.cxx b/Examples/Statistics/ExampleDescriptiveStatistics.cxx new file mode 100644 index 00000000000..5e0f8ae777d --- /dev/null +++ b/Examples/Statistics/ExampleDescriptiveStatistics.cxx @@ -0,0 +1,791 @@ +/* + * Copyright 2008 Sandia Corporation. + * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive + * license for use of this work by or on behalf of the + * U.S. Government. Redistribution and use in source and binary forms, with + * or without modification, are permitted provided that this Notice and any + * statement of authorship are reproduced on all copies. + */ +// .SECTION Thanks +// Thanks to Philippe Pebay and David Thompson from Sandia National Laboratories +// for implementing this test. + +#include "vtkDataObjectCollection.h" +#include "vtkDoubleArray.h" +#include "vtkMath.h" +#include "vtkMultiBlockDataSet.h" +#include "vtkStringArray.h" +#include "vtkTable.h" +#include "vtkTimerLog.h" +#include "vtkDescriptiveStatistics.h" + +//============================================================================= +int main( int, char *[] ) +{ + int testStatus = 0; + + // ************** Test with 3 columns of input data ************** + + // Input data + double mingledData[] = + { + 46, + 45, + 47, + 49, + 46, + 47, + 46, + 46, + 47, + 46, + 47, + 49, + 49, + 49, + 47, + 45, + 50, + 50, + 46, + 46, + 51, + 50, + 48, + 48, + 52, + 54, + 48, + 47, + 52, + 52, + 49, + 49, + 53, + 54, + 50, + 50, + 53, + 54, + 50, + 52, + 53, + 53, + 50, + 51, + 54, + 54, + 49, + 49, + 52, + 52, + 50, + 51, + 52, + 52, + 49, + 47, + 48, + 48, + 48, + 50, + 46, + 48, + 47, + 47, + }; + + // Test with entire data set + int nVals1 = 32; + + vtkDoubleArray* dataset1Arr = vtkDoubleArray::New(); + dataset1Arr->SetNumberOfComponents( 1 ); + dataset1Arr->SetName( "Metric 0" ); + + vtkDoubleArray* dataset2Arr = vtkDoubleArray::New(); + dataset2Arr->SetNumberOfComponents( 1 ); + dataset2Arr->SetName( "Metric 1" ); + + vtkDoubleArray* dataset3Arr = vtkDoubleArray::New(); + dataset3Arr->SetNumberOfComponents( 1 ); + dataset3Arr->SetName( "Metric 2" ); + + for ( int i = 0; i < nVals1; ++ i ) + { + int ti = i << 1; + dataset1Arr->InsertNextValue( mingledData[ti] ); + dataset2Arr->InsertNextValue( mingledData[ti + 1] ); + dataset3Arr->InsertNextValue( -1. ); + } + + vtkTable* datasetTable1 = vtkTable::New(); + datasetTable1->AddColumn( dataset1Arr ); + dataset1Arr->Delete(); + datasetTable1->AddColumn( dataset2Arr ); + dataset2Arr->Delete(); + datasetTable1->AddColumn( dataset3Arr ); + dataset3Arr->Delete(); + + // Pairs of interest + int nMetrics = 3; + vtkStdString columns[] = + { + "Metric 1", + "Metric 2", + "Metric 0" + }; + + // Reference values + // Means for metrics 0, 1, and 2, respectively + double means1[] = { 49.21875 , 49.5, -1. }; + + // Standard deviations for metrics 0, 1, and 2, respectively + double stdevs1[] = { sqrt( 5.9828629 ), sqrt( 7.548397 ), 0. }; + + // Set descriptive statistics algorithm and its input data port + vtkDescriptiveStatistics* ds1 = vtkDescriptiveStatistics::New(); + + // First verify that absence of input does not cause trouble + cout << "\n## Verifying that absence of input does not cause trouble... "; + ds1->Update(); + cout << "done.\n"; + + // Prepare first test with data + ds1->SetInput( vtkStatisticsAlgorithm::INPUT_DATA, datasetTable1 ); + datasetTable1->Delete(); + + // Select Columns of Interest + for ( int i = 0; i< nMetrics; ++ i ) + { + ds1->AddColumn( columns[i] ); + } + + // Test Learn, Derive, Test, and Assess options + ds1->SetLearnOption( true ); + ds1->SetDeriveOption( true ); + ds1->SetAssessOption( true ); + ds1->SetTestOption( true ); + ds1->SignedDeviationsOff(); + ds1->Update(); + + // Get output data and meta tables + vtkTable* outputData1 = ds1->GetOutput( vtkStatisticsAlgorithm::OUTPUT_DATA ); + vtkMultiBlockDataSet* outputMetaDS1 = vtkMultiBlockDataSet::SafeDownCast( ds1->GetOutputDataObject( vtkStatisticsAlgorithm::OUTPUT_MODEL ) ); + vtkTable* outputPrimary1 = vtkTable::SafeDownCast( outputMetaDS1->GetBlock( 0 ) ); + vtkTable* outputDerived1 = vtkTable::SafeDownCast( outputMetaDS1->GetBlock( 1 ) ); + vtkTable* outputTest1 = ds1->GetOutput( vtkStatisticsAlgorithm::OUTPUT_TEST ); + + cout << "\n## Calculated the following primary statistics for first data set:\n"; + for ( vtkIdType r = 0; r < outputPrimary1->GetNumberOfRows(); ++ r ) + { + cout << " "; + for ( int i = 0; i < outputPrimary1->GetNumberOfColumns(); ++ i ) + { + cout << outputPrimary1->GetColumnName( i ) + << "=" + << outputPrimary1->GetValue( r, i ).ToString() + << " "; + } + + // Verify some of the calculated primary statistics + if ( fabs ( outputPrimary1->GetValueByName( r, "Mean" ).ToDouble() - means1[r] ) > 1.e-6 ) + { + vtkGenericWarningMacro("Incorrect mean"); + testStatus = 1; + } + cout << "\n"; + } + + cout << "\n## Calculated the following derived statistics for first data set:\n"; + for ( vtkIdType r = 0; r < outputDerived1->GetNumberOfRows(); ++ r ) + { + cout << " "; + for ( int i = 0; i < outputDerived1->GetNumberOfColumns(); ++ i ) + { + cout << outputDerived1->GetColumnName( i ) + << "=" + << outputDerived1->GetValue( r, i ).ToString() + << " "; + } + + // Verify some of the calculated derived statistics + if ( fabs ( outputDerived1->GetValueByName( r, "Standard Deviation" ).ToDouble() - stdevs1[r] ) > 1.e-5 ) + { + vtkGenericWarningMacro("Incorrect standard deviation"); + testStatus = 1; + } + cout << "\n"; + } + + // Check some results of the Test option + cout << "\n## Calculated the following Jarque-Bera statistics:\n"; + for ( vtkIdType r = 0; r < outputTest1->GetNumberOfRows(); ++ r ) + { + cout << " "; + for ( int i = 0; i < outputTest1->GetNumberOfColumns(); ++ i ) + { + cout << outputTest1->GetColumnName( i ) + << "=" + << outputTest1->GetValue( r, i ).ToString() + << " "; + } + + cout << "\n"; + } + + // Search for outliers to check results of Assess option + double maxdev = 1.5; + cout << "\n## Searching for outliers from mean with relative deviation > " + << maxdev + << " for metric 1:\n"; + + vtkDoubleArray* vals0 = vtkDoubleArray::SafeDownCast( outputData1->GetColumnByName( "Metric 0" ) ); + vtkDoubleArray* vals1 = vtkDoubleArray::SafeDownCast( outputData1->GetColumnByName( "Metric 1" ) ); + vtkDoubleArray* devs0 = vtkDoubleArray::SafeDownCast( outputData1->GetColumnByName( "d(Metric 0)" ) ); + vtkDoubleArray* devs1 = vtkDoubleArray::SafeDownCast( outputData1->GetColumnByName( "d(Metric 1)" ) ); + + if ( ! devs0 || ! devs1 || ! vals0 || ! vals1 ) + { + vtkGenericWarningMacro("Empty output column(s).\n"); + testStatus = 1; + + return testStatus; + } + + double dev; + int m0outliers = 0; + int m1outliers = 0; + for ( vtkIdType r = 0; r < outputData1->GetNumberOfRows(); ++ r ) + { + dev = devs0->GetValue( r ); + if ( dev > maxdev ) + { + ++ m0outliers; + cout << " " + << " row " + << r + << ", " + << devs0->GetName() + << " = " + << dev + << " > " + << maxdev + << " (value: " + << vals0->GetValue( r ) + << ")\n"; + } + } + for ( vtkIdType r = 0; r < outputData1->GetNumberOfRows(); ++ r ) + { + dev = devs1->GetValue( r ); + if ( dev > maxdev ) + { + ++ m1outliers; + cout << " " + << " row " + << r + << ", " + << devs1->GetName() + << " = " + << dev + << " > " + << maxdev + << " (value: " + << vals1->GetValue( r ) + << ")\n"; + } + } + + cout << " Found " + << m0outliers + << " outliers for Metric 0" + << " and " + << m1outliers + << " outliers for Metric 1.\n"; + + if ( m0outliers != 4 || m1outliers != 6 ) + { + vtkGenericWarningMacro("Expected 4 outliers for Metric 0 and 6 outliers for Metric 1."); + testStatus = 1; + } + + // Now, used modified output 1 as input 1 to test 0-deviation + cout << "\n## Searching for values not equal to 50 for metric 1:\n"; + + vtkTable* modifiedPrimary = vtkTable::New(); + modifiedPrimary->ShallowCopy( outputPrimary1 ); + modifiedPrimary->SetValueByName( 1, "Mean", 50. ); + + vtkTable* modifiedDerived = vtkTable::New(); + modifiedDerived->ShallowCopy( outputDerived1 ); + modifiedDerived->SetValueByName( 1, "Standard Deviation", 0. ); + + vtkMultiBlockDataSet* modifiedModel = vtkMultiBlockDataSet::New(); + modifiedModel->SetNumberOfBlocks( 2 ); + modifiedModel->SetBlock( 0, modifiedPrimary ); + modifiedModel->SetBlock( 1, modifiedDerived ); + + // Run with Assess option only (do not recalculate nor rederive a model) + ds1->SetInput( vtkStatisticsAlgorithm::INPUT_MODEL, modifiedModel ); + ds1->SetLearnOption( false ); + ds1->SetDeriveOption( false ); + ds1->SetTestOption( true ); + ds1->SetAssessOption( true ); + ds1->Update(); + + vals1 = vtkDoubleArray::SafeDownCast( outputData1->GetColumnByName( "Metric 1" ) ); + devs1 = vtkDoubleArray::SafeDownCast( outputData1->GetColumnByName( "d(Metric 1)" ) ); + + if ( ! devs1 || ! vals1 ) + { + vtkGenericWarningMacro("Empty output column(s).\n"); + testStatus = 1; + + return testStatus; + } + + m1outliers = 0; + for ( vtkIdType r = 0; r < outputData1->GetNumberOfRows(); ++ r ) + { + dev = devs1->GetValue( r ); + if ( dev ) + { + ++ m1outliers; + } + } + + cout << " Found " + << m1outliers + << " outliers for Metric 1.\n"; + + if ( m1outliers != 28 ) + { + vtkGenericWarningMacro("Expected 28 outliers for Metric 1, found " << m1outliers << "."); + testStatus = 1; + } + + // Clean up (which implies resetting input model to first algorithm parameters table values which were modified to their initial values) + modifiedPrimary->SetValueByName( 1, "Mean", means1[1] ); + modifiedPrimary->Delete(); + modifiedDerived->SetValueByName( 1, "Standard Deviation", stdevs1[1] ); + modifiedDerived->Delete(); + modifiedModel->Delete(); + + // Test with a slight variation of initial data set (to test model aggregation) + int nVals2 = 32; + + vtkDoubleArray* dataset4Arr = vtkDoubleArray::New(); + dataset4Arr->SetNumberOfComponents( 1 ); + dataset4Arr->SetName( "Metric 0" ); + + vtkDoubleArray* dataset5Arr = vtkDoubleArray::New(); + dataset5Arr->SetNumberOfComponents( 1 ); + dataset5Arr->SetName( "Metric 1" ); + + vtkDoubleArray* dataset6Arr = vtkDoubleArray::New(); + dataset6Arr->SetNumberOfComponents( 1 ); + dataset6Arr->SetName( "Metric 2" ); + + for ( int i = 0; i < nVals2; ++ i ) + { + int ti = i << 1; + dataset4Arr->InsertNextValue( mingledData[ti] + 1. ); + dataset5Arr->InsertNextValue( mingledData[ti + 1] ); + dataset6Arr->InsertNextValue( 1. ); + } + + vtkTable* datasetTable2 = vtkTable::New(); + datasetTable2->AddColumn( dataset4Arr ); + dataset4Arr->Delete(); + datasetTable2->AddColumn( dataset5Arr ); + dataset5Arr->Delete(); + datasetTable2->AddColumn( dataset6Arr ); + dataset6Arr->Delete(); + + // Set descriptive statistics algorithm and its input data port + vtkDescriptiveStatistics* ds2 = vtkDescriptiveStatistics::New(); + ds2->SetInput( vtkStatisticsAlgorithm::INPUT_DATA, datasetTable2 ); + + // Select Columns of Interest (all of them) + for ( int i = 0; i< nMetrics; ++ i ) + { + ds2->AddColumn( columns[i] ); + } + + // Update with Learn option only + ds2->SetLearnOption( true ); + ds2->SetDeriveOption( false ); + ds2->SetTestOption( false ); + ds2->SetAssessOption( false ); + ds2->Update(); + + // Get output meta tables + vtkMultiBlockDataSet* outputMetaDS2 = vtkMultiBlockDataSet::SafeDownCast( ds2->GetOutputDataObject( vtkStatisticsAlgorithm::OUTPUT_MODEL ) ); + vtkTable* outputPrimary2 = vtkTable::SafeDownCast( outputMetaDS2->GetBlock( 0 ) ); + + cout << "\n## Calculated the following primary statistics for second data set:\n"; + for ( vtkIdType r = 0; r < outputPrimary2->GetNumberOfRows(); ++ r ) + { + cout << " "; + for ( int i = 0; i < outputPrimary2->GetNumberOfColumns(); ++ i ) + { + cout << outputPrimary2->GetColumnName( i ) + << "=" + << outputPrimary2->GetValue( r, i ).ToString() + << " "; + } + cout << "\n"; + } + + // Clean up + ds2->Delete(); + + // Test model aggregation by adding new data to engine which already has a model + ds1->SetInput( vtkStatisticsAlgorithm::INPUT_DATA, datasetTable2 ); + datasetTable2->Delete(); + vtkMultiBlockDataSet* model = vtkMultiBlockDataSet::New(); + model->ShallowCopy( outputMetaDS1 ); + ds1->SetInput( vtkStatisticsAlgorithm::INPUT_MODEL, model ); + model->Delete(); + + // Update with Learn and Derive options only + ds1->SetLearnOption( true ); + ds1->SetDeriveOption( true ); + ds1->SetTestOption( false ); + ds1->SetAssessOption( false ); + ds1->Update(); + + // Updated reference values + // Means deviations for metrics 0, 1, and 2, respectively + double means0[] = { 49.71875 , 49.5, 0. }; + + // Standard deviations for metrics 0, 1, and 2, respectively + double stdevs0[] = { sqrt( 6.1418651 ), sqrt( 7.548397 * 62. / 63. ), sqrt( 64. / 63. ) }; + + // Get output data and meta tables + outputMetaDS1 = vtkMultiBlockDataSet::SafeDownCast( ds1->GetOutputDataObject( vtkStatisticsAlgorithm::OUTPUT_MODEL ) ); + outputPrimary1 = vtkTable::SafeDownCast( outputMetaDS1->GetBlock( 0 ) ); + outputDerived1 = vtkTable::SafeDownCast( outputMetaDS1->GetBlock( 1 ) ); + + cout << "\n## Calculated the following primary statistics for updated (first + second) data set:\n"; + for ( vtkIdType r = 0; r < outputPrimary1->GetNumberOfRows(); ++ r ) + { + cout << " "; + for ( int i = 0; i < outputPrimary1->GetNumberOfColumns(); ++ i ) + { + cout << outputPrimary1->GetColumnName( i ) + << "=" + << outputPrimary1->GetValue( r, i ).ToString() + << " "; + } + + // Verify some of the calculated primary statistics + if ( fabs ( outputPrimary1->GetValueByName( r, "Mean" ).ToDouble() - means0[r] ) > 1.e-6 ) + { + vtkGenericWarningMacro("Incorrect mean"); + testStatus = 1; + } + cout << "\n"; + } + + cout << "\n## Calculated the following derived statistics for updated (first + second) data set:\n"; + for ( vtkIdType r = 0; r < outputDerived1->GetNumberOfRows(); ++ r ) + { + cout << " "; + for ( int i = 0; i < outputDerived1->GetNumberOfColumns(); ++ i ) + { + cout << outputDerived1->GetColumnName( i ) + << "=" + << outputDerived1->GetValue( r, i ).ToString() + << " "; + } + + // Verify some of the calculated derived statistics + if ( fabs ( outputDerived1->GetValueByName( r, "Standard Deviation" ).ToDouble() - stdevs0[r] ) > 1.e-5 ) + { + vtkGenericWarningMacro("Incorrect standard deviation"); + testStatus = 1; + } + cout << "\n"; + } + + // Clean up + ds1->Delete(); + + // ************** Very simple example, for baseline comparison vs. R ********* + double simpleData[] = + { + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + }; + int nSimpleVals = 10; + + vtkDoubleArray* datasetArr = vtkDoubleArray::New(); + datasetArr->SetNumberOfComponents( 1 ); + datasetArr->SetName( "Digits" ); + + for ( int i = 0; i < nSimpleVals; ++ i ) + { + datasetArr->InsertNextValue( simpleData[i] ); + } + + vtkTable* simpleTable = vtkTable::New(); + simpleTable->AddColumn( datasetArr ); + datasetArr->Delete(); + + double mean = 4.5; + double variance = 9.16666666666667; + double skewness = 0.; + double kurtosis = -1.56163636363636; + + // Set descriptive statistics algorithm and its input data port + vtkDescriptiveStatistics* ds3 = vtkDescriptiveStatistics::New(); + ds3->SetInput( vtkStatisticsAlgorithm::INPUT_DATA, simpleTable ); + simpleTable->Delete(); + + // Select column of interest + ds3->AddColumn( "Digits" ); + + // Add non existing column + ds3->AddColumn( "Bogus" ); + + // Warning for non existing column will mess up output + cout << "\n"; + + // Test Learn and Derive options only + ds3->SetLearnOption( true ); + ds3->SetDeriveOption( true ); + ds3->SetTestOption( false ); + ds3->SetAssessOption( false ); + ds3->Update(); + + // Get output data and meta tables + vtkMultiBlockDataSet* outputMetaDS3 = vtkMultiBlockDataSet::SafeDownCast( ds3->GetOutputDataObject( vtkStatisticsAlgorithm::OUTPUT_MODEL ) ); + vtkTable* outputPrimary3 = vtkTable::SafeDownCast( outputMetaDS3->GetBlock( 0 ) ); + vtkTable* outputDerived3 = vtkTable::SafeDownCast( outputMetaDS3->GetBlock( 1 ) ); + + cout << "\n## Calculated the following primary statistics for {0,...9} sequence:\n"; + cout << " "; + for ( int i = 0; i < outputPrimary3->GetNumberOfColumns(); ++ i ) + { + cout << outputPrimary3->GetColumnName( i ) + << "=" + << outputPrimary3->GetValue( 0, i ).ToString() + << " "; + } + + // Verify some of the calculated primary statistics + if ( fabs ( outputPrimary3->GetValueByName( 0, "Mean" ).ToDouble() - mean ) > 1.e-6 ) + { + vtkGenericWarningMacro("Incorrect mean"); + testStatus = 1; + } + cout << "\n"; + + cout << "\n## Calculated the following derived statistics for {0,...9} sequence:\n"; + cout << " "; + for ( int i = 0; i < outputDerived3->GetNumberOfColumns(); ++ i ) + { + cout << outputDerived3->GetColumnName( i ) + << "=" + << outputDerived3->GetValue( 0, i ).ToString() + << " "; + } + + // Verify some of the calculated derived statistics + if ( fabs ( outputDerived3->GetValueByName( 0, "Variance" ).ToDouble() - variance ) > 1.e-6 ) + { + vtkGenericWarningMacro("Incorrect variance"); + testStatus = 1; + } + + if ( fabs ( outputDerived3->GetValueByName( 0, "Skewness" ).ToDouble() - skewness ) > 1.e-6 ) + { + vtkGenericWarningMacro("Incorrect skewness"); + testStatus = 1; + } + + if ( fabs ( outputDerived3->GetValueByName( 0, "Kurtosis" ).ToDouble() - kurtosis ) > 1.e-6 ) + { + vtkGenericWarningMacro("Incorrect kurtosis"); + testStatus = 1; + } + cout << "\n"; + + // Clean up + ds3->Delete(); + + // ************** Pseudo-random sample to exercise Jarque-Bera test ********* + int nVals = 10000; + + vtkDoubleArray* datasetNormal = vtkDoubleArray::New(); + datasetNormal->SetNumberOfComponents( 1 ); + datasetNormal->SetName( "Standard Normal" ); + + vtkDoubleArray* datasetUniform = vtkDoubleArray::New(); + datasetUniform->SetNumberOfComponents( 1 ); + datasetUniform->SetName( "Standard Uniform" ); + + vtkDoubleArray* datasetLogNormal = vtkDoubleArray::New(); + datasetLogNormal->SetNumberOfComponents( 1 ); + datasetLogNormal->SetName( "Standard Log-Normal" ); + + vtkDoubleArray* datasetExponential = vtkDoubleArray::New(); + datasetExponential->SetNumberOfComponents( 1 ); + datasetExponential->SetName( "Standard Exponential" ); + + vtkDoubleArray* datasetLaplace = vtkDoubleArray::New(); + datasetLaplace->SetNumberOfComponents( 1 ); + datasetLaplace->SetName( "Standard Laplace" ); + + // Seed random number generator + vtkMath::RandomSeed( static_cast<int>( vtkTimerLog::GetUniversalTime() ) ); + + for ( int i = 0; i < nVals; ++ i ) + { + datasetNormal->InsertNextValue( vtkMath::Gaussian() ); + datasetUniform->InsertNextValue( vtkMath::Random() ); + datasetLogNormal->InsertNextValue( exp( vtkMath::Gaussian() ) ); + datasetExponential->InsertNextValue( -log ( vtkMath::Random() ) ); + double u = vtkMath::Random() - .5; + datasetLaplace->InsertNextValue( ( u < 0. ? 1. : -1. ) * log ( 1. - 2. * fabs( u ) ) ); + } + + vtkTable* gaussianTable = vtkTable::New(); + gaussianTable->AddColumn( datasetNormal ); + datasetNormal->Delete(); + gaussianTable->AddColumn( datasetUniform ); + datasetUniform->Delete(); + gaussianTable->AddColumn( datasetLogNormal ); + datasetLogNormal->Delete(); + gaussianTable->AddColumn( datasetExponential ); + datasetExponential->Delete(); + gaussianTable->AddColumn( datasetLaplace ); + datasetLaplace->Delete(); + + // Set descriptive statistics algorithm and its input data port + vtkDescriptiveStatistics* ds4 = vtkDescriptiveStatistics::New(); + ds4->SetInput( vtkStatisticsAlgorithm::INPUT_DATA, gaussianTable ); + gaussianTable->Delete(); + + // Select Column of Interest + ds4->AddColumn( "Standard Normal" ); + ds4->AddColumn( "Standard Uniform" ); + ds4->AddColumn( "Standard Log-Normal" ); + ds4->AddColumn( "Standard Exponential" ); + ds4->AddColumn( "Standard Laplace" ); + + // Test Learn, Derive, and Test options only + ds4->SetLearnOption( true ); + ds4->SetDeriveOption( true ); + ds4->SetTestOption( true ); + ds4->SetAssessOption( false ); + ds4->Update(); + + // Get output data and meta tables + vtkMultiBlockDataSet* outputMetaDS4 = vtkMultiBlockDataSet::SafeDownCast( ds4->GetOutputDataObject( vtkStatisticsAlgorithm::OUTPUT_MODEL ) ); + vtkTable* outputPrimary4 = vtkTable::SafeDownCast( outputMetaDS4->GetBlock( 0 ) ); + vtkTable* outputDerived4 = vtkTable::SafeDownCast( outputMetaDS4->GetBlock( 1 ) ); + vtkTable* outputTest4 = ds4->GetOutput( vtkStatisticsAlgorithm::OUTPUT_TEST ); + + cout << "\n## Calculated the following primary statistics for pseudo-random variables (n=" + << nVals + << "):\n"; + for ( vtkIdType r = 0; r < outputPrimary4->GetNumberOfRows(); ++ r ) + { + cout << " "; + for ( int i = 0; i < outputPrimary4->GetNumberOfColumns(); ++ i ) + { + cout << outputPrimary4->GetColumnName( i ) + << "=" + << outputPrimary4->GetValue( r, i ).ToString() + << " "; + } + + cout << "\n"; + } + + cout << "\n## Calculated the following derived statistics for pseudo-random variables (n=" + << nVals + << "):\n"; + for ( vtkIdType r = 0; r < outputDerived4->GetNumberOfRows(); ++ r ) + { + cout << " "; + for ( int i = 0; i < outputDerived4->GetNumberOfColumns(); ++ i ) + { + cout << outputDerived4->GetColumnName( i ) + << "=" + << outputDerived4->GetValue( r, i ).ToString() + << " "; + } + + cout << "\n"; + } + + // Check some results of the Test option + cout << "\n## Calculated the following Jarque-Bera statistics for pseudo-random variables (n=" + << nVals; + +#ifdef VTK_USE_GNU_R + int nNonGaussian = 3; + int nRejected = 0; + double alpha = .01; + + cout << ", null hypothesis: normality, significance level=" + << alpha; +#endif // VTK_USE_GNU_R + + cout << "):\n"; + + // Loop over Test table + for ( vtkIdType r = 0; r < outputTest4->GetNumberOfRows(); ++ r ) + { + cout << " "; + for ( int c = 0; c < outputTest4->GetNumberOfColumns(); ++ c ) + { + cout << outputTest4->GetColumnName( c ) + << "=" + << outputTest4->GetValue( r, c ).ToString() + << " "; + } + +#ifdef VTK_USE_GNU_R + // Check if null hypothesis is rejected at specified significance level + double p = outputTest4->GetValueByName( r, "P" ).ToDouble(); + // Must verify that p value is valid (it is set to -1 if R has failed) + if ( p > -1 && p < alpha ) + { + cout << "N.H. rejected"; + + ++ nRejected; + } +#endif // VTK_USE_GNU_R + + cout << "\n"; + } + +#ifdef VTK_USE_GNU_R + if ( nRejected < nNonGaussian ) + { + vtkGenericWarningMacro("Rejected only " + << nRejected + << " null hypotheses of normality whereas " + << nNonGaussian + << " variables are not Gaussian"); + testStatus = 1; + } +#endif // VTK_USE_GNU_R + + // Clean up + ds4->Delete(); + + return testStatus; +} diff --git a/Examples/Statistics/ExampleKMeansStatistics.cxx b/Examples/Statistics/ExampleKMeansStatistics.cxx new file mode 100644 index 00000000000..f2d6e8ded77 --- /dev/null +++ b/Examples/Statistics/ExampleKMeansStatistics.cxx @@ -0,0 +1,254 @@ +/* + * Copyright 2008 Sandia Corporation. + * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive + * license for use of this work by or on behalf of the + * U.S. Government. Redistribution and use in source and binary forms, with + * or without modification, are permitted provided that this Notice and any + * statement of authorship are reproduced on all copies. + */ +// .SECTION Thanks +// Thanks to Janine Bennett, Philippe Pebay, and David Thompson from Sandia National Laboratories +// for implementing this test. + +#include "vtkDoubleArray.h" +#include "vtkMultiBlockDataSet.h" +#include "vtkStringArray.h" +#include "vtkIdTypeArray.h" +#include "vtkTable.h" +#include "vtkMath.h" +#include "vtkKMeansStatistics.h" +#include "vtkStdString.h" +#include "vtkTimerLog.h" + +#include <vtksys/ios/sstream> + + +//============================================================================= +int main( int, char *[] ) +{ + int testStatus = 0; + + const int nDim = 4; + int nVals = 50; + + // Seed random number generator + vtkMath::RandomSeed( static_cast<int>( vtkTimerLog::GetUniversalTime() ) ); + + // Generate an input table that contains samples of mutually independent random variables over [0, 1] + vtkTable* inputData = vtkTable::New(); + vtkDoubleArray* doubleArray; + + int numComponents = 1; + for ( int c = 0; c < nDim; ++ c ) + { + vtksys_ios::ostringstream colName; + colName << "coord " << c; + doubleArray = vtkDoubleArray::New(); + doubleArray->SetNumberOfComponents( numComponents ); + doubleArray->SetName( colName.str().c_str() ); + doubleArray->SetNumberOfTuples( nVals ); + + double x; + for ( int r = 0; r < nVals; ++ r ) + { + //x = vtkMath::Gaussian(); + x = vtkMath::Random(); + doubleArray->SetValue( r, x ); + } + + inputData->AddColumn( doubleArray ); + doubleArray->Delete(); + } + + vtkTable* paramData = vtkTable::New(); + vtkIdTypeArray* paramCluster; + vtkDoubleArray* paramArray; + const int numRuns = 5; + const int numClustersInRun[] = { 5, 2, 3, 4, 5 }; + paramCluster = vtkIdTypeArray::New(); + paramCluster->SetName( "K" ); + + for( int curRun = 0; curRun < numRuns; curRun++ ) + { + for( int nInRun = 0; nInRun < numClustersInRun[curRun]; nInRun++ ) + { + paramCluster->InsertNextValue( numClustersInRun[curRun] ); + } + } + paramData->AddColumn( paramCluster ); + paramCluster->Delete(); + + for ( int c = 0; c < 5; ++ c ) + { + vtksys_ios::ostringstream colName; + colName << "coord " << c; + paramArray = vtkDoubleArray::New(); + paramArray->SetNumberOfComponents( numComponents ); + paramArray->SetName( colName.str().c_str() ); + + double x; + for( int curRun = 0; curRun < numRuns; curRun++ ) + { + for( int nInRun = 0; nInRun < numClustersInRun[curRun]; nInRun++ ) + { + //x = vtkMath::Gaussian(); + x = vtkMath::Random(); + paramArray->InsertNextValue( x ); + } + } + paramData->AddColumn( paramArray ); + paramArray->Delete(); + } + + // Set k-means statistics algorithm and its input data port + vtkKMeansStatistics* haruspex = vtkKMeansStatistics::New(); + + // First verify that absence of input does not cause trouble + cout << "## Verifying that absence of input does not cause trouble... "; + haruspex->Update(); + cout << "done.\n"; + + // Prepare first test with data + haruspex->SetInput( vtkStatisticsAlgorithm::INPUT_DATA, inputData ); + haruspex->SetColumnStatus( inputData->GetColumnName( 0 ) , 1 ); + haruspex->SetColumnStatus( inputData->GetColumnName( 2 ) , 1 ); + haruspex->SetColumnStatus( "Testing", 1 ); + haruspex->RequestSelectedColumns(); + haruspex->SetDefaultNumberOfClusters( 3 ); + + cout << "## Testing with no input data:" + << "\n"; + // Test Learn and Derive options + haruspex->SetLearnOption( true ); + haruspex->SetDeriveOption( true ); + haruspex->SetTestOption( false ); + haruspex->SetAssessOption( false ); + + haruspex->Update(); + vtkMultiBlockDataSet* outputMetaDS = vtkMultiBlockDataSet::SafeDownCast( + haruspex->GetOutputDataObject( vtkStatisticsAlgorithm::OUTPUT_MODEL ) ); + for ( unsigned int b = 0; b < outputMetaDS->GetNumberOfBlocks(); ++ b ) + { + vtkTable* outputMeta = vtkTable::SafeDownCast( outputMetaDS->GetBlock( b ) ); + if ( b == 0 ) + { + + vtkIdType testIntValue = 0; + for( vtkIdType r = 0; r < outputMeta->GetNumberOfRows(); r++ ) + { + testIntValue += outputMeta->GetValueByName( r, "Cardinality" ).ToInt(); + } + + cout << "## Computed clusters (cardinality: " + << testIntValue + << " / run):\n"; + + if ( testIntValue != nVals ) + { + vtkGenericWarningMacro("Sum of cluster cardinalities is incorrect: " + << testIntValue + << " != " + << nVals + << "."); + testStatus = 1; + } + } + else + { + cout << "## Ranked cluster: " + << "\n"; + } + + outputMeta->Dump(); + cout << "\n"; + } + + + haruspex->SetInput( vtkStatisticsAlgorithm::LEARN_PARAMETERS, paramData ); + cout << "## Testing with input table:" + << "\n"; + + paramData->Dump(); + cout << "\n"; + + // Test Assess option only + haruspex->SetLearnOption( true ); + haruspex->SetDeriveOption( true ); + haruspex->SetTestOption( false ); + haruspex->SetAssessOption( false ); + + haruspex->Update(); + outputMetaDS = vtkMultiBlockDataSet::SafeDownCast( + haruspex->GetOutputDataObject( vtkStatisticsAlgorithm::OUTPUT_MODEL ) ); + for ( unsigned int b = 0; b < outputMetaDS->GetNumberOfBlocks(); ++ b ) + { + vtkTable* outputMeta = vtkTable::SafeDownCast( outputMetaDS->GetBlock( b ) ); + if ( b == 0 ) + { + vtkIdType r = 0; + vtkIdType testIntValue = 0; + for( int curRun = 0; curRun < numRuns; curRun++ ) + { + testIntValue = 0; + for( int nInRun = 0; nInRun < numClustersInRun[curRun]; nInRun++ ) + { + testIntValue += outputMeta->GetValueByName( r, "Cardinality" ).ToInt(); + r++; + } + } + + if ( r != outputMeta->GetNumberOfRows() ) + { + vtkGenericWarningMacro("Inconsistency in number of rows: " + << r + << " != " + << outputMeta->GetNumberOfRows() + << "."); + testStatus = 1; + } + + cout << "## Computed clusters (cardinality: " + << testIntValue + << " / run):\n"; + + if ( testIntValue != nVals ) + { + vtkGenericWarningMacro("Sum of cluster cardinalities is incorrect: " + << testIntValue + << " != " + << nVals + << "."); + testStatus = 1; + } + } + else + { + cout << "## Ranked cluster: " + << "\n"; + } + + outputMeta->Dump(); + cout << "\n"; + } + + cout << "=================== ASSESS ==================== " << endl; + vtkMultiBlockDataSet* paramsTables = vtkMultiBlockDataSet::New(); + paramsTables->ShallowCopy( outputMetaDS ); + + haruspex->SetInput( vtkStatisticsAlgorithm::INPUT_MODEL, paramsTables ); + + // Test Assess option only (do not recalculate nor rederive a model) + haruspex->SetLearnOption( false ); + haruspex->SetDeriveOption( false ); + haruspex->SetTestOption( false ); + haruspex->SetAssessOption( true ); + haruspex->Update(); + vtkTable* outputData = haruspex->GetOutput(); + outputData->Dump(); + paramsTables->Delete(); + paramData->Delete(); + inputData->Delete(); + haruspex->Delete(); + + return testStatus; +} diff --git a/Filters/Core/CMakeLists.txt b/Filters/Core/CMakeLists.txt new file mode 100644 index 00000000000..c4bf81068a4 --- /dev/null +++ b/Filters/Core/CMakeLists.txt @@ -0,0 +1,86 @@ +set(Module_SRCS + vtkAppendFilter.cxx + vtkAppendPolyData.cxx + vtkAppendSelection.cxx + vtkArrayCalculator.cxx + vtkAssignAttribute.cxx + vtkAttributeDataToFieldDataFilter.cxx + vtkCellDataToPointData.cxx + vtkCleanPolyData.cxx + vtkClipPolyData.cxx + vtkCompositeDataProbeFilter.cxx + vtkConnectivityFilter.cxx + vtkContourFilter.cxx + vtkContourGrid.cxx + vtkDataObjectGenerator.cxx + vtkDataObjectToDataSetFilter.cxx + vtkDataSetEdgeSubdivisionCriterion.cxx + vtkDataSetToDataObjectFilter.cxx + vtkDecimatePolylineFilter.cxx + vtkDecimatePro.cxx + vtkDelaunay2D.cxx + vtkDelaunay3D.cxx + vtkElevationFilter.cxx + vtkFeatureEdges.cxx + vtkFieldDataToAttributeDataFilter.cxx + vtkGlyph2D.cxx + vtkGlyph3D.cxx + vtkHedgeHog.cxx + vtkHull.cxx + vtkIdFilter.cxx + vtkMarchingCubes.cxx + vtkMarchingSquares.cxx + vtkMaskFields.cxx + vtkMaskPoints.cxx + vtkMaskPolyData.cxx + vtkMassProperties.cxx + vtkMergeDataObjectFilter.cxx + vtkMergeFields.cxx + vtkMergeFilter.cxx + vtkPointDataToCellData.cxx + vtkPolyDataConnectivityFilter.cxx + vtkPolyDataNormals.cxx + vtkProbeFilter.cxx + vtkQuadricClustering.cxx + vtkQuadricDecimation.cxx + vtkRearrangeFields.cxx + vtkReverseSense.cxx + vtkSimpleElevationFilter.cxx + vtkSmoothPolyDataFilter.cxx + vtkStreamer.cxx + vtkStreamLine.cxx + vtkStreamPoints.cxx + vtkStripper.cxx + vtkStructuredGridOutlineFilter.cxx + vtkSynchronizedTemplates2D.cxx + vtkSynchronizedTemplates3D.cxx + vtkSynchronizedTemplatesCutter3D.cxx + vtkTensorGlyph.cxx + vtkThreshold.cxx + vtkThresholdPoints.cxx + vtkTriangleFilter.cxx + vtkTubeFilter.cxx + vtkVectorDot.cxx + vtkVectorNorm.cxx + vtkWindowedSincPolyDataFilter.cxx + + vtkCutter.cxx + vtkGridSynchronizedTemplates3D.cxx + vtkRectilinearSynchronizedTemplates.cxx + vtkEdgeSubdivisionCriterion.cxx + vtkStreamingTessellator.cxx + vtkImplicitPolyDataDistance.cxx + vtkStreamerBase.cxx + vtkCenterOfMass.cxx + + vtkGhostArray.cxx + ) + +set_source_files_properties( + vtkEdgeSubdivisionCriterion + vtkStreamer + vtkStreamerBase + ABSTRACT + ) + +vtk_module_library(vtkFiltersCore ${Module_SRCS}) diff --git a/Filters/Core/Testing/Cxx/CMakeLists.txt b/Filters/Core/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..6ffe898cbd1 --- /dev/null +++ b/Filters/Core/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,34 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestGhostArray.cxx + # TestAppendPolyData.cxx + TestAppendSelection.cxx + TestArrayCalculator.cxx + TestAssignAttribute.cxx + TestCellDataToPointData.cxx + TestCenterOfMass.cxx + TestDecimatePolylineFilter.cxx + TestDelaunay2D.cxx + TestGlyph3D.cxx + TestImplicitPolyDataDistance.cxx + + EXTRA_INCLUDE vtkTestDriver.h) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Graphics/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Filters/Core/module.cmake b/Filters/Core/module.cmake new file mode 100644 index 00000000000..fe609674f09 --- /dev/null +++ b/Filters/Core/module.cmake @@ -0,0 +1,16 @@ +vtk_module(vtkFiltersCore + GROUPS + StandAlone + DEPENDS + vtkCommonExecutionModel + vtkCommonSystem + vtkCommonMisc + vtkCommonTransforms + vtkCommonMath + TEST_DEPENDS + vtkTestingRendering + vtkIOXML + vtkImagingCore + vtkFiltersGeneral + vtkRenderingOpenGL + ) diff --git a/Filters/Extraction/CMakeLists.txt b/Filters/Extraction/CMakeLists.txt new file mode 100644 index 00000000000..359b4e7e637 --- /dev/null +++ b/Filters/Extraction/CMakeLists.txt @@ -0,0 +1,38 @@ +set(Module_SRCS + vtkConvertSelection.cxx + vtkExtractArraysOverTime.cxx + vtkExtractBlock.cxx + vtkExtractCells.cxx + vtkExtractDataOverTime.cxx + vtkExtractDataSets.cxx + vtkExtractEdges.cxx + vtkExtractGeometry.cxx + vtkExtractGrid.cxx + vtkExtractLevel.cxx + vtkExtractPolyDataGeometry.cxx + vtkExtractRectilinearGrid.cxx + vtkExtractSelectedBlock.cxx + vtkExtractSelectedFrustum.cxx + vtkExtractSelectedIds.cxx + vtkExtractSelectedLocations.cxx + vtkExtractSelectedPolyDataIds.cxx + vtkExtractSelectedRows.cxx + vtkExtractSelectedThresholds.cxx + vtkExtractSelectionBase.cxx + vtkExtractSelection.cxx + vtkExtractTemporalFieldData.cxx + vtkExtractTensorComponents.cxx + vtkExtractUnstructuredGrid.cxx + vtkExtractVectorComponents.cxx + + vtkProbeSelectedLocations.cxx + vtkHierarchicalDataExtractDataSets.cxx + vtkHierarchicalDataExtractLevel.cxx + ) + +set_source_files_properties( + vtkExtractSelectionBase + ABSTRACT + ) + +vtk_module_library(vtkFiltersExtraction ${Module_SRCS}) diff --git a/Filters/Extraction/Testing/Cxx/CMakeLists.txt b/Filters/Extraction/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..26281946051 --- /dev/null +++ b/Filters/Extraction/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,26 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestConvertSelection.cxx + TestExtractSelection.cxx + TestExtraction.cxx + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Graphics/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Filters/Extraction/module.cmake b/Filters/Extraction/module.cmake new file mode 100644 index 00000000000..7c0677c5fd3 --- /dev/null +++ b/Filters/Extraction/module.cmake @@ -0,0 +1,11 @@ +vtk_module(vtkFiltersExtraction + GROUPS + StandAlone + DEPENDS + vtkFiltersCore + vtkFiltersGeneral + TEST_DEPENDS + vtkRenderingOpenGL + vtkTestingRendering + vtkInteractionStyle + ) diff --git a/Filters/General/CMakeLists.txt b/Filters/General/CMakeLists.txt new file mode 100644 index 00000000000..2be139ffbc0 --- /dev/null +++ b/Filters/General/CMakeLists.txt @@ -0,0 +1,136 @@ +set(Module_SRCS + vtkAnnotationLink.cxx + vtkAppendCompositeDataLeaves.cxx + vtkAppendPoints.cxx + vtkApproximatingSubdivisionFilter.cxx + vtkAreaContourSpectrumFilter.cxx + vtkAxes.cxx + vtkBlankStructuredGrid.cxx + vtkBlankStructuredGridWithImage.cxx + vtkBlockIdScalars.cxx + vtkBoxClipDataSet.cxx + vtkBrownianPoints.cxx + vtkCellCenters.cxx + vtkCellDerivatives.cxx + vtkClipClosedSurface.cxx + vtkClipConvexPolyData.cxx + vtkClipDataSet.cxx + vtkClipVolume.cxx + vtkCoincidentPoints.cxx + vtkCursor2D.cxx + vtkCursor3D.cxx + vtkCurvatures.cxx + vtkDashedStreamLine.cxx + vtkDataSetGradient.cxx + vtkDataSetGradientPrecompute.cxx + vtkDataSetTriangleFilter.cxx + vtkDensifyPolyData.cxx + vtkDicer.cxx + vtkDiscreteMarchingCubes.cxx + vtkEdgePoints.cxx + vtkGradientFilter.cxx + vtkGraphLayoutFilter.cxx + vtkGraphToPoints.cxx + vtkHierarchicalDataLevelFilter.cxx + vtkHyperStreamline.cxx + vtkIconGlyphFilter.cxx + vtkImageMarchingCubes.cxx + vtkInterpolateDataSetAttributes.cxx + vtkInterpolatingSubdivisionFilter.cxx + vtkKdTreeSelector.cxx + vtkLevelIdScalars.cxx + vtkLinkEdgels.cxx + vtkMergeCells.cxx + vtkModelMetadata.cxx + vtkMultiBlockDataGroupFilter.cxx + vtkMultiBlockMergeFilter.cxx + vtkMultiThreshold.cxx + vtkOBBDicer.cxx + vtkOBBTree.cxx + vtkPassThrough.cxx + vtkPolyDataStreamer.cxx + vtkPolyDataToReebGraphFilter.cxx + vtkProbePolyhedron.cxx + vtkQuadraturePointInterpolator.cxx + vtkQuadraturePointsGenerator.cxx + vtkQuadratureSchemeDictionaryGenerator.cxx + vtkQuantizePolyDataPoints.cxx + vtkRandomAttributeGenerator.cxx + vtkRectilinearGridClip.cxx + vtkRectilinearGridToTetrahedra.cxx + vtkRecursiveDividingCubes.cxx + vtkReflectionFilter.cxx + vtkRotationFilter.cxx + vtkSCurveSpline.cxx + vtkShrinkFilter.cxx + vtkShrinkPolyData.cxx + vtkSpatialRepresentationFilter.cxx + vtkSplineFilter.cxx + vtkSplitField.cxx + vtkStructuredGridClip.cxx + vtkSubPixelPositionEdgels.cxx + vtkTableBasedClipDataSet.cxx + vtkTableToPolyData.cxx + vtkTableToStructuredGrid.cxx + vtkTemporalPathLineFilter.cxx + vtkTemporalStatistics.cxx + vtkTessellatorFilter.cxx + vtkTimeSourceExample.cxx + vtkTransformFilter.cxx + vtkTransformPolyDataFilter.cxx + vtkUncertaintyTubeFilter.cxx + vtkVertexGlyphFilter.cxx + vtkVolumeContourSpectrumFilter.cxx + vtkVoxelContoursToSurfaceFilter.cxx + vtkWarpLens.cxx + vtkWarpScalar.cxx + vtkWarpTo.cxx + vtkWarpVector.cxx + vtkYoungsMaterialInterface.cxx + + vtkMarchingContourFilter.cxx + + # Depend upon FiltersSources + #vtkStreamTracer.cxx # Needs vtkModifiedBSPTree + #vtkModifiedBSPTree.cxx # Needs vtkCubeSource.h + #vtkCellLocatorInterpolatedVelocityField.cxx # Needs vtkModifiedBSPTree + #vtkOutlineCornerFilter.cxx # Needs vtkOutlineCornerSource + + # Depend upon IO/Image + #vtkSliceCubes.cxx # Needs vtkVolumeReader + + # Move to FiltersGeometry + #vtkDataSetSurfaceFilter.cxx # Needs vtkStructuredGridGeometryFilter - Geometry + + vtkRectilinearGridToPointSet.cxx + vtkGraphWeightEuclideanDistanceFilter.cxx + vtkGraphWeightFilter.cxx + vtkImageDataToPointSet.cxx + vtkIntersectionPolyDataFilter.cxx + vtkBooleanOperationPolyDataFilter.cxx + vtkDistancePolyDataFilter.cxx + + # New AMR classes + vtkUniformGridAMRAlgorithm.cxx + vtkOverlappingAMRAlgorithm.cxx + vtkNonOverlappingAMRAlgorithm.cxx + vtkOverlappingAMRLevelIdScalars.cxx + vtkExtractArray.cxx + + vtkMatricizeArray.cxx + vtkExtractArray.cxx + vtkNormalizeMatrixVectors.cxx + vtkPassArrays.cxx + vtkSplitColumnComponents.cxx + vtkCellTreeLocator.cxx + ) + +set_source_files_properties( + vtkApproximatingSubdivisionFilter + vtkDicer + vtkGraphWeightFilter + vtkInterpolatingSubdivisionFilter + ABSTRACT + ) + +vtk_module_library(vtkFiltersGeneral ${Module_SRCS}) diff --git a/Filters/General/Testing/Cxx/CMakeLists.txt b/Filters/General/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..5014f043e7b --- /dev/null +++ b/Filters/General/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,48 @@ +set(MyTests + TestGraphWeightEuclideanDistanceFilter.cxx + BoxClipPolyData.cxx + BoxClipTetrahedra.cxx + BoxClipTriangulate.cxx + BoxClipTriangulateAndInterpolate.cxx + # TestBSPTree.cxx # todo (unsatistfied deps) + TestBooleanOperationPolyDataFilter.cxx + TestBooleanOperationPolyDataFilter2.cxx + TestDensifyPolyData.cxx + TestDistancePolyDataFilter.cxx + TestGradientAndVorticity.cxx + TestIconGlyphFilterGravity.cxx + TestImageDataToPointSet.cxx + TestIntersectionPolyDataFilter.cxx + # TestMultiBlock.cxx # todo (unsatistfied deps) + TestQuadraturePoints.cxx + TestRectilinearGridToPointSet.cxx + TestReflectionFilter.cxx + TestUncertaintyTubeFilter.cxx + TestYoungsMaterialInterface.cxx +) + +# Use the testing object factory, to reduce boilerplate code in tests. +include("${VTK_SOURCE_DIR}/Testing/Rendering/vtkTestingObjectFactory.cmake") + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun CxxTests.cxx) + +# Add all the executables +foreach (test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Graphics/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -T ${VTK_BINARY_DIR}/Testing/Temporary + ) + endif() +endforeach() diff --git a/Filters/General/module.cmake b/Filters/General/module.cmake new file mode 100644 index 00000000000..cfc14a34a72 --- /dev/null +++ b/Filters/General/module.cmake @@ -0,0 +1,11 @@ +vtk_module(vtkFiltersGeneral + GROUPS + StandAlone + DEPENDS + vtkCommonComputationalGeometry + vtkFiltersCore + TEST_DEPENDS + vtkRenderingOpenGL + vtkRenderingAnnotation + vtkTestingRendering + ) diff --git a/Filters/Generic/CMakeLists.txt b/Filters/Generic/CMakeLists.txt new file mode 100644 index 00000000000..ad96c056c8e --- /dev/null +++ b/Filters/Generic/CMakeLists.txt @@ -0,0 +1,13 @@ +set(Module_SRCS + vtkGenericClip.cxx + vtkGenericContourFilter.cxx + vtkGenericCutter.cxx + vtkGenericDataSetTessellator.cxx + vtkGenericGeometryFilter.cxx + vtkGenericGlyph3DFilter.cxx + vtkGenericOutlineFilter.cxx + vtkGenericProbeFilter.cxx + vtkGenericStreamTracer.cxx + ) + +vtk_module_library(vtkFiltersGeneric ${Module_SRCS}) diff --git a/Filters/Generic/module.cmake b/Filters/Generic/module.cmake new file mode 100644 index 00000000000..4aaddf1a1af --- /dev/null +++ b/Filters/Generic/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkFiltersGeneric + GROUPS + StandAlone + DEPENDS + vtkFiltersCore + vtkFiltersSources + ) diff --git a/Filters/Geometry/CMakeLists.txt b/Filters/Geometry/CMakeLists.txt new file mode 100644 index 00000000000..46f6aeeadc5 --- /dev/null +++ b/Filters/Geometry/CMakeLists.txt @@ -0,0 +1,34 @@ +set(Module_SRCS + vtkCompositeDataGeometryFilter.cxx + vtkGeometryFilter.cxx + vtkHierarchicalDataSetGeometryFilter.cxx + vtkImageDataGeometryFilter.cxx + vtkRectilinearGridGeometryFilter.cxx + vtkStructuredGridGeometryFilter.cxx + vtkStructuredPointsGeometryFilter.cxx + vtkUnstructuredGridGeometryFilter.cxx + + vtkDataSetSurfaceFilter.cxx + + vtkAbstractGridConnectivity.cxx + vtkDataSetGhostGenerator.cxx + vtkRectilinearGridPartitioner.cxx + vtkStructuredGridConnectivity.cxx + vtkStructuredGridGhostDataGenerator.cxx + vtkStructuredGridPartitioner.cxx + vtkStructuredNeighbor.cxx + vtkUniformGridGhostDataGenerator.cxx + ) + +set_source_files_properties( + vtkAbstractGridConnectivity + vtkDataSetGhostGenerator + ABSTRACT + ) + +set_source_files_properties( + vtkStructuredNeighbor + WRAP_EXCLUDE + ) + +vtk_module_library(vtkFiltersGeometry ${Module_SRCS}) diff --git a/Filters/Geometry/Testing/Cxx/CMakeLists.txt b/Filters/Geometry/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..81f5efbe4fa --- /dev/null +++ b/Filters/Geometry/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,32 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + # TestRectilinearGridPartitioner.cxx # has main + # TestStructuredGridConnectivity.cxx # has main + # TestStructuredGridGhostDataGenerator.cxx # Has main + # TestStructuredGridPartitioner.cxx # Has main + # TestUniformGridGhostDataGenerator.cxx # Strange error? + + TestExtractSurfaceNonLinearSubdivision.cxx + TestUnstructuredGridGeometryFilter.cxx + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Graphics/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Filters/Geometry/module.cmake b/Filters/Geometry/module.cmake new file mode 100644 index 00000000000..bcc788e835a --- /dev/null +++ b/Filters/Geometry/module.cmake @@ -0,0 +1,10 @@ +vtk_module(vtkFiltersGeometry + GROUPS + StandAlone + DEPENDS + vtkFiltersCore + TEST_DEPENDS + vtkIOXML + vtkRenderingOpenGL + vtkTestingRendering + ) diff --git a/Filters/Hybrid/CMakeLists.txt b/Filters/Hybrid/CMakeLists.txt new file mode 100644 index 00000000000..9fdb665434f --- /dev/null +++ b/Filters/Hybrid/CMakeLists.txt @@ -0,0 +1,55 @@ +set(Module_SRCS + vtkBSplineTransform.cxx + vtkDepthSortPolyData.cxx + vtkDSPFilterDefinition.cxx + vtkDSPFilterGroup.cxx + vtkEarthSource.cxx + vtkFacetReader.cxx + vtkGreedyTerrainDecimation.cxx + vtkGridTransform.cxx + vtkImageDataLIC2D.cxx + vtkImageDataLIC2DExtentTranslator.cxx + vtkImageToPolyDataFilter.cxx + vtkImplicitModeller.cxx + vtkPCAAnalysisFilter.cxx + vtkPolyDataSilhouette.cxx + #vtkPolyDataToImageStencil.cxx + vtkProcrustesAlignmentFilter.cxx + vtkProjectedTerrainPath.cxx + vtkRenderLargeImage.cxx + vtkTemporalDataSetCache.cxx + vtkTemporalInterpolator.cxx + vtkTemporalShiftScale.cxx + vtkTemporalSnapToTimeStep.cxx + vtkTransformToGrid.cxx + vtkWeightedTransformFilter.cxx + # FIXME: These should not be in filters. + vtkStructuredGridLIC2D.cxx + vtkStructuredGridLIC2D_fs.cxx + ) + +set(shader_files + vtkStructuredGridLIC2D_fs.glsl + ) + +# FIXME: This should be in a rendering module (an OpenGL rendering module) +# for vtkStructuredGridLIC2D +SET( shader_h_files ) +FOREACH( file ${shader_files} ) + #message("@@@@ file=${file}") + GET_FILENAME_COMPONENT(file_we ${file} NAME_WE) + SET( src ${CMAKE_CURRENT_SOURCE_DIR}/${file} ) + SET( res ${CMAKE_CURRENT_BINARY_DIR}/${file_we}.cxx ) + SET( resh ${CMAKE_CURRENT_BINARY_DIR}/${file_we}.h ) + SET( shader_h_files ${shader_h_files} "${resh}" ) + ADD_CUSTOM_COMMAND( + OUTPUT ${res} ${resh} + DEPENDS ${src} vtkEncodeString + COMMAND ${VTK_ENCODESTRING_EXE} + ARGS ${res} ${src} ${file_we} --build-header VTK_HYBRID_EXPORT vtkSystemIncludes.h + ) + SET( Kit_EXTRA_SRCS ${Kit_EXTRA_SRCS} ${res} ) + set_source_files_properties(${res} WRAP_EXCLUDE) +ENDFOREACH( file ) + +vtk_module_library(vtkFiltersHybrid ${Module_SRCS}) diff --git a/Filters/Hybrid/Testing/Cxx/CMakeLists.txt b/Filters/Hybrid/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..6a22ccb79ed --- /dev/null +++ b/Filters/Hybrid/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,18 @@ +set(MyTests + # TestBSplineWarp.cxx # Fixme after vtkImageViewer deps + TestPolyDataSilhouette.cxx +) + +# Use the testing object factory, to reduce boilerplate code in tests. +include("${VTK_SOURCE_DIR}/Testing/Rendering/vtkTestingObjectFactory.cmake") + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-PolyDataSilhouette + COMMAND ${vtk-module}CxxTests TestPolyDataSilhouette + ${VTK_DATA_ROOT}/Data/cow.vtp + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Hybrid/TestPolyDataSilhouette.png) +endif() diff --git a/Filters/Hybrid/module.cmake b/Filters/Hybrid/module.cmake new file mode 100644 index 00000000000..5139be9dbe1 --- /dev/null +++ b/Filters/Hybrid/module.cmake @@ -0,0 +1,13 @@ +vtk_module(vtkFiltersHybrid + GROUPS + StandAlone + DEPENDS + vtkImagingSources + vtkRenderingOpenGL # This should not be allowed - FIXME - move classes. + vtkFiltersGeneral + COMPILE_DEPENDS + vtkUtilitiesEncodeString # This is only here as GL is in this module. FIXME. + TEST_DEPENDS + vtkImagingCore + vtkTestingRendering + ) diff --git a/Filters/HyperOctree/CMakeLists.txt b/Filters/HyperOctree/CMakeLists.txt new file mode 100644 index 00000000000..40913d888fb --- /dev/null +++ b/Filters/HyperOctree/CMakeLists.txt @@ -0,0 +1,14 @@ +set(Module_SRCS + vtkClipHyperOctree.cxx + vtkHyperOctreeClipCutPointsGrabber.cxx + vtkHyperOctreeContourFilter.cxx + vtkHyperOctreeCutter.cxx + vtkHyperOctreeDepth.cxx + vtkHyperOctreeDualGridContourFilter.cxx + vtkHyperOctreeLimiter.cxx + vtkHyperOctreeSampleFunction.cxx + vtkHyperOctreeSurfaceFilter.cxx + vtkHyperOctreeToUniformGridFilter.cxx + ) + +vtk_module_library(vtkFiltersHyperOctree ${Module_SRCS}) diff --git a/Filters/HyperOctree/Testing/Cxx/CMakeLists.txt b/Filters/HyperOctree/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..f165257cc2e --- /dev/null +++ b/Filters/HyperOctree/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,30 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestClipHyperOctree.cxx + TestHyperOctreeContourFilter.cxx + TestHyperOctreeCutter.cxx + TestHyperOctreeDual.cxx + TestHyperOctreeSurfaceFilter.cxx + TestHyperOctreeToUniformGrid.cxx + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Graphics/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Filters/HyperOctree/module.cmake b/Filters/HyperOctree/module.cmake new file mode 100644 index 00000000000..83a5530ac0c --- /dev/null +++ b/Filters/HyperOctree/module.cmake @@ -0,0 +1,9 @@ +vtk_module(vtkFiltersHyperOctree + GROUPS + StandAlone + DEPENDS + vtkFiltersGeneral + TEST_DEPENDS + vtkRenderingOpenGL + vtkTestingRendering + ) diff --git a/Filters/Imaging/CMakeLists.txt b/Filters/Imaging/CMakeLists.txt new file mode 100644 index 00000000000..560ef5d75f2 --- /dev/null +++ b/Filters/Imaging/CMakeLists.txt @@ -0,0 +1,7 @@ +set(Module_SRCS + vtkPairwiseExtractHistogram2D.cxx + vtkExtractHistogram2D.cxx + vtkComputeHistogram2DOutliers.cxx + ) + +vtk_module_library(vtkFiltersImaging ${Module_SRCS}) diff --git a/Filters/Imaging/module.cmake b/Filters/Imaging/module.cmake new file mode 100644 index 00000000000..3de6eef876c --- /dev/null +++ b/Filters/Imaging/module.cmake @@ -0,0 +1,9 @@ +vtk_module(vtkFiltersImaging + GROUPS + Imaging + StandAlone + DEPENDS + vtkImagingSources + vtkImagingGeneral + vtkFiltersStatistics + ) diff --git a/Filters/Modeling/CMakeLists.txt b/Filters/Modeling/CMakeLists.txt new file mode 100644 index 00000000000..c233c3411bd --- /dev/null +++ b/Filters/Modeling/CMakeLists.txt @@ -0,0 +1,33 @@ +set(Module_SRCS + vtkBandedPolyDataContourFilter.cxx + vtkButterflySubdivisionFilter.cxx + vtkDijkstraGraphGeodesicPath.cxx + vtkDijkstraImageGeodesicPath.cxx + vtkFillHolesFilter.cxx + vtkGeodesicPath.cxx + vtkGraphGeodesicPath.cxx + vtkLinearExtrusionFilter.cxx + vtkLinearSubdivisionFilter.cxx + vtkLoopSubdivisionFilter.cxx + vtkPolyDataPointSampler.cxx + vtkProjectedTexture.cxx + vtkQuadRotationalExtrusionFilter.cxx + vtkRibbonFilter.cxx + vtkRotationalExtrusionFilter.cxx + vtkRuledSurfaceFilter.cxx + vtkSelectEnclosedPoints.cxx + vtkSelectPolyData.cxx + vtkSpherePuzzleArrows.cxx + vtkSpherePuzzle.cxx + vtkSubdivideTetra.cxx + vtkOutlineFilter.cxx + vtkSectorSource.cxx + ) + +set_source_files_properties( + vtkGeodesicPath + vtkGraphGeodesicPath + ABSTRACT + ) + +vtk_module_library(vtkFiltersModeling ${Module_SRCS}) diff --git a/Filters/Modeling/Testing/Cxx/CMakeLists.txt b/Filters/Modeling/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..934c1af44e8 --- /dev/null +++ b/Filters/Modeling/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,29 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestPolyDataPointSampler.cxx + TestQuadRotationalExtrusion.cxx + TestQuadRotationalExtrusionMultiBlock.cxx + TestRotationalExtrusion.cxx + TestSelectEnclosedPoints.cxx + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Graphics/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Filters/Modeling/module.cmake b/Filters/Modeling/module.cmake new file mode 100644 index 00000000000..52c4ca856f4 --- /dev/null +++ b/Filters/Modeling/module.cmake @@ -0,0 +1,10 @@ +vtk_module(vtkFiltersModeling + GROUPS + StandAlone + DEPENDS + vtkFiltersGeneral + vtkFiltersSources + TEST_DEPENDS + vtkRenderingOpenGL + vtkTestingRendering + ) diff --git a/Filters/Parallel/CMakeLists.txt b/Filters/Parallel/CMakeLists.txt new file mode 100644 index 00000000000..24da068e4b8 --- /dev/null +++ b/Filters/Parallel/CMakeLists.txt @@ -0,0 +1,55 @@ +find_package(MPI REQUIRED) +include_directories(${MPI_INCLUDE_PATH}) + +set(Module_SRCS + vtkCollectGraph.cxx + vtkCollectPolyData.cxx + vtkCollectTable.cxx + vtkCachingInterpolatedVelocityField.cxx + vtkCutMaterial.cxx + vtkDistributedDataFilter.cxx + # vtkDistributedStreamTracer.cxx # needs vtkStreamTracer + vtkDuplicatePolyData.cxx + vtkExtractCTHPart.cxx + # vtkExtractPiece.cxx # needs vtkImageClip + vtkExtractPolyDataPiece.cxx + vtkExtractUnstructuredGridPiece.cxx + vtkExtractUserDefinedPiece.cxx + # vtkImageRenderManager.cxx # needs to move + # vtkMemoryLimitImageDataStreamer.cxx # nees vtkImageDataStreamer + vtkPassThroughFilter.cxx + vtkPCellDataToPointData.cxx + vtkPCosmoHaloFinder.cxx + vtkPExtractArraysOverTime.cxx + vtkPieceRequestFilter.cxx + vtkPieceScalars.cxx + vtkPipelineSize.cxx + vtkPKdTree.cxx + vtkPLinearExtrusionFilter.cxx + vtkPOutlineCornerFilter.cxx + vtkPOutlineFilter.cxx + vtkPPolyDataNormals.cxx + vtkPProbeFilter.cxx + vtkPReflectionFilter.cxx + vtkProcessIdScalars.cxx + vtkPSphereSource.cxx + # vtkPStreamTracer.cxx # needs vtkStreamTracer + vtkPTableToStructuredGrid.cxx + vtkRectilinearGridOutlineFilter.cxx + # vtkTemporalFractal.cxx # needs vtkImageMandelbrotSource + vtkTemporalInterpolatedVelocityField.cxx + # vtkTemporalStreamTracer.cxx # needs vtkStreamTracer + # vtkTransmitImageDataPiece.cxx # needs vtkImageClip + vtkTransmitPolyDataPiece.cxx + vtkTransmitRectilinearGridPiece.cxx + vtkTransmitStructuredGridPiece.cxx + vtkTransmitUnstructuredGridPiece.cxx + vtkPYoungsMaterialInterface.cxx + vtkPMaskPoints.cxx + ) +set_source_files_properties( + vtkBlockDistribution.h + HEADER_FILE_ONLY + ) + +vtk_module_library(vtkFiltersParallel ${Module_SRCS}) diff --git a/Filters/Parallel/module.cmake b/Filters/Parallel/module.cmake new file mode 100644 index 00000000000..16861335f77 --- /dev/null +++ b/Filters/Parallel/module.cmake @@ -0,0 +1,12 @@ +vtk_module(vtkFiltersParallel + GROUPS + MPI + DEPENDS + vtkParallelMPI + vtkCosmo + vtkFiltersGeneral + vtkFiltersExtraction + vtkFiltersModeling + vtkFiltersSources + vtkRenderingCore + ) diff --git a/Filters/Parallel/vtkBlockDistribution.h b/Filters/Parallel/vtkBlockDistribution.h index 301f99071bf..3377aaf0b11 100644 --- a/Filters/Parallel/vtkBlockDistribution.h +++ b/Filters/Parallel/vtkBlockDistribution.h @@ -25,7 +25,7 @@ #ifndef __vtkBlockDistribution_h #define __vtkBlockDistribution_h -class VTK_PARALLEL_EXPORT vtkBlockDistribution +class vtkBlockDistribution { public: // Description: diff --git a/Filters/ParallelGeometry/CMakeLists.txt b/Filters/ParallelGeometry/CMakeLists.txt new file mode 100644 index 00000000000..f37ef05834c --- /dev/null +++ b/Filters/ParallelGeometry/CMakeLists.txt @@ -0,0 +1,13 @@ +set(Module_SRCS + vtkPDataSetGhostGenerator.cxx + vtkPStructuredGridConnectivity.cxx + vtkPStructuredGridGhostDataGenerator.cxx + vtkPUniformGridGhostDataGenerator.cxx + ) + +set_source_files_properties( + vtkPDataSetGhostGenerator + ABSTRACT + ) + +vtk_module_library(vtkFiltersParallelGeometry ${Module_SRCS}) diff --git a/Filters/ParallelGeometry/module.cmake b/Filters/ParallelGeometry/module.cmake new file mode 100644 index 00000000000..b065e53cb16 --- /dev/null +++ b/Filters/ParallelGeometry/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkFiltersParallelGeometry + GROUPS + MPI + DEPENDS + vtkFiltersGeometry + vtkParallelMPI + ) diff --git a/Filters/ParallelImaging/CMakeLists.txt b/Filters/ParallelImaging/CMakeLists.txt new file mode 100644 index 00000000000..58ea7a3ede9 --- /dev/null +++ b/Filters/ParallelImaging/CMakeLists.txt @@ -0,0 +1,7 @@ +set(Module_SRCS + vtkPComputeHistogram2DOutliers.cxx + vtkPExtractHistogram2D.cxx + vtkPPairwiseExtractHistogram2D.cxx + ) + +vtk_module_library(vtkFiltersParallelImaging ${Module_SRCS}) diff --git a/Filters/ParallelImaging/module.cmake b/Filters/ParallelImaging/module.cmake new file mode 100644 index 00000000000..88bd4331090 --- /dev/null +++ b/Filters/ParallelImaging/module.cmake @@ -0,0 +1,9 @@ +vtk_module(vtkFiltersParallelImaging + GROUPS + Imaging + StandAlone + DEPENDS + vtkImagingCore + vtkFiltersImaging + vtkParallelCore + ) diff --git a/Filters/ParallelStatistics/CMakeLists.txt b/Filters/ParallelStatistics/CMakeLists.txt new file mode 100644 index 00000000000..1bdabdd00b4 --- /dev/null +++ b/Filters/ParallelStatistics/CMakeLists.txt @@ -0,0 +1,12 @@ +set(Module_SRCS + vtkPContingencyStatistics.cxx + vtkPCorrelativeStatistics.cxx + vtkPDescriptiveStatistics.cxx + vtkPKMeansStatistics.cxx + vtkPMultiCorrelativeStatistics.cxx + vtkPOrderStatistics.cxx + vtkPPCAStatistics.cxx + vtkPBivariateLinearTableThreshold.cxx + ) + +vtk_module_library(vtkFiltersParallelStatistics ${Module_SRCS}) diff --git a/Filters/ParallelStatistics/module.cmake b/Filters/ParallelStatistics/module.cmake new file mode 100644 index 00000000000..f34571d5b55 --- /dev/null +++ b/Filters/ParallelStatistics/module.cmake @@ -0,0 +1,11 @@ +vtk_module(vtkFiltersParallelStatistics + GROUPS + StandAlone + DEPENDS + vtkCommonMath + vtkCommonDataModel + vtkCommonSystem + vtkalglib + vtkFiltersStatistics + vtkParallelCore + ) diff --git a/Filters/Programmable/CMakeLists.txt b/Filters/Programmable/CMakeLists.txt new file mode 100644 index 00000000000..1fdc5b70dd4 --- /dev/null +++ b/Filters/Programmable/CMakeLists.txt @@ -0,0 +1,7 @@ +set(Module_SRCS + vtkProgrammableAttributeDataFilter.cxx + vtkProgrammableFilter.cxx + vtkProgrammableGlyphFilter.cxx + ) + +vtk_module_library(vtkFiltersProgrammable ${Module_SRCS}) diff --git a/Filters/Programmable/module.cmake b/Filters/Programmable/module.cmake new file mode 100644 index 00000000000..5705ae83f8d --- /dev/null +++ b/Filters/Programmable/module.cmake @@ -0,0 +1,6 @@ +vtk_module(vtkFiltersProgrammable + GROUPS + StandAlone + DEPENDS + vtkCommonExecutionModel + ) diff --git a/Filters/ReebGraph/CMakeLists.txt b/Filters/ReebGraph/CMakeLists.txt new file mode 100644 index 00000000000..382bff11235 --- /dev/null +++ b/Filters/ReebGraph/CMakeLists.txt @@ -0,0 +1,12 @@ +find_package(Boost REQUIRED) +include_directories(${Boost_INCLUDE_DIRS}) + +set(Module_SRCS + vtkReebGraphSimplificationFilter.cxx + vtkReebGraphSurfaceSkeletonFilter.cxx + vtkReebGraphToJoinSplitTreeFilter.cxx + vtkReebGraphVolumeSkeletonFilter.cxx + vtkUnstructuredGridToReebGraphFilter.cxx + ) + +vtk_module_library(vtkFiltersReebGraph ${Module_SRCS}) diff --git a/Filters/ReebGraph/module.cmake b/Filters/ReebGraph/module.cmake new file mode 100644 index 00000000000..9174981d471 --- /dev/null +++ b/Filters/ReebGraph/module.cmake @@ -0,0 +1,4 @@ +vtk_module(vtkFiltersReebGraph + DEPENDS + vtkFiltersCore + ) diff --git a/Filters/Sources/CMakeLists.txt b/Filters/Sources/CMakeLists.txt new file mode 100644 index 00000000000..8599b7bd6b5 --- /dev/null +++ b/Filters/Sources/CMakeLists.txt @@ -0,0 +1,41 @@ +set(Module_SRCS + vtkArcSource.cxx + vtkArrowSource.cxx + vtkButtonSource.cxx + vtkConeSource.cxx + vtkCubeSource.cxx + vtkCylinderSource.cxx + vtkDiskSource.cxx + vtkEllipticalButtonSource.cxx + vtkFrustumSource.cxx + vtkGlyphSource2D.cxx + vtkHyperOctreeFractalSource.cxx + vtkLineSource.cxx + vtkOutlineCornerSource.cxx + vtkOutlineSource.cxx + vtkParametricFunctionSource.cxx + vtkPlaneSource.cxx + vtkPlatonicSolidSource.cxx + vtkPointSource.cxx + vtkProgrammableDataObjectSource.cxx + vtkProgrammableSource.cxx + vtkRectangularButtonSource.cxx + vtkRegularPolygonSource.cxx + #vtkRRandomTableSource.cxx # Should be in R kit + #vtkSectorSource.cxx # Needs vtkRotationalExtrusionFilter + vtkSelectionSource.cxx + vtkSphereSource.cxx + vtkSuperquadricSource.cxx + vtkTessellatedBoxSource.cxx + vtkTextSource.cxx + vtkTexturedSphereSource.cxx + vtkGraphToPolyData.cxx + vtkDiagonalMatrixSource.cxx + ) + +set_source_files_properties( + vtkButtonSource + ABSTRACT + ) + +vtk_module_library(vtkFiltersSources ${Module_SRCS}) diff --git a/Filters/Sources/Testing/Cxx/CMakeLists.txt b/Filters/Sources/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..e66a2bcb7a5 --- /dev/null +++ b/Filters/Sources/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,26 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestLineSource.cxx + TestTessellatedBoxSource.cxx + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/${vtk-module}/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Filters/Sources/Testing/Tcl/CMakeLists.txt b/Filters/Sources/Testing/Tcl/CMakeLists.txt new file mode 100644 index 00000000000..45ee940b04e --- /dev/null +++ b/Filters/Sources/Testing/Tcl/CMakeLists.txt @@ -0,0 +1,32 @@ +if (VTK_USE_RENDERING AND VTK_USE_DISPLAY) + # + # Add tests, with the data + # + if(VTK_DATA_ROOT) + foreach( tfile + squadViewer + ) + add_test(${tfile}-image ${VTK_EXECUTABLE} + ${VTK_SOURCE_DIR}/Common/Testing/Tcl/rtImageTest.tcl + ${vtkFiltersSources_SOURCE_DIR}/Testing/Tcl/${tfile}.tcl + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Filtering/${tfile}.png + -A ${VTK_SOURCE_DIR}/Wrapping/Tcl) + endforeach() + if(VTK_USE_TK) + add_test(squadViewer-image ${VTK_EXECUTABLE} + ${VTK_SOURCE_DIR}/Common/Testing/Tcl/rtImageTest.tcl + ${VTK_SOURCE_DIR}/Filtering/Testing/Tcl/squadViewer.tcl + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Filtering/squadViewer.png + -A ${VTK_SOURCE_DIR}/Wrapping/Tcl) + endif() + # + # If we do not have the data, still run the tests that we can + # + else() + endif() + +endif() diff --git a/Filters/Sources/module.cmake b/Filters/Sources/module.cmake new file mode 100644 index 00000000000..49c5a5c746b --- /dev/null +++ b/Filters/Sources/module.cmake @@ -0,0 +1,14 @@ +vtk_module(vtkFiltersSources + GROUPS + StandAlone + DEPENDS + vtkCommonComputationalGeometry + vtkFiltersGeneral + TEST_DEPENDS + vtkTestingCore + vtkTestingRendering + vtkRenderingCore + vtkRenderingFreeType + vtkFiltersModeling + vtkIOXML + ) diff --git a/Filters/Statistics/CMakeLists.txt b/Filters/Statistics/CMakeLists.txt new file mode 100644 index 00000000000..db227282dbf --- /dev/null +++ b/Filters/Statistics/CMakeLists.txt @@ -0,0 +1,22 @@ +set(Module_SRCS + vtkBivariateLinearTableThreshold.cxx + vtkContingencyStatistics.cxx + vtkCorrelativeStatistics.cxx + vtkDescriptiveStatistics.cxx + vtkKMeansDistanceFunctorCalculator.cxx + vtkKMeansDistanceFunctor.cxx + vtkKMeansStatistics.cxx + vtkMultiCorrelativeStatistics.cxx + vtkOrderStatistics.cxx + vtkPCAStatistics.cxx + vtkStatisticsAlgorithm.cxx + vtkStrahlerMetric.cxx + vtkStreamingStatistics.cxx + ) + +set_source_files_properties( + vtkStatisticsAlgorithm.cxx + ABSTRACT +) + +vtk_module_library(vtkFiltersStatistics ${Module_SRCS}) diff --git a/Filters/Statistics/Testing/Cxx/CMakeLists.txt b/Filters/Statistics/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..6668aafe224 --- /dev/null +++ b/Filters/Statistics/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,26 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestMultiCorrelativeStatistics.cxx + TestOrderStatistics.cxx + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/${vtk-module}/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Filters/Statistics/module.cmake b/Filters/Statistics/module.cmake new file mode 100644 index 00000000000..28f8a584373 --- /dev/null +++ b/Filters/Statistics/module.cmake @@ -0,0 +1,12 @@ +vtk_module(vtkFiltersStatistics + GROUPS + StandAlone + DEPENDS + vtkCommonMath + vtkCommonExecutionModel + vtkCommonTransforms + vtkCommonMisc + vtkalglib + TEST_DEPENDS + vtkTestingCore + ) diff --git a/Filters/Statistics/vtkContingencyStatistics.cxx b/Filters/Statistics/vtkContingencyStatistics.cxx index 682a46aa6c6..c2d09768851 100644 --- a/Filters/Statistics/vtkContingencyStatistics.cxx +++ b/Filters/Statistics/vtkContingencyStatistics.cxx @@ -29,9 +29,6 @@ PURPOSE. See the above copyright notice for more information. #include "vtkInformationVector.h" #include "vtkMultiBlockDataSet.h" #include "vtkObjectFactory.h" -#ifdef VTK_USE_GNU_R -#include <vtkRInterface.h> -#endif // VTK_USE_GNU_R #include "vtkStringArray.h" #include "vtkStdString.h" #include "vtkTable.h" @@ -650,6 +647,37 @@ void vtkContingencyStatistics::Assess( vtkTable* inData, } // rit } +// ---------------------------------------------------------------------- +void vtkContingencyStatistics::CalculatePValues( vtkTable* testTab ) +{ + vtkIdTypeArray* dimCol = vtkIdTypeArray::SafeDownCast(testTab->GetColumn(0)); + + // Test columns must be created first + vtkDoubleArray* testChi2Col = vtkDoubleArray::New(); // Chi square p-value + vtkDoubleArray* testChi2yCol = vtkDoubleArray::New(); // Chi square with Yates correction p-value + + // Fill this column + vtkIdType n = dimCol->GetNumberOfTuples(); + testChi2Col->SetNumberOfTuples( n ); + testChi2yCol->SetNumberOfTuples( n ); + for ( vtkIdType r = 0; r < n; ++ r ) + { + testChi2Col->SetTuple1( r, -1 ); + testChi2yCol->SetTuple1( r, -1 ); + } + + // Now add the column of invalid values to the output table + testTab->AddColumn( testChi2Col ); + testTab->AddColumn( testChi2yCol ); + + testChi2Col->SetName( "P" ); + testChi2yCol->SetName( "P Yates" ); + + // Clean up + testChi2Col->Delete(); + testChi2yCol->Delete(); +} + // ---------------------------------------------------------------------- void vtkContingencyStatistics::Test( vtkTable* inData, vtkMultiBlockDataSet* inMeta, @@ -899,82 +927,7 @@ void vtkContingencyStatistics::Test( vtkTable* inData, testTab->AddColumn( chi2yCol ); // Last phase: compute the p-values or assign invalid value if they cannot be computed - vtkDoubleArray* testChi2Col = 0; - vtkDoubleArray* testChi2yCol = 0; - bool calculatedP = false; - - // If available, use R to obtain the p-values for the Chi square distribution with required DOFs -#ifdef VTK_USE_GNU_R - // Prepare VTK - R interface - vtkRInterface* ri = vtkRInterface::New(); - - // Use the calculated DOFs and Chi square statistics as inputs to the Chi square function - ri->AssignVTKDataArrayToRVariable( dimCol, "d" ); - ri->AssignVTKDataArrayToRVariable( chi2Col, "chi2" ); - ri->AssignVTKDataArrayToRVariable( chi2yCol, "chi2y" ); - - // Now prepare R script and calculate the p-values (in a single R script evaluation for efficiency) - vtksys_ios::ostringstream rs; - rs << "p<-c();" - << "py<-c();" - << "for(i in 1:" - << dimCol->GetNumberOfTuples() - << "){" - << "p<-c(p,1-pchisq(chi2[i],d[i]));" - << "py<-c(py,1-pchisq(chi2y[i],d[i]))" - << "}"; - ri->EvalRscript( rs.str().c_str() ); - - // Retrieve the p-values - testChi2Col = vtkDoubleArray::SafeDownCast( ri->AssignRVariableToVTKDataArray( "p" ) ); - testChi2yCol = vtkDoubleArray::SafeDownCast( ri->AssignRVariableToVTKDataArray( "py" ) ); - if ( ! testChi2Col || ! testChi2yCol - || testChi2Col->GetNumberOfTuples() != dimCol->GetNumberOfTuples() - || testChi2yCol->GetNumberOfTuples() != dimCol->GetNumberOfTuples() ) - { - vtkWarningMacro( "Something went wrong with the R calculations. Reported p-values will be invalid." ); - } - else - { - // Test values have been calculated by R: the test column can be added to the output table - testTab->AddColumn( testChi2Col ); - testTab->AddColumn( testChi2yCol ); - calculatedP = true; - } - - // Clean up - ri->Delete(); -#endif // VTK_USE_GNU_R - - // Use the invalid value of -1 for p-values if R is absent or there was an R error - if ( ! calculatedP ) - { - // Test columns must be created first - testChi2Col = vtkDoubleArray::New(); // Chi square p-value - testChi2yCol = vtkDoubleArray::New(); // Chi square with Yates correction p-value - - // Fill this column - vtkIdType n = dimCol->GetNumberOfTuples(); - testChi2Col->SetNumberOfTuples( n ); - testChi2yCol->SetNumberOfTuples( n ); - for ( vtkIdType r = 0; r < n; ++ r ) - { - testChi2Col->SetTuple1( r, -1 ); - testChi2yCol->SetTuple1( r, -1 ); - } - - // Now add the column of invalid values to the output table - testTab->AddColumn( testChi2Col ); - testTab->AddColumn( testChi2yCol ); - - // Clean up - testChi2Col->Delete(); - testChi2yCol->Delete(); - } - - // The test column name can only be set after the column has been obtained from R - testChi2Col->SetName( "P" ); - testChi2yCol->SetName( "P Yates" ); + this->CalculatePValues(testTab); // Finally set output table to test table outMeta->ShallowCopy( testTab ); diff --git a/Filters/Statistics/vtkContingencyStatistics.h b/Filters/Statistics/vtkContingencyStatistics.h index dfd1b674966..7414b480cfd 100644 --- a/Filters/Statistics/vtkContingencyStatistics.h +++ b/Filters/Statistics/vtkContingencyStatistics.h @@ -46,6 +46,8 @@ class vtkMultiBlockDataSet; class vtkStringArray; class vtkTable; class vtkVariant; +class vtkIdTypeArray; +class vtkDoubleArray; class VTK_INFOVIS_EXPORT vtkContingencyStatistics : public vtkStatisticsAlgorithm { @@ -85,6 +87,11 @@ protected: virtual void Assess( vtkTable*, vtkMultiBlockDataSet*, vtkTable* ); +//BTX + // Description: + // Calculate p-value. This will overridden using the object factory with an + // R implementation if R is present. + virtual void CalculatePValues(vtkTable*); //BTX // Description: diff --git a/Filters/Statistics/vtkCorrelativeStatistics.cxx b/Filters/Statistics/vtkCorrelativeStatistics.cxx index 36d04669019..4b02c826482 100644 --- a/Filters/Statistics/vtkCorrelativeStatistics.cxx +++ b/Filters/Statistics/vtkCorrelativeStatistics.cxx @@ -31,9 +31,6 @@ #include "vtkMath.h" #include "vtkMultiBlockDataSet.h" #include "vtkObjectFactory.h" -#ifdef VTK_USE_GNU_R -#include <vtkRInterface.h> -#endif // VTK_USE_GNU_R #include "vtkStringArray.h" #include "vtkStdString.h" #include "vtkTable.h" @@ -476,6 +473,22 @@ void vtkCorrelativeStatistics::Derive( vtkMultiBlockDataSet* inMeta ) delete [] derivedVals; } +// ---------------------------------------------------------------------- +vtkDoubleArray* vtkCorrelativeStatistics::CalculatePValues(vtkDoubleArray* statCol) +{ + vtkDoubleArray* testCol = vtkDoubleArray::New(); + + // Fill this column + vtkIdType n = statCol->GetNumberOfTuples(); + testCol->SetNumberOfTuples( n ); + for ( vtkIdType r = 0; r < n; ++ r ) + { + testCol->SetTuple1( r, -1 ); + } + + return testCol; +} + // ---------------------------------------------------------------------- void vtkCorrelativeStatistics::Test( vtkTable* inData, vtkMultiBlockDataSet* inMeta, @@ -746,60 +759,16 @@ void vtkCorrelativeStatistics::Test( vtkTable* inData, outMeta->AddColumn( statCol ); // Last phase: compute the p-values or assign invalid value if they cannot be computed - vtkDoubleArray* testCol = 0; - bool calculatedP = false; - // If available, use R to obtain the p-values for the Chi square distribution with 2 DOFs -#ifdef VTK_USE_GNU_R - // Prepare VTK - R interface - vtkRInterface* ri = vtkRInterface::New(); - - // Use the calculated Jarque-Bera-Srivastava statistics as input to the Chi square function - ri->AssignVTKDataArrayToRVariable( statCol, "jbs" ); - - // Calculate the p-values (p+1=3 degrees of freedom) - ri->EvalRscript( "p=1-pchisq(jbs,3)" ); - - // Retrieve the p-values - testCol = vtkDoubleArray::SafeDownCast( ri->AssignRVariableToVTKDataArray( "p" ) ); - if ( ! testCol || testCol->GetNumberOfTuples() != statCol->GetNumberOfTuples() ) - { - vtkWarningMacro( "Something went wrong with the R calculations. Reported p-values will be invalid." ); - } - else - { - // Test values have been calculated by R: the test column can be added to the output table - outMeta->AddColumn( testCol ); - calculatedP = true; - } - - // Clean up - ri->Delete(); -#endif // VTK_USE_GNU_R - - // Use the invalid value of -1 for p-values if R is absent or there was an R error - if ( ! calculatedP ) - { - // A column must be created first - testCol = vtkDoubleArray::New(); + vtkDoubleArray* testCol = this->CalculatePValues(statCol); - // Fill this column - vtkIdType n = statCol->GetNumberOfTuples(); - testCol->SetNumberOfTuples( n ); - for ( vtkIdType r = 0; r < n; ++ r ) - { - testCol->SetTuple1( r, -1 ); - } - - // Now add the column of invalid values to the output table - outMeta->AddColumn( testCol ); + // The test column name + testCol->SetName( "P" ); - // Clean up - testCol->Delete(); - } + // Now add the column of invalid values to the output table + outMeta->AddColumn( testCol ); - // The test column name can only be set after the column has been obtained from R - testCol->SetName( "P" ); + testCol->Delete(); // Clean up nameColX->Delete(); diff --git a/Filters/Statistics/vtkCorrelativeStatistics.h b/Filters/Statistics/vtkCorrelativeStatistics.h index 16d61749063..8408eab111b 100644 --- a/Filters/Statistics/vtkCorrelativeStatistics.h +++ b/Filters/Statistics/vtkCorrelativeStatistics.h @@ -47,6 +47,7 @@ class vtkMultiBlockDataSet; class vtkStringArray; class vtkTable; class vtkVariant; +class vtkDoubleArray; class VTK_INFOVIS_EXPORT vtkCorrelativeStatistics : public vtkStatisticsAlgorithm { @@ -87,7 +88,12 @@ protected: vtkTable* outData ) { this->Superclass::Assess( inData, inMeta, outData, 2 ); } -//BTX +//BTX + // Description: + // Calculate p-value. This will overridden using the object factory with an + // R implementation if R is present. + virtual vtkDoubleArray* CalculatePValues(vtkDoubleArray*); + // Description: // Provide the appropriate assessment functor. virtual void SelectAssessFunctor( vtkTable* outData, diff --git a/Filters/Statistics/vtkDescriptiveStatistics.cxx b/Filters/Statistics/vtkDescriptiveStatistics.cxx index 58f6df9bb7f..9a4f7cf6e6c 100644 --- a/Filters/Statistics/vtkDescriptiveStatistics.cxx +++ b/Filters/Statistics/vtkDescriptiveStatistics.cxx @@ -30,9 +30,6 @@ #include "vtkMath.h" #include "vtkMultiBlockDataSet.h" #include "vtkObjectFactory.h" -#ifdef VTK_USE_GNU_R -#include <vtkRInterface.h> -#endif // VTK_USE_GNU_R #include "vtkStringArray.h" #include "vtkStdString.h" #include "vtkTable.h" @@ -470,6 +467,24 @@ void vtkDescriptiveStatistics::Derive( vtkMultiBlockDataSet* inMeta ) delete [] derivedVals; } +// ---------------------------------------------------------------------- +// Use the invalid value of -1 for p-values if R is absent +vtkDoubleArray* vtkDescriptiveStatistics::CalculatePValues(vtkDoubleArray *statCol) +{ + // A column must be created first + vtkDoubleArray* testCol = vtkDoubleArray::New(); + + // Fill this column + vtkIdType n = statCol->GetNumberOfTuples(); + testCol->SetNumberOfTuples( n ); + for ( vtkIdType r = 0; r < n; ++ r ) + { + testCol->SetTuple1( r, -1 ); + } + + return testCol; +} + // ---------------------------------------------------------------------- void vtkDescriptiveStatistics::Test( vtkTable* inData, vtkMultiBlockDataSet* inMeta, @@ -571,61 +586,17 @@ void vtkDescriptiveStatistics::Test( vtkTable* inData, outMeta->AddColumn( statCol ); // Last phase: compute the p-values or assign invalid value if they cannot be computed - vtkDoubleArray* testCol = 0; - bool calculatedP = false; - // If available, use R to obtain the p-values for the Chi square distribution with 2 DOFs -#ifdef VTK_USE_GNU_R - // Prepare VTK - R interface - vtkRInterface* ri = vtkRInterface::New(); - - // Use the calculated Jarque-Bera statistics as input to the Chi square function - ri->AssignVTKDataArrayToRVariable( statCol, "jb" ); - - // Calculate the p-values (p+1=2 degrees of freedom) - ri->EvalRscript( "p=1-pchisq(jb,2)" ); - - // Retrieve the p-values - testCol = vtkDoubleArray::SafeDownCast( ri->AssignRVariableToVTKDataArray( "p" ) ); - if ( ! testCol || testCol->GetNumberOfTuples() != statCol->GetNumberOfTuples() ) - { - vtkWarningMacro( "Something went wrong with the R calculations. Reported p-values will be invalid." ); - } - else - { - // Test values have been calculated by R: the test column can be added to the output table - outMeta->AddColumn( testCol ); - calculatedP = true; - } - - // Clean up - ri->Delete(); -#endif // VTK_USE_GNU_R - - // Use the invalid value of -1 for p-values if R is absent or there was an R error - if ( ! calculatedP ) - { - // A column must be created first - testCol = vtkDoubleArray::New(); - - // Fill this column - vtkIdType n = statCol->GetNumberOfTuples(); - testCol->SetNumberOfTuples( n ); - for ( vtkIdType r = 0; r < n; ++ r ) - { - testCol->SetTuple1( r, -1 ); - } - - // Now add the column of invalid values to the output table - outMeta->AddColumn( testCol ); - - // Clean up - testCol->Delete(); - } + vtkDoubleArray* testCol = this->CalculatePValues( statCol ); // The test column name can only be set after the column has been obtained from R testCol->SetName( "P" ); + // Now add the column of invalid values to the output table + outMeta->AddColumn( testCol ); + + testCol->Delete(); + // Clean up nameCol->Delete(); statCol->Delete(); diff --git a/Filters/Statistics/vtkDescriptiveStatistics.h b/Filters/Statistics/vtkDescriptiveStatistics.h index 15dcb4861ac..2b048e69111 100644 --- a/Filters/Statistics/vtkDescriptiveStatistics.h +++ b/Filters/Statistics/vtkDescriptiveStatistics.h @@ -52,6 +52,7 @@ class vtkMultiBlockDataSet; class vtkStringArray; class vtkTable; class vtkVariant; +class vtkDoubleArray; class VTK_INFOVIS_EXPORT vtkDescriptiveStatistics : public vtkStatisticsAlgorithm { @@ -125,7 +126,12 @@ protected: vtkTable* outData ) { this->Superclass::Assess( inData, inMeta, outData, 1 ); } -//BTX +//BTX + // Description: + // Calculate p-value. This will overridden using the object factory with an + // R implementation if R is present. + virtual vtkDoubleArray* CalculatePValues(vtkDoubleArray*); + // Description: // Provide the appropriate assessment functor. virtual void SelectAssessFunctor( vtkTable* outData, diff --git a/Filters/Statistics/vtkPCAStatistics.cxx b/Filters/Statistics/vtkPCAStatistics.cxx index 612964de05e..d9563d6c897 100644 --- a/Filters/Statistics/vtkPCAStatistics.cxx +++ b/Filters/Statistics/vtkPCAStatistics.cxx @@ -6,9 +6,6 @@ #include "vtkMultiBlockDataSet.h" #include "vtkMultiCorrelativeStatisticsAssessFunctor.h" #include "vtkObjectFactory.h" -#ifdef VTK_USE_GNU_R -#include <vtkRInterface.h> -#endif // VTK_USE_GNU_R #include "vtkSmartPointer.h" #include "vtkStringArray.h" #include "vtkTable.h" @@ -772,6 +769,23 @@ void vtkPCAStatistics::Derive( vtkMultiBlockDataSet* inMeta ) row->Delete(); } } +// Use the invalid value of -1 for p-values if R is absent +vtkDoubleArray* vtkPCAStatistics::CalculatePValues( vtkIdTypeArray* vtkNotUsed( dimCol ), + vtkDoubleArray* statCol ) +{ + // A column must be created first + vtkDoubleArray* testCol = vtkDoubleArray::New(); + + // Fill this column + vtkIdType n = statCol->GetNumberOfTuples(); + testCol->SetNumberOfTuples( n ); + for ( vtkIdType r = 0; r < n; ++ r ) + { + testCol->SetTuple1( r, -1 ); + } + + return testCol; +} // ---------------------------------------------------------------------- void vtkPCAStatistics::Test( vtkTable* inData, @@ -946,69 +960,14 @@ void vtkPCAStatistics::Test( vtkTable* inData, outMeta->AddColumn( dimCol ); // Last phase: compute the p-values or assign invalid value if they cannot be computed - vtkDoubleArray* testCol = 0; - bool calculatedP = false; - - // If available, use R to obtain the p-values for the Chi square distribution with 2 DOFs -#ifdef VTK_USE_GNU_R - // Prepare VTK - R interface - vtkRInterface* ri = vtkRInterface::New(); - - // Use the calculated Jarque-Bera-Srivastava statistics as input to the Chi square function - ri->AssignVTKDataArrayToRVariable( statCol, "jbs" ); - ri->AssignVTKDataArrayToRVariable( dimCol, "d" ); - - // Calculate the p-values (p+1 degrees of freedom) - // Now prepare R script and calculate the p-values (in a single R script evaluation for efficiency) - vtksys_ios::ostringstream rs; - rs << "p<-c();" - << "for(i in 1:" - << dimCol->GetNumberOfTuples() - << "){" - << "p<-c(p,1-pchisq(jbs[i],d[i]));" - << "}"; - ri->EvalRscript( rs.str().c_str() ); - - // Retrieve the p-values - testCol = vtkDoubleArray::SafeDownCast( ri->AssignRVariableToVTKDataArray( "p" ) ); - if ( ! testCol || testCol->GetNumberOfTuples() != statCol->GetNumberOfTuples() ) - { - vtkWarningMacro( "Something went wrong with the R calculations. Reported p-values will be invalid." ); - } - else - { - // Test values have been calculated by R: the test column can be added to the output table - outMeta->AddColumn( testCol ); - calculatedP = true; - } - - // Clean up - ri->Delete(); -#endif // VTK_USE_GNU_R - - // Use the invalid value of -1 for p-values if R is absent or there was an R error - if ( ! calculatedP ) - { - // A column must be created first - testCol = vtkDoubleArray::New(); - - // Fill this column - vtkIdType n = statCol->GetNumberOfTuples(); - testCol->SetNumberOfTuples( n ); - for ( vtkIdType r = 0; r < n; ++ r ) - { - testCol->SetTuple1( r, -1 ); - } - - // Now add the column of invalid values to the output table - outMeta->AddColumn( testCol ); - - // Clean up - testCol->Delete(); - } + vtkDoubleArray* testCol = this->CalculatePValues( dimCol, statCol ); // The test column name can only be set after the column has been obtained from R testCol->SetName( "P" ); + // Now add the column of invalid values to the output table + outMeta->AddColumn( testCol ); + // Clean up + testCol->Delete(); // Clean up blockCol->Delete(); diff --git a/Filters/Statistics/vtkPCAStatistics.h b/Filters/Statistics/vtkPCAStatistics.h index a2b03cb153c..9df8c220ad2 100644 --- a/Filters/Statistics/vtkPCAStatistics.h +++ b/Filters/Statistics/vtkPCAStatistics.h @@ -47,6 +47,7 @@ PURPOSE. See the above copyright notice for more information. #include "vtkMultiCorrelativeStatistics.h" class vtkDoubleArray; +class vtkIdTypeArray; class VTK_INFOVIS_EXPORT vtkPCAStatistics : public vtkMultiCorrelativeStatistics { @@ -232,6 +233,11 @@ protected: virtual void Assess( vtkTable*, vtkMultiBlockDataSet*, vtkTable* ); + //BTX + // Description: + // Calculate p-value. This will overridden using the object factory with an + // R implementation if R is present. + virtual vtkDoubleArray* CalculatePValues(vtkIdTypeArray*, vtkDoubleArray*); //BTX // Description: diff --git a/Filters/StatisticsGnuR/CMakeLists.txt b/Filters/StatisticsGnuR/CMakeLists.txt new file mode 100644 index 00000000000..7ff395f672e --- /dev/null +++ b/Filters/StatisticsGnuR/CMakeLists.txt @@ -0,0 +1,62 @@ +set(Module_SRCS + vtkRRandomTableSource.cxx + vtkRCalculatorFilter.cxx + vtkRInterface.cxx + vtkRAdapter.cxx + vtkContingencyStatisticsGnuR.cxx + vtkCorrelativeStatisticsGnuR.cxx + vtkDescriptiveStatisticsGnuR.cxx + vtkPCAStatisticsGnuR.cxx + + ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx +) + +find_package(R) +include_directories(${R_INCLUDE_DIR}) + +# Configure the module specific settings into a module configured header. +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkFiltersStatisticsGnuRConfigure.h.in + ${CMAKE_CURRENT_BINARY_DIR}/vtkFiltersStatisticsGnuRConfigure.h) + +# Set up some of the module specific preprocessor definitions. +set(${vtk-module}_EXPORT_CODE "#include \"vtkFiltersStatisticsGnuRConfigure.h\"") + +set_source_files_properties( + vtkRAdapter.cxx + ${vtk-module}ObjectFactory + WRAP_EXCLUDE + ) + +# Now to generate our object factory. +set( vtk_module_overrides + vtkContingencyStatistics + vtkCorrelativeStatistics + vtkDescriptiveStatistics + vtkPCAStatistics + ) + +# Now we iterate and create that class file... +foreach(_class ${vtk_module_overrides}) + set(vtk_module_${_class}_override ${_class}GnuR) + set(_override ${vtk_module_${_class}_override}) + set(_vtk_override_includes "${_vtk_override_includes} +#include \"${_override}.h\"") + set(_vtk_override_creates "${_vtk_override_creates} +VTK_CREATE_CREATE_FUNCTION(${_override})") + set(_vtk_override_do "${_vtk_override_do} + this->RegisterOverride(\"${_class}\", + \"${_override}\", + \"Override for ${vtk-module} module\", 1, + vtkObjectFactoryCreate${_override});") +endforeach() + +# Now lets create the object factory classes +string(TOUPPER ${vtk-module} VTK-MODULE) +configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in + ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h) +configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in + ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx) + +vtk_module_library(vtkFiltersStatisticsGnuR ${Module_SRCS}) + +target_link_libraries(vtkFiltersStatisticsGnuR ${R_LIBRARIES}) diff --git a/Filters/StatisticsGnuR/module.cmake b/Filters/StatisticsGnuR/module.cmake new file mode 100644 index 00000000000..0c25e02c09b --- /dev/null +++ b/Filters/StatisticsGnuR/module.cmake @@ -0,0 +1,8 @@ +vtk_module(vtkFiltersStatisticsGnuR + IMPLEMENTS + vtkFiltersStatistics + DEPENDS + vtkCommonCore + vtkCommonExecutionModel + vtkFiltersStatistics + EXCLUDE_FROM_ALL) diff --git a/Filters/StatisticsGnuR/vtkContingencyStatisticsGnuR.cxx b/Filters/StatisticsGnuR/vtkContingencyStatisticsGnuR.cxx new file mode 100644 index 00000000000..cbfff16934e --- /dev/null +++ b/Filters/StatisticsGnuR/vtkContingencyStatisticsGnuR.cxx @@ -0,0 +1,110 @@ +/*========================================================================= + +Program: Visualization Toolkit +Module: vtkContingencyStatisticsGnuR.cxx + +Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen +All rights reserved. +See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +/*------------------------------------------------------------------------- + Copyright 2011 Sandia Corporation. + Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, + the U.S. Government retains certain rights in this software. + -------------------------------------------------------------------------*/ + +#include "vtkContingencyStatisticsGnuR.h" +#include "vtkRInterface.h" +#include "vtkToolkits.h" +#include "vtkStatisticsAlgorithmPrivate.h" +#include "vtkDoubleArray.h" +#include "vtkIdTypeArray.h" +#include "vtkInformation.h" +#include "vtkInformationVector.h" +#include "vtkMultiBlockDataSet.h" +#include "vtkObjectFactory.h" +#include "vtkStringArray.h" +#include "vtkStdString.h" +#include "vtkTable.h" +#include "vtkVariantArray.h" + +#include <vtksys/stl/map> +#include <vtksys/stl/vector> + +#include <vtksys/ios/sstream> + + +vtkStandardNewMacro(vtkContingencyStatisticsGnuR); + +vtkContingencyStatisticsGnuR::vtkContingencyStatisticsGnuR() +{ + +} + +// ---------------------------------------------------------------------- +vtkContingencyStatisticsGnuR::~vtkContingencyStatisticsGnuR() +{ + +} + +// ---------------------------------------------------------------------- +void vtkContingencyStatisticsGnuR::PrintSelf( ostream &os, vtkIndent indent ) +{ + this->Superclass::PrintSelf( os, indent ); +} + +// ---------------------------------------------------------------------- +void vtkContingencyStatisticsGnuR::CalculatePValues( vtkTable* outTab) +{ + vtkIdTypeArray* dimCol = vtkIdTypeArray::SafeDownCast( outTab->GetColumn(0) ); + vtkDoubleArray* chi2Col = vtkDoubleArray::SafeDownCast( outTab->GetColumn(1)); + vtkDoubleArray* chi2yCol = vtkDoubleArray::SafeDownCast( outTab->GetColumn(2)); + + // Prepare VTK - R interface + vtkRInterface* ri = vtkRInterface::New(); + + // Use the calculated DOFs and Chi square statistics as inputs to the Chi square function + ri->AssignVTKDataArrayToRVariable( dimCol, "d" ); + ri->AssignVTKDataArrayToRVariable( chi2Col, "chi2" ); + ri->AssignVTKDataArrayToRVariable( chi2yCol, "chi2y" ); + + // Now prepare R script and calculate the p-values (in a single R script evaluation for efficiency) + vtksys_ios::ostringstream rs; + rs << "p<-c();" + << "py<-c();" + << "for(i in 1:" + << dimCol->GetNumberOfTuples() + << "){" + << "p<-c(p,1-pchisq(chi2[i],d[i]));" + << "py<-c(py,1-pchisq(chi2y[i],d[i]))" + << "}"; + ri->EvalRscript( rs.str().c_str() ); + + // Retrieve the p-values + vtkDoubleArray* testChi2Col = vtkDoubleArray::SafeDownCast( ri->AssignRVariableToVTKDataArray( "p" ) ); + vtkDoubleArray* testChi2yCol = vtkDoubleArray::SafeDownCast( ri->AssignRVariableToVTKDataArray( "py" ) ); + if ( ! testChi2Col || ! testChi2yCol + || testChi2Col->GetNumberOfTuples() != dimCol->GetNumberOfTuples() + || testChi2yCol->GetNumberOfTuples() != dimCol->GetNumberOfTuples() ) + { + vtkWarningMacro( "Something went wrong with the R calculations. Reported p-values will be invalid." ); + this->Superclass::CalculatePValues( outTab ); + } + else + { + outTab->AddColumn( testChi2Col ); + outTab->AddColumn( testChi2yCol ); + } + + testChi2Col->SetName( "P" ); + testChi2yCol->SetName( "P Yates" ); + + // Clean up + ri->Delete(); +} + diff --git a/Filters/StatisticsGnuR/vtkContingencyStatisticsGnuR.h b/Filters/StatisticsGnuR/vtkContingencyStatisticsGnuR.h new file mode 100644 index 00000000000..8238f6a6909 --- /dev/null +++ b/Filters/StatisticsGnuR/vtkContingencyStatisticsGnuR.h @@ -0,0 +1,67 @@ +/*========================================================================= + +Program: Visualization Toolkit +Module: vtkContingencyStatisticsGnuR.h + +Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen +All rights reserved. +See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +/*------------------------------------------------------------------------- + Copyright 2011 Sandia Corporation. + Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, + the U.S. Government retains certain rights in this software. + -------------------------------------------------------------------------*/ +// .NAME vtkContingencyStatisticsGnuR - A class for bivariate correlation contigency +// tables, conditional probabilities, and information entropy. The p-value are +// calculated using R. +// +// .SECTION Description +// Given a pair of columns of interest, this class provides the +// following functionalities, depending on the operation in which it is executed: +// * Learn: calculate contigency tables and corresponding discrete joint +// probability distribution. +// * Derive: calculate conditional probabilities, information entropies, and +// pointwise mutual information. +// * Assess: given two columns of interest with the same number of entries as +// input in port INPUT_DATA, and a corresponding bivariate probability distribution, +// * Test: calculate Chi-square independence statistic and, if VTK to R interface is available, +// retrieve corresponding p-value for independence testing. +// +// .SECTION Thanks +// Thanks to Philippe Pebay and David Thompson from Sandia National Laboratories +// for implementing this class. +// Updated by Philippe Pebay, Kitware SAS 2012 + +#ifndef __vtkContingencyStatisticsGnuR_h +#define __vtkContingencyStatisticsGnuR_h + +#include "vtkFiltersStatisticsGnuRModule.h" // For export macro +#include "vtkContingencyStatistics.h" + +class vtkIdTypeArray; +class vtkTable; + +class VTKFILTERSSTATISTICSGNUR_EXPORT vtkContingencyStatisticsGnuR : public vtkContingencyStatistics +{ +public: + vtkTypeMacro(vtkContingencyStatisticsGnuR, vtkContingencyStatistics); + void PrintSelf(ostream& os, vtkIndent indent); + static vtkContingencyStatisticsGnuR* New(); + +protected: + vtkContingencyStatisticsGnuR(); + ~vtkContingencyStatisticsGnuR(); + +//BTX + virtual void CalculatePValues(vtkTable*); +//ETX +}; + +#endif + diff --git a/Filters/StatisticsGnuR/vtkCorrelativeStatisticsGnuR.cxx b/Filters/StatisticsGnuR/vtkCorrelativeStatisticsGnuR.cxx new file mode 100644 index 00000000000..369b6b49dc8 --- /dev/null +++ b/Filters/StatisticsGnuR/vtkCorrelativeStatisticsGnuR.cxx @@ -0,0 +1,74 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkCorrelativeStatisticsGnuR.cxx + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +/*------------------------------------------------------------------------- + Copyright 2011 Sandia Corporation. + Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, + the U.S. Government retains certain rights in this software. +-------------------------------------------------------------------------*/ + +#include "vtkToolkits.h" + +#include "vtkCorrelativeStatisticsGnuR.h" + +#include "vtkDoubleArray.h" +#include "vtkIdTypeArray.h" +#include "vtkObjectFactory.h" +#include "vtkRInterface.h" + +#include <vtksys/ios/sstream> + +vtkStandardNewMacro(vtkCorrelativeStatisticsGnuR); + +// ---------------------------------------------------------------------- +vtkCorrelativeStatisticsGnuR::vtkCorrelativeStatisticsGnuR() +{ +} + +// ---------------------------------------------------------------------- +vtkCorrelativeStatisticsGnuR::~vtkCorrelativeStatisticsGnuR() +{ +} + +// ---------------------------------------------------------------------- +void vtkCorrelativeStatisticsGnuR::PrintSelf( ostream &os, vtkIndent indent ) +{ + this->Superclass::PrintSelf( os, indent ); +} + +vtkDoubleArray* vtkCorrelativeStatisticsGnuR::CalculatePValues(vtkDoubleArray* statCol) +{ + // Prepare VTK - R interface + vtkRInterface* ri = vtkRInterface::New(); + + // Use the calculated Jarque-Bera-Srivastava statistics as input to the Chi square function + ri->AssignVTKDataArrayToRVariable( statCol, "jbs" ); + + // Calculate the p-values (p+1=3 degrees of freedom) + ri->EvalRscript( "p=1-pchisq(jbs,3)" ); + + // Retrieve the p-values + vtkDoubleArray* testCol = vtkDoubleArray::SafeDownCast( ri->AssignRVariableToVTKDataArray( "p" ) ); + if ( ! testCol || testCol->GetNumberOfTuples() != statCol->GetNumberOfTuples() ) + { + vtkWarningMacro( "Something went wrong with the R calculations. Reported p-values will be invalid." ); + testCol = this->Superclass::CalculatePValues( statCol ); + } + + // Clean up + ri->Delete(); + + return testCol; +} + diff --git a/Filters/StatisticsGnuR/vtkCorrelativeStatisticsGnuR.h b/Filters/StatisticsGnuR/vtkCorrelativeStatisticsGnuR.h new file mode 100644 index 00000000000..60512094458 --- /dev/null +++ b/Filters/StatisticsGnuR/vtkCorrelativeStatisticsGnuR.h @@ -0,0 +1,66 @@ +/*========================================================================= + +Program: Visualization Toolkit +Module: vtkCorrelativeStatisticsGnuR.h + +Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen +All rights reserved. +See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +/*------------------------------------------------------------------------- + Copyright 2011 Sandia Corporation. + Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, + the U.S. Government retains certain rights in this software. + -------------------------------------------------------------------------*/ +// .NAME vtkCorrelativeStatisticsGnuR - A class for bivariate linear correlation using R +// to calculate the p-values. +// +// .SECTION Description +// Given a selection of pairs of columns of interest, this class provides the +// following functionalities, depending on the chosen execution options: +// * Learn: calculate extremal values, sample mean, and M2 aggregates +// (cf. P. Pebay, Formulas for robust, one-pass parallel computation of covariances +// and Arbitrary-Order Statistical Moments, Sandia Report SAND2008-6212, Sep 2008, +// http://infoserve.sandia.gov/sand_doc/2008/086212.pdf for details) +// * Derive: calculate unbiased covariance matrix estimators and its determinant, +// linear regressions, and Pearson correlation coefficient. +// * Assess: given an input data set, two means and a 2x2 covariance matrix, +// mark each datum with corresponding relative deviation (2-dimensional Mahlanobis +// distance). +// * Test: Perform Jarque-Bera-Srivastava test of 2-d normality +// +// .SECTION Thanks +// Thanks to Philippe Pebay and David Thompson from Sandia National Laboratories +// for implementing this class. +// Updated by Philippe Pebay, Kitware SAS 2012 + +#ifndef __vtkCorrelativeStatisticsGnuR_h +#define __vtkCorrelativeStatisticsGnuR_h + +#include "vtkFiltersStatisticsGnuRModule.h" // For export macro +#include "vtkCorrelativeStatistics.h" + +class vtkDoubleArray; + +class VTKFILTERSSTATISTICSGNUR_EXPORT vtkCorrelativeStatisticsGnuR : public vtkCorrelativeStatistics +{ +public: + vtkTypeMacro(vtkCorrelativeStatisticsGnuR, vtkCorrelativeStatistics); + void PrintSelf(ostream& os, vtkIndent indent); + static vtkCorrelativeStatisticsGnuR* New(); + +protected: + vtkCorrelativeStatisticsGnuR(); + ~vtkCorrelativeStatisticsGnuR(); + +//BTX + virtual vtkDoubleArray* CalculatePValues(vtkDoubleArray*); +//ETX +}; + +#endif diff --git a/Filters/StatisticsGnuR/vtkDescriptiveStatisticsGnuR.cxx b/Filters/StatisticsGnuR/vtkDescriptiveStatisticsGnuR.cxx new file mode 100644 index 00000000000..235af45aea6 --- /dev/null +++ b/Filters/StatisticsGnuR/vtkDescriptiveStatisticsGnuR.cxx @@ -0,0 +1,74 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkDescriptiveStatisticsGnuR.cxx + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +/*------------------------------------------------------------------------- + Copyright 2011 Sandia Corporation. + Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, + the U.S. Government retains certain rights in this software. +-------------------------------------------------------------------------*/ + +#include "vtkToolkits.h" + +#include "vtkDescriptiveStatisticsGnuR.h" +#include "vtkDoubleArray.h" +#include "vtkIdTypeArray.h" +#include "vtkObjectFactory.h" +#include "vtkRInterface.h" +#include "vtkStringArray.h" + +#include <vtksys/ios/sstream> + +vtkStandardNewMacro(vtkDescriptiveStatisticsGnuR); + +// ---------------------------------------------------------------------- +vtkDescriptiveStatisticsGnuR::vtkDescriptiveStatisticsGnuR() +{ +} + +// ---------------------------------------------------------------------- +vtkDescriptiveStatisticsGnuR::~vtkDescriptiveStatisticsGnuR() +{ +} + +// ---------------------------------------------------------------------- +void vtkDescriptiveStatisticsGnuR::PrintSelf( ostream &os, vtkIndent indent ) +{ + this->Superclass::PrintSelf( os, indent ); +} + +vtkDoubleArray* vtkDescriptiveStatisticsGnuR::CalculatePValues(vtkDoubleArray* statCol) +{ + // Prepare VTK - R interface + vtkRInterface* ri = vtkRInterface::New(); + + // Use the calculated Jarque-Bera statistics as input to the Chi square function + ri->AssignVTKDataArrayToRVariable( statCol, "jb" ); + + // Calculate the p-values (p+1=2 degrees of freedom) + ri->EvalRscript( "p=1-pchisq(jb,2)" ); + + // Retrieve the p-values + vtkDoubleArray* testCol = vtkDoubleArray::SafeDownCast( ri->AssignRVariableToVTKDataArray( "p" ) ); + if ( ! testCol || testCol->GetNumberOfTuples() != statCol->GetNumberOfTuples() ) + { + vtkWarningMacro( "Something went wrong with the R calculations. Reported p-values will be invalid." ); + testCol = this->Superclass::CalculatePValues( statCol ); + } + + // Clean up + ri->Delete(); + + return testCol; +} + diff --git a/Filters/StatisticsGnuR/vtkDescriptiveStatisticsGnuR.h b/Filters/StatisticsGnuR/vtkDescriptiveStatisticsGnuR.h new file mode 100644 index 00000000000..1586a197746 --- /dev/null +++ b/Filters/StatisticsGnuR/vtkDescriptiveStatisticsGnuR.h @@ -0,0 +1,64 @@ +/*========================================================================= + +Program: Visualization Toolkit +Module: vtkDescriptiveStatisticsGnuR.h + +Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen +All rights reserved. +See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +// .NAME vtkDescriptiveStatisticsGnu - A class for univariate descriptive statistics using +// R to calculate p-values +// +// .SECTION Description +// Given a selection of columns of interest in an input data table, this +// class provides the following functionalities, depending on the chosen +// execution options: +// * Learn: calculate extremal values, sample mean, and M2, M3, and M4 aggregates +// (cf. P. Pebay, Formulas for robust, one-pass parallel computation of covariances +// and Arbitrary-Order Statistical Moments, Sandia Report SAND2008-6212, Sep 2008, +// http://infoserve.sandia.gov/sand_doc/2008/086212.pdf for details) +// * Derive: calculate unbiased variance estimator, standard deviation estimator, +// two skewness estimators, and two kurtosis excess estimators. +// * Assess: given an input data set, a reference value and a non-negative deviation, +// mark each datum with corresponding relative deviation (1-dimensional Mahlanobis +// distance). If the deviation is zero, then mark each datum which are equal to the +// reference value with 0, and all others with 1. By default, the reference value +// and the deviation are, respectively, the mean and the standard deviation of the +// input model. +// +// .SECTION Thanks +// Thanks to Philippe Pebay and David Thompson from Sandia National Laboratories +// for implementing this class. +// Updated by Philippe Pebay, Kitware SAS 2012 + +#ifndef __vtkDescriptiveStatisticsGnuR_h +#define __vtkDescriptiveStatisticsGnuR_h + +#include "vtkFiltersStatisticsGnuRModule.h" // For export macro +#include "vtkDescriptiveStatistics.h" + +class vtkDoubleArray; + +class VTKFILTERSSTATISTICSGNUR_EXPORT vtkDescriptiveStatisticsGnuR : public vtkDescriptiveStatistics +{ +public: + vtkTypeMacro(vtkDescriptiveStatisticsGnuR, vtkDescriptiveStatistics); + void PrintSelf(ostream& os, vtkIndent indent); + static vtkDescriptiveStatisticsGnuR* New(); + +protected: + vtkDescriptiveStatisticsGnuR(); + ~vtkDescriptiveStatisticsGnuR(); + +//BTX + virtual vtkDoubleArray* CalculatePValues(vtkDoubleArray*); +//ETX +}; + +#endif diff --git a/Filters/StatisticsGnuR/vtkFiltersStatisticsGnuRConfigure.h.in b/Filters/StatisticsGnuR/vtkFiltersStatisticsGnuRConfigure.h.in new file mode 100644 index 00000000000..b48cebaa8f9 --- /dev/null +++ b/Filters/StatisticsGnuR/vtkFiltersStatisticsGnuRConfigure.h.in @@ -0,0 +1,23 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkFiltersStatisticsGnuRConfigure.h.in + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +#ifndef __vtkFiltersStatisticsGnuRConfigure_h +#define __vtkFiltersStatisticsGnuRConfigure_h + +/* Set the whether we have UINTPTR_T defined in support of the GNU R interface */ +#cmakedefine HAVE_VTK_UINTPTR_T +#define VTK_R_HOME "@VTK_R_HOME@" + +#endif diff --git a/Filters/StatisticsGnuR/vtkPCAStatisticsGnuR.cxx b/Filters/StatisticsGnuR/vtkPCAStatisticsGnuR.cxx new file mode 100644 index 00000000000..b0492482daf --- /dev/null +++ b/Filters/StatisticsGnuR/vtkPCAStatisticsGnuR.cxx @@ -0,0 +1,77 @@ +/*========================================================================= + +Program: Visualization Toolkit +Module: vtkPCAStatisticsGnuR.cxx + +Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen +All rights reserved. +See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +#include "vtkPCAStatisticsGnuR.h" + +#include "vtkDoubleArray.h" +#include "vtkIdTypeArray.h" +#include "vtkRInterface.h" +#include "vtkObjectFactory.h" + +#include <vtksys/ios/sstream> + +vtkStandardNewMacro(vtkPCAStatisticsGnuR); + +// ---------------------------------------------------------------------- +vtkPCAStatisticsGnuR::vtkPCAStatisticsGnuR() +{ +} + +// ---------------------------------------------------------------------- +vtkPCAStatisticsGnuR::~vtkPCAStatisticsGnuR() +{ +} + +// ---------------------------------------------------------------------- +void vtkPCAStatisticsGnuR::PrintSelf( ostream& os, vtkIndent indent ) +{ + this->Superclass::PrintSelf( os, indent ); +} +// Use R to obtain the p-values for the Chi square distribution with 2 DOFs +vtkDoubleArray* vtkPCAStatisticsGnuR::CalculatePValues(vtkIdTypeArray* dimCol, + vtkDoubleArray* statCol) +{ + // Prepare VTK - R interface + vtkRInterface* ri = vtkRInterface::New(); + + // Use the calculated Jarque-Bera-Srivastava statistics as input to the Chi square function + ri->AssignVTKDataArrayToRVariable( statCol, "jbs" ); + ri->AssignVTKDataArrayToRVariable( dimCol, "d" ); + + // Calculate the p-values (p+1 degrees of freedom) + // Now prepare R script and calculate the p-values (in a single R script evaluation for efficiency) + vtksys_ios::ostringstream rs; + rs << "p<-c();" + << "for(i in 1:" + << dimCol->GetNumberOfTuples() + << "){" + << "p<-c(p,1-pchisq(jbs[i],d[i]));" + << "}"; + ri->EvalRscript( rs.str().c_str() ); + + // Retrieve the p-values + vtkDoubleArray* testCol = vtkDoubleArray::SafeDownCast( ri->AssignRVariableToVTKDataArray( "p" ) ); + if ( ! testCol || testCol->GetNumberOfTuples() != statCol->GetNumberOfTuples() ) + { + vtkWarningMacro( "Something went wrong with the R calculations. Reported p-values will be invalid." ); + testCol = this->Superclass::CalculatePValues( dimCol, statCol ); + } + + // Clean up + ri->Delete(); + + return testCol; +} + diff --git a/Filters/StatisticsGnuR/vtkPCAStatisticsGnuR.h b/Filters/StatisticsGnuR/vtkPCAStatisticsGnuR.h new file mode 100644 index 00000000000..5175988d8ac --- /dev/null +++ b/Filters/StatisticsGnuR/vtkPCAStatisticsGnuR.h @@ -0,0 +1,69 @@ +/*========================================================================= + +Program: Visualization Toolkit +Module: vtkPCAStatisticsGnuR.h + +Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen +All rights reserved. +See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +/*------------------------------------------------------------------------- + Copyright 2010 Sandia Corporation. + Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, + the U.S. Government retains certain rights in this software. + -------------------------------------------------------------------------*/ +// .NAME vtkPCAStatisticsGnuR - A class for multivariate principal component analysis +// using R to calculate p-values. +// +// .SECTION Description +// This class derives from the multi-correlative statistics algorithm and +// uses the covariance matrix and Cholesky decomposition computed by it. +// However, when it finalizes the statistics in learn operation, the PCA class +// computes the SVD of the covariance matrix in order to obtain its eigenvectors. +// +// In the assess operation, the input data are +// - projected into the basis defined by the eigenvectors, +// - the energy associated with each datum is computed, +// - or some combination thereof. +// Additionally, the user may specify some threshold energy or +// eigenvector entry below which the basis is truncated. This allows +// projection into a lower-dimensional state while minimizing (in a +// least squares sense) the projection error. +// +// In the test operation, a Jarque-Bera-Srivastava test of n-d normality is performed. +// +// .SECTION Thanks +// Thanks to David Thompson, Philippe Pebay and Jackson Mayo from +// Sandia National Laboratories for implementing this class. +// Updated by Philippe Pebay, Kitware SAS 2012 + +#ifndef __vtkPCAStatisticsGnuR_h +#define __vtkPCAStatisticsGnuR_h + +#include "vtkFiltersStatisticsGnuRModule.h" // For export macro +#include "vtkPCAStatistics.h" + +class vtkDoubleArray; + +class VTKFILTERSSTATISTICSGNUR_EXPORT vtkPCAStatisticsGnuR : public vtkPCAStatistics +{ +public: + vtkTypeMacro(vtkPCAStatisticsGnuR,vtkPCAStatistics); + virtual void PrintSelf( ostream& os, vtkIndent indent ); + static vtkPCAStatisticsGnuR* New(); + +protected: + vtkPCAStatisticsGnuR(); + ~vtkPCAStatisticsGnuR(); +//BTX + virtual vtkDoubleArray* CalculatePValues(vtkIdTypeArray*, vtkDoubleArray*); +//ETX +}; + +#endif // __vtkPCAStatisticsGnuR_h + diff --git a/Filters/Texture/CMakeLists.txt b/Filters/Texture/CMakeLists.txt new file mode 100644 index 00000000000..1447d5c0979 --- /dev/null +++ b/Filters/Texture/CMakeLists.txt @@ -0,0 +1,11 @@ +set(Module_SRCS + vtkTextureMapToCylinder.cxx + vtkTextureMapToPlane.cxx + vtkTextureMapToSphere.cxx + vtkImplicitTextureCoords.cxx + vtkThresholdTextureCoords.cxx + vtkTransformTextureCoords.cxx + vtkTriangularTCoords.cxx + ) + +vtk_module_library(vtkFiltersTexture ${Module_SRCS}) diff --git a/Filters/Texture/module.cmake b/Filters/Texture/module.cmake new file mode 100644 index 00000000000..af0789583f3 --- /dev/null +++ b/Filters/Texture/module.cmake @@ -0,0 +1,6 @@ +vtk_module(vtkFiltersTexture + GROUPS + StandAlone + DEPENDS + vtkFiltersGeneral + ) diff --git a/Filters/Verdict/CMakeLists.txt b/Filters/Verdict/CMakeLists.txt new file mode 100644 index 00000000000..c16bbee34e1 --- /dev/null +++ b/Filters/Verdict/CMakeLists.txt @@ -0,0 +1,7 @@ +set(Module_SRCS + vtkCellQuality.cxx + vtkMatrixMathFilter.cxx + vtkMeshQuality.cxx + ) + +vtk_module_library(vtkFiltersVerdict ${Module_SRCS}) diff --git a/Filters/Verdict/Testing/Cxx/CMakeLists.txt b/Filters/Verdict/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..153a12f756e --- /dev/null +++ b/Filters/Verdict/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,23 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + MeshQuality.cxx + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/${vtk-module}/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Filters/Verdict/module.cmake b/Filters/Verdict/module.cmake new file mode 100644 index 00000000000..41f83e5dfdc --- /dev/null +++ b/Filters/Verdict/module.cmake @@ -0,0 +1,10 @@ +vtk_module(vtkFiltersVerdict + GROUPS + StandAlone + DEPENDS + vtkCommonExecutionModel + vtkverdict + TEST_DEPENDS + vtkIOGeometry + vtkTestingCore + ) diff --git a/GUISupport/MFC/CMakeLists.txt b/GUISupport/MFC/CMakeLists.txt index 131726775e8..08012edfba6 100644 --- a/GUISupport/MFC/CMakeLists.txt +++ b/GUISupport/MFC/CMakeLists.txt @@ -1,51 +1,36 @@ -CONFIGURE_FILE( +configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/VTKMFCSettings.cmake" "${CMAKE_CURRENT_BINARY_DIR}/VTKMFCSettings.cmake" COPYONLY ) -INCLUDE("${CMAKE_CURRENT_BINARY_DIR}/VTKMFCSettings.cmake") +include("${CMAKE_CURRENT_BINARY_DIR}/VTKMFCSettings.cmake") -CONFIGURE_FILE( +configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/vtkMFCConfigure.h.in" "${CMAKE_CURRENT_BINARY_DIR}/vtkMFCConfigure.h" ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) -SET(MFC_SRCS +set(MFC_SRCS vtkMFCWindow.cpp - ) - -VTK_ADD_LIBRARY(vtkMFC ${VTK_MFC_LIB_TYPE} ${MFC_SRCS}) - -# Apply user-defined properties to the library target. -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(vtkMFC PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) + ) -IF(VTK_MFC_EXTRA_LIBS) - TARGET_LINK_LIBRARIES(vtkMFC ${VTK_MFC_EXTRA_LIBS}) -ENDIF(VTK_MFC_EXTRA_LIBS) +vtk_module_library(${vtk-module} ${VTK_MFC_LIB_TYPE} ${MFC_SRCS}) -TARGET_LINK_LIBRARIES(vtkMFC vtkRendering) +if(VTK_MFC_EXTRA_LIBS) + target_link_libraries(${vtk-module} ${VTK_MFC_EXTRA_LIBS}) +endif(VTK_MFC_EXTRA_LIBS) -IF ( WIN32 ) - IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - FILE(GLOB vtkMFCHeaderFiles "*.h") - SET(vtkMFCHeaderFiles ${vtkMFCHeaderFiles} +if ( WIN32 ) + if(NOT VTK_INSTALL_NO_DEVELOPMENT) + file(GLOB vtkMFCHeaderFiles "*.h") + set(vtkMFCHeaderFiles ${vtkMFCHeaderFiles} "${CMAKE_CURRENT_BINARY_DIR}/vtkMFCConfigure.h") - INSTALL(FILES ${vtkMFCHeaderFiles} + install(FILES ${vtkMFCHeaderFiles} DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24} COMPONENT Development ) - ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) - IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtkMFC - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries # .exe, .dll - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries # .so, mod.dll - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development # .a, .lib - ) - ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) -ENDIF ( WIN32 ) + endif(NOT VTK_INSTALL_NO_DEVELOPMENT) +endif ( WIN32 ) diff --git a/GUISupport/MFC/module.cmake b/GUISupport/MFC/module.cmake new file mode 100755 index 00000000000..6a96c7a3527 --- /dev/null +++ b/GUISupport/MFC/module.cmake @@ -0,0 +1,10 @@ +# only add this module if we are on a windows platform +if(WIN32) + vtk_module(vtkGUISupportMFC + DEPENDS + vtkRenderingOpenGL + vtkInteractionStyle + EXCLUDE_FROM_WRAPPING + ) +endif() + diff --git a/GUISupport/MFC/vtkMFCWindow.h b/GUISupport/MFC/vtkMFCWindow.h index bfdd7a6e0a0..6b9b843b76f 100644 --- a/GUISupport/MFC/vtkMFCWindow.h +++ b/GUISupport/MFC/vtkMFCWindow.h @@ -23,16 +23,6 @@ class vtkRenderWindowInteractor; #include "vtkMFCConfigure.h" -#if !defined(VTK_MFC_STATIC) -# if defined(vtkMFC_EXPORTS) -# define VTK_MFC_EXPORT __declspec( dllexport ) -# else -# define VTK_MFC_EXPORT __declspec( dllimport ) -# endif -#else -# define VTK_MFC_EXPORT -#endif - //! class to display a VTK window in an MFC window class VTK_MFC_EXPORT vtkMFCWindow : public CWnd { diff --git a/GUISupport/Qt/CMakeLists.txt b/GUISupport/Qt/CMakeLists.txt index 7dbf05977ff..385db9b2a9e 100644 --- a/GUISupport/Qt/CMakeLists.txt +++ b/GUISupport/Qt/CMakeLists.txt @@ -1,358 +1,110 @@ - # set up sources to build -SET(QVTKLibSrcs - vtkEventQtSlotConnect.cxx - vtkQtConnection.cxx - QVTKApplication.cxx - QVTKInteractor.cxx - QVTKInteractorAdapter.cxx - QVTKWidget.cxx - QFilterTreeProxyModel.cxx - QVTKPaintEngine.cxx - QVTKPaintEngine.h - vtkQtAbstractModelAdapter.cxx - vtkQtAnnotationLayersModelAdapter.cxx - vtkQtDebugLeaksModel.cxx - vtkQtDebugLeaksView.cxx - vtkQtSQLDatabase.cxx - vtkQtSQLQuery.cxx - vtkQtTableModelAdapter.cxx - vtkQtTimePointUtility.cxx - vtkQtTreeModelAdapter.cxx - ) - -SET(QVTKMocHeaders - QVTKApplication.h - QVTKInteractorAdapter.h - QVTKInteractorInternal.h - QVTKWidget.h - vtkQtConnection.h - QFilterTreeProxyModel.h - vtkQtAbstractModelAdapter.h - vtkQtAnnotationLayersModelAdapter.h - vtkQtDebugLeaksModel.h - vtkQtDebugLeaksView.h - vtkQtTableModelAdapter.h - vtkQtTreeModelAdapter.h - ) - -IF(VTK_USE_X AND VTK_USE_TDX) - SET(QVTKMocHeaders ${QVTKMocHeaders} - vtkTDxQtUnixDevices.h - ) - SET(QVTKLibSrcs ${QVTKLibSrcs} - vtkTDxQtUnixDevices.cxx - ) -ENDIF() - -SET(QVTKNonMocHeaders - QVTKWin32Header.h - vtkEventQtSlotConnect.h - QVTKInteractor.h - ) +set(QVTKLibSrcs + vtkEventQtSlotConnect.cxx + vtkQtConnection.cxx + QVTKApplication.cxx + QVTKInteractor.cxx + QVTKInteractorAdapter.cxx + QVTKWidget.cxx + QFilterTreeProxyModel.cxx + QVTKPaintEngine.cxx + QVTKPaintEngine.h + vtkQtAbstractModelAdapter.cxx + vtkQtAnnotationLayersModelAdapter.cxx + vtkQtDebugLeaksModel.cxx + vtkQtTableModelAdapter.cxx + vtkQtTreeModelAdapter.cxx + ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +set(QVTKMocHeaders + QVTKApplication.h + QVTKInteractorAdapter.h + QVTKInteractorInternal.h + QVTKWidget.h + vtkQtConnection.h + QFilterTreeProxyModel.h + vtkQtAbstractModelAdapter.h + vtkQtAnnotationLayersModelAdapter.h + vtkQtDebugLeaksModel.h + vtkQtTableModelAdapter.h + vtkQtTreeModelAdapter.h + ) -# add additional files if the user will allow Qt's OpenGL support -IF(VTK_USE_QVTK_QTOPENGL) - SET(QT_USE_QTOPENGL 1) - SET(QVTKMocHeaders ${QVTKMocHeaders} - QVTKGraphicsItem.h - QVTKWidget2.h +if(VTK_USE_X AND VTK_USE_TDX) + set(QVTKMocHeaders ${QVTKMocHeaders} + vtkTDxQtUnixDevices.h ) - SET(QVTKLibSrcs ${QVTKLibSrcs} - QVTKGraphicsItem.cxx - QVTKWidget2.cxx + set(QVTKLibSrcs ${QVTKLibSrcs} + vtkTDxQtUnixDevices.cxx ) -ENDIF(VTK_USE_QVTK_QTOPENGL) +endif() -# add additional files depending on infovis and/or views -IF(VTK_USE_VIEWS) - SET(QVTKLibSrcs ${QVTKLibSrcs} - vtkQtAnnotationView.cxx - vtkQtListView.cxx - vtkQtRecordView.cxx - vtkQtTableRepresentation.cxx - vtkQtTableView.cxx - vtkQtTreeView.cxx - vtkQtView.cxx - ) - SET_SOURCE_FILES_PROPERTIES(vtkQtView.cxx ABSTRACT ) - SET(QVTKMocHeaders ${QVTKMocHeaders} - vtkQtAnnotationView.h - vtkQtListView.h - vtkQtRecordView.h - vtkQtTableView.h - vtkQtTreeView.h - vtkQtView.h - ) - SET(QVTKNonMocHeaders ${QVTKNonMocHeaders} - vtkQtTableRepresentation.h - ) +if(VTK_USE_X) + find_package(X11 REQUIRED) + include_directories(${X11_INCLUDE_DIR}) +endif() - # Rich-text view requires Qt >= 4.5.0 - # Rich-text depends on Qt Webkit which is not portable on Unix (AIX & HP-UX) - IF(QT_QTWEBKIT_FOUND) - OPTION(VTK_QT_USE_WEBKIT "Option to use QT Webkit" ON) - MARK_AS_ADVANCED(VTK_QT_USE_WEBKIT) - IF( VTK_QT_USE_WEBKIT ) - QT4_WRAP_UI(UI_FILES vtkQtRichTextView.ui) - SET(QVTKLibSrcs ${QVTKLibSrcs} ${UI_FILES} vtkQtRichTextView.cxx) - SET(QVTKMocHeaders ${QVTKMocHeaders} vtkQtRichTextView.h) - IF(QT_PHONON_FOUND AND APPLE) - SET(QT_USE_PHONON 1) - ENDIF(QT_PHONON_FOUND AND APPLE) - SET(QT_USE_QTWEBKIT 1) - ENDIF( VTK_QT_USE_WEBKIT ) - ENDIF(QT_QTWEBKIT_FOUND) -ENDIF(VTK_USE_VIEWS) +set(QVTKNonMocHeaders + QVTKWin32Header.h + vtkEventQtSlotConnect.h + QVTKInteractor.h + ) # import Qt4 build settings -SET(QT_USE_QTNETWORK 1) -INCLUDE(${QT_USE_FILE}) - -QT4_WRAP_CPP(QVTKLibMocSrcs ${QVTKMocHeaders}) - -VTK_ADD_LIBRARY(QVTK ${QVTKLibSrcs} ${QVTKLibMocSrcs}) -# Add target specific compile flags for ABI setttings -IF(VTK_ABI_CXX_FLAGS) - SET_PROPERTY(TARGET QVTK APPEND PROPERTY COMPILE_FLAGS "${VTK_ABI_CXX_FLAGS}") -ENDIF(VTK_ABI_CXX_FLAGS) - -# Apply user-defined properties to the library target. -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(QVTK PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -TARGET_LINK_LIBRARIES(QVTK - ${QT_LIBRARIES} - vtkRendering - vtkIO - vtkGraphics - vtkImaging - vtkCommon) - -# add extra dependencies if necessary -IF(VTK_USE_VIEWS) - TARGET_LINK_LIBRARIES(QVTK vtkViews) -ENDIF(VTK_USE_VIEWS) - -IF(VTK_USE_QVTK_QTOPENGL) - TARGET_LINK_LIBRARIES(QVTK ${OPENGL_gl_LIBRARY}) -ENDIF(VTK_USE_QVTK_QTOPENGL) - -IF(VTK_USE_X) - TARGET_LINK_LIBRARIES(QVTK ${X11_LIBRARIES}) -ENDIF() - -IF(APPLE) - IF(VTK_USE_CARBON) - TARGET_LINK_LIBRARIES( QVTK "-framework Carbon" ) - ENDIF(VTK_USE_CARBON) -ENDIF(APPLE) - -# recurse into testing directory if testing is on -IF(BUILD_TESTING) - ADD_SUBDIRECTORY(Testing/Cxx) -ENDIF(BUILD_TESTING) - -# wrapping for python -if(VTK_WRAP_PYTHON_SIP) - - #### wrap vtkObject derived classes with the VTK python wrapper generator - # list header files here for wrapping - set(QVTK_PythonHeaders - QVTKInteractor.h - vtkEventQtSlotConnect.h - vtkQtSQLDatabase.h - vtkQtSQLQuery.h - vtkQtTimePointUtility.h - ) - if(VTK_USE_VIEWS) - set(QVTK_PythonHeaders ${QVTK_PythonHeaders} - vtkQtAnnotationView.h - vtkQtListView.h - vtkQtRecordView.h - vtkQtTableRepresentation.h - vtkQtTableView.h - vtkQtTreeView.h - vtkQtView.h - ) - endif(VTK_USE_VIEWS) - - IF(VTK_USE_VIEWS AND VTK_QT_USE_WEBKIT) - set(QVTK_PythonHeaders ${QVTK_PythonHeaders} - vtkQtRichTextView.h - ) - ENDIF(VTK_USE_VIEWS AND VTK_QT_USE_WEBKIT) +set(QT_USE_QTNETWORK 1) +find_package(Qt4 REQUIRED QUIET) +mark_as_advanced(QT_QMAKE_EXECUTABLE) +include(${QT_USE_FILE}) - # GUISupport/Qt doesn't have a hierarchy file, use Rendering - IF(VTK_IGNORE_BTX) - SET(KIT_HIERARCHY_FILE - ${VTK_BINARY_DIR}/Rendering/vtkRenderingHierarchy.txt) - ENDIF(VTK_IGNORE_BTX) +qt4_wrap_cpp(QVTKLibMocSrcs ${QVTKMocHeaders}) - VTK_WRAP_PYTHON3(vtkQtPython QVTK_PythonSrcs "${QVTK_PythonHeaders}") - VTK_ADD_LIBRARY(vtkQtPythonD ${QVTK_PythonSrcs}) - TARGET_LINK_LIBRARIES(vtkQtPythonD QVTK) - IF(VTK_USE_VIEWS) - TARGET_LINK_LIBRARIES(vtkQtPythonD vtkViewsPythonD) - ENDIF(VTK_USE_VIEWS) - TARGET_LINK_LIBRARIES(vtkQtPythonD vtkRenderingPythonD vtkPythonCore) +vtk_module_library(${vtk-module} ${QVTKLibSrcs} ${QVTKLibMocSrcs}) - PYTHON_ADD_MODULE(vtkQtPython vtkQtPythonInit.cxx) - TARGET_LINK_LIBRARIES(vtkQtPython vtkQtPythonD) +target_link_libraries(${vtk-module} ${QT_LIBRARIES}) - #### wrap QObject derived classes with SIP - # list .sip files here for wrapping - set(SIP_FILES - QVTKWidget.sip - QVTKInteractor.sip - QVTKInteractorAdapter.sip - vtkQtAbstractModelAdapter.sip - vtkQtAnnotationLayersModelAdapter.sip - vtkQtTableModelAdapter.sip - vtkQtTreeModelAdapter.sip - ) - if(VTK_USE_QVTK_QTOPENGL) - set(SIP_FILES - ${SIP_FILES} - QVTKWidget2.sip - QVTKGraphicsItem.sip - ) - endif(VTK_USE_QVTK_QTOPENGL) - - # auto generate the module .sip file from the list of .sip files above - set(SIP_MODULE QVTKPython) - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${SIP_MODULE}.sip.in - "%Module vtk.${SIP_MODULE} 0\n\n") - - set(SIP_OUT) - foreach(f ${SIP_FILES}) - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${SIP_MODULE}.sip.in "%Include ${f}\n") - get_filename_component(f1 "${f}" NAME_WE) - set(SIP_OUT ${SIP_OUT} ${CMAKE_CURRENT_BINARY_DIR}/sip${SIP_MODULE}${f1}.cpp) - endforeach(f ${SIP_FILES}) - - set(MODULE_SIP_FILE ${CMAKE_CURRENT_BINARY_DIR}/${SIP_MODULE}.sip) - configure_file(${CMAKE_CURRENT_BINARY_DIR}/${SIP_MODULE}.sip.in ${MODULE_SIP_FILE} COPY_ONLY) +if(VTK_USE_QVTK_QTOPENGL) + target_link_libraries(${vtk-module} ${OPENGL_gl_LIBRARY}) +endif() - set(SIP_OUT ${SIP_OUT} ${CMAKE_CURRENT_BINARY_DIR}/sip${SIP_MODULE}cmodule.cpp) - set(SIP_FILES ${SIP_FILES} ${MODULE_SIP_FILE}) +if(VTK_USE_X) + target_link_libraries(${vtk-module} ${X11_LIBRARIES}) +endif() - # find .sip files for Qt - find_path(SIP_PYQT_DIR NAMES QtCore/QtCoremod.sip - PATHS ${PYTHON_INCLUDE_PATH}/../Lib/site-packages/PyQt4/sip/PyQt4 - ${PYTHON_INCLUDE_PATH}/../sip/PyQt4 - ${PYTHON_INCLUDE_PATH}/../Versions/2.5/share/sip/PyQt4 - ${PYTHON_INCLUDE_PATH}/../share/sip/PyQt4 - /usr/share/sip/PyQt4 - /usr/local/share/sip/PyQt4 - DOC "Root directory containing all PyQt4 sip files." - ) - - # build command args for sip - if(Q_WS_X11) - set(SIP_FLAGS ${SIP_FLAGS} -t WS_X11) - elseif(Q_WS_WIN) - set(SIP_FLAGS ${SIP_FLAGS} -t WS_WIN) - elseif(Q_WS_MAC) - set(SIP_FLAGS ${SIP_FLAGS} -t WS_MACX) +if(APPLE) + if(VTK_USE_CARBON) + target_link_libraries(${vtk-module} "-framework Carbon" ) endif() - set(SIP_FLAGS ${SIP_FLAGS} -t Qt_${QT_VERSION_MAJOR}_${QT_VERSION_MINOR}_0) - set(SIP_FLAGS ${SIP_FLAGS} - -I ${SIP_PYQT_DIR} - -I ${CMAKE_CURRENT_SOURCE_DIR} - -I ${VTK_BINARY_DIR}/Rendering - -I ${VTK_BINARY_DIR}/Filtering - -I ${VTK_BINARY_DIR}/Common - ) - IF(VTK_USE_VIEWS) - set(SIP_FLAGS ${SIP_FLAGS} - -I ${VTK_BINARY_DIR}/Views - ) - ENDIF(VTK_USE_VIEWS) - - # call sip on our files - add_custom_command( - OUTPUT ${SIP_OUT} - COMMAND ${SIP_EXECUTABLE} - ARGS -c "${CMAKE_CURRENT_BINARY_DIR}" ${SIP_FLAGS} ${MODULE_SIP_FILE} - DEPENDS ${SIP_FILES} - ) - - # create the sip module - include_directories(${SIP_INCLUDE_DIR}) - include_directories("${PYTHON_INCLUDE_PATH}") - VTK_ADD_LIBRARY(${SIP_MODULE} MODULE ${SIP_OUT} ${SIP_FILES}) - target_link_libraries(${SIP_MODULE} QVTK vtkRenderingPythonD) - set_target_properties(${SIP_MODULE} PROPERTIES PREFIX "") - IF(WIN32 AND NOT CYGWIN) - SET_TARGET_PROPERTIES(${SIP_MODULE} PROPERTIES SUFFIX ".pyd") - ENDIF(WIN32 AND NOT CYGWIN) - get_target_property(lib_loc ${SIP_MODULE} LOCATION) - add_custom_command(TARGET ${SIP_MODULE} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${lib_loc}" "${VTK_BINARY_DIR}/Wrapping/Python/vtk/" - ) - - - SET_TARGET_PROPERTIES(vtkQtPython QVTKPython PROPERTIES SKIP_BUILD_RPATH 1) - - IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtkQtPythonD - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) - IF(VTK_INSTALL_PYTHON_USING_CMAKE) - INSTALL(TARGETS vtkQtPython QVTKPython - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) - ENDIF(VTK_INSTALL_PYTHON_USING_CMAKE) - ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) - - IF(BUILD_TESTING) - ADD_SUBDIRECTORY(Testing/Python) - ENDIF(BUILD_TESTING) - -endif(VTK_WRAP_PYTHON_SIP) - +endif() # Configure the VTKConfigQt.cmake support file. -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/VTKConfigQt.cmake.in - ${VTK_BINARY_DIR}/VTKConfigQt.cmake @ONLY IMMEDIATE) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/VTKConfigQt.cmake.in + ${VTK_BINARY_DIR}/VTKConfigQt.cmake @ONLY IMMEDIATE) -# build plugin -IF(BUILD_SHARED_LIBS) - SET ( PluginLibSrcs - Q4VTKWidgetPlugin.cxx - ) +# This build plugin logic should just get migrated into a module I think. +if(BUILD_SHARED_LIBS) + set(PluginLibSrcs Q4VTKWidgetPlugin.cxx) - SET ( PluginMocHeaders - Q4VTKWidgetPlugin.h - ) + set(PluginMocHeaders Q4VTKWidgetPlugin.h) - ADD_DEFINITIONS(-DQT_PLUGIN) - INCLUDE_DIRECTORIES(${QT_QTDESIGNER_INCLUDE_DIR}) - QT4_WRAP_CPP ( PluginMocSrcs ${PluginMocHeaders} ) + add_definitions(-DQT_PLUGIN) + include_directories(${QT_QTDESIGNER_INCLUDE_DIR}) + qt4_wrap_cpp(PluginMocSrcs ${PluginMocHeaders}) # add QVTK plugin from sources # stand-alone as it doesn't depend on QVTK library - VTK_ADD_LIBRARY ( QVTKWidgetPlugin + vtk_add_library(QVTKWidgetPlugin SHARED ${PluginLibSrcs} ${PluginMocSrcs} - ) + ) - SET_TARGET_PROPERTIES(QVTKWidgetPlugin PROPERTIES COMPILE_DEFINITIONS QT_NO_DEBUG) + set_target_properties(QVTKWidgetPlugin PROPERTIES COMPILE_DEFINITIONS QT_NO_DEBUG) # link with Qt libs - TARGET_LINK_LIBRARIES( QVTKWidgetPlugin + target_link_libraries(QVTKWidgetPlugin ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} - ) + ) # install rules @@ -362,59 +114,36 @@ IF(BUILD_SHARED_LIBS) # The default is to install to VTK_INSTALL_QT_DIR under the installation # prefix. The default VTK_INSTALL_QT_DIR will allow the designer plugin # path to be set to vtk-install-prefix/plugins to get the plugin. - IF(NOT VTK_INSTALL_QT_DIR) - SET(VTK_INSTALL_QT_DIR /plugins/designer) - ENDIF(NOT VTK_INSTALL_QT_DIR) + if(NOT VTK_INSTALL_QT_DIR) + set(VTK_INSTALL_QT_DIR /plugins/designer) + endif() # If no runtime is to be installed then do not install the qt plugin. - IF(VTK_INSTALL_NO_RUNTIME) - SET(VTK_INSTALL_NO_QT_PLUGIN 1) - ENDIF(VTK_INSTALL_NO_RUNTIME) + if(VTK_INSTALL_NO_RUNTIME) + set(VTK_INSTALL_NO_QT_PLUGIN 1) + endif() - IF(NOT VTK_INSTALL_NO_QT_PLUGIN) + if(NOT VTK_INSTALL_NO_QT_PLUGIN) # Set default plugin install directory. - SET(DOLLAR "$") - IF(DEFINED VTK_INSTALL_QT_PLUGIN_DIR) - ELSE(DEFINED VTK_INSTALL_QT_PLUGIN_DIR) - SET(VTK_INSTALL_QT_PLUGIN_DIR "${DOLLAR}{CMAKE_INSTALL_PREFIX}${DOLLAR}{VTK_INSTALL_QT_DIR}" + set(DOLLAR "$") + if(DEFINED VTK_INSTALL_QT_PLUGIN_DIR) + else() + set(VTK_INSTALL_QT_PLUGIN_DIR + "${DOLLAR}{CMAKE_INSTALL_PREFIX}${DOLLAR}{VTK_INSTALL_QT_DIR}" CACHE STRING "Directory in which the VTK Qt plugin is placed during installation.") - MARK_AS_ADVANCED(VTK_INSTALL_QT_PLUGIN_DIR) - ENDIF(DEFINED VTK_INSTALL_QT_PLUGIN_DIR) + mark_as_advanced(VTK_INSTALL_QT_PLUGIN_DIR) + endif() # Configure the plugin install script. This is used instead of # INSTALL TARGETS to allow the plugin to be installed outside the # main install prefix. Attach the script as a post-install script. - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/PluginInstall.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/PluginInstall.cmake - @ONLY IMMEDIATE) - SET_TARGET_PROPERTIES(QVTK PROPERTIES POST_INSTALL_SCRIPT + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/PluginInstall.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/PluginInstall.cmake - ) - ENDIF(NOT VTK_INSTALL_NO_QT_PLUGIN) -ENDIF(BUILD_SHARED_LIBS) - -IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - INSTALL(FILES - ${QVTKMocHeaders} - ${QVTKNonMocHeaders} - DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24} - COMPONENT Development - ) - - INSTALL(FILES - "${VTK_BINARY_DIR}/VTKConfigQt.cmake" - DESTINATION ${VTK_INSTALL_PACKAGE_DIR_CM24} - COMPONENT Development - ) -ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS QVTK - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) + @ONLY IMMEDIATE) + set_target_properties(${vtk-module} PROPERTIES POST_INSTALL_SCRIPT + ${CMAKE_CURRENT_BINARY_DIR}/PluginInstall.cmake) + endif() +endif() -CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.ctest.in" +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.ctest.in" "${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.ctest" @ONLY IMMEDIATE) diff --git a/GUISupport/Qt/QVTKWidget.cxx b/GUISupport/Qt/QVTKWidget.cxx index 0803d3bec25..a41e299eabf 100644 --- a/GUISupport/Qt/QVTKWidget.cxx +++ b/GUISupport/Qt/QVTKWidget.cxx @@ -43,6 +43,7 @@ #include "qpainter.h" #include "qsignalmapper.h" #include "qtimer.h" +#include "vtkRenderingOpenGLModule.h" #if defined(Q_WS_X11) #include "qx11info_x11.h" #endif diff --git a/GUISupport/Qt/Testing/Cxx/CMakeLists.txt b/GUISupport/Qt/Testing/Cxx/CMakeLists.txt index c69fbcd4e88..d6872f6ee77 100644 --- a/GUISupport/Qt/Testing/Cxx/CMakeLists.txt +++ b/GUISupport/Qt/Testing/Cxx/CMakeLists.txt @@ -1,43 +1,30 @@ -# if we have rendering add the following tests -SET(KIT QVTK) -# add tests that do not require data -SET(MyTests - TestQtDebugLeaksView.cxx - TestQtInitialization.cxx - TestQtSQLDatabase.cxx +set(MyTests TestQtTableModelAdapter.cxx TestQtTreeModelAdapter.cxx ) -IF(VTK_USE_VIEWS) - SET(MyTests - ${MyTests} - TestVtkQtTableView.cxx - ) -ENDIF(VTK_USE_VIEWS) -IF (VTK_DATA_ROOT) - # add tests that require data - SET(MyTests ${MyTests} +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx ${MyTests} + EXTRA_INCLUDE vtkTestDriver.h) - ) -ENDIF (VTK_DATA_ROOT) -CREATE_TEST_SOURCELIST(Tests ${KIT}CxxTests.cxx ${MyTests} - EXTRA_INCLUDE vtkTestDriver.h) -ADD_EXECUTABLE(${KIT}CxxTests ${Tests} QTestApp.cxx) -TARGET_LINK_LIBRARIES(${KIT}CxxTests QVTK) -SET (TestsToRun ${Tests}) -REMOVE (TestsToRun ${KIT}CxxTests.cxx) +find_package(Qt4 REQUIRED) +include(${QT_USE_FILE}) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests} QTestApp.cxx) + +set(TestsToRun ${Tests}) +remove(TestsToRun ${vtk-module}CxxTests.cxx) -# # Add all the executables -FOREACH (test ${TestsToRun}) - GET_FILENAME_COMPONENT(TName ${test} NAME_WE) - IF (VTK_DATA_ROOT) - ADD_TEST(QVTK-${TName} ${CXX_TEST_PATH}/${KIT}CxxTests ${TName} +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} -D ${VTK_DATA_ROOT} -T ${VTK_BINARY_DIR}/Testing/Temporary - -V Baseline/${KIT}/${TName}.png) - ELSE (VTK_DATA_ROOT) - ADD_TEST(QVTK-${TName} ${CXX_TEST_PATH}/${KIT}CxxTests ${TName}) - ENDIF (VTK_DATA_ROOT) -ENDFOREACH (test) + -V Baseline/QVTK/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/GUISupport/Qt/module.cmake b/GUISupport/Qt/module.cmake new file mode 100644 index 00000000000..f967dc3964d --- /dev/null +++ b/GUISupport/Qt/module.cmake @@ -0,0 +1,12 @@ +vtk_module(vtkGUISupportQt + GROUPS + Qt + DEPENDS + vtkCommonExecutionModel + vtkRenderingOpenGL + vtkInteractionStyle + vtkImagingCore + TEST_DEPENDS + vtkTestingCore + EXCLUDE_FROM_WRAPPING + ) diff --git a/GUISupport/QtOpenGL/CMakeLists.txt b/GUISupport/QtOpenGL/CMakeLists.txt new file mode 100644 index 00000000000..731d902b2b8 --- /dev/null +++ b/GUISupport/QtOpenGL/CMakeLists.txt @@ -0,0 +1,18 @@ +set(MocHeaders ${QVTKMocHeaders} + QVTKGraphicsItem.h + QVTKWidget2.h + ) +set(LibSrcs ${QVTKLibSrcs} + QVTKGraphicsItem.cxx + QVTKWidget2.cxx + ) + +# import Qt4 build settings +set(QT_USE_QTOPENGL 1) +find_package(Qt4 REQUIRED QUIET) +include(${QT_USE_FILE}) + +qt4_wrap_cpp(LibMocSrcs ${MocHeaders}) + +vtk_module_library(${vtk-module} ${LibSrcs} ${LibMocSrcs}) +target_link_libraries(${vtk-module} ${QT_LIBRARIES}) diff --git a/GUISupport/QtOpenGL/module.cmake b/GUISupport/QtOpenGL/module.cmake new file mode 100644 index 00000000000..3e2455456b4 --- /dev/null +++ b/GUISupport/QtOpenGL/module.cmake @@ -0,0 +1,10 @@ +vtk_module(vtkGUISupportQtOpenGL + GROUPS + Qt + DEPENDS + vtkGUISupportQt + vtkRenderingOpenGL + TEST_DEPENDS + vtkTestingCore + EXCLUDE_FROM_WRAPPING + ) diff --git a/GUISupport/QtSQL/CMakeLists.txt b/GUISupport/QtSQL/CMakeLists.txt new file mode 100644 index 00000000000..b531d47f21a --- /dev/null +++ b/GUISupport/QtSQL/CMakeLists.txt @@ -0,0 +1,22 @@ +# set up sources to build +set(LibSrcs + vtkQtSQLDatabase.cxx + vtkQtSQLQuery.cxx + vtkQtTimePointUtility.cxx + ) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +# import Qt4 build settings +set(QT_USE_QTSQL 1) +find_package(Qt4 REQUIRED QUIET) +include(${QT_USE_FILE}) + +vtk_module_library(${vtk-module} ${LibSrcs}) + +# Apply user-defined properties to the library target. +if(VTK_LIBRARY_PROPERTIES) + set_target_properties(${vtk-module} PROPERTIES ${VTK_LIBRARY_PROPERTIES}) +endif() + +target_link_libraries(${vtk-module} ${QT_LIBRARIES}) diff --git a/GUISupport/QtSQL/module.cmake b/GUISupport/QtSQL/module.cmake new file mode 100644 index 00000000000..3cd5bbc359c --- /dev/null +++ b/GUISupport/QtSQL/module.cmake @@ -0,0 +1,9 @@ +vtk_module(vtkGUISupportQtSQL + GROUPS + Qt + DEPENDS + vtkIOSQL + TEST_DEPENDS + vtkTestingCore + EXCLUDE_FROM_WRAPPING + ) diff --git a/GUISupport/QtSQL/vtkQtSQLDatabase.h b/GUISupport/QtSQL/vtkQtSQLDatabase.h index 655c8634790..2c59fce4bd6 100644 --- a/GUISupport/QtSQL/vtkQtSQLDatabase.h +++ b/GUISupport/QtSQL/vtkQtSQLDatabase.h @@ -29,7 +29,7 @@ #include <qglobal.h> #if (QT_EDITION & QT_MODULE_SQL) -#include "QVTKWin32Header.h" +#include "vtkGUISupportQtSQLModule.h" #include "vtkSQLDatabase.h" #include <QtSql/QSqlDatabase> @@ -37,7 +37,7 @@ class vtkSQLQuery; class vtkStringArray; -class QVTK_EXPORT vtkQtSQLDatabase : public vtkSQLDatabase +class VTKGUISUPPORTQTSQL_EXPORT vtkQtSQLDatabase : public vtkSQLDatabase { public: static vtkQtSQLDatabase* New(); diff --git a/GUISupport/QtSQL/vtkQtSQLQuery.h b/GUISupport/QtSQL/vtkQtSQLQuery.h index e557f948970..22bbf211bd4 100644 --- a/GUISupport/QtSQL/vtkQtSQLQuery.h +++ b/GUISupport/QtSQL/vtkQtSQLQuery.h @@ -29,14 +29,14 @@ #include <qglobal.h> #if (QT_EDITION & QT_MODULE_SQL) -#include "QVTKWin32Header.h" +#include "vtkGUISupportQtSQLModule.h" #include "vtkSQLQuery.h" #include "vtkType.h" class vtkVariant; class vtkQtSQLQueryInternals; -class QVTK_EXPORT vtkQtSQLQuery : public vtkSQLQuery +class VTKGUISUPPORTQTSQL_EXPORT vtkQtSQLQuery : public vtkSQLQuery { public: static vtkQtSQLQuery* New(); diff --git a/GUISupport/QtSQL/vtkQtTimePointUtility.h b/GUISupport/QtSQL/vtkQtTimePointUtility.h index 26863bc9ee2..fab0596c7d1 100644 --- a/GUISupport/QtSQL/vtkQtTimePointUtility.h +++ b/GUISupport/QtSQL/vtkQtTimePointUtility.h @@ -25,11 +25,11 @@ #ifndef __vtkQtTimePointUtility_h #define __vtkQtTimePointUtility_h -#include "QVTKWin32Header.h" +#include "vtkGUISupportQtSQLModule.h" #include "vtkObject.h" #include <QDateTime> -class QVTK_EXPORT vtkQtTimePointUtility : public vtkObject +class VTKGUISUPPORTQTSQL_EXPORT vtkQtTimePointUtility : public vtkObject { public: vtkTypeMacro(vtkQtTimePointUtility,vtkObject); diff --git a/GUISupport/QtWebkit/CMakeLists.txt b/GUISupport/QtWebkit/CMakeLists.txt new file mode 100644 index 00000000000..d979c05ed5a --- /dev/null +++ b/GUISupport/QtWebkit/CMakeLists.txt @@ -0,0 +1,21 @@ +find_package(Qt4 REQUIRED QtCore QtGui QtWebKit QUIET) + +# Rich-text view requires Qt >= 4.5.0 +# Rich-text depends on Qt Webkit which is not portable on Unix (AIX & HP-UX) +QT4_WRAP_UI(UI_FILES vtkQtRichTextView.ui) +set(LibSrcs ${QVTKLibSrcs} ${UI_FILES} vtkQtRichTextView.cxx) +set(MocHeaders ${QVTKMocHeaders} vtkQtRichTextView.h) +if(QT_PHONON_FOUND AND APPLE) + set(QT_USE_PHONON 1) +endif() +set(QT_USE_QTWEBKIT 1) + +# import Qt4 build settings +set(QT_USE_QTNETWORK 1) +include(${QT_USE_FILE}) + +qt4_wrap_cpp(LibMocSrcs ${MocHeaders}) + +vtk_module_library(${vtk-module} ${LibSrcs} ${LibMocSrcs}) + +target_link_libraries(${vtk-module} ${QT_LIBRARIES}) diff --git a/GUISupport/QtWebkit/module.cmake b/GUISupport/QtWebkit/module.cmake new file mode 100644 index 00000000000..0c9e6a8ee0d --- /dev/null +++ b/GUISupport/QtWebkit/module.cmake @@ -0,0 +1,9 @@ +vtk_module(vtkGUISupportQtWebkit + GROUPS + Qt + DEPENDS + vtkViewsQt + TEST_DEPENDS + vtkTestingCore + EXCLUDE_FROM_WRAPPING + ) diff --git a/Geovis/Core/CMakeLists.txt b/Geovis/Core/CMakeLists.txt index d0591bd8d95..a06a82adc40 100644 --- a/Geovis/Core/CMakeLists.txt +++ b/Geovis/Core/CMakeLists.txt @@ -1,16 +1,7 @@ -SET(KIT Geovis) -SET(UKIT GEOVIS) -SET(KIT_TCL_LIBS vtkWidgetsTCL vtkViewsTCL) -SET(KIT_PYTHON_LIBS vtkWidgetsPythonD vtkViewsPythonD) -SET(KIT_JAVA_LIBS vtkWidgetsJava vtkViewsJava) -SET(KIT_INTERFACE_LIBRARIES vtkWidgets vtkViews) -SET(KIT_LIBS ${VTK_LIBPROJ4_LIBRARIES}) - -SET( Kit_SRCS +set(Module_SRCS vtkCompassRepresentation.cxx vtkCompassWidget.cxx vtkGeoAdaptiveArcs.cxx - vtkGeoAlignedImageRepresentation.cxx vtkGeoAlignedImageSource.cxx vtkGeoArcs.cxx vtkGeoAssignCoordinates.cxx @@ -21,8 +12,8 @@ SET( Kit_SRCS vtkGeoGraticule.cxx vtkGeoImageNode.cxx vtkGeoInteractorStyle.cxx - vtkGeoProjectionSource.cxx - vtkGeoProjection.cxx + # vtkGeoProjection.cxx #needs vtklibproj4 which isnt working well + # vtkGeoProjectionSource.cxx # needs vtkGeoProjection vtkGeoRandomGraphSource.cxx vtkGeoSampleArcs.cxx vtkGeoSource.cxx @@ -30,33 +21,16 @@ SET( Kit_SRCS vtkGeoTerrain.cxx vtkGeoTerrain2D.cxx vtkGeoTerrainNode.cxx - vtkGeoTransform.cxx + # vtkGeoTransform.cxx #needs vtklibproj4 which isnt working well vtkGeoTreeNode.cxx vtkGeoTreeNodeCache.cxx - vtkGeoView.cxx - vtkGeoView2D.cxx vtkGlobeSource.cxx -) + vtkGeoAlignedImageRepresentation.cxx + ) -SET_SOURCE_FILES_PROPERTIES( - vtkGeoSource.cxx +set_source_files_properties( + vtkGeoSource ABSTRACT -) - -#SET_SOURCE_FILES_PROPERTIES( -# WRAP_EXCLUDE -#) - -SET(Kit_EXTRA_SRCS) -SET(Kit_EXTRA_CMDS) -SET(Kit_TCL_EXTRA_SRCS) -SET(Kit_PYTHON_EXTRA_SRCS) -SET(Kit_JAVA_EXTRA_SRCS) -SET(KIT_TCL_DEPS) -SET(KIT_PYTHON_DEPS) -SET(KIT_JAVA_DEPS) + ) -#----------------------------------------------------------------------------- -# Include CMake code common to all kits. -INCLUDE(${VTK_CMAKE_DIR}/KitCommonBlock.cmake) -#----------------------------------------------------------------------------- +vtk_module_library(vtkGeovisCore ${Module_SRCS}) diff --git a/Geovis/Core/module.cmake b/Geovis/Core/module.cmake new file mode 100644 index 00000000000..05256ae51ea --- /dev/null +++ b/Geovis/Core/module.cmake @@ -0,0 +1,10 @@ +vtk_module(vtkGeovisCore + GROUPS + StandAlone + DEPENDS + vtkInteractionWidgets + vtkInteractionStyle + vtkCommonExecutionModel + vtkInfovisLayout + vtkViewsCore + ) diff --git a/IO/Core/CMakeLists.txt b/IO/Core/CMakeLists.txt new file mode 100644 index 00000000000..6eaf2c6c017 --- /dev/null +++ b/IO/Core/CMakeLists.txt @@ -0,0 +1,44 @@ +SET(Module_SRCS + vtkAbstractParticleWriter.cxx + vtkArrayReader.cxx + vtkArrayWriter.cxx + vtkASCIITextCodec.cxx + vtkBase64InputStream.cxx + vtkBase64OutputStream.cxx + vtkBase64Utilities.cxx + vtkDataCompressor.cxx + vtkDataObjectReader.cxx + vtkDataObjectWriter.cxx + vtkDataReader.cxx + vtkDataWriter.cxx + vtkDelimitedTextWriter.cxx + vtkGlobFileNames.cxx + vtkGraphReader.cxx + vtkGraphWriter.cxx + vtkInputStream.cxx + vtkJavaScriptDataWriter.cxx + vtkOutputStream.cxx + vtkSortFileNames.cxx + vtkTextCodec.cxx + vtkTextCodecFactory.cxx + vtkUTF16TextCodec.cxx + vtkUTF8TextCodec.cxx + vtkWriter.cxx + vtkZLibDataCompressor.cxx + vtkTableReader.cxx + vtkTableWriter.cxx + vtkArrayDataReader.cxx + vtkArrayDataWriter.cxx + ) + +include_directories(${VTK_SOURCE_DIR}/ThirdParty/utf8/source) + +set_source_files_properties( + vtkAbstractParticleWriter + vtkDataCompressor + vtkTextCodec + vtkWriter + ABSTRACT + ) + +vtk_module_library(vtkIOCore ${Module_SRCS}) diff --git a/IO/Core/Testing/Cxx/CMakeLists.txt b/IO/Core/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..e65b98f462f --- /dev/null +++ b/IO/Core/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,27 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestArrayDataWriter.cxx + TestArrayDenormalized.cxx + TestArraySerialization.cxx + TestCompress.cxx + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/${vtk-module}/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/IO/Core/module.cmake b/IO/Core/module.cmake new file mode 100644 index 00000000000..fd0030ddff0 --- /dev/null +++ b/IO/Core/module.cmake @@ -0,0 +1,12 @@ +vtk_module(vtkIOCore + GROUPS + StandAlone + DEPENDS + vtkCommonDataModel + vtkCommonExecutionModel + vtkCommonMisc + vtkzlib + vtksys + TEST_DEPENDS + vtkTestingCore + ) diff --git a/IO/Core/vtkASCIITextCodec.cxx b/IO/Core/vtkASCIITextCodec.cxx index 0720b38b970..4eff82e32b7 100644 --- a/IO/Core/vtkASCIITextCodec.cxx +++ b/IO/Core/vtkASCIITextCodec.cxx @@ -18,10 +18,10 @@ PURPOSE. See the above copyright notice for more information. the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------*/ -#include <vtkASCIITextCodec.h> +#include "vtkASCIITextCodec.h" -#include <vtkObjectFactory.h> -#include <vtkTextCodecFactory.h> +#include "vtkObjectFactory.h" +#include "vtkTextCodecFactory.h" #include <stdexcept> diff --git a/IO/Core/vtkArrayWriter.cxx b/IO/Core/vtkArrayWriter.cxx index e799e20b3d2..484e3336a52 100644 --- a/IO/Core/vtkArrayWriter.cxx +++ b/IO/Core/vtkArrayWriter.cxx @@ -13,9 +13,9 @@ =========================================================================*/ +#include "vtkArrayWriter.h" #include <vtkArrayData.h> #include <vtkArrayPrint.h> -#include <vtkArrayWriter.h> #include <vtkDenseArray.h> #include <vtkExecutive.h> #include <vtkInformation.h> diff --git a/IO/Core/vtkArrayWriter.h b/IO/Core/vtkArrayWriter.h index 1655910504c..740872cdd93 100644 --- a/IO/Core/vtkArrayWriter.h +++ b/IO/Core/vtkArrayWriter.h @@ -50,8 +50,8 @@ #ifndef __vtkArrayWriter_h #define __vtkArrayWriter_h -#include <vtkWriter.h> -#include <vtkStdString.h> // For string API +#include "vtkWriter.h" +#include "vtkStdString.h" // For string API class vtkArray; diff --git a/IO/Core/vtkTextCodec.cxx b/IO/Core/vtkTextCodec.cxx index a2b3ece4412..8ec94da339a 100644 --- a/IO/Core/vtkTextCodec.cxx +++ b/IO/Core/vtkTextCodec.cxx @@ -18,8 +18,7 @@ PURPOSE. See the above copyright notice for more information. the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------*/ -#include <vtkTextCodec.h> - +#include "vtkTextCodec.h" const char* vtkTextCodec::Name() { diff --git a/IO/Core/vtkUTF16TextCodec.cxx b/IO/Core/vtkUTF16TextCodec.cxx index b081e2dfc34..4f238965174 100644 --- a/IO/Core/vtkUTF16TextCodec.cxx +++ b/IO/Core/vtkUTF16TextCodec.cxx @@ -18,10 +18,10 @@ PURPOSE. See the above copyright notice for more information. the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------*/ -#include <vtkUTF16TextCodec.h> +#include "vtkUTF16TextCodec.h" -#include <vtkObjectFactory.h> -#include <vtkTextCodecFactory.h> +#include "vtkObjectFactory.h" +#include "vtkTextCodecFactory.h" #include <stdexcept> diff --git a/IO/Core/vtkUTF8TextCodec.cxx b/IO/Core/vtkUTF8TextCodec.cxx index e82cfaa9268..a75a9ea7649 100644 --- a/IO/Core/vtkUTF8TextCodec.cxx +++ b/IO/Core/vtkUTF8TextCodec.cxx @@ -18,10 +18,10 @@ PURPOSE. See the above copyright notice for more information. the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------*/ -#include <vtkUTF8TextCodec.h> +#include "vtkUTF8TextCodec.h" -#include <vtkObjectFactory.h> -#include <vtkTextCodecFactory.h> +#include "vtkObjectFactory.h" +#include "vtkTextCodecFactory.h" #include <utf8.h> diff --git a/IO/EnSight/CMakeLists.txt b/IO/EnSight/CMakeLists.txt new file mode 100644 index 00000000000..c183a2a91c6 --- /dev/null +++ b/IO/EnSight/CMakeLists.txt @@ -0,0 +1,16 @@ +set(Module_SRCS + vtkEnSight6BinaryReader.cxx + vtkEnSight6Reader.cxx + vtkEnSightGoldBinaryReader.cxx + vtkEnSightGoldReader.cxx + vtkEnSightMasterServerReader.cxx + vtkEnSightReader.cxx + vtkGenericEnSightReader.cxx +) + +set_source_files_properties( + vtkEnSightReader + ABSTRACT + ) + +vtk_module_library(vtkIOEnSight ${Module_SRCS}) diff --git a/IO/EnSight/module.cmake b/IO/EnSight/module.cmake new file mode 100644 index 00000000000..3938189566c --- /dev/null +++ b/IO/EnSight/module.cmake @@ -0,0 +1,6 @@ +vtk_module(vtkIOEnSight + GROUPS + StandAlone + DEPENDS + vtkCommonExecutionModel + ) diff --git a/IO/Exodus/CMakeLists.txt b/IO/Exodus/CMakeLists.txt new file mode 100644 index 00000000000..72e8034216e --- /dev/null +++ b/IO/Exodus/CMakeLists.txt @@ -0,0 +1,15 @@ +set(Module_SRCS + vtkExodusIICache.cxx + vtkExodusIIReader.cxx + vtkExodusIIReaderParser.cxx + vtkExodusIIReaderVariableCheck.cxx + vtkExodusModel.cxx + ) + +set_source_files_properties( + vtkExodusIIReaderParser + vtkExodusIIReaderVariableCheck + WRAP_EXCLUDE + ) + +vtk_module_library(vtkIOExodus ${Module_SRCS}) diff --git a/IO/Exodus/module.cmake b/IO/Exodus/module.cmake new file mode 100644 index 00000000000..bb7e1a744bc --- /dev/null +++ b/IO/Exodus/module.cmake @@ -0,0 +1,8 @@ +vtk_module(vtkIOExodus + GROUPS + StandAlone + DEPENDS + vtkFiltersGeneral + vtkIOXML + vtkexodusII + ) diff --git a/IO/Exodus/vtkExodusIIReaderPrivate.h b/IO/Exodus/vtkExodusIIReaderPrivate.h index a60b6b44110..988b37e16b7 100644 --- a/IO/Exodus/vtkExodusIIReaderPrivate.h +++ b/IO/Exodus/vtkExodusIIReaderPrivate.h @@ -18,14 +18,14 @@ class vtkMultiProcessController; #include <vector> #include "vtk_exodusII.h" - +#include "vtkIOExodusModule.h" // For export macro class vtkExodusIIReaderParser; class vtkMutableDirectedGraph; /** This class holds metadata for an Exodus file. * */ -class vtkExodusIIReaderPrivate : public vtkObject +class VTKIOEXODUS_EXPORT vtkExodusIIReaderPrivate : public vtkObject { public: static vtkExodusIIReaderPrivate* New(); diff --git a/IO/Export/CMakeLists.txt b/IO/Export/CMakeLists.txt new file mode 100644 index 00000000000..ac72a7917de --- /dev/null +++ b/IO/Export/CMakeLists.txt @@ -0,0 +1,44 @@ +set(Module_SRCS + vtkExporter.cxx + vtkIVExporter.cxx + vtkOBJExporter.cxx + vtkOOGLExporter.cxx + vtkPOVExporter.cxx + vtkRIBExporter.cxx + vtkRIBLight.cxx + vtkRIBProperty.cxx + vtkVRMLExporter.cxx + vtkX3D.cxx + vtkX3DExporter.cxx + vtkX3DExporterFIWriter.cxx + #vtkX3DExporterJavaHelper.cxx Needs JNI + vtkX3DExporterWriter.cxx + vtkX3DExporterXMLWriter.cxx + vtkGL2PSExporter.cxx + ) + +if(NOT VTK_USE_SYSTEM_GL2PS) + # TODO: Build vtkgl2ps library over in its module + list(APPEND Module_SRCS ${VTK_SOURCE_DIR}/ThirdParty/gl2ps/vtkgl2ps/gl2ps.c) + add_definitions(-DGL2PS_HAVE_ZLIB) + add_definitions(-DGL2PS_HAVE_LIBPNG) + set_source_files_properties( + ${VTK_SOURCE_DIR}/ThirdParty/gl2ps/vtkgl2ps/gl2ps + WRAP_EXCLUDE + ) +endif() + +set_source_files_properties( + vtkX3D + vtkX3DExporterWriter + vtkX3DExporterFIWriter + vtkX3DExporterXMLWriter + WRAP_EXCLUDE + ) + +set_source_files_properties( + vtkExporter + ABSTRACT + ) + +vtk_module_library(vtkIOExport ${Module_SRCS}) diff --git a/IO/Export/Testing/Cxx/CMakeLists.txt b/IO/Export/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..b30a23b00f6 --- /dev/null +++ b/IO/Export/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,24 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + X3DTest.cxx + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Hybrid/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/IO/Export/module.cmake b/IO/Export/module.cmake new file mode 100644 index 00000000000..5b75281ba11 --- /dev/null +++ b/IO/Export/module.cmake @@ -0,0 +1,14 @@ +vtk_module(vtkIOExport + GROUPS + StandAlone + DEPENDS + vtkCommonCore + vtkRenderingCore + vtkRenderingFreeType + vtkImagingCore + vtkIOCore + vtkgl2ps + TEST_DEPENDS + vtkTestingRendering + vtkRenderingOpenGL + ) diff --git a/IO/Geometry/CMakeLists.txt b/IO/Geometry/CMakeLists.txt new file mode 100644 index 00000000000..3eb483086b6 --- /dev/null +++ b/IO/Geometry/CMakeLists.txt @@ -0,0 +1,61 @@ +SET(Module_SRCS + vtkAVSucdReader.cxx + vtkBYUReader.cxx + vtkBYUWriter.cxx + #vtkCGMWriter.cxx # Needs vtkViewport. + vtkChacoReader.cxx + vtkCompositeDataReader.cxx + vtkCompositeDataWriter.cxx + vtkDataSetReader.cxx + vtkDataSetWriter.cxx + vtkFacetWriter.cxx + vtkFLUENTReader.cxx + vtkGAMBITReader.cxx + vtkGenericDataObjectReader.cxx + vtkGenericDataObjectWriter.cxx + vtkGenericMovieWriter.cxx + #vtkIVWriter.cxx # Needs vtkAbstractMapper + vtkMaterialLibrary.cxx + vtkMCubesReader.cxx + vtkMCubesWriter.cxx + vtkMFIXReader.cxx + vtkMoleculeReaderBase.cxx + vtkMultiBlockPLOT3DReader.cxx + vtkOBJReader.cxx + vtkOpenFOAMReader.cxx + vtkParticleReader.cxx + vtkPDBReader.cxx + vtkPolyDataReader.cxx + vtkPolyDataWriter.cxx + vtkProStarReader.cxx + vtkRectilinearGridReader.cxx + vtkRectilinearGridWriter.cxx + vtkSESAMEReader.cxx + vtkSimplePointsReader.cxx + vtkSimplePointsWriter.cxx + vtkSTLReader.cxx + vtkSTLWriter.cxx + vtkStructuredGridReader.cxx + vtkStructuredGridWriter.cxx + vtkTecplotReader.cxx + vtkTreeReader.cxx + vtkTreeWriter.cxx + vtkUGFacetReader.cxx + vtkUnstructuredGridReader.cxx + vtkUnstructuredGridWriter.cxx + + vtkStructuredPointsReader.cxx + vtkStructuredPointsWriter.cxx + + vtkShaderCodeLibrary.cxx + + vtkXYZMolReader.cxx + ) + +set_source_files_properties( + vtkGenericMovieWriter + vtkMoleculeReaderBase + ABSTRACT + ) + +vtk_module_library(vtkIOGeometry ${Module_SRCS}) diff --git a/IO/Geometry/Testing/Cxx/CMakeLists.txt b/IO/Geometry/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..ddc30274544 --- /dev/null +++ b/IO/Geometry/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,27 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestProStarReader.cxx + TestSimplePointsReaderWriter.cxx + TestTecplotReader.cxx + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/IO/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/IO/Geometry/module.cmake b/IO/Geometry/module.cmake new file mode 100644 index 00000000000..c7a0f5c1909 --- /dev/null +++ b/IO/Geometry/module.cmake @@ -0,0 +1,16 @@ +vtk_module(vtkIOGeometry + GROUPS + StandAlone + DEPENDS + vtkCommonDataModel + vtkCommonSystem + vtkCommonMisc + vtkIOCore + vtkzlib + COMPILE_DEPENDS + vtkUtilitiesMaterialLibrary + TEST_DEPENDS + vtkFiltersGeometry + vtkRenderingOpenGL + vtkTestingRendering + ) diff --git a/IO/Image/CMakeLists.txt b/IO/Image/CMakeLists.txt new file mode 100644 index 00000000000..c17061d36c8 --- /dev/null +++ b/IO/Image/CMakeLists.txt @@ -0,0 +1,51 @@ +set(Module_SRCS + vtkBMPReader.cxx + vtkBMPWriter.cxx + vtkDEMReader.cxx + vtkDICOMImageReader.cxx + #vtkFFMPEGWriter.cxx + vtkGaussianCubeReader.cxx + vtkGESignaReader.cxx + vtkImageExport.cxx + vtkImageImport.cxx + vtkImageImportExecutive.cxx + vtkImageReader2Collection.cxx + vtkImageReader2.cxx + #vtkImageReader2Factory.cxx + vtkImageReader.cxx + vtkImageWriter.cxx + vtkJPEGReader.cxx + vtkJPEGWriter.cxx + vtkMedicalImageProperties.cxx + vtkMedicalImageReader2.cxx + vtkMetaImageReader.cxx + vtkMetaImageWriter.cxx + #vtkMPEG2Writer.cxx # Do we want to continue supporting? + #vtkOggTheoraWriter.cxx + vtkPNGReader.cxx + vtkPNGWriter.cxx + vtkPNMReader.cxx + vtkPNMWriter.cxx + vtkPostScriptWriter.cxx + vtkSLCReader.cxx + vtkTIFFReader.cxx + vtkTIFFWriter.cxx + vtkVolume16Reader.cxx + vtkVolumeReader.cxx + ) + +if(WIN32) + # Should we force this on Windows? + list(APPEND Module_SRCS vtkAVIWriter.cxx) +endif() + +set_source_files_properties( + vtkVolumeReader + ABSTRACT + ) + +vtk_module_library(vtkIOImage ${Module_SRCS}) + +if(WIN32) + target_link_libraries(vtkIOImage vfw32) +endif() diff --git a/IO/Image/Testing/Cxx/CMakeLists.txt b/IO/Image/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..b8e9a0546f8 --- /dev/null +++ b/IO/Image/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,41 @@ +set(TEST_SRC) + +if(WIN32) + list(APPEND TEST_SRC TestAVIWriter.cxx) +endif() + +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + # TestFFMPEGWriter.cxx # fixme (deps not satisfied) + # TestImageReader2Factory.cxx # fixme (deps not satisfied) + TestMetaIO.cxx + # TestMovieWriter.cxx # fixme (deps not satisfied) + # TestOggTheoraWriter.cxx # fixme (deps not satisfied) + ${TEST_SRC} + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) +list(REMOVE_ITEM TestsToRun TestMetaIO.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/IO/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() + +if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-MetaIO + COMMAND ${vtk-module}CxxTests TestMetaIO + ${VTK_DATA_ROOT}/Data/HeadMRVolume.mhd) +endif() diff --git a/IO/Image/module.cmake b/IO/Image/module.cmake new file mode 100644 index 00000000000..29a547e7695 --- /dev/null +++ b/IO/Image/module.cmake @@ -0,0 +1,20 @@ +vtk_module(vtkIOImage + GROUPS + StandAlone + DEPENDS + vtkCommonDataModel + vtkCommonSystem + vtkCommonMath + vtkCommonMisc + vtkCommonTransforms + vtkIOGeometry + vtkjpeg + vtkpng + vtktiff + vtkMetaIO + vtkoggtheora + vtkDICOMParser + TEST_DEPENDS + vtkTestingCore + vtkImagingSources + ) diff --git a/IO/Import/CMakeLists.txt b/IO/Import/CMakeLists.txt new file mode 100644 index 00000000000..fc00885529f --- /dev/null +++ b/IO/Import/CMakeLists.txt @@ -0,0 +1,12 @@ +set(Module_SRCS + vtk3DSImporter.cxx + vtkImporter.cxx + vtkVRMLImporter.cxx +) + +set_source_files_properties( + vtkImporter + ABSTRACT + ) + +vtk_module_library(vtkIOImport ${Module_SRCS}) diff --git a/IO/Import/Testing/Cxx/CMakeLists.txt b/IO/Import/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..87a67214271 --- /dev/null +++ b/IO/Import/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,24 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestVRMLNormals.cxx + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Hybrid/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/IO/Import/module.cmake b/IO/Import/module.cmake new file mode 100644 index 00000000000..31948375dbf --- /dev/null +++ b/IO/Import/module.cmake @@ -0,0 +1,10 @@ +vtk_module(vtkIOImport + GROUPS + StandAlone + DEPENDS + vtkCommonCore + vtkRenderingCore + TEST_DEPENDS + vtkRenderingOpenGL + vtkTestingRendering + ) diff --git a/IO/Infovis/CMakeLists.txt b/IO/Infovis/CMakeLists.txt new file mode 100644 index 00000000000..14b9ed7d55f --- /dev/null +++ b/IO/Infovis/CMakeLists.txt @@ -0,0 +1,24 @@ +set(Module_SRCS + vtkChacoGraphReader.cxx + vtkChacoGraphReader.h + vtkDelimitedTextReader.cxx + vtkDelimitedTextReader.h + vtkDIMACSGraphReader.cxx + vtkDIMACSGraphReader.h + vtkDIMACSGraphWriter.cxx + vtkDIMACSGraphWriter.h + vtkFixedWidthTextReader.cxx + vtkFixedWidthTextReader.h + vtkISIReader.cxx + vtkISIReader.h + vtkRISReader.cxx + vtkRISReader.h + vtkTulipReader.cxx + vtkTulipReader.h + vtkXGMLReader.cxx + vtkXGMLReader.h + vtkXMLTreeReader.cxx + vtkXMLTreeReader.h + ) + +vtk_module_library(vtkIOInfovis ${Module_SRCS}) diff --git a/IO/Infovis/Testing/Cxx/CMakeLists.txt b/IO/Infovis/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..56926e59dfd --- /dev/null +++ b/IO/Infovis/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,26 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + # TestTulipReader.cxx # todo (unsatisfied deps) + # TestTulipReaderClusters.cxx # todo (unsatisfied deps) + TestTulipReaderProperties.cxx + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/${vtk-module}/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/IO/Infovis/module.cmake b/IO/Infovis/module.cmake new file mode 100644 index 00000000000..cb1e3f7e144 --- /dev/null +++ b/IO/Infovis/module.cmake @@ -0,0 +1,15 @@ +vtk_module(vtkIOInfovis + GROUPS + StandAlone + DEPENDS + vtkCommonDataModel + vtkCommonSystem + vtkCommonMisc + vtkIOCore + vtkInfovisCore + vtklibxml2 + TEST_DEPENDS + vtkInfovisLayout + vtkRenderingCore + vtkTestingRendering + ) diff --git a/IO/LSDyna/CMakeLists.txt b/IO/LSDyna/CMakeLists.txt new file mode 100644 index 00000000000..581738a1d01 --- /dev/null +++ b/IO/LSDyna/CMakeLists.txt @@ -0,0 +1,28 @@ +set(Module_SRCS + vtkLSDynaPart.cxx + vtkLSDynaPartCollection.cxx + vtkLSDynaReader.cxx + vtkLSDynaSummaryParser.cxx + private/LSDynaFamily.cxx + private/LSDynaMetaData.cxx + ) + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/private/LSDynaExport.h.in + ${CMAKE_CURRENT_BINARY_DIR}/private/LSDynaExport.h + ) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR}/private + ${CMAKE_CURRENT_BINARY_DIR}/private + ) + +set_source_files_properties( + vtkLSDynaPart + vtkLSDynaPartCollection + private/LSDynaFamily + private/LSDynaMetaData + WRAP_EXCLUDE + ) + +vtk_module_library(vtkIOLSDyna ${Module_SRCS}) diff --git a/IO/LSDyna/Testing/Cxx/CMakeLists.txt b/IO/LSDyna/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..59dd338031f --- /dev/null +++ b/IO/LSDyna/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,26 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestLSDynaReader.cxx + TestLSDynaReaderSPH.cxx + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_LARGE_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/IO/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/IO/LSDyna/module.cmake b/IO/LSDyna/module.cmake new file mode 100644 index 00000000000..19c78baaf31 --- /dev/null +++ b/IO/LSDyna/module.cmake @@ -0,0 +1,10 @@ +vtk_module(vtkIOLSDyna + GROUPS + StandAlone + DEPENDS + vtkCommonExecutionModel + vtkIOXML + TEST_DEPENDS + vtkRenderingOpenGL + vtkTestingRendering + ) diff --git a/IO/LSDyna/private/LSDynaFamily.h b/IO/LSDyna/private/LSDynaFamily.h index 78d0f9b9284..73bb8117d91 100644 --- a/IO/LSDyna/private/LSDynaFamily.h +++ b/IO/LSDyna/private/LSDynaFamily.h @@ -67,7 +67,7 @@ typedef FILE* vtkLSDynaFile_t; # include <errno.h> #endif -class LSDyna_EXPORT LSDynaFamily +class LSDynaFamily { public: LSDynaFamily(); diff --git a/IO/LSDyna/private/LSDynaMetaData.h b/IO/LSDyna/private/LSDynaMetaData.h index 531771c204d..2bd4c97f8f0 100644 --- a/IO/LSDyna/private/LSDynaMetaData.h +++ b/IO/LSDyna/private/LSDynaMetaData.h @@ -35,7 +35,7 @@ #include <set> #include <vector> -class LSDyna_EXPORT LSDynaMetaData +class LSDynaMetaData { public: LSDynaMetaData(); diff --git a/IO/MINC/CMakeLists.txt b/IO/MINC/CMakeLists.txt new file mode 100644 index 00000000000..72d9edb78c7 --- /dev/null +++ b/IO/MINC/CMakeLists.txt @@ -0,0 +1,13 @@ +set(Module_SRCS + vtkMINCImageAttributes.cxx + vtkMINCImageReader.cxx + vtkMINCImageWriter.cxx + vtkMNIObjectReader.cxx + vtkMNIObjectWriter.cxx + vtkMNITagPointReader.cxx + vtkMNITagPointWriter.cxx + vtkMNITransformReader.cxx + vtkMNITransformWriter.cxx + ) + +vtk_module_library(vtkIOMINC ${Module_SRCS}) diff --git a/IO/MINC/module.cmake b/IO/MINC/module.cmake new file mode 100644 index 00000000000..f25db388158 --- /dev/null +++ b/IO/MINC/module.cmake @@ -0,0 +1,10 @@ +vtk_module(vtkIOMINC + GROUPS + StandAlone + DEPENDS + vtkIOImage + vtkCommonExecutionModel + vtkRenderingCore + vtkFiltersHybrid + vtknetcdf + ) diff --git a/IO/MySQL/CMakeLists.txt b/IO/MySQL/CMakeLists.txt new file mode 100644 index 00000000000..d300a18d268 --- /dev/null +++ b/IO/MySQL/CMakeLists.txt @@ -0,0 +1,17 @@ +find_package(MySQL REQUIRED) + +set(MySQL_SRCS + vtkMySQLDatabase.cxx + vtkMySQLQuery.cxx + vtkMySQLToTableReader.cxx + vtkTableToMySQLWriter.cxx + vtkIOMySQL_AutoInit.cxx + ) + +set_source_files_properties(vtkIOMySQL_AutoInit WRAP_EXCLUDE) + +include_directories(${MYSQL_INCLUDE_DIRECTORIES}) + +vtk_module_library(vtkIOMySQL ${MySQL_SRCS}) + +target_link_libraries(vtkIOMySQL ${MYSQL_LIBRARY} ${MYSQL_EXTRA_LIBRARIES}) diff --git a/IO/MySQL/Testing/Cxx/CMakeLists.txt b/IO/MySQL/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..0895740a3ea --- /dev/null +++ b/IO/MySQL/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,28 @@ +if(VTK_MYSQL_TEST_URL) + create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestMySQLDatabase.cxx + TestMySQLTableReadWrite.cxx + EXTRA_INCLUDE vtkTestDriver.h + ) + + vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + + set(TestsToRun ${Tests}) + list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + + add_test(NAME ${vtk-module}Cxx-TestMySQLDatabase + COMMAND ${vtk-module}CxxTests TestMySQLDatabase) + + if(VTK_DATA_ROOT) + if(WIN32) + add_test(NAME ${vtk-module}Cxx-TestMySQLTableReadWrite + COMMAND ${vtk-module}CxxTests TestMySQLTableReadWrite + ${VTK_DATA_ROOT}/Baseline/IO/simple_table_win.vtk) + else() + add_test(NAME ${vtk-module}Cxx-TestMySQLTableReadWrite + COMMAND ${vtk-module}CxxTests TestMySQLTableReadWrite + ${VTK_DATA_ROOT}/Baseline/IO/simple_table.vtk) + endif() + endif() + +endif() diff --git a/IO/MySQL/Testing/Cxx/TestMySQLDatabase.cxx b/IO/MySQL/Testing/Cxx/TestMySQLDatabase.cxx index 63672601159..b8061090833 100644 --- a/IO/MySQL/Testing/Cxx/TestMySQLDatabase.cxx +++ b/IO/MySQL/Testing/Cxx/TestMySQLDatabase.cxx @@ -43,12 +43,17 @@ #include "vtkVariant.h" #include "vtkVariantArray.h" #include "vtkToolkits.h" +#include "DatabaseSchemaWith2Tables.h" #include <vector> int TestMySQLDatabase( int, char ** const ) { vtkMySQLDatabase* db = vtkMySQLDatabase::SafeDownCast( vtkSQLDatabase::CreateFromURL( VTK_MYSQL_TEST_URL ) ); + + // Temp code to for linkage ... + vtkMySQLDatabase* tmp = vtkMySQLDatabase::New(); + bool status = db->Open("vtktest"); if ( ! status ) @@ -179,7 +184,7 @@ int TestMySQLDatabase( int, char ** const ) // Testing transformation of a schema into a MySQL database // 1. Create the schema -#include "DatabaseSchemaWith2Tables.cxx" + DatabaseSchemaWith2Tables schema; // 2. Convert the schema into a MySQL database cerr << "@@ Converting the schema into a MySQL database..."; @@ -193,7 +198,7 @@ int TestMySQLDatabase( int, char ** const ) return 1; } - status = db->EffectSchema( schema ); + status = db->EffectSchema( schema.GetSchema() ); if ( ! status ) { cerr << "Could not effect test schema.\n"; @@ -236,7 +241,10 @@ int TestMySQLDatabase( int, char ** const ) // 4. Inspect these tables cerr << "@@ Inspecting these tables..." << "\n"; + vtkStdString queryStr; + int tblHandle = schema.GetTableBHandle(); + for ( tblHandle = 0; tblHandle < numTbl; ++ tblHandle ) { vtkStdString tblName( schema->GetTableNameFromHandle( tblHandle ) ); @@ -368,7 +376,6 @@ int TestMySQLDatabase( int, char ** const ) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -379,7 +386,6 @@ int TestMySQLDatabase( int, char ** const ) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -390,7 +396,6 @@ int TestMySQLDatabase( int, char ** const ) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -406,7 +411,6 @@ int TestMySQLDatabase( int, char ** const ) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -424,7 +428,6 @@ int TestMySQLDatabase( int, char ** const ) << " != " << dpts[numDpt] << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -441,7 +444,6 @@ int TestMySQLDatabase( int, char ** const ) << " != " << 3 << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -460,7 +462,6 @@ int TestMySQLDatabase( int, char ** const ) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -476,7 +477,6 @@ int TestMySQLDatabase( int, char ** const ) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -485,7 +485,6 @@ int TestMySQLDatabase( int, char ** const ) if ( ! query->NextRow() ) { cerr << "Query returned no results" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -583,7 +582,6 @@ int TestMySQLDatabase( int, char ** const ) // Clean up db->Delete(); - schema->Delete(); query->Delete(); return 0; diff --git a/IO/MySQL/module.cmake b/IO/MySQL/module.cmake new file mode 100644 index 00000000000..796fc4c0cef --- /dev/null +++ b/IO/MySQL/module.cmake @@ -0,0 +1,9 @@ +vtk_module(vtkIOMySQL + DEPENDS + vtkCommonDataModel + IMPLEMENTS + vtkIOSQL + TEST_DEPENDS + vtkTestingCore + vtkTestingIOSQL + ) diff --git a/IO/MySQL/vtkIOMySQL_AutoInit.cxx b/IO/MySQL/vtkIOMySQL_AutoInit.cxx new file mode 100644 index 00000000000..f82928c3c4e --- /dev/null +++ b/IO/MySQL/vtkIOMySQL_AutoInit.cxx @@ -0,0 +1,61 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkIOMySQL_AutoInit.cxx + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +#include "vtkMySQLDatabase.h" + +#include <vtksys/SystemTools.hxx> + +#include <string> + +// Registration of MySQL dynamically with the vtkSQLDatabase factory method. +vtkSQLDatabase * MySQLCreateFunction(const char* URL) +{ + std::string urlstr(URL ? URL : ""); + std::string protocol, unused; + vtkMySQLDatabase *db = 0; + + if (vtksys::SystemTools::ParseURLProtocol(urlstr, protocol, unused) && + protocol == "mysql") + { + db = vtkMySQLDatabase::New(); + db->ParseURL(URL); + } + + return db; +} + +static unsigned int vtkIOMySQLCount; + +struct VTKIOMYSQL_EXPORT vtkIOMySQL_AutoInit +{ + vtkIOMySQL_AutoInit(); + ~vtkIOMySQL_AutoInit(); +}; + +vtkIOMySQL_AutoInit::vtkIOMySQL_AutoInit() +{ + if (++vtkIOMySQLCount == 1) + { + vtkSQLDatabase::RegisterCreateFromURLCallback(MySQLCreateFunction); + } +} + +vtkIOMySQL_AutoInit::~vtkIOMySQL_AutoInit() +{ + if (--vtkIOMySQLCount == 0) + { + vtkSQLDatabase::UnRegisterCreateFromURLCallback(MySQLCreateFunction); + } +} diff --git a/IO/MySQL/vtkMySQLDatabase.cxx b/IO/MySQL/vtkMySQLDatabase.cxx index f998b23891f..6ab83c83ebf 100644 --- a/IO/MySQL/vtkMySQLDatabase.cxx +++ b/IO/MySQL/vtkMySQLDatabase.cxx @@ -35,41 +35,6 @@ vtkStandardNewMacro(vtkMySQLDatabase) -// Registration of MySQL dynamically with the vtkSQLDatabase factory method. -vtkSQLDatabase * MySQLCreateFunction(const char* URL) -{ - std::string urlstr(URL ? URL : ""); - std::string protocol, unused; - vtkMySQLDatabase *db = 0; - - if (vtksys::SystemTools::ParseURLProtocol(urlstr, protocol, unused) && - protocol == "mysql") - { - db = vtkMySQLDatabase::New(); - db->ParseURL(URL); - } - - return db; -} - -class vtkMySQLDatabaseRegister -{ -public: - vtkMySQLDatabaseRegister() - { - vtkSQLDatabase::RegisterCreateFromURLCallback(MySQLCreateFunction); - } - ~vtkMySQLDatabaseRegister() - { - vtkSQLDatabase::UnRegisterCreateFromURLCallback(MySQLCreateFunction); - } -}; - -// Remove ifndef in VTK 6.0: only register callback in old layout. -#ifndef VTK_USE_MYSQL -static vtkMySQLDatabaseRegister mySQLDataBaseRegister; -#endif - // ---------------------------------------------------------------------- vtkMySQLDatabase::vtkMySQLDatabase() : Private(new vtkMySQLDatabasePrivate()) diff --git a/IO/NetCDF/CMakeLists.txt b/IO/NetCDF/CMakeLists.txt new file mode 100644 index 00000000000..26b27408183 --- /dev/null +++ b/IO/NetCDF/CMakeLists.txt @@ -0,0 +1,14 @@ +set(Module_SRCS + vtkMPASReader.cxx + vtkNetCDFCAMReader.cxx + vtkNetCDFCFReader.cxx + vtkNetCDFPOPReader.cxx + vtkNetCDFReader.cxx + vtkSLACParticleReader.cxx + vtkSLACReader.cxx + ) + +vtk_module_library(vtkIONetCDF ${Module_SRCS}) + +target_link_libraries(vtkIONetCDF vtkNetCDF_cxx) +set_target_properties(vtkIONetCDF PROPERTIES LINK_INTERFACE_LIBRARIES "") diff --git a/IO/NetCDF/Testing/Cxx/CMakeLists.txt b/IO/NetCDF/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..49a6633906d --- /dev/null +++ b/IO/NetCDF/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,30 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + SLACParticleReader.cxx + SLACReaderLinear.cxx + SLACReaderQuadratic.cxx + TestMPASReader.cxx + # TestNetCDFCAMReader.cxx # todo + # TestNetCDFPOPReader.cxx # todo + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_LARGE_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_LARGE_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/IO/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/IO/NetCDF/module.cmake b/IO/NetCDF/module.cmake new file mode 100644 index 00000000000..9fa1732a805 --- /dev/null +++ b/IO/NetCDF/module.cmake @@ -0,0 +1,14 @@ +vtk_module(vtkIONetCDF + GROUPS + StandAlone + DEPENDS + vtkCommonDataModel + vtkCommonSystem + vtkIOCore + COMPILE_DEPENDS + vtknetcdf + TEST_DEPENDS + vtkCommonExecutionModel + vtkRenderingOpenGL + vtkTestingRendering + ) diff --git a/IO/NetCDF/vtkMPASReader.cxx b/IO/NetCDF/vtkMPASReader.cxx index 105f61fbb6b..859242ca039 100644 --- a/IO/NetCDF/vtkMPASReader.cxx +++ b/IO/NetCDF/vtkMPASReader.cxx @@ -70,7 +70,6 @@ PURPOSE. See the above copyright notice for more information. #include "vtkCellArray.h" #include "vtkDataArraySelection.h" #include "vtkDataObject.h" -#include "vtkErrorCode.h" #include "vtkDoubleArray.h" #include "vtkInformation.h" #include "vtkInformationDoubleVectorKey.h" diff --git a/IO/ODBC/CMakeLists.txt b/IO/ODBC/CMakeLists.txt new file mode 100644 index 00000000000..ce2fbae7cde --- /dev/null +++ b/IO/ODBC/CMakeLists.txt @@ -0,0 +1,12 @@ +find_package(ODBC REQUIRED) + +set(ODBC_SRCS + vtkODBCDatabase.cxx + vtkODBCQuery.cxx + ) + +include_directories(${ODBC_INCLUDE_DIRECTORIES}) + +vtk_module_library(vtkIOODBC ${ODBC_SRCS}) + +target_link_libraries(vtkIOODBC ${ODBC_LIBRARIES}) diff --git a/IO/ODBC/Testing/Cxx/CMakeLists.txt b/IO/ODBC/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..d9b6418bc34 --- /dev/null +++ b/IO/ODBC/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,25 @@ +if(VTK_ODBC_TEST_DSN) + create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestODBCDatabase.cxx + EXTRA_INCLUDE vtkTestDriver.h + ) + + vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + + set(TestsToRun ${Tests}) + list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + + # Add all the executables + foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/${vtk-module}/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} COMMAND ${vtk-module}CxxTests ${TName}) + endif() + endforeach() +endif() diff --git a/IO/ODBC/module.cmake b/IO/ODBC/module.cmake new file mode 100644 index 00000000000..d33690285e2 --- /dev/null +++ b/IO/ODBC/module.cmake @@ -0,0 +1,5 @@ +vtk_module(vtkIOODBC + DEPENDS + vtkCommonDataModel + vtkIOSQL + ) diff --git a/IO/PLY/CMakeLists.txt b/IO/PLY/CMakeLists.txt new file mode 100644 index 00000000000..c51ac5c3bd6 --- /dev/null +++ b/IO/PLY/CMakeLists.txt @@ -0,0 +1,12 @@ +set(Module_SRCS + vtkPLY.cxx + vtkPLYReader.cxx + vtkPLYWriter.cxx +) + +SET_SOURCE_FILES_PROPERTIES( + vtkPLY + WRAP_EXCLUDE +) + +vtk_module_library(vtkIOPLY ${Module_SRCS}) diff --git a/IO/PLY/Testing/Cxx/CMakeLists.txt b/IO/PLY/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..ffa45723ba4 --- /dev/null +++ b/IO/PLY/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,24 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestPLYReader.cxx + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/IO/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/IO/PLY/module.cmake b/IO/PLY/module.cmake new file mode 100644 index 00000000000..24806b230cd --- /dev/null +++ b/IO/PLY/module.cmake @@ -0,0 +1,12 @@ +vtk_module(vtkIOPLY + GROUPS + StandAlone + DEPENDS + vtkCommonMisc + vtkCommonExecutionModel + vtkIOGeometry + TEST_DEPENDS + vtkRenderingOpenGL + vtkIOImage + vtkTestingRendering + ) diff --git a/IO/Parallel/CMakeLists.txt b/IO/Parallel/CMakeLists.txt new file mode 100644 index 00000000000..fc52c81e4d0 --- /dev/null +++ b/IO/Parallel/CMakeLists.txt @@ -0,0 +1,21 @@ +find_package(MPI REQUIRED) +include_directories(${MPI_INCLUDE_PATH}) + +set(Module_SRCS + vtkEnSightWriter.cxx + # vtkExodusIIWriter.cxx needs vtkMultiProcessController + vtkPChacoReader.cxx + vtkPCosmoReader.cxx + vtkPDataSetReader.cxx + vtkPDataSetWriter.cxx + vtkPImageWriter.cxx + vtkPNrrdReader.cxx + vtkPOpenFOAMReader.cxx + vtkPSLACReader.cxx + vtkVPICReader.cxx + vtkWindBladeReader.cxx + vtkXMLPHierarchicalBoxDataWriter.cxx + vtkXMLPMultiBlockDataWriter.cxx + ) + +vtk_module_library(vtkIOParallel ${Module_SRCS}) diff --git a/IO/Parallel/module.cmake b/IO/Parallel/module.cmake new file mode 100644 index 00000000000..b6bd14f2252 --- /dev/null +++ b/IO/Parallel/module.cmake @@ -0,0 +1,13 @@ +vtk_module(vtkIOParallel + GROUPS + MPI + DEPENDS + vtkParallelCore + vtkFiltersParallel + vtkIOParallelMPI + vtkIONetCDF + vtkexodusII + vtkVPIC + TEST_DEPENDS + vtkTestingCore + ) diff --git a/IO/ParallelExodus/CMakeLists.txt b/IO/ParallelExodus/CMakeLists.txt new file mode 100644 index 00000000000..c3707e89cfb --- /dev/null +++ b/IO/ParallelExodus/CMakeLists.txt @@ -0,0 +1,8 @@ +find_package(MPI) +include_directories(${MPI_INCLUDE_PATH}) + +set(Module_SRCS + vtkPExodusIIReader.cxx + ) + +vtk_module_library(vtkIOParallelExodus ${Module_SRCS}) diff --git a/IO/ParallelExodus/module.cmake b/IO/ParallelExodus/module.cmake new file mode 100644 index 00000000000..2d98026c82a --- /dev/null +++ b/IO/ParallelExodus/module.cmake @@ -0,0 +1,6 @@ +vtk_module(vtkIOParallelExodus + DEPENDS + vtkParallelCore + vtkIOExodus + vtkexodusII + ) diff --git a/IO/ParallelLSDyna/CMakeLists.txt b/IO/ParallelLSDyna/CMakeLists.txt new file mode 100644 index 00000000000..2b4fcfdc36d --- /dev/null +++ b/IO/ParallelLSDyna/CMakeLists.txt @@ -0,0 +1,10 @@ +set(Module_SRCS + vtkPLSDynaReader.cxx + ) + +include_directories( + ${vtkIOLSDyna_SOURCE_DIR}/private + ${vtkIOLSDyna_BINARY_DIR}/private + ) + +vtk_module_library(vtkIOParallelLSDyna ${Module_SRCS}) diff --git a/IO/ParallelLSDyna/module.cmake b/IO/ParallelLSDyna/module.cmake new file mode 100644 index 00000000000..24ddcf9685f --- /dev/null +++ b/IO/ParallelLSDyna/module.cmake @@ -0,0 +1,6 @@ +vtk_module(vtkIOParallelLSDyna + DEPENDS + vtkParallelCore + vtkIOLSDyna + vtkCommonDataModel + ) diff --git a/IO/ParallelMPI/CMakeLists.txt b/IO/ParallelMPI/CMakeLists.txt new file mode 100644 index 00000000000..117d1bfb67c --- /dev/null +++ b/IO/ParallelMPI/CMakeLists.txt @@ -0,0 +1,8 @@ +find_package(MPI REQUIRED) +include_directories(${MPI_INCLUDE_PATH}) + +set(Module_SRCS + vtkMPIImageReader.cxx + ) + +vtk_module_library(vtkIOParallelMPI ${Module_SRCS}) diff --git a/IO/ParallelMPI/module.cmake b/IO/ParallelMPI/module.cmake new file mode 100644 index 00000000000..a1407ace97d --- /dev/null +++ b/IO/ParallelMPI/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkIOParallelMPI + GROUPS + MPI + DEPENDS + vtkParallelCore + vtkIOImage + ) diff --git a/IO/ParallelNetCDF/CMakeLists.txt b/IO/ParallelNetCDF/CMakeLists.txt new file mode 100644 index 00000000000..33dabf04160 --- /dev/null +++ b/IO/ParallelNetCDF/CMakeLists.txt @@ -0,0 +1,10 @@ +find_package(MPI) +include_directories(${MPI_INCLUDE_PATH}) + +set(Module_SRCS + vtkPNetCDFPOPReader.cxx + ) + +vtk_module_library(vtkIOParallelNetCDF ${Module_SRCS}) + +target_link_libraries(vtkIOParallelNetCDF vtkNetCDF_cxx) diff --git a/IO/ParallelNetCDF/module.cmake b/IO/ParallelNetCDF/module.cmake new file mode 100644 index 00000000000..8d3a1fbbda8 --- /dev/null +++ b/IO/ParallelNetCDF/module.cmake @@ -0,0 +1,9 @@ +vtk_module(vtkIOParallelNetCDF + GROUPS + MPI + DEPENDS + vtkCommonCore + vtkParallelMPI + COMPILE_DEPENDS + vtknetcdf + ) diff --git a/IO/PostgreSQL/CMakeLists.txt b/IO/PostgreSQL/CMakeLists.txt new file mode 100644 index 00000000000..a29d1075154 --- /dev/null +++ b/IO/PostgreSQL/CMakeLists.txt @@ -0,0 +1,17 @@ +find_package(PostgreSQL REQUIRED) + +set(PostgreSQL_SRCS + vtkPostgreSQLDatabase.cxx + vtkPostgreSQLQuery.cxx + vtkPostgreSQLToTableReader.cxx + vtkTableToPostgreSQLWriter.cxx + vtkIOPostgreSQL_AutoInit.cxx + ) + +set_source_files_properties(vtkIOPostgreSQL_AutoInit WRAP_EXCLUDE) + +include_directories(${PostgreSQL_INCLUDE_DIRS}) + +vtk_module_library(vtkIOPostgreSQL ${PostgreSQL_SRCS}) + +target_link_libraries(vtkIOPostgreSQL ${PostgreSQL_LIBRARY}) diff --git a/IO/PostgreSQL/Testing/Cxx/CMakeLists.txt b/IO/PostgreSQL/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..f9ecb7c91dc --- /dev/null +++ b/IO/PostgreSQL/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,28 @@ +if(VTK_MYSQL_TEST_URL) + create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestPostgreSQLDatabase + TestPostgreSQLTableReadWrite.cxx + EXTRA_INCLUDE vtkTestDriver.h + ) + + vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + + set(TestsToRun ${Tests}) + list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + + add_test(NAME ${vtk-module}Cxx-TestPostgreSQLDatabase + COMMAND ${vtk-module}CxxTests TestPostgreSQLDatabase) + + if(VTK_DATA_ROOT) + if(WIN32) + add_test(NAME ${vtk-module}Cxx-TestPostgreSQLTableReadWrite + COMMAND ${vtk-module}CxxTests TestPostgreSQLTableReadWrite + ${VTK_DATA_ROOT}/Baseline/IO/simple_table_win.vtk) + else() + add_test(NAME ${vtk-module}Cxx-TestPostgreSQLTableReadWrite + COMMAND ${vtk-module}CxxTests TestPostgreSQLTableReadWrite + ${VTK_DATA_ROOT}/Baseline/IO/simple_table.vtk) + endif() + endif() + +endif() diff --git a/IO/PostgreSQL/Testing/Cxx/TestPostgreSQLDatabase.cxx b/IO/PostgreSQL/Testing/Cxx/TestPostgreSQLDatabase.cxx index e192833e7be..844a0191102 100644 --- a/IO/PostgreSQL/Testing/Cxx/TestPostgreSQLDatabase.cxx +++ b/IO/PostgreSQL/Testing/Cxx/TestPostgreSQLDatabase.cxx @@ -31,7 +31,7 @@ #include "vtkVariantArray.h" #include "vtkStringArray.h" #include "vtkToolkits.h" - +#include "DatabaseSchemaWith2Tables.h" #include <vector> int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) @@ -228,7 +228,7 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) // Testing transformation of a schema into a PostgreSQL database // 1. Create the schema -#include "DatabaseSchemaWith2Tables.cxx" + DatabaseSchemaWith2Tables schema; // 2. Convert the schema into a PostgreSQL database cerr << "@@ Converting the schema into a PostgreSQL database..."; @@ -241,16 +241,14 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) cerr << "Couldn't open database.\nError: \"" << db->GetLastErrorText() << "\"\n"; - schema->Delete(); db->Delete(); return 1; } - status = db->EffectSchema( schema ); + status = db->EffectSchema( schema.GetSchema() ); if ( ! status ) { cerr << "Could not effect test schema.\n"; - schema->Delete(); db->Delete(); return 1; } @@ -264,7 +262,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -285,7 +282,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) << " != " << schema->GetNumberOfTables() << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -296,7 +292,7 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) // 4. Inspect these tables cerr << "@@ Inspecting these tables..." << "\n"; - + int tblHandle = schema.GetTableBHandle(); vtkStdString queryStr; for ( tblHandle = 0; tblHandle < numTbl; ++ tblHandle ) { @@ -312,7 +308,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) << " != " << tblName << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -326,7 +321,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -352,7 +346,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) << " != " << colName << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -371,7 +364,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) << " != " << schema->GetNumberOfColumnsInTable( tblHandle ) << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -386,7 +378,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -397,7 +388,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -408,7 +398,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -424,7 +413,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -442,7 +430,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) << " != " << dpts[numDpt] << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -459,7 +446,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) << " != " << 3 << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -478,7 +464,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -494,7 +479,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -503,7 +487,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) if ( ! query->NextRow() ) { cerr << "Query returned no results" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -525,7 +508,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -547,7 +529,6 @@ int TestPostgreSQLDatabase( int /*argc*/, char* /*argv*/[] ) // Clean up db->Delete(); - schema->Delete(); query->Delete(); return 0; diff --git a/IO/PostgreSQL/module.cmake b/IO/PostgreSQL/module.cmake new file mode 100644 index 00000000000..16af8180c28 --- /dev/null +++ b/IO/PostgreSQL/module.cmake @@ -0,0 +1,8 @@ +vtk_module(vtkIOPostgreSQL + DEPENDS + vtkCommonDataModel + IMPLEMENTS + vtkIOSQL + TEST_DEPENDS + vtkTestingIOSQL + ) diff --git a/IO/PostgreSQL/vtkIOPostgreSQL_AutoInit.cxx b/IO/PostgreSQL/vtkIOPostgreSQL_AutoInit.cxx new file mode 100644 index 00000000000..0f332150f5c --- /dev/null +++ b/IO/PostgreSQL/vtkIOPostgreSQL_AutoInit.cxx @@ -0,0 +1,61 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkIOPostgreSQL_AutoInit.cxx + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + + =========================================================================*/ + +#include "vtkPostgreSQLDatabase.h" + +#include <vtksys/SystemTools.hxx> + +#include <string> + +// Registration of PostgreSQL dynamically with the vtkSQLDatabase factory method. +vtkSQLDatabase * PostgreSQLCreateFunction(const char* URL) +{ + std::string urlstr(URL ? URL : ""); + std::string protocol, unused; + vtkPostgreSQLDatabase *db = 0; + + if (vtksys::SystemTools::ParseURLProtocol(urlstr, protocol, unused) && + protocol == "psql") + { + db = vtkPostgreSQLDatabase::New(); + db->ParseURL(URL); + } + + return db; +} + +static unsigned int vtkIOPostgreSQLCount; + +struct VTKIOPOSTGRESQL_EXPORT vtkIOPostgreSQL_AutoInit +{ + vtkIOPostgreSQL_AutoInit(); + ~vtkIOPostgreSQL_AutoInit(); +}; + +vtkIOPostgreSQL_AutoInit::vtkIOPostgreSQL_AutoInit() +{ + if (++vtkIOPostgreSQLCount == 1) + { + vtkSQLDatabase::RegisterCreateFromURLCallback(PostgreSQLCreateFunction); + } +} + +vtkIOPostgreSQL_AutoInit::~vtkIOPostgreSQL_AutoInit() +{ + if (--vtkIOPostgreSQLCount == 0) + { + vtkSQLDatabase::UnRegisterCreateFromURLCallback(PostgreSQLCreateFunction); + } +} diff --git a/IO/PostgreSQL/vtkPostgreSQLDatabase.cxx b/IO/PostgreSQL/vtkPostgreSQLDatabase.cxx index 76cbbd684d0..af3388cd3cc 100644 --- a/IO/PostgreSQL/vtkPostgreSQLDatabase.cxx +++ b/IO/PostgreSQL/vtkPostgreSQLDatabase.cxx @@ -26,8 +26,8 @@ #include "vtkObjectFactory.h" #include "vtkStringArray.h" -#include <vtksys/SystemTools.hxx> #include <vtksys/ios/sstream> +#include <vtksys/SystemTools.hxx> #include <vtkSmartPointer.h> #define VTK_CREATE(classname, varname) vtkSmartPointer<classname> varname = vtkSmartPointer<classname>::New() @@ -38,41 +38,6 @@ vtkStandardNewMacro(vtkPostgreSQLDatabase); -// Registration of PostgreSQL dynamically with the vtkSQLDatabase factory method. -vtkSQLDatabase * PostgreSQLCreateFunction(const char* URL) -{ - std::string urlstr(URL ? URL : ""); - std::string protocol, unused; - vtkPostgreSQLDatabase *db = 0; - - if (vtksys::SystemTools::ParseURLProtocol(urlstr, protocol, unused) && - protocol == "psql") - { - db = vtkPostgreSQLDatabase::New(); - db->ParseURL(URL); - } - - return db; -} - -class vtkPostgreSQLDatabaseRegister -{ -public: - vtkPostgreSQLDatabaseRegister() - { - vtkSQLDatabase::RegisterCreateFromURLCallback(PostgreSQLCreateFunction); - } - ~vtkPostgreSQLDatabaseRegister() - { - vtkSQLDatabase::UnRegisterCreateFromURLCallback(PostgreSQLCreateFunction); - } -}; - -// Remove ifndef in VTK 6.0: only register callback in old layout. -#ifndef VTK_USE_POSTGRES -static vtkPostgreSQLDatabaseRegister postgreSQLDataBaseRegister; -#endif - // ---------------------------------------------------------------------- vtkPostgreSQLDatabase::vtkPostgreSQLDatabase() { diff --git a/IO/SQL/CMakeLists.txt b/IO/SQL/CMakeLists.txt new file mode 100644 index 00000000000..a62a0b3a2d1 --- /dev/null +++ b/IO/SQL/CMakeLists.txt @@ -0,0 +1,30 @@ +set(Module_SRCS + vtkDatabaseToTableReader.cxx + vtkRowQuery.cxx + vtkRowQueryToTable.cxx + vtkSQLDatabase.cxx + # vtkSQLDatabaseGraphSource.cxx + vtkSQLDatabaseSchema.cxx + vtkSQLDatabaseTableSource.cxx + #vtkSQLGraphReader.cxx + vtkSQLQuery.cxx + vtkTableToDatabaseWriter.cxx + ) + +set(SQLite_SRCS + vtkSQLiteDatabase.cxx + vtkSQLiteQuery.cxx + vtkSQLiteToTableReader.cxx + vtkTableToSQLiteWriter.cxx + ) + +set_source_files_properties( + vtkDatabaseToTableReader + vtkRowQuery + vtkSQLDatabase + vtkSQLQuery + vtkTableToDatabaseWriter + ABSTRACT + ) + +vtk_module_library(vtkIOSQL ${Module_SRCS} ${SQLite_SRCS}) diff --git a/IO/SQL/Testing/Cxx/CMakeLists.txt b/IO/SQL/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..2ca44dbd757 --- /dev/null +++ b/IO/SQL/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,34 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestSQLDatabaseSchema.cxx + TestSQLiteDatabase.cxx + TestSQLiteTableReadWrite.cxx + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) +list(REMOVE_ITEM TestsToRun TestSQLiteTableReadWrite.cxx) + +if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-SQLiteTableReadWrite + COMMAND ${vtk-module}CxxTests TestSQLiteTableReadWrite + ${VTK_DATA_ROOT}/Baseline/IO/simple_table.vtk + ) +endif() + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/IO/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} COMMAND ${vtk-module}CxxTests ${TName}) + endif() + +endforeach() diff --git a/IO/SQL/Testing/Cxx/TestSQLDatabaseSchema.cxx b/IO/SQL/Testing/Cxx/TestSQLDatabaseSchema.cxx index ba017ae622c..6ca31a20145 100644 --- a/IO/SQL/Testing/Cxx/TestSQLDatabaseSchema.cxx +++ b/IO/SQL/Testing/Cxx/TestSQLDatabaseSchema.cxx @@ -22,7 +22,7 @@ PURPOSE. See the above copyright notice for more information. // for implementing this test. #include "vtkSQLDatabaseSchema.h" - +#include "DatabaseSchemaWith2Tables.h" #include "vtkStdString.h" #include <set> @@ -32,7 +32,7 @@ int TestSQLDatabaseSchema( int /*argc*/, char* /*argv*/[] ) bool status = true; // 1. Create the schema -#include "DatabaseSchemaWith2Tables.cxx" + DatabaseSchemaWith2Tables schema; // 2. Check the schema @@ -100,7 +100,7 @@ int TestSQLDatabaseSchema( int /*argc*/, char* /*argv*/[] ) colTypes.insert( static_cast<int>( vtkSQLDatabaseSchema::VARCHAR ) ); // Loop over all columns of the first table - tblHandle = 0; + int tblHandle = 0; int numCol = schema->GetNumberOfColumnsInTable( tblHandle ); if ( numCol != 3 ) { @@ -290,7 +290,5 @@ int TestSQLDatabaseSchema( int /*argc*/, char* /*argv*/[] ) } } - schema->Delete(); - return status ? 0 : 1; } diff --git a/IO/SQL/Testing/Cxx/TestSQLiteDatabase.cxx b/IO/SQL/Testing/Cxx/TestSQLiteDatabase.cxx index 492e99a2460..c394c45b403 100644 --- a/IO/SQL/Testing/Cxx/TestSQLiteDatabase.cxx +++ b/IO/SQL/Testing/Cxx/TestSQLiteDatabase.cxx @@ -29,6 +29,7 @@ #include "vtkTable.h" #include "vtkVariant.h" #include "vtkVariantArray.h" +#include "DatabaseSchemaWith2Tables.h" #include <vector> @@ -260,7 +261,7 @@ int TestSQLiteDatabase( int /*argc*/, char* /*argv*/[]) // Testing transformation of a schema into a SQLite database // 1. Create the schema -#include "DatabaseSchemaWith2Tables.cxx" + DatabaseSchemaWith2Tables schema; // 2. Convert the schema into a SQLite database cerr << "@@ Converting the schema into a SQLite database..."; @@ -274,7 +275,7 @@ int TestSQLiteDatabase( int /*argc*/, char* /*argv*/[]) return 1; } - status = dbSch->EffectSchema( schema ); + status = dbSch->EffectSchema( schema.GetSchema() ); if ( ! status ) { cerr << "Could not effect test schema.\n"; @@ -295,7 +296,8 @@ int TestSQLiteDatabase( int /*argc*/, char* /*argv*/[]) } std::vector<vtkStdString> tables; - for ( tblHandle = 0; query->NextRow(); ++ tblHandle ) + int tblHandle = 0; + for ( ; query->NextRow(); ++ tblHandle ) { vtkStdString tblNameSch( schema->GetTableNameFromHandle( tblHandle ) ); vtkStdString tblNameDB( query->DataValue( 0 ).ToString() ); @@ -341,7 +343,6 @@ int TestSQLiteDatabase( int /*argc*/, char* /*argv*/[]) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -357,7 +358,6 @@ int TestSQLiteDatabase( int /*argc*/, char* /*argv*/[]) if ( ! query->Execute() ) { cerr << "Query failed" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -366,7 +366,6 @@ int TestSQLiteDatabase( int /*argc*/, char* /*argv*/[]) if ( ! query->NextRow() ) { cerr << "Query returned no results" << endl; - schema->Delete(); query->Delete(); db->Delete(); return 1; @@ -396,7 +395,6 @@ int TestSQLiteDatabase( int /*argc*/, char* /*argv*/[]) // Clean up dbSch->Delete(); - schema->Delete(); query->Delete(); return 0; diff --git a/IO/SQL/module.cmake b/IO/SQL/module.cmake new file mode 100644 index 00000000000..80414bd169f --- /dev/null +++ b/IO/SQL/module.cmake @@ -0,0 +1,10 @@ +vtk_module(vtkIOSQL + GROUPS + StandAlone + DEPENDS + vtkIOCore + vtksqlite # We should consider splitting this into a module. + TEST_DEPENDS + vtkTestingIOSQL + vtkTestingCore + ) diff --git a/IO/Video/CMakeLists.txt b/IO/Video/CMakeLists.txt new file mode 100644 index 00000000000..2c09f5b0981 --- /dev/null +++ b/IO/Video/CMakeLists.txt @@ -0,0 +1,16 @@ +set(Module_SRCS + vtkVideoSource.cxx +) + +if(WIN32) + if(VTK_VFW_SUPPORTS_CAPTURE) + list(APPEND Module_SRCS vtkWin32VideoSource.cxx) + endif() + + if(VTK_USE_MATROX_IMAGING) + list(APPEND Module_SRCS vtkMILVideoSource.cxx) + # Include directory needed for vtkMILVideoSource.cxx. + endif() +endif() + +vtk_module_library(vtkIOVideo ${Module_SRCS}) diff --git a/IO/Video/module.cmake b/IO/Video/module.cmake new file mode 100644 index 00000000000..898d3fe6aa8 --- /dev/null +++ b/IO/Video/module.cmake @@ -0,0 +1,4 @@ +vtk_module(vtkIOVideo + DEPENDS + vtkCommonExecutionModel + ) diff --git a/IO/XML/CMakeLists.txt b/IO/XML/CMakeLists.txt new file mode 100644 index 00000000000..1defd17febe --- /dev/null +++ b/IO/XML/CMakeLists.txt @@ -0,0 +1,84 @@ +set(Module_SRCS + vtkRTXMLPolyDataReader.cxx + vtkXMLCompositeDataReader.cxx + vtkXMLCompositeDataWriter.cxx + vtkXMLDataParser.cxx + vtkXMLDataReader.cxx + vtkXMLDataSetWriter.cxx + vtkXMLFileReadTester.cxx + vtkXMLGenericDataObjectReader.cxx + vtkXMLHierarchicalBoxDataReader.cxx + vtkXMLHierarchicalBoxDataWriter.cxx + vtkXMLHierarchicalDataReader.cxx + vtkXMLHyperOctreeReader.cxx + vtkXMLHyperOctreeWriter.cxx + vtkXMLImageDataReader.cxx + vtkXMLImageDataWriter.cxx + vtkXMLMaterial.cxx + vtkXMLMaterialParser.cxx + vtkXMLMaterialReader.cxx + vtkXMLMultiBlockDataReader.cxx + vtkXMLMultiBlockDataWriter.cxx + vtkXMLMultiGroupDataReader.cxx + vtkXMLParser.cxx + vtkXMLPDataReader.cxx + vtkXMLPDataSetWriter.cxx + vtkXMLPDataWriter.cxx + vtkXMLPImageDataReader.cxx + vtkXMLPImageDataWriter.cxx + vtkXMLPolyDataReader.cxx + vtkXMLPolyDataWriter.cxx + vtkXMLPPolyDataReader.cxx + vtkXMLPPolyDataWriter.cxx + vtkXMLPRectilinearGridReader.cxx + vtkXMLPRectilinearGridWriter.cxx + vtkXMLPStructuredDataReader.cxx + vtkXMLPStructuredDataWriter.cxx + vtkXMLPStructuredGridReader.cxx + vtkXMLPStructuredGridWriter.cxx + vtkXMLPUnstructuredDataReader.cxx + vtkXMLPUnstructuredDataWriter.cxx + vtkXMLPUnstructuredGridReader.cxx + vtkXMLPUnstructuredGridWriter.cxx + vtkXMLReader.cxx + vtkXMLRectilinearGridReader.cxx + vtkXMLRectilinearGridWriter.cxx + vtkXMLShader.cxx + vtkXMLStructuredDataReader.cxx + vtkXMLStructuredDataWriter.cxx + vtkXMLStructuredGridReader.cxx + vtkXMLStructuredGridWriter.cxx + vtkXMLUnstructuredDataReader.cxx + vtkXMLUnstructuredDataWriter.cxx + vtkXMLUnstructuredGridReader.cxx + vtkXMLUnstructuredGridWriter.cxx + vtkXMLUtilities.cxx + vtkXMLWriterC.cxx + vtkXMLWriter.cxx + ) + +set_source_files_properties( + vtkXMLCompositeDataReader + vtkXMLCompositeDataWriter + vtkXMLDataReader + vtkXMLPDataReader + vtkXMLPDataWriter + vtkXMLPStructuredDataReader + vtkXMLPStructuredDataWriter + vtkXMLPUnstructuredDataReader + vtkXMLPUnstructuredDataWriter + vtkXMLReader + vtkXMLStructuredDataReader + vtkXMLStructuredDataWriter + vtkXMLUnstructuredDataReader + vtkXMLUnstructuredDataWriter + vtkXMLWriter + ABSTRACT + ) + +set_source_files_properties( + vtkXMLWriterC + WRAP_EXCLUDE + ) + +vtk_module_library(vtkIOXML ${Module_SRCS}) diff --git a/IO/XML/Testing/Cxx/CMakeLists.txt b/IO/XML/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..a5be40077bd --- /dev/null +++ b/IO/XML/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,31 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestDataObjectXMLIO.cxx + TestXML.cxx + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) +list(REMOVE_ITEM TestsToRun TestXML.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/IO/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() + +if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-XML + COMMAND ${vtk-module}CxxTests TestXML ${VTK_DATA_ROOT}/Data/sample.xml) +endif() diff --git a/IO/XML/module.cmake b/IO/XML/module.cmake new file mode 100644 index 00000000000..495a706b370 --- /dev/null +++ b/IO/XML/module.cmake @@ -0,0 +1,17 @@ +vtk_module(vtkIOXML + GROUPS + StandAlone + DEPENDS + vtkCommonDataModel + vtkCommonSystem + vtkCommonMisc + vtkIOCore + vtkIOGeometry + vtkexpat + TEST_DEPENDS + vtkTestingCore + vtkImagingSources + vtkFiltersSources + vtkInfovisCore + vtkFiltersCore + ) diff --git a/IO/XML/vtkXMLWriterC.h b/IO/XML/vtkXMLWriterC.h index 6397c134241..9398363f132 100644 --- a/IO/XML/vtkXMLWriterC.h +++ b/IO/XML/vtkXMLWriterC.h @@ -17,17 +17,6 @@ #include "vtkType.h" /* For scalar and vtkDataObject type enumerations. */ -/* Define the export macro. */ -#if defined(_WIN32) && defined(VTK_BUILD_SHARED_LIBS) -# if defined(vtkIO_EXPORTS) -# define VTK_XML_EXPORT __declspec(dllexport) -# else -# define VTK_XML_EXPORT __declspec(dllimport) -# endif -#else -# define VTK_XML_EXPORT -#endif - #ifdef __cplusplus extern "C" { @@ -276,7 +265,4 @@ void vtkXMLWriterC_Stop(vtkXMLWriterC* self); } /* extern "C" */ #endif /*cplusplus*/ -/* Done with export macro. */ -#undef VTK_XML_EXPORT - #endif diff --git a/Imaging/Color/CMakeLists.txt b/Imaging/Color/CMakeLists.txt new file mode 100644 index 00000000000..aa7652b8ad3 --- /dev/null +++ b/Imaging/Color/CMakeLists.txt @@ -0,0 +1,12 @@ +set(Module_SRCS + vtkImageHSIToRGB.cxx + vtkImageHSVToRGB.cxx + vtkImageLuminance.cxx + vtkImageMapToRGBA.cxx + vtkImageMapToWindowLevelColors.cxx + vtkImageQuantizeRGBToIndex.cxx + vtkImageRGBToHSI.cxx + vtkImageRGBToHSV.cxx + ) + +vtk_module_library(${vtk-module} ${Module_SRCS}) diff --git a/Imaging/Color/module.cmake b/Imaging/Color/module.cmake new file mode 100644 index 00000000000..d7cbc00bb55 --- /dev/null +++ b/Imaging/Color/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkImagingColor + GROUPS + Imaging + StandAlone + DEPENDS + vtkImagingCore + ) diff --git a/Imaging/Core/CMakeLists.txt b/Imaging/Core/CMakeLists.txt new file mode 100644 index 00000000000..ab331e6424c --- /dev/null +++ b/Imaging/Core/CMakeLists.txt @@ -0,0 +1,64 @@ +set(Module_SRCS + vtkImageStencilIterator.cxx + vtkExtractVOI.cxx + vtkImageAppendComponents.cxx + vtkImageAppend.cxx + vtkImageBlend.cxx + vtkImageCacheFilter.cxx + vtkImageCast.cxx + vtkImageChangeInformation.cxx + vtkImageClip.cxx + vtkImageConstantPad.cxx + vtkImageDataStreamer.cxx + vtkImageDecomposeFilter.cxx + vtkImageDifference.cxx + vtkImageExtractComponents.cxx + vtkImageIterateFilter.cxx + vtkImageMagnify.cxx + vtkImageMapToColors.cxx + vtkImageMaskBits.cxx + vtkImageMask.cxx + vtkImageMirrorPad.cxx + vtkImagePadFilter.cxx + vtkImagePermute.cxx + vtkImageResample.cxx + vtkImageReslice.cxx + vtkImageResliceToColors.cxx + vtkImageShiftScale.cxx + vtkImageShrink3D.cxx + vtkImageThreshold.cxx + vtkImageTranslateExtent.cxx + vtkImageWrapPad.cxx + vtkRTAnalyticSource.cxx + vtkImageResize.cxx + vtkImageBSplineCoefficients.cxx + + vtkImageStencilData.cxx + vtkImageStencilAlgorithm.cxx + vtkAbstractImageInterpolator.cxx + vtkImageBSplineInternals.cxx + vtkImageBSplineInterpolator.cxx + vtkImageSincInterpolator.cxx + vtkImageInterpolator.cxx + + vtkImageStencilSource.cxx # Needed by vtkImageStencilData + ) + +SET_SOURCE_FILES_PROPERTIES( + vtkAbstractImageInterpolator + vtkImageBSplineInternals + vtkImageDecomposeFilter + vtkImageFourierFilter + vtkImageIterateFilter + vtkImagePadFilter + vtkImageSpatialAlgorithm + ABSTRACT +) + +SET_SOURCE_FILES_PROPERTIES( + vtkImageStencilIterator + vtkImageBSplineInternals + WRAP_EXCLUDE +) + +vtk_module_library(vtkImagingCore ${Module_SRCS}) diff --git a/Imaging/Core/Testing/Cxx/CMakeLists.txt b/Imaging/Core/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..fb31ab3be03 --- /dev/null +++ b/Imaging/Core/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,57 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + TestImageStencilData.cxx + # FastSplatter.cxx # todo (unsatistfied deps) + ImageAccumulate.cxx + # ImageAutoRange.cxx # todo (unsatistfied deps) + ImageBSplineCoefficients.cxx + # ImageHistogram.cxx # todo (unsatistfied deps) + # ImageHistogramStatistics.cxx # todo (unsatistfied deps) + # ImageResize.cxx # todo (unsatistfied deps) + # ImageResize3D.cxx # todo (unsatistfied deps) + # ImageResizeCropping.cxx # todo (unsatistfied deps) + ImageWeightedSum.cxx + # ImportExport.cxx # todo (unsatistfied deps) + TestUpdateExtentReset.cxx + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) +list(REMOVE_ITEM TestsToRun TestImageStencilData.cxx) + +# The stencil test is special +if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-AddStencilData + COMMAND ${vtk-module}CxxTests TestImageStencilData 1 + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Hybrid/TestAddStencilData.png) + add_test(NAME ${vtk-module}Cxx-SubtractStencilData + COMMAND ${vtk-module}CxxTests TestImageStencilData 2 + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Hybrid/TestSubtractStencilData.png) + add_test(NAME ${vtk-module}Cxx-ClipStencilData + COMMAND ${vtk-module}CxxTests TestImageStencilData 3 + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Hybrid/TestClipStencilData.png) +endif() + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Imaging/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Imaging/Core/module.cmake b/Imaging/Core/module.cmake new file mode 100644 index 00000000000..05224bb9f33 --- /dev/null +++ b/Imaging/Core/module.cmake @@ -0,0 +1,22 @@ +vtk_module(vtkImagingCore + GROUPS + StandAlone + DEPENDS + vtkCommonSystem + vtkCommonTransforms + vtkCommonMath + vtkCommonComputationalGeometry + vtkCommonExecutionModel + vtkImagingMath + TEST_DEPENDS + vtkFiltersModeling + vtkFiltersGeneral + vtkFiltersHybrid + vtkRenderingCore + vtkTestingRendering + vtkInteractionStyle + vtkImagingStencil # Move tests + vtkImagingGeneral # Move tests + vtkImagingStatistics # Move tests + vtkRenderingImage # Move tests + ) diff --git a/Imaging/Core/vtkImageStencilIterator.cxx b/Imaging/Core/vtkImageStencilIterator.cxx index 90b3e157e5e..a45183538a6 100644 --- a/Imaging/Core/vtkImageStencilIterator.cxx +++ b/Imaging/Core/vtkImageStencilIterator.cxx @@ -17,24 +17,24 @@ #ifndef VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION -template class VTK_IMAGING_EXPORT vtkImageStencilIterator<signed char>; -template class VTK_IMAGING_EXPORT vtkImageStencilIterator<char>; -template class VTK_IMAGING_EXPORT vtkImageStencilIterator<int>; -template class VTK_IMAGING_EXPORT vtkImageStencilIterator<long>; -template class VTK_IMAGING_EXPORT vtkImageStencilIterator<short>; -template class VTK_IMAGING_EXPORT vtkImageStencilIterator<float>; -template class VTK_IMAGING_EXPORT vtkImageStencilIterator<double>; -template class VTK_IMAGING_EXPORT vtkImageStencilIterator<unsigned long>; -template class VTK_IMAGING_EXPORT vtkImageStencilIterator<unsigned short>; -template class VTK_IMAGING_EXPORT vtkImageStencilIterator<unsigned char>; -template class VTK_IMAGING_EXPORT vtkImageStencilIterator<unsigned int>; +template class VTKIMAGINGCORE_EXPORT vtkImageStencilIterator<signed char>; +template class VTKIMAGINGCORE_EXPORT vtkImageStencilIterator<char>; +template class VTKIMAGINGCORE_EXPORT vtkImageStencilIterator<int>; +template class VTKIMAGINGCORE_EXPORT vtkImageStencilIterator<long>; +template class VTKIMAGINGCORE_EXPORT vtkImageStencilIterator<short>; +template class VTKIMAGINGCORE_EXPORT vtkImageStencilIterator<float>; +template class VTKIMAGINGCORE_EXPORT vtkImageStencilIterator<double>; +template class VTKIMAGINGCORE_EXPORT vtkImageStencilIterator<unsigned long>; +template class VTKIMAGINGCORE_EXPORT vtkImageStencilIterator<unsigned short>; +template class VTKIMAGINGCORE_EXPORT vtkImageStencilIterator<unsigned char>; +template class VTKIMAGINGCORE_EXPORT vtkImageStencilIterator<unsigned int>; #if defined(VTK_TYPE_USE_LONG_LONG) -template class VTK_IMAGING_EXPORT vtkImageStencilIterator<long long>; -template class VTK_IMAGING_EXPORT vtkImageStencilIterator<unsigned long long>; +template class VTKIMAGINGCORE_EXPORT vtkImageStencilIterator<long long>; +template class VTKIMAGINGCORE_EXPORT vtkImageStencilIterator<unsigned long long>; #endif #if defined(VTK_TYPE_USE___INT64) -template class VTK_IMAGING_EXPORT vtkImageStencilIterator<__int64>; -template class VTK_IMAGING_EXPORT vtkImageStencilIterator<unsigned __int64>; +template class VTKIMAGINGCORE_EXPORT vtkImageStencilIterator<__int64>; +template class VTKIMAGINGCORE_EXPORT vtkImageStencilIterator<unsigned __int64>; #endif #endif diff --git a/Imaging/Fourier/CMakeLists.txt b/Imaging/Fourier/CMakeLists.txt new file mode 100644 index 00000000000..13a8d79f4f6 --- /dev/null +++ b/Imaging/Fourier/CMakeLists.txt @@ -0,0 +1,14 @@ +set(Module_SRCS + vtkImageFlip.cxx + vtkImageFFT.cxx + vtkImageFourierCenter.cxx + vtkImageFourierFilter.cxx + vtkImageRFFT.cxx + ) + +set_source_files_properties( + vtkImageFourierFilter + ABSTRACT + ) + +vtk_module_library(${vtk-module} ${Module_SRCS}) diff --git a/Imaging/Fourier/module.cmake b/Imaging/Fourier/module.cmake new file mode 100644 index 00000000000..e4bec9ee152 --- /dev/null +++ b/Imaging/Fourier/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkImagingFourier + GROUPS + Imaging + StandAlone + DEPENDS + vtkImagingCore + ) diff --git a/Imaging/General/CMakeLists.txt b/Imaging/General/CMakeLists.txt new file mode 100644 index 00000000000..b84870be2c9 --- /dev/null +++ b/Imaging/General/CMakeLists.txt @@ -0,0 +1,32 @@ +set(Module_SRCS + vtkImageAnisotropicDiffusion2D.cxx + vtkImageAnisotropicDiffusion3D.cxx + vtkImageButterworthHighPass.cxx + vtkImageButterworthLowPass.cxx + vtkImageCheckerboard.cxx + vtkImageCityBlockDistance.cxx + vtkImageConvolve.cxx + vtkImageCorrelation.cxx + vtkImageEuclideanDistance.cxx + vtkImageEuclideanToPolar.cxx + vtkImageGaussianSmooth.cxx + vtkImageGradient.cxx + vtkImageGradientMagnitude.cxx + vtkImageHybridMedian2D.cxx + vtkImageIdealHighPass.cxx + vtkImageIdealLowPass.cxx + vtkImageLaplacian.cxx + vtkImageMedian3D.cxx + vtkImageNormalize.cxx + vtkImageRange3D.cxx + vtkImageSeparableConvolution.cxx + vtkImageSobel2D.cxx + vtkImageSobel3D.cxx + vtkImageSpatialAlgorithm.cxx + vtkImageVariance3D.cxx + vtkSimpleImageFilterExample.cxx + vtkImageSlab.cxx + vtkImageSlabReslice.cxx + ) + +vtk_module_library(${vtk-module} ${Module_SRCS}) diff --git a/Imaging/General/module.cmake b/Imaging/General/module.cmake new file mode 100644 index 00000000000..306c0830efd --- /dev/null +++ b/Imaging/General/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkImagingGeneral + GROUPS + Imaging + StandAlone + DEPENDS + vtkImagingSources + ) diff --git a/Imaging/Hybrid/CMakeLists.txt b/Imaging/Hybrid/CMakeLists.txt new file mode 100644 index 00000000000..24fe67f6b27 --- /dev/null +++ b/Imaging/Hybrid/CMakeLists.txt @@ -0,0 +1,15 @@ +set(Module_SRCS + vtkBooleanTexture.cxx + vtkShepardMethod.cxx + vtkVoxelModeller.cxx + vtkSurfaceReconstructionFilter.cxx + vtkFastSplatter.cxx + vtkGaussianSplatter.cxx + vtkSampleFunction.cxx + vtkPointLoad.cxx + vtkImageCursor3D.cxx + vtkImageRectilinearWipe.cxx + vtkTriangularTexture.cxx + ) + +vtk_module_library(${vtk-module} ${Module_SRCS}) diff --git a/Imaging/Hybrid/module.cmake b/Imaging/Hybrid/module.cmake new file mode 100644 index 00000000000..e842fd7310f --- /dev/null +++ b/Imaging/Hybrid/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkImagingHybrid + GROUPS + Imaging + StandAlone + DEPENDS + vtkImagingCore + ) diff --git a/Imaging/Math/CMakeLists.txt b/Imaging/Math/CMakeLists.txt new file mode 100644 index 00000000000..b5735351444 --- /dev/null +++ b/Imaging/Math/CMakeLists.txt @@ -0,0 +1,11 @@ +set(Module_SRCS + vtkImageDivergence.cxx + vtkImageDotProduct.cxx + vtkImageLogarithmicScale.cxx + vtkImageLogic.cxx + vtkImageMagnitude.cxx + vtkImageMathematics.cxx + vtkImageWeightedSum.cxx + ) + +vtk_module_library(${vtk-module} ${Module_SRCS}) diff --git a/Imaging/Math/module.cmake b/Imaging/Math/module.cmake new file mode 100644 index 00000000000..b686f0afab5 --- /dev/null +++ b/Imaging/Math/module.cmake @@ -0,0 +1,8 @@ +vtk_module(vtkImagingMath + GROUPS + Imaging + StandAlone + DEPENDS + vtkCommonDataModel + vtkCommonExecutionModel + ) diff --git a/Imaging/Morphological/CMakeLists.txt b/Imaging/Morphological/CMakeLists.txt new file mode 100644 index 00000000000..03e8ec0eb89 --- /dev/null +++ b/Imaging/Morphological/CMakeLists.txt @@ -0,0 +1,14 @@ +set(Module_SRCS + vtkImageConnector.cxx + vtkImageContinuousDilate3D.cxx + vtkImageContinuousErode3D.cxx + vtkImageDilateErode3D.cxx + vtkImageIslandRemoval2D.cxx + vtkImageNonMaximumSuppression.cxx + vtkImageOpenClose3D.cxx + vtkImageSeedConnectivity.cxx + vtkImageSkeleton2D.cxx + vtkImageThresholdConnectivity.cxx + ) + +vtk_module_library(${vtk-module} ${Module_SRCS}) diff --git a/Imaging/Morphological/module.cmake b/Imaging/Morphological/module.cmake new file mode 100644 index 00000000000..aaafacbcbf9 --- /dev/null +++ b/Imaging/Morphological/module.cmake @@ -0,0 +1,8 @@ +vtk_module(vtkImagingMorphological + GROUPS + Imaging + StandAlone + DEPENDS + vtkImagingCore + vtkImagingGeneral + ) diff --git a/Imaging/Sources/CMakeLists.txt b/Imaging/Sources/CMakeLists.txt new file mode 100644 index 00000000000..ad3ebef6c1a --- /dev/null +++ b/Imaging/Sources/CMakeLists.txt @@ -0,0 +1,11 @@ +set(Module_SRCS + vtkImageCanvasSource2D.cxx + vtkImageEllipsoidSource.cxx + vtkImageGaussianSource.cxx + vtkImageGridSource.cxx + vtkImageMandelbrotSource.cxx + vtkImageNoiseSource.cxx + vtkImageSinusoidSource.cxx + ) + +vtk_module_library(${vtk-module} ${Module_SRCS}) diff --git a/Imaging/Sources/module.cmake b/Imaging/Sources/module.cmake new file mode 100644 index 00000000000..77b7acb7b8b --- /dev/null +++ b/Imaging/Sources/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkImagingSources + GROUPS + Imaging + StandAlone + DEPENDS + vtkImagingCore + ) diff --git a/Imaging/Statistics/CMakeLists.txt b/Imaging/Statistics/CMakeLists.txt new file mode 100644 index 00000000000..9226da93a48 --- /dev/null +++ b/Imaging/Statistics/CMakeLists.txt @@ -0,0 +1,7 @@ +set(Module_SRCS + vtkImageAccumulate.cxx + vtkImageHistogram.cxx + vtkImageHistogramStatistics.cxx + ) + +vtk_module_library(${vtk-module} ${Module_SRCS}) diff --git a/Imaging/Statistics/module.cmake b/Imaging/Statistics/module.cmake new file mode 100644 index 00000000000..2506972b7e7 --- /dev/null +++ b/Imaging/Statistics/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkImagingStatistics + GROUPS + Imaging + StandAlone + DEPENDS + vtkImagingCore + ) diff --git a/Imaging/Stencil/CMakeLists.txt b/Imaging/Stencil/CMakeLists.txt new file mode 100644 index 00000000000..b36bcbe0ee2 --- /dev/null +++ b/Imaging/Stencil/CMakeLists.txt @@ -0,0 +1,11 @@ +set(Module_SRCS + vtkImageStencil.cxx + vtkImageStencilToImage.cxx + vtkImageToImageStencil.cxx + vtkImplicitFunctionToImageStencil.cxx + vtkLassoStencilSource.cxx + vtkPolyDataToImageStencil.cxx + vtkROIStencilSource.cxx + ) + +vtk_module_library(${vtk-module} ${Module_SRCS}) diff --git a/Imaging/Stencil/module.cmake b/Imaging/Stencil/module.cmake new file mode 100644 index 00000000000..059e0266af4 --- /dev/null +++ b/Imaging/Stencil/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkImagingStencil + GROUPS + Imaging + StandAlone + DEPENDS + vtkImagingCore + ) diff --git a/Infovis/Boost/CMakeLists.txt b/Infovis/Boost/CMakeLists.txt new file mode 100644 index 00000000000..0dfba0cb7d7 --- /dev/null +++ b/Infovis/Boost/CMakeLists.txt @@ -0,0 +1 @@ +vtk_module_impl() diff --git a/Infovis/Boost/Testing/Cxx/CMakeLists.txt b/Infovis/Boost/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..7ec6331176f --- /dev/null +++ b/Infovis/Boost/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,11 @@ +find_package(Boost REQUIRED + COMPONENTS serialization + ) +include_directories(${Boost_INCLUDE_DIRS}) + +vtk_module_test_executable(TestVariantSerialization TestVariantSerialization.cxx + ) + +target_link_libraries(TestVariantSerialization ${Boost_SERIALIZATION_LIBRARY}) + +add_test(NAME ${vtk-module}-TestVariantSerialization COMMAND TestVariantSerialization) diff --git a/Infovis/Boost/module.cmake b/Infovis/Boost/module.cmake new file mode 100644 index 00000000000..fc26be87b71 --- /dev/null +++ b/Infovis/Boost/module.cmake @@ -0,0 +1,6 @@ +vtk_module(vtkInfovisBoost + TEST_DEPENDS + vtkTestingCore + vtkCommonCore + EXCLUDE_FROM_WRAPPING + ) diff --git a/Infovis/BoostGraphAlgorithms/CMakeLists.txt b/Infovis/BoostGraphAlgorithms/CMakeLists.txt new file mode 100644 index 00000000000..6e3e8507755 --- /dev/null +++ b/Infovis/BoostGraphAlgorithms/CMakeLists.txt @@ -0,0 +1,19 @@ +find_package(Boost REQUIRED) +include_directories(${Boost_INCLUDE_DIRS}) + +set(Module_SRCS + vtkBoostBetweennessClustering.cxx + vtkBoostBiconnectedComponents.cxx + vtkBoostBrandesCentrality.cxx + vtkBoostBreadthFirstSearch.cxx + vtkBoostBreadthFirstSearchTree.cxx + vtkBoostConnectedComponents.cxx + vtkBoostExtractLargestComponent.cxx + vtkBoostKruskalMinimumSpanningTree.cxx + vtkBoostLogWeighting.cxx + vtkBoostPrimMinimumSpanningTree.cxx + vtkBoostRandomSparseArraySource.cxx + vtkBoostSplitTableField.cxx + ) + +vtk_module_library(vtkInfovisBoostGraphAlgorithms ${Module_SRCS}) diff --git a/Infovis/BoostGraphAlgorithms/Testing/Cxx/CMakeLists.txt b/Infovis/BoostGraphAlgorithms/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..79a5063fb2f --- /dev/null +++ b/Infovis/BoostGraphAlgorithms/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,32 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + # BoostArrayLogWeighting.cxx # todo (unsatisfied deps) + BoostArrayRandomSparseArraySource.cxx + TestBoostAdapter.cxx + TestBoostAlgorithms.cxx + TestBoostBetweennessClustering.cxx + # TestBoostBrandesCentrality.cxx # todo (unsatisfied deps) + TestBoostExtractLargestComponent.cxx + TestBoostSplitTableField.cxx + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Infovis/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Infovis/BoostGraphAlgorithms/module.cmake b/Infovis/BoostGraphAlgorithms/module.cmake new file mode 100644 index 00000000000..e8191c3e1ce --- /dev/null +++ b/Infovis/BoostGraphAlgorithms/module.cmake @@ -0,0 +1,9 @@ +vtk_module(vtkInfovisBoostGraphAlgorithms + DEPENDS + vtkInfovisCore + vtkCommonExecutionModel + TEST_DEPENDS + vtkRenderingOpenGL + vtkTestingRendering + vtkIOInfovis + ) diff --git a/Infovis/Core/CMakeLists.txt b/Infovis/Core/CMakeLists.txt new file mode 100644 index 00000000000..1d3982ee915 --- /dev/null +++ b/Infovis/Core/CMakeLists.txt @@ -0,0 +1,41 @@ +set(Module_SRCS + vtkAddMembershipArray.cxx + vtkAdjacencyMatrixToEdgeTable.cxx + vtkArrayNorm.cxx + vtkArrayToTable.cxx + vtkCollapseGraph.cxx + vtkCollapseVerticesByArray.cxx + vtkDataObjectToTable.cxx + vtkEdgeCenters.cxx + vtkExpandSelectedGraph.cxx + vtkExtractSelectedGraph.cxx + vtkGenerateIndexArray.cxx + vtkGraphHierarchicalBundleEdges.cxx + vtkGroupLeafVertices.cxx + vtkMergeColumns.cxx + vtkMergeGraphs.cxx + vtkMergeTables.cxx + vtkMutableGraphHelper.cxx + vtkNetworkHierarchy.cxx + vtkPruneTreeFilter.cxx + vtkRandomGraphSource.cxx + vtkRemoveIsolatedVertices.cxx + vtkSparseArrayToTable.cxx + vtkStreamGraph.cxx + vtkStringToCategory.cxx + vtkStringToNumeric.cxx + vtkTableToArray.cxx + vtkTableToGraph.cxx + vtkTableToSparseArray.cxx + vtkTableToTreeFilter.cxx + vtkThresholdGraph.cxx + vtkThresholdTable.cxx + vtkTransposeMatrix.cxx + vtkTreeFieldAggregator.cxx + vtkTreeLevelsFilter.cxx + vtkVertexDegree.cxx + vtkRemoveHiddenData.cxx + vtkKCoreDecomposition.cxx + ) + +vtk_module_library(vtkInfovisCore ${Module_SRCS}) diff --git a/Infovis/Core/Testing/Cxx/CMakeLists.txt b/Infovis/Core/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..04a953aef3d --- /dev/null +++ b/Infovis/Core/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,43 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + ArraySparseArrayToTable.cxx + ArrayTableToSparseArray.cxx + ArrayToTable.cxx + ArrayTransposeMatrix.cxx + # TestArrayNorm.cxx # todo (unsatisfied deps) + TestCollapseVerticesByArray.cxx + # TestConvexHull2D.cxx # todo (unsatisfied deps) + TestDataObjectToTable.cxx + TestExtractSelectedGraph.cxx + TestGraphAlgorithms.cxx + TestMergeGraphs.cxx + TestMergeTables.cxx + TestRandomGraphSource.cxx + TestRemoveIsolatedVertices.cxx + TestStreamGraph.cxx + TestStringToNumeric.cxx + TestTableToArray.cxx + TestThresholdTable.cxx + # TestTimePoint.cxx # deprecated dep + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Infovis/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Infovis/Core/module.cmake b/Infovis/Core/module.cmake new file mode 100644 index 00000000000..73b2fb46ead --- /dev/null +++ b/Infovis/Core/module.cmake @@ -0,0 +1,13 @@ +vtk_module(vtkInfovisCore + GROUPS + StandAlone + DEPENDS + vtkCommonDataModel + vtkCommonSystem + vtkFiltersExtraction + TEST_DEPENDS + vtkInfovisLayout + vtkRenderingOpenGL + vtkTestingRendering + vtkIOInfovis + ) diff --git a/Infovis/Layout/CMakeLists.txt b/Infovis/Layout/CMakeLists.txt new file mode 100644 index 00000000000..0d658d93d52 --- /dev/null +++ b/Infovis/Layout/CMakeLists.txt @@ -0,0 +1,56 @@ +set(Module_SRCS + vtkArcParallelEdgeStrategy.cxx + vtkAreaLayout.cxx + vtkAreaLayoutStrategy.cxx + vtkAssignCoordinates.cxx + vtkAssignCoordinatesLayoutStrategy.cxx + vtkAttributeClustering2DLayoutStrategy.cxx + vtkBoxLayoutStrategy.cxx + vtkCirclePackFrontChainLayoutStrategy.cxx + vtkCirclePackLayout.cxx + vtkCirclePackLayoutStrategy.cxx + vtkCirclePackToPolyData.cxx + vtkCircularLayoutStrategy.cxx + vtkClustering2DLayoutStrategy.cxx + vtkCommunity2DLayoutStrategy.cxx + vtkConeLayoutStrategy.cxx + vtkConstrained2DLayoutStrategy.cxx + vtkCosmicTreeLayoutStrategy.cxx + vtkEdgeLayout.cxx + vtkEdgeLayoutStrategy.cxx + vtkFast2DLayoutStrategy.cxx + vtkForceDirectedLayoutStrategy.cxx + vtkGeoEdgeStrategy.cxx + vtkGeoMath.cxx + vtkGraphLayout.cxx + vtkGraphLayoutStrategy.cxx + vtkPassThroughEdgeStrategy.cxx + vtkPassThroughLayoutStrategy.cxx + vtkPerturbCoincidentVertices.cxx + vtkRandomLayoutStrategy.cxx + vtkSimple2DLayoutStrategy.cxx + vtkSimple3DCirclesStrategy.cxx + vtkSliceAndDiceLayoutStrategy.cxx + vtkSpanTreeLayoutStrategy.cxx + vtkSplineGraphEdges.cxx + vtkSquarifyLayoutStrategy.cxx + vtkStackedTreeLayoutStrategy.cxx + vtkTreeLayoutStrategy.cxx + vtkTreeMapLayout.cxx + vtkTreeMapLayoutStrategy.cxx + vtkTreeMapToPolyData.cxx + vtkTreeOrbitLayoutStrategy.cxx + vtkTreeRingToPolyData.cxx + vtkKCoreLayout.cxx + ) + +set_source_files_properties( + vtkAreaLayoutStrategy.cxx + vtkCirclePackLayoutStrategy.cxx + vtkEdgeLayoutStrategy.cxx + vtkGraphLayoutStrategy.cxx + vtkTreeMapLayoutStrategy.cxx + ABSTRACT + ) + +vtk_module_library(vtkInfovisLayout ${Module_SRCS}) diff --git a/Infovis/Layout/Testing/Cxx/CMakeLists.txt b/Infovis/Layout/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..3a9896e92e4 --- /dev/null +++ b/Infovis/Layout/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,30 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + # TestAssignCoordinates.cxx # todo (unsatisfied deps) + # TestChacoGraphReader.cxx # todo (unsatisfied deps) + TestCirclePackLayoutStrategy.cxx + # TestCosmicTreeLayoutStrategy.cxx # todo (unsatisfied deps) + TestGraphLayoutStrategy.cxx + TestTreeMapLayoutStrategy.cxx + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Infovis/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Infovis/Layout/module.cmake b/Infovis/Layout/module.cmake new file mode 100644 index 00000000000..dc5461f3eaa --- /dev/null +++ b/Infovis/Layout/module.cmake @@ -0,0 +1,14 @@ +vtk_module(vtkInfovisLayout + GROUPS + StandAlone + DEPENDS + vtkCommonExecutionModel + vtkImagingHybrid + vtkFiltersModeling + vtkInfovisCore + TEST_DEPENDS + vtkRenderingLabel + vtkRenderingOpenGL + vtkTestingRendering + vtkIOInfovis + ) diff --git a/Infovis/Parallel/CMakeLists.txt b/Infovis/Parallel/CMakeLists.txt new file mode 100644 index 00000000000..b8fd20348a7 --- /dev/null +++ b/Infovis/Parallel/CMakeLists.txt @@ -0,0 +1,21 @@ +find_package(Boost 1.40.0 REQUIRED + COMPONENTS serialization mpi filesystem system graph_parallel) +include_directories(${Boost_INCLUDE_DIRS}) + +set(Module_SRCS + vtkPBGLBreadthFirstSearch.cxx + vtkPBGLCollapseGraph.cxx + vtkPBGLCollapseParallelEdges.cxx + vtkPBGLCollectGraph.cxx + vtkPBGLConnectedComponents.cxx + vtkPBGLDistributedGraphHelper.cxx + vtkPBGLGraphSQLReader.cxx + vtkPBGLMinimumSpanningTree.cxx + vtkPBGLRandomGraphSource.cxx + vtkPBGLRMATGraphSource.cxx + vtkPBGLShortestPaths.cxx + vtkPBGLVertexColoring.cxx + ) + +vtk_module_library(vtkInfovisParallel ${Module_SRCS}) +target_link_libraries(vtkInfovisParallel ${Boost_LIBRARIES}) diff --git a/Infovis/Parallel/module.cmake b/Infovis/Parallel/module.cmake new file mode 100644 index 00000000000..98db1009969 --- /dev/null +++ b/Infovis/Parallel/module.cmake @@ -0,0 +1,10 @@ +vtk_module(vtkInfovisParallel + DEPENDS + vtkInfovisBoost + vtkInfovisBoostGraphAlgorithms + vtkCommonExecutionModel + vtkParallelMPI + vtkFiltersParallel + vtkIOSQL + EXCLUDE_FROM_ALL + ) diff --git a/Interaction/Style/CMakeLists.txt b/Interaction/Style/CMakeLists.txt new file mode 100644 index 00000000000..dc8a212ff15 --- /dev/null +++ b/Interaction/Style/CMakeLists.txt @@ -0,0 +1,53 @@ +set(Module_SRCS + vtkInteractorStyleFlight.cxx + vtkInteractorStyleImage.cxx + vtkInteractorStyleJoystickActor.cxx + vtkInteractorStyleJoystickCamera.cxx + vtkInteractorStyleRubberBand2D.cxx + vtkInteractorStyleRubberBand3D.cxx + vtkInteractorStyleRubberBandPick.cxx + vtkInteractorStyleRubberBandZoom.cxx + vtkInteractorStyleTerrain.cxx + vtkInteractorStyleTrackballActor.cxx + vtkInteractorStyleTrackballCamera.cxx + vtkInteractorStyleTrackball.cxx + vtkInteractorStyleUnicam.cxx + vtkInteractorStyleUser.cxx + + vtkInteractorStyleSwitch.cxx + vtkParallelCoordinatesInteractorStyle.cxx + + ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx + ) + +set_source_files_properties( + ${vtk-module}ObjectFactory + WRAP_EXCLUDE + ) + +# Now to generate our object factory. +set(vtk_module_overrides "vtkInteractorStyleSwitchBase") +set(vtk_module_vtkInteractorStyleSwitchBase_override "vtkInteractorStyleSwitch") + +# Now we iterate and create that class file... +foreach(_class ${vtk_module_overrides}) + set(_override ${vtk_module_${_class}_override}) + set(_vtk_override_includes "${_vtk_override_includes} +#include \"${_override}.h\"") + set(_vtk_override_creates "${_vtk_override_creates} +VTK_CREATE_CREATE_FUNCTION(${_override})") + set(_vtk_override_do "${_vtk_override_do} + this->RegisterOverride(\"${_class}\", + \"${_override}\", + \"Override for ${vtk-module} module\", 1, + vtkObjectFactoryCreate${_override});") +endforeach() + +# Now lets create the object factory classes +string(TOUPPER ${vtk-module} VTK-MODULE) +configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in + ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h) +configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in + ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx) + +vtk_module_library(vtkInteractionStyle ${Module_SRCS}) diff --git a/Interaction/Style/module.cmake b/Interaction/Style/module.cmake new file mode 100644 index 00000000000..20be7f0be1b --- /dev/null +++ b/Interaction/Style/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkInteractionStyle + GROUPS + Rendering + StandAlone + IMPLEMENTS + vtkRenderingCore + ) diff --git a/Interaction/Widgets/CMakeLists.txt b/Interaction/Widgets/CMakeLists.txt new file mode 100644 index 00000000000..83b6e1d0f94 --- /dev/null +++ b/Interaction/Widgets/CMakeLists.txt @@ -0,0 +1,157 @@ +set(Module_SRCS + vtk3DWidget.cxx + vtkAbstractPolygonalHandleRepresentation3D.cxx + vtkAbstractWidget.cxx + vtkAffineRepresentation2D.cxx + vtkAffineRepresentation.cxx + vtkAffineWidget.cxx + vtkAngleRepresentation2D.cxx + vtkAngleRepresentation3D.cxx + vtkAngleRepresentation.cxx + vtkAngleWidget.cxx + vtkAxesTransformRepresentation.cxx + vtkAxesTransformWidget.cxx + vtkBalloonRepresentation.cxx + vtkBalloonWidget.cxx + vtkBezierContourLineInterpolator.cxx + vtkBiDimensionalRepresentation2D.cxx + vtkBiDimensionalRepresentation.cxx + vtkBiDimensionalWidget.cxx + vtkBorderRepresentation.cxx + vtkBorderWidget.cxx + vtkBoundedPlanePointPlacer.cxx + vtkBoxRepresentation.cxx + vtkBoxWidget2.cxx + vtkBoxWidget.cxx + vtkBrokenLineWidget.cxx + vtkButtonRepresentation.cxx + vtkButtonWidget.cxx + vtkCameraRepresentation.cxx + vtkCameraWidget.cxx + vtkCaptionRepresentation.cxx + vtkCaptionWidget.cxx + vtkCellCentersPointPlacer.cxx + vtkCenteredSliderRepresentation.cxx + vtkCenteredSliderWidget.cxx + vtkCheckerboardRepresentation.cxx + vtkCheckerboardWidget.cxx + vtkClosedSurfacePointPlacer.cxx + vtkConstrainedPointHandleRepresentation.cxx + vtkContinuousValueWidget.cxx + vtkContinuousValueWidgetRepresentation.cxx + vtkContourLineInterpolator.cxx + vtkContourRepresentation.cxx + vtkContourWidget.cxx + vtkDijkstraImageContourLineInterpolator.cxx + vtkDistanceRepresentation2D.cxx + vtkDistanceRepresentation3D.cxx + vtkDistanceRepresentation.cxx + vtkDistanceWidget.cxx + vtkEllipsoidTensorProbeRepresentation.cxx + vtkEvent.cxx + vtkFixedSizeHandleRepresentation3D.cxx + vtkFocalPlaneContourRepresentation.cxx + vtkFocalPlanePointPlacer.cxx + vtkHandleRepresentation.cxx + vtkHandleWidget.cxx + vtkHoverWidget.cxx + vtkImageActorPointPlacer.cxx + vtkImageCroppingRegionsWidget.cxx + vtkImageOrthoPlanes.cxx + vtkImagePlaneWidget.cxx + vtkImageTracerWidget.cxx + vtkImplicitPlaneRepresentation.cxx + vtkImplicitPlaneWidget2.cxx + vtkImplicitPlaneWidget.cxx + vtkLinearContourLineInterpolator.cxx + vtkLineRepresentation.cxx + vtkLineWidget2.cxx + vtkLineWidget.cxx + vtkLogoRepresentation.cxx + vtkLogoWidget.cxx + vtkOrientationMarkerWidget.cxx + vtkOrientedGlyphContourRepresentation.cxx + vtkOrientedGlyphFocalPlaneContourRepresentation.cxx + vtkOrientedPolygonalHandleRepresentation3D.cxx + vtkParallelopipedRepresentation.cxx + vtkParallelopipedWidget.cxx + vtkPlaneWidget.cxx + vtkPlaybackRepresentation.cxx + vtkPlaybackWidget.cxx + vtkPointHandleRepresentation2D.cxx + vtkPointHandleRepresentation3D.cxx + vtkPointPlacer.cxx + vtkPointWidget.cxx + vtkPolyDataContourLineInterpolator.cxx + vtkPolyDataPointPlacer.cxx + vtkPolyDataSourceWidget.cxx + vtkPolygonalHandleRepresentation3D.cxx + vtkPolygonalSurfaceContourLineInterpolator.cxx + vtkPolygonalSurfacePointPlacer.cxx + vtkProp3DButtonRepresentation.cxx + vtkRectilinearWipeRepresentation.cxx + vtkRectilinearWipeWidget.cxx + vtkScalarBarRepresentation.cxx + vtkScalarBarWidget.cxx + vtkSeedRepresentation.cxx + vtkSeedWidget.cxx + vtkSliderRepresentation2D.cxx + vtkSliderRepresentation3D.cxx + vtkSliderRepresentation.cxx + vtkSliderWidget.cxx + vtkSphereHandleRepresentation.cxx + vtkSphereRepresentation.cxx + vtkSphereWidget2.cxx + vtkSphereWidget.cxx + vtkSplineRepresentation.cxx + vtkSplineWidget2.cxx + vtkSplineWidget.cxx + vtkTensorProbeRepresentation.cxx + vtkTensorProbeWidget.cxx + vtkTerrainContourLineInterpolator.cxx + vtkTerrainDataPointPlacer.cxx + vtkTextRepresentation.cxx + vtkTexturedButtonRepresentation2D.cxx + vtkTexturedButtonRepresentation.cxx + vtkTextWidget.cxx + vtkWidgetCallbackMapper.cxx + vtkWidgetEvent.cxx + vtkWidgetEventTranslator.cxx + vtkWidgetRepresentation.cxx + vtkWidgetSet.cxx + vtkXYPlotWidget.cxx + vtkResliceCursorLineRepresentation.cxx + vtkResliceCursorRepresentation.cxx + vtkResliceCursorThickLineRepresentation.cxx + vtkResliceCursorWidget.cxx + vtkResliceCursorActor.cxx + vtkResliceCursorPicker.cxx + vtkResliceCursor.cxx + vtkResliceCursorPolyDataAlgorithm.cxx + ) + +set_source_files_properties( + vtk3DWidget + vtkAbstractWidget + vtkAbstractPolygonalHandleRepresentation3D + vtkAffineRepresentation + vtkAngleRepresentation + vtkBiDimensionalRepresentation + vtkButtonRepresentation + vtkContinuousValueWidget + vtkContinuousValueWidgetRepresentation + vtkContourLineInterpolator + vtkContourRepresentation + vtkFocalPlaneContourRepresentation + vtkDistanceRepresentation + vtkHandleRepresentation + vtkPolyDataContourLineInterpolator + vtkPolyDataSourceWidget + vtkResliceCursorRepresentation + vtkSliderRepresentation + vtkTensorProbeRepresentation + vtkWidgetRepresentation + ABSTRACT + ) + +vtk_module_library(vtkInteractionWidgets ${Module_SRCS}) diff --git a/Interaction/Widgets/Testing/Cxx/CMakeLists.txt b/Interaction/Widgets/Testing/Cxx/CMakeLists.txt index 047f36ad0c0..7cc707f0994 100644 --- a/Interaction/Widgets/Testing/Cxx/CMakeLists.txt +++ b/Interaction/Widgets/Testing/Cxx/CMakeLists.txt @@ -1,214 +1,116 @@ -SET(KIT Widgets) - - -# Most (all?) Widgets tests require access to the display: -# -IF(VTK_USE_DISPLAY) - -# add tests that do not require data -SET(MyTests -# ScaledBoxWidget2.cxx +set(MyTests + BoxWidget.cxx + BoxWidget2.cxx + # ImagePlaneWidget.cxx # todo (unsatisfied deps) + TerrainPolylineEditor.cxx TestAffineWidget.cxx -# TestAxesTransformWidget.cxx - TestButtonWidget.cxx -# TestCaptionWidget.cxx + TestAngleWidget2D.cxx + TestAngleWidget3D.cxx + TestBalloonWidget.cxx + TestBiDimensionalWidget.cxx + TestBorderWidget.cxx + # TestBrokenLineWidget.cxx # todo (unsatisfied deps) + # TestButtonWidget.cxx # todo (unsatistfied deps) + TestCameraWidget.cxx + TestCellCentersPointPlacer.cxx + TestCenteredSliderWidget2D.cxx + TestCheckerboardWidget.cxx + TestConstrainedHandleWidget.cxx + TestContourWidget2.cxx + TestDijkstraGraphGeodesicPath.cxx + TestDijkstraImageGeodesicPath.cxx + TestDistanceWidget.cxx TestDistanceWidget3D.cxx + TestFixedSizeHandleRepresentation3D.cxx + TestFocalPlaneContour.cxx TestHandleWidget.cxx + TestHandleWidget2D.cxx + # TestImageActorContourWidget.cxx # todo(unsatistfied deps) + TestImageTracerWidget.cxx + TestImplicitPlaneWidget.cxx + TestImplicitPlaneWidget2.cxx + TestImplicitPlaneWidget2LockNormalToCamera.cxx + TestImplicitPlaneWidget2b.cxx + TestLineWidget.cxx + TestLineWidget2.cxx TestLogoWidget.cxx + TestLogoWidgetAlphaBlending.cxx + TestLogoWidgetDepthPeeling.cxx + TestOrientationMarkerWidget.cxx + # TestOrthoPlanes.cxx # todo (unsatistfied deps) + TestParallelopipedWidget.cxx + TestPlaneWidget.cxx + TestPlaybackWidget.cxx + TestPointHandleRepresentation3D.cxx + TestPointWidget.cxx + TestPolyPlane.cxx + TestPolygonalHandleRepresentations.cxx + TestPolygonalRepresentationHandleWidget.cxx + TestPolygonalSurfaceConstrainedDistanceWidget.cxx TestProgrammaticPlacement.cxx TestRectilinearWipeWidget.cxx - TerrainPolylineEditor.cxx - TestDijkstraGraphGeodesicPath.cxx - TestPolyPlane.cxx - vtkAngleWidgetTest1.cxx - vtkBiDimensionalWidgetTest1.cxx - vtkImplicitPlaneWidget2Test1.cxx - vtkLineWidget2Test1.cxx - vtkSeedWidgetTest1.cxx - vtkSplineWidget2Test1.cxx - vtkBorderWidgetTest1.cxx - vtkCaptionWidgetTest1.cxx - vtkTextWidgetTest1.cxx - vtkHoverWidgetTest1.cxx - vtkBalloonWidgetTest1.cxx + # TestResliceCursorWidget2.cxx # todo (unsatistfied deps) + # TestResliceCursorWidget3.cxx # todo (unsatistfied deps) + TestScalarBarWidget.cxx + TestSeedWidget.cxx + TestSeedWidget2.cxx + TestSeedWidgetNonUniformRepresentations.cxx + TestSliderWidget.cxx + TestSliderWidget2D.cxx + TestSphereHandleWidget.cxx + # TestSplineWidget.cxx # todo (unsatistfied deps) + TestSurfaceConstrainedHandleWidget.cxx + TestTensorProbeWidget.cxx + TestTextWidget.cxx vtkAngleRepresentation2DTest1.cxx vtkAngleRepresentation3DTest1.cxx + vtkAngleWidgetTest1.cxx vtkBalloonRepresentationTest1.cxx + vtkBalloonWidgetTest1.cxx vtkBiDimensionalRepresentation2DTest1.cxx + vtkBiDimensionalWidgetTest1.cxx + vtkBorderWidgetTest1.cxx vtkCaptionRepresentationTest1.cxx - vtkTextRepresentationTest1.cxx -# vtkImplicitPlaneRepresentationTest1.cxx + vtkCaptionWidgetTest1.cxx + vtkHoverWidgetTest1.cxx vtkLineRepresentationTest1.cxx -# vtkSplineRepresentationTest1.cxx + vtkLineWidget2Test1.cxx vtkSeedRepresentationTest1.cxx -# vtkPointHandleRepresentation2DTest1.cxx -# vtkPointHandleRepresentation3DTest1.cxx -# vtkConstrainedPointHandleRepresentationTest1 -# vtkSphereHandleRepresentationTest1.cxx -# vtkPolygonalHandleRepresentation3DTest1.cxx -# vtkOrientedPolygonalHandleRepresentation3DTest1.cxx - ) + vtkSeedWidgetTest1.cxx + vtkSplineWidget2Test1.cxx + vtkTextRepresentationTest1.cxx + vtkTextWidgetTest1.cxx +) -IF (VTK_DATA_ROOT) - # add tests that require data - SET(MyTests ${MyTests} - BoxWidget.cxx - BoxWidget2.cxx - ImagePlaneWidget.cxx - TestAngleWidget2D.cxx - TestAngleWidget3D.cxx - TestBalloonWidget.cxx - TestBiDimensionalWidget.cxx - TestBorderWidget.cxx - TestBrokenLineWidget.cxx - TestCameraWidget.cxx - TestCellCentersPointPlacer.cxx - TestCenteredSliderWidget2D.cxx - TestCheckerboardWidget.cxx - TestConstrainedHandleWidget.cxx - TestContourWidget2.cxx - TestDistanceWidget.cxx - TestDijkstraImageGeodesicPath.cxx - TestFixedSizeHandleRepresentation3D.cxx - TestFocalPlaneContour.cxx - TestHandleWidget2D.cxx - TestImageActorContourWidget.cxx - TestImageTracerWidget.cxx - TestImplicitPlaneWidget.cxx - TestImplicitPlaneWidget2.cxx - TestImplicitPlaneWidget2b.cxx - TestImplicitPlaneWidget2LockNormalToCamera.cxx - TestLineWidget.cxx - TestLineWidget2.cxx - TestLogoWidgetAlphaBlending.cxx - TestLogoWidgetDepthPeeling.cxx - TestOrientationMarkerWidget.cxx - TestOrthoPlanes.cxx - TestPlaneWidget.cxx - TestPlaybackWidget.cxx - TestPointHandleRepresentation3D.cxx - TestPointWidget.cxx - TestParallelopipedWidget.cxx - TestPolygonalRepresentationHandleWidget.cxx - TestPolygonalHandleRepresentations.cxx - TestPolygonalSurfaceConstrainedDistanceWidget.cxx - TestSeedWidget.cxx - TestSeedWidgetNonUniformRepresentations.cxx - TestSphereHandleWidget.cxx - #TestOrientedGlyphContour.cxx - TestResliceCursorWidget2.cxx - TestResliceCursorWidget3.cxx - TestScalarBarWidget.cxx - TestSeedWidget2.cxx - TestSliderWidget.cxx - TestSliderWidget2D.cxx - TestSplineWidget.cxx - TestSurfaceConstrainedHandleWidget.cxx - TestTensorProbeWidget.cxx - TestTextWidget.cxx - ) -ENDIF (VTK_DATA_ROOT) +# Use the testing object factory, to reduce boilerplate code in tests. +include("${VTK_SOURCE_DIR}/Testing/Rendering/vtkTestingObjectFactory.cmake") +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) -INCLUDE(${VTK_SOURCE_DIR}/Rendering/vtkTestingObjectFactory.cmake) +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun CxxTests.cxx) +list(REMOVE_ITEM TestsToRun TerrainPolylineEditor.cxx) -ADD_EXECUTABLE(${KIT}CxxTests ${Tests}) -TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkWidgets) -SET (TestsToRun ${Tests}) -REMOVE( TestsToRun - ${KIT}CxxTests.cxx - TestHandleWidget.cxx - TerrainPolylineEditor.cxx - TestDijkstraGraphGeodesicPath.cxx - TestRectilinearWipeWidget.cxx - ) +if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-TerrainPolylineEditor + COMMAND ${vtk-module}CxxTests TerrainPolylineEditor + -ProjectionMode 2 + -HeightOffset 100 + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Widgets/TerrainPolylineEditor.png) +endif() -# Add all the tests -# -FOREACH (test ${TestsToRun}) - GET_FILENAME_COMPONENT(TName ${test} NAME_WE) - IF (VTK_DATA_ROOT) - ADD_TEST(${TName} ${CXX_TEST_PATH}/${KIT}CxxTests ${TName} +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} -D ${VTK_DATA_ROOT} - -V Baseline/${KIT}/${TName}.png) - ELSE (VTK_DATA_ROOT) - ADD_TEST(${TName} ${CXX_TEST_PATH}/${KIT}CxxTests ${TName}) - ENDIF (VTK_DATA_ROOT) -ENDFOREACH (test) - -# Add any tests with special arguments here.. -# -IF(VTK_DATA_ROOT AND VTK_USE_DISPLAY) - ADD_TEST( TerrainPolylineEditor ${CXX_TEST_PATH}/${KIT}CxxTests - TerrainPolylineEditor - -ProjectionMode 2 - -HeightOffset 100 - -T ${VTK_BINARY_DIR}/Testing/Temporary - -D ${VTK_DATA_ROOT} - -V Baseline/${KIT}/TerrainPolylineEditor.png) - ADD_TEST( TestHandleWidget ${CXX_TEST_PATH}/${KIT}CxxTests - TestHandleWidget - -ConstrainHandlesToPlane - -T ${VTK_BINARY_DIR}/Testing/Temporary - -D ${VTK_DATA_ROOT} - -V Baseline/${KIT}/TestHandleWidget.png) - ADD_TEST( TestDijkstraGraphGeodesicPath ${CXX_TEST_PATH}/${KIT}CxxTests - TestDijkstraGraphGeodesicPath - -DistanceOffset 20.0 - -T ${VTK_BINARY_DIR}/Testing/Temporary - -D ${VTK_DATA_ROOT} - -V Baseline/${KIT}/TestDijkstraGraphGeodesicPath.png) - - ADD_TEST( TestRectilinearWipeWidget0 ${CXX_TEST_PATH}/${KIT}CxxTests - TestRectilinearWipeWidget - 0 - -E 40 - -T ${VTK_BINARY_DIR}/Testing/Temporary - -D ${VTK_DATA_ROOT} - -V Baseline/${KIT}/TestRectilinearWipeWidget0.png) - ADD_TEST( TestRectilinearWipeWidget1 ${CXX_TEST_PATH}/${KIT}CxxTests - TestRectilinearWipeWidget - 1 - -E 40 - -T ${VTK_BINARY_DIR}/Testing/Temporary - -D ${VTK_DATA_ROOT} - -V Baseline/${KIT}/TestRectilinearWipeWidget1.png) - ADD_TEST( TestRectilinearWipeWidget2 ${CXX_TEST_PATH}/${KIT}CxxTests - TestRectilinearWipeWidget - 2 - -E 40 - -T ${VTK_BINARY_DIR}/Testing/Temporary - -D ${VTK_DATA_ROOT} - -V Baseline/${KIT}/TestRectilinearWipeWidget2.png) - ADD_TEST( TestRectilinearWipeWidget3 ${CXX_TEST_PATH}/${KIT}CxxTests - TestRectilinearWipeWidget - 3 - -E 40 - -T ${VTK_BINARY_DIR}/Testing/Temporary - -D ${VTK_DATA_ROOT} - -V Baseline/${KIT}/TestRectilinearWipeWidget3.png) - ADD_TEST( TestRectilinearWipeWidget4 ${CXX_TEST_PATH}/${KIT}CxxTests - TestRectilinearWipeWidget - 4 - -E 40 - -T ${VTK_BINARY_DIR}/Testing/Temporary - -D ${VTK_DATA_ROOT} - -V Baseline/${KIT}/TestRectilinearWipeWidget4.png) - ADD_TEST( TestRectilinearWipeWidget5 ${CXX_TEST_PATH}/${KIT}CxxTests - TestRectilinearWipeWidget - 5 - -E 40 - -T ${VTK_BINARY_DIR}/Testing/Temporary - -D ${VTK_DATA_ROOT} - -V Baseline/${KIT}/TestRectilinearWipeWidget5.png) - ADD_TEST( TestRectilinearWipeWidget6 ${CXX_TEST_PATH}/${KIT}CxxTests - TestRectilinearWipeWidget - 6 - -E 40 - -T ${VTK_BINARY_DIR}/Testing/Temporary - -D ${VTK_DATA_ROOT} - -V Baseline/${KIT}/TestRectilinearWipeWidget6.png) -ENDIF(VTK_DATA_ROOT AND VTK_USE_DISPLAY) - - -ENDIF(VTK_USE_DISPLAY) + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Widgets/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Interaction/Widgets/module.cmake b/Interaction/Widgets/module.cmake new file mode 100644 index 00000000000..1be2e5e4f85 --- /dev/null +++ b/Interaction/Widgets/module.cmake @@ -0,0 +1,19 @@ +vtk_module(vtkInteractionWidgets + GROUPS + Rendering + StandAlone + DEPENDS + vtkRenderingAnnotation + vtkRenderingFreeType + vtkRenderingVolume + vtkFiltersModeling + vtkFiltersHybrid + vtkImagingGeneral + vtkInteractionStyle + TEST_DEPENDS + vtkTestingRendering + vtkInteractionStyle + vtkFiltersModeling + vtkRenderingLOD + vtkImagingStencil + ) diff --git a/Parallel/Core/CMakeLists.txt b/Parallel/Core/CMakeLists.txt new file mode 100644 index 00000000000..dcf1406243e --- /dev/null +++ b/Parallel/Core/CMakeLists.txt @@ -0,0 +1,44 @@ +set(Module_SRCS + vtkCommunicator.cxx + vtkDummyCommunicator.cxx + vtkDummyController.cxx + vtkMultiProcessController.cxx + vtkMultiProcessStream.cxx +# vtkParallelFactory.cxx + vtkProcess.cxx + vtkProcessGroup.cxx + vtkSocketCommunicator.cxx + vtkSocketController.cxx + vtkSubCommunicator.cxx + vtkSubGroup.cxx + vtkFieldDataSerializer.cxx + ) + +# Generate "vtkSocketCommunicatorHash.h". +add_custom_command( + OUTPUT ${VTK_BINARY_DIR}/Parallel/Core/vtkSocketCommunicatorHash.h + DEPENDS ${VTK_SOURCE_DIR}/Parallel/Core/vtkSocketCommunicator.cxx + vtkHashSource + COMMAND vtkHashSource + ${VTK_SOURCE_DIR}/Parallel/Core/vtkSocketCommunicator.cxx + vtkSocketCommunicatorHash vtkSocketCommunicatorHash.h + ) + +list(APPEND Module_SRCS + ${VTK_BINARY_DIR}/Parallel/Core/vtkSocketCommunicatorHash.h + ) + +set_source_files_properties( + vtkMultiProcessStream + vtkSocketCommunicatorHash + WRAP_EXCLUDE + ) + +set_source_files_properties( + vtkCommunicator + vtkMultiProcessController + vtkProcess + ABSTRACT + ) + +vtk_module_library(vtkParallelCore ${Module_SRCS}) diff --git a/Parallel/Core/module.cmake b/Parallel/Core/module.cmake new file mode 100644 index 00000000000..1a54c478a9b --- /dev/null +++ b/Parallel/Core/module.cmake @@ -0,0 +1,8 @@ +vtk_module(vtkParallelCore + GROUPS + StandAlone + DEPENDS + vtkIOGeometry + COMPILE_DEPENDS + vtkUtilitiesHashSource + ) diff --git a/Parallel/Core/vtkCommunicator.cxx b/Parallel/Core/vtkCommunicator.cxx index e0865b74b0d..9ea14c48749 100644 --- a/Parallel/Core/vtkCommunicator.cxx +++ b/Parallel/Core/vtkCommunicator.cxx @@ -25,7 +25,6 @@ #include "vtkGenericDataObjectReader.h" #include "vtkGenericDataObjectWriter.h" #include "vtkIdTypeArray.h" -#include "vtkImageClip.h" #include "vtkImageData.h" #include "vtkIntArray.h" #include "vtkMultiBlockDataSet.h" @@ -35,8 +34,6 @@ #include "vtkSmartPointer.h" #include "vtkStructuredGrid.h" #include "vtkStructuredPoints.h" -#include "vtkStructuredPointsReader.h" -#include "vtkStructuredPointsWriter.h" #include "vtkTemporalDataSet.h" #include "vtkTypeTraits.h" #include "vtkUnsignedCharArray.h" diff --git a/Parallel/Core/vtkSocketCommunicator.cxx b/Parallel/Core/vtkSocketCommunicator.cxx index 2775b36ee17..026b8f6bea2 100644 --- a/Parallel/Core/vtkSocketCommunicator.cxx +++ b/Parallel/Core/vtkSocketCommunicator.cxx @@ -91,7 +91,7 @@ public: // represent the CVS revision number of this file, so the value must // be larger than the last revision which used that strategy. #define vtkSocketCommunicatorHashId 100 /* MD5 */ -#include "Parallel/vtkSocketCommunicatorHash.h" +#include "vtkSocketCommunicatorHash.h" vtkStandardNewMacro(vtkSocketCommunicator); vtkCxxSetObjectMacro(vtkSocketCommunicator, Socket, vtkClientSocket); diff --git a/Parallel/MPI/CMakeLists.txt b/Parallel/MPI/CMakeLists.txt new file mode 100644 index 00000000000..da65c311260 --- /dev/null +++ b/Parallel/MPI/CMakeLists.txt @@ -0,0 +1,29 @@ +find_package(MPI) +mark_as_advanced(MPI_LIBRARY MPI_EXTRA_LIBRARY) +include_directories(${MPI_INCLUDE_PATH}) + +set(Module_SRCS + vtkMPICommunicator.cxx + vtkMPIController.cxx + # vtkMPIEventLog.cxx # Deprecated + vtkMPI.h + ) + +set_source_files_properties( + vtkMPI + HEADER_FILE_ONLY + ) + +set_source_files_properties( + vtkMPI + WRAP_EXCLUDE + ) + +# Needed for mpich 2 +add_definitions("-DMPICH_IGNORE_CXX_SEEK") + +vtk_module_library(vtkParallelMPI ${Module_SRCS}) +target_link_libraries(vtkParallelMPI ${MPI_LIBRARY}) +if(MPI_EXTRA_LIBRARY) + target_link_libraries(vtkParallelMPI ${MPI_EXTRA_LIBRARY}) +endif() diff --git a/Parallel/MPI/module.cmake b/Parallel/MPI/module.cmake new file mode 100644 index 00000000000..c38ce35409e --- /dev/null +++ b/Parallel/MPI/module.cmake @@ -0,0 +1,6 @@ +vtk_module(vtkParallelMPI + GROUPS + MPI + DEPENDS + vtkParallelCore + ) diff --git a/Rendering/Annotation/CMakeLists.txt b/Rendering/Annotation/CMakeLists.txt new file mode 100644 index 00000000000..243b961224d --- /dev/null +++ b/Rendering/Annotation/CMakeLists.txt @@ -0,0 +1,23 @@ +set(Module_SRCS + vtkAnnotatedCubeActor.cxx + vtkArcPlotter.cxx + vtkAxesActor.cxx + vtkAxisActor2D.cxx + vtkAxisActor.cxx + vtkAxisFollower.cxx + vtkBarChartActor.cxx + vtkCaptionActor2D.cxx + vtkCornerAnnotation.cxx + vtkCubeAxesActor2D.cxx + vtkCubeAxesActor.cxx + vtkLeaderActor2D.cxx + vtkLegendBoxActor.cxx + vtkLegendScaleActor.cxx + vtkPieChartActor.cxx + vtkPolarAxesActor.cxx + vtkScalarBarActor.cxx + vtkSpiderPlotActor.cxx + vtkXYPlotActor.cxx + ) + +vtk_module_library(vtkRenderingAnnotation ${Module_SRCS}) diff --git a/Rendering/Annotation/Testing/Cxx/CMakeLists.txt b/Rendering/Annotation/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..7e3d2046df3 --- /dev/null +++ b/Rendering/Annotation/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,43 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + # TestAxisActor3D.cxx # todo (may not be in vtk in the first place) + TestBarChartActor.cxx + TestCubeAxes2DMode.cxx + TestCubeAxes3.cxx + TestCubeAxesWithGridLines.cxx + TestCubeAxesWithXInnerGrids.cxx + TestCubeAxesWithXInnerPolys.cxx + TestCubeAxesWithXLines.cxx + TestCubeAxesWithYInnerGrids.cxx + TestCubeAxesWithYInnerPolys.cxx + TestCubeAxesWithYLines.cxx + TestCubeAxesWithZInnerGrids.cxx + TestCubeAxesWithZInnerPolys.cxx + TestCubeAxesWithZLines.cxx + TestLegendBoxActor.cxx + TestLegendScaleActor.cxx + TestPieChartActor.cxx + TestPolarAxes.cxx + TestSpiderPlotActor.cxx + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Hybrid/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Rendering/Annotation/module.cmake b/Rendering/Annotation/module.cmake new file mode 100644 index 00000000000..05de4810bc5 --- /dev/null +++ b/Rendering/Annotation/module.cmake @@ -0,0 +1,13 @@ +vtk_module(vtkRenderingAnnotation + GROUPS + Rendering + StandAlone + DEPENDS + vtkRenderingFreeType + vtkImagingColor + TEST_DEPENDS + vtkRenderingOpenGL + vtkTestingRendering + vtkInteractionStyle + vtkRenderingLOD + ) diff --git a/Rendering/Context2D/CMakeLists.txt b/Rendering/Context2D/CMakeLists.txt new file mode 100644 index 00000000000..872e215c3e3 --- /dev/null +++ b/Rendering/Context2D/CMakeLists.txt @@ -0,0 +1,50 @@ +set(module_SRCS + vtkAbstractContextBufferId.cxx + vtkAbstractContextItem.cxx + vtkBlockItem.cxx + vtkBrush.cxx + vtkContext2D.cxx + vtkContext3D.cxx + vtkContextActor.cxx + vtkContextBufferId.cxx + vtkContextClip.cxx + vtkContextDevice2D.cxx + vtkContextDevice3D.cxx + vtkContextItem.cxx + vtkContextKeyEvent.cxx + vtkContextMapper2D.cxx + vtkContextMouseEvent.cxx + vtkContextScene.cxx + vtkContextTransform.cxx + vtkImageItem.cxx + vtkOpenGL2ContextDevice2D.cxx + vtkOpenGLContextBufferId.cxx + vtkOpenGLContextDevice2D.cxx + vtkOpenGLContextDevice3D.cxx + vtkPen.cxx +# vtkPiecewisePointHandleItem.cxx + vtkTooltipItem.cxx + ) + +set_source_files_properties( + vtkAbstractContextBufferId + vtkAbstractContextItem + vtkContextItem + ABSTRACT + ) + +set_source_files_properties( + vtkContextDevice2D + vtkContextDevice3D + vtkContext2D + vtkContext3D + vtkContextKeyEvent + vtkContextMouseEvent + vtkOpenGL2ContextDevice2D + vtkOpenGLContextBufferId + vtkOpenGLContextDevice2D + vtkOpenGLContextDevice3D + WRAP_EXCLUDE + ) + +vtk_module_library(vtkRenderingContext2D ${module_SRCS}) diff --git a/Rendering/Context2D/module.cmake b/Rendering/Context2D/module.cmake new file mode 100644 index 00000000000..eda396be3b0 --- /dev/null +++ b/Rendering/Context2D/module.cmake @@ -0,0 +1,12 @@ +vtk_module(vtkRenderingContext2D + GROUPS + Rendering + StandAlone + DEPENDS + vtkCommonDataModel + vtkCommonMath + vtkCommonTransforms + vtkRenderingCore + vtkRenderingOpenGL + vtkRenderingFreeType + ) diff --git a/Rendering/Context2D/vtkContextActor.h b/Rendering/Context2D/vtkContextActor.h index 181df46e23a..5c1bc1e18d9 100644 --- a/Rendering/Context2D/vtkContextActor.h +++ b/Rendering/Context2D/vtkContextActor.h @@ -43,7 +43,7 @@ public: // Description: // Get the vtkContext2D for the actor. - vtkGetNewMacro(Context, vtkContext2D) + vtkGetNewMacro(Context, vtkContext2D); // Description: // Get the chart object for the actor. diff --git a/Rendering/Core/CMakeLists.txt b/Rendering/Core/CMakeLists.txt new file mode 100644 index 00000000000..1ccea0eac09 --- /dev/null +++ b/Rendering/Core/CMakeLists.txt @@ -0,0 +1,169 @@ +set(Module_SRCS + vtkAbstractMapper3D.cxx + vtkAbstractMapper.cxx + vtkAbstractPicker.cxx + vtkAbstractVolumeMapper.cxx + vtkActor2DCollection.cxx + vtkActor2D.cxx + vtkActorCollection.cxx + vtkActor.cxx + vtkAssembly.cxx + vtkCameraActor.cxx + vtkCamera.cxx + vtkCameraInterpolator.cxx + vtkCellCenterDepthSort.cxx + vtkChooserPainter.cxx + vtkClipPlanesPainter.cxx + vtkCoincidentTopologyResolutionPainter.cxx + vtkColorTransferFunction.cxx + vtkCompositePainter.cxx + vtkCompositePolyDataMapper2.cxx + vtkCompositePolyDataMapper.cxx + vtkCoordinate.cxx + vtkCullerCollection.cxx + vtkCuller.cxx + vtkDataSetMapper.cxx + vtkDefaultPainter.cxx + vtkDiscretizableColorTransferFunction.cxx + vtkDisplayListPainter.cxx + vtkDistanceToCamera.cxx + vtkFollower.cxx + vtkFrustumCoverageCuller.cxx + vtkGenericRenderWindowInteractor.cxx + vtkGenericVertexAttributeMapping.cxx + vtkGlyph3DMapper.cxx + vtkGPUInfo.cxx + vtkGPUInfoList.cxx + vtkGraphicsFactory.cxx + #vtkGraphMapper.cxx - vtkGraphToPolyData + vtkGraphToGlyphs.cxx + vtkHardwareSelector.cxx + vtkHierarchicalPolyDataMapper.cxx + vtkImageActor.cxx + vtkImageMapper3D.cxx + vtkImageMapper.cxx + vtkImageProperty.cxx + vtkImageSlice.cxx + vtkImageSliceMapper.cxx + vtkImagingFactory.cxx + vtkInteractorEventRecorder.cxx + vtkInteractorObserver.cxx + vtkLightActor.cxx + vtkLightCollection.cxx + vtkLight.cxx + vtkLightingPainter.cxx + vtkLightKit.cxx + vtkLinesPainter.cxx + vtkLogLookupTable.cxx + vtkLookupTableWithEnabling.cxx + vtkMapArrayValues.cxx + vtkMapper2D.cxx + vtkMapperCollection.cxx + vtkMapper.cxx + vtkObserverMediator.cxx + vtkPainter.cxx + vtkPainterDeviceAdapter.cxx + vtkPainterPolyDataMapper.cxx + vtkPointsPainter.cxx + vtkPolyDataMapper2D.cxx + vtkPolyDataMapper.cxx + vtkPolyDataPainter.cxx + vtkPolygonsPainter.cxx + vtkPrimitivePainter.cxx + vtkProp3DCollection.cxx + vtkProp3D.cxx + vtkProp3DFollower.cxx + vtkPropAssembly.cxx + vtkPropCollection.cxx + vtkProp.cxx + vtkProperty2D.cxx + vtkProperty.cxx # needs a load of image readers - IOImage, IOXML + vtkRendererCollection.cxx + vtkRenderer.cxx + vtkRendererDelegate.cxx + vtkRendererSource.cxx + vtkRenderWindowCollection.cxx + vtkRenderWindow.cxx + vtkRenderWindowInteractor.cxx + vtkRepresentationPainter.cxx + vtkScalarsToColorsPainter.cxx + vtkSelectVisiblePoints.cxx + vtkShader.cxx # vtkXMLShader + vtkShaderDeviceAdapter.cxx + vtkShaderDeviceAdapter2.cxx + vtkShaderProgram.cxx # vtkXMLShaderProgram + vtkStandardPolyDataPainter.cxx + vtkTexture.cxx + vtkTexturedActor2D.cxx + vtkTransformCoordinateSystems.cxx + vtkTransformInterpolator.cxx + vtkTStripsPainter.cxx + vtkTupleInterpolator.cxx + vtkViewDependentErrorMetric.cxx + vtkViewport.cxx + vtkVisibilitySort.cxx + vtkVolumeCollection.cxx + vtkVolume.cxx + vtkVolumeProperty.cxx + vtkWindowLevelLookupTable.cxx + vtkWindowToImageFilter.cxx + + vtkAssemblyNode.cxx # Needed by vtkAssembly + vtkAssemblyPath.cxx # Needed by vtkAssembly + vtkAssemblyPaths.cxx # Needed by vtkAssembly + + vtkAreaPicker.cxx # Needed by vtkRenderer + vtkPicker.cxx # Needed by vtkRenderer + vtkAbstractPropPicker.cxx # Needed by vtkAreaPicker + vtkPropPicker.cxx # Needed by vtkRenderWindowInteractor + vtkLODProp3D.cxx # Needed by vtkAreaPicker + vtkWorldPointPicker.cxx # Needed by vtkPropPicker + vtkHardwareSelectionPolyDataPainter.cxx # Needed by vtkPainterPolyDataMapper + + # Needed for the InteractorStyleSwitch... + vtkCellPicker.cxx + vtkPointPicker.cxx + vtkRenderedAreaPicker.cxx + vtkScenePicker.cxx + + # Needed by vtkRenderWindowInteractor, for the default interactor. + vtkInteractorStyle.cxx + vtkInteractorStyleSwitchBase.cxx + # vtkTDx stuff dragged in by vtkInteractorStyle + vtkTDxInteractorStyle.cxx + vtkTDxInteractorStyleCamera.cxx + vtkTDxInteractorStyleSettings.cxx + + vtkStringToImage.cxx + ) + +set_source_files_properties( + vtkAbstractMapper3D + vtkAbstractMapper + vtkAbstractVolumeMapper + vtkAbstractPicker + vtkAbstractPropPicker + vtkCuller + vtkGPUInfoList + vtkImageMapper3D + vtkInteractorObserver + vtkMapper + vtkMapper2D + vtkPainter + vtkPolyDataPainter + vtkPrimitivePainter + vtkProp + vtkProp3D + vtkRendererDelegate + vtkShader + vtkShaderDeviceAdapter + vtkShaderDeviceAdapter2 + vtkShaderProgram + vtkTDxInteractorStyle + vtkViewport + vtkVisibilitySort + vtkStringToImage + ABSTRACT + ) + +vtk_module_library(vtkRenderingCore ${Module_SRCS}) diff --git a/Rendering/Core/Testing/Cxx/CMakeLists.txt b/Rendering/Core/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..171ad2ddc6c --- /dev/null +++ b/Rendering/Core/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,26 @@ +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx + # otherLookupTable.cxx # fixme + # otherLookupTableWithEnabling.cxx # fixme + + EXTRA_INCLUDE vtkTestDriver.h +) + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Rendering/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Rendering/Core/module.cmake b/Rendering/Core/module.cmake new file mode 100644 index 00000000000..dc888556603 --- /dev/null +++ b/Rendering/Core/module.cmake @@ -0,0 +1,15 @@ +vtk_module(vtkRenderingCore + GROUPS + StandAlone + DEPENDS + vtkCommonExecutionModel + vtkCommonTransforms + vtkFiltersSources + vtkFiltersGeneral + vtkFiltersGeometry + vtkFiltersExtraction + vtkIOImage + vtkIOXML + TEST_DEPENDS + vtkTestingCore + ) diff --git a/Rendering/Core/vtkGraphicsFactory.cxx b/Rendering/Core/vtkGraphicsFactory.cxx index 69b9b015590..6edcb474f16 100644 --- a/Rendering/Core/vtkGraphicsFactory.cxx +++ b/Rendering/Core/vtkGraphicsFactory.cxx @@ -17,76 +17,7 @@ #include "vtkGraphicsFactory.h" #include "vtkToolkits.h" #include "vtkDebugLeaks.h" -#include "vtkPainterPolyDataMapper.h" -#include "vtkInteractorStyleSwitch.h" -// if using some sort of opengl, then include these files -#if defined(VTK_USE_OGLR) || defined(VTK_USE_OSMESA) || defined(_WIN32) || defined(VTK_USE_COCOA) || defined(VTK_USE_CARBON) -#include "vtkOpenGLActor.h" -#include "vtkOpenGLCamera.h" -#include "vtkOpenGLClipPlanesPainter.h" -#include "vtkOpenGLCoincidentTopologyResolutionPainter.h" -#include "vtkOpenGLDisplayListPainter.h" -#include "vtkOpenGLGlyph3DMapper.h" -#include "vtkOpenGLImageSliceMapper.h" -#include "vtkOpenGLLight.h" -#include "vtkOpenGLLightingPainter.h" -#include "vtkOpenGLPainterDeviceAdapter.h" -#include "vtkOpenGLProperty.h" -#include "vtkOpenGLPolyDataMapper.h" -#include "vtkOpenGLRenderer.h" -#include "vtkOpenGLRepresentationPainter.h" -#include "vtkOpenGLScalarsToColorsPainter.h" -#include "vtkOpenGLTexture.h" -#endif - -// Win32 specific stuff -#ifdef _WIN32 -# ifndef VTK_USE_OGLR -# include "vtkWin32OpenGLRenderWindow.h" -# include "vtkWin32RenderWindowInteractor.h" -# define VTK_DISPLAY_WIN32_OGL -# endif // VTK_USE_OGLR -#endif - -// Apple OSX stuff -#ifdef VTK_USE_CARBON -# include "vtkCarbonRenderWindow.h" -# include "vtkCarbonRenderWindowInteractor.h" -# define VTK_DISPLAY_CARBON -#endif - -#ifdef VTK_USE_COCOA -# include "vtkCocoaRenderWindow.h" -# include "vtkCocoaRenderWindowInteractor.h" -# define VTK_DISPLAY_COCOA -#endif - -// X OpenGL stuff -#ifdef VTK_USE_OGLR -# include "vtkXRenderWindowInteractor.h" -# include "vtkXOpenGLRenderWindow.h" -# define VTK_DISPLAY_X11_OGL -#endif - -// OSMESA OpenGL stuff -#ifdef VTK_USE_OSMESA -# include "vtkRenderWindowInteractor.h" -# include "vtkOSOpenGLRenderWindow.h" -//# define VTK_DISPLAY_X11_OGL -#endif - -#include "vtkDummyGPUInfoList.h" -#ifdef VTK_USE_DIRECTX // Windows -# include "vtkDirectXGPUInfoList.h" -#else -# ifdef VTK_USE_CORE_GRAPHICS // Mac -# include "vtkCoreGraphicsGPUInfoList.h" -# endif -#endif -#ifdef VTK_USE_NVCONTROL // Linux and X server extensions queries -# include "vtkXGPUInfoList.h" -#endif #include "vtkCriticalSection.h" @@ -165,172 +96,6 @@ vtkObject* vtkGraphicsFactory::CreateInstance(const char* vtkclassname ) vtkDebugLeaks::DestructClass(vtkclassname); #endif const char *rl = vtkGraphicsFactory::GetRenderLibrary(); - -#ifdef VTK_USE_OGLR - if (!strcmp("OpenGL",rl)) - { - if(strcmp(vtkclassname, "vtkRenderWindow") == 0) - { - return vtkXOpenGLRenderWindow::New(); - } - } - if ( !vtkGraphicsFactory::GetOffScreenOnlyMode() ) - { - if(strcmp(vtkclassname, "vtkRenderWindowInteractor") == 0) - { - return vtkXRenderWindowInteractor::New(); - } - } -#endif - - if(strcmp(vtkclassname, "vtkGPUInfoList") == 0) - { -#ifdef VTK_USE_DIRECTX // Windows - return vtkDirectXGPUInfoList::New(); -#else -# ifdef VTK_USE_CORE_GRAPHICS // Mac - return vtkCoreGraphicsGPUInfoList::New(); -# else -# ifdef VTK_USE_NVCONTROL // X11 - return vtkXGPUInfoList::New(); -# else - return vtkDummyGPUInfoList::New(); -# endif -# endif -#endif - } - -#if defined(VTK_USE_OSMESA) - if(strcmp(vtkclassname, "vtkRenderWindow") == 0) - { - return vtkOSOpenGLRenderWindow::New(); - } - if(strcmp(vtkclassname, "vtkRenderWindowInteractor") == 0) - { - return 0; // there is no interactor with OSMesa - } -#endif - -#ifdef VTK_DISPLAY_WIN32_OGL - if ( !vtkGraphicsFactory::GetOffScreenOnlyMode() ) - { - if(strcmp(vtkclassname, "vtkRenderWindowInteractor") == 0) - { - return vtkWin32RenderWindowInteractor::New(); - } - } - if (!strcmp("Win32OpenGL",rl)) - { - if(strcmp(vtkclassname, "vtkRenderWindow") == 0) - { - return vtkWin32OpenGLRenderWindow::New(); - } - } -#endif - -#ifdef VTK_USE_CARBON - if ( !vtkGraphicsFactory::GetOffScreenOnlyMode() ) - { - if(strcmp(vtkclassname, "vtkRenderWindowInteractor") == 0) - { - return vtkCarbonRenderWindowInteractor::New(); - } - } - if(strcmp(vtkclassname, "vtkRenderWindow") == 0) - { - return vtkCarbonRenderWindow::New(); - } -#endif -#ifdef VTK_USE_COCOA - if ( !vtkGraphicsFactory::GetOffScreenOnlyMode() ) - { - if(strcmp(vtkclassname, "vtkRenderWindowInteractor") == 0) - { - return vtkCocoaRenderWindowInteractor::New(); - } - } - if(strcmp(vtkclassname, "vtkRenderWindow") == 0) - { - return vtkCocoaRenderWindow::New(); - } -#endif - -#if defined(VTK_USE_OGLR) || defined(VTK_USE_OSMESA) || defined(_WIN32) || defined(VTK_USE_COCOA) || defined(VTK_USE_CARBON) - if (!strcmp("OpenGL",rl) || !strcmp("Win32OpenGL",rl) || !strcmp("CarbonOpenGL",rl) || !strcmp("CocoaOpenGL",rl)) - { - if(strcmp(vtkclassname, "vtkActor") == 0) - { - return vtkOpenGLActor::New(); - } - if(strcmp(vtkclassname, "vtkCamera") == 0) - { - return vtkOpenGLCamera::New(); - } - if(strcmp(vtkclassname, "vtkImageSliceMapper") == 0) - { - return vtkOpenGLImageSliceMapper::New(); - } - if(strcmp(vtkclassname, "vtkLight") == 0) - { - return vtkOpenGLLight::New(); - } - if(strcmp(vtkclassname, "vtkProperty") == 0) - { - return vtkOpenGLProperty::New(); - } - if(strcmp(vtkclassname, "vtkPolyDataMapper") == 0) - { - return vtkPainterPolyDataMapper::New(); - } - if (strcmp(vtkclassname, "vtkPainterDeviceAdapter") == 0) - { - return vtkOpenGLPainterDeviceAdapter::New(); - } - if (strcmp(vtkclassname, "vtkScalarsToColorsPainter") == 0) - { - return vtkOpenGLScalarsToColorsPainter::New(); - } - if (strcmp(vtkclassname, "vtkClipPlanesPainter") == 0) - { - return vtkOpenGLClipPlanesPainter::New(); - } - if (strcmp(vtkclassname, "vtkCoincidentTopologyResolutionPainter") == 0) - { - return vtkOpenGLCoincidentTopologyResolutionPainter::New(); - } - if (strcmp(vtkclassname, "vtkDisplayListPainter") == 0) - { - return vtkOpenGLDisplayListPainter::New(); - } - if (strcmp(vtkclassname, "vtkLightingPainter") == 0) - { - return vtkOpenGLLightingPainter::New(); - } - if (strcmp(vtkclassname, "vtkRepresentationPainter") == 0) - { - return vtkOpenGLRepresentationPainter::New(); - } - if(strcmp(vtkclassname, "vtkRenderer") == 0) - { - return vtkOpenGLRenderer::New(); - } - if(strcmp(vtkclassname, "vtkTexture") == 0) - { - return vtkOpenGLTexture::New(); - } - if(strcmp(vtkclassname, "vtkGlyph3DMapper") == 0) - { - return vtkOpenGLGlyph3DMapper::New(); - } - } -#endif - - // Temporarily added here, this will be replaced very soon in modular VTK. - if(strcmp(vtkclassname, "vtkInteractorStyleSwitchBase") == 0) - { - return vtkInteractorStyleSwitch::New(); - } - return 0; } diff --git a/Rendering/Core/vtkImagingFactory.cxx b/Rendering/Core/vtkImagingFactory.cxx index 38a2d51e1a5..e66cc8cdf12 100644 --- a/Rendering/Core/vtkImagingFactory.cxx +++ b/Rendering/Core/vtkImagingFactory.cxx @@ -18,37 +18,6 @@ #include "vtkToolkits.h" #include "vtkDebugLeaks.h" -#if defined(VTK_USE_OGLR) || defined(VTK_USE_OSMESA) -#include "vtkOpenGLImageMapper.h" -#include "vtkOpenGLPolyDataMapper2D.h" -#include "vtkOpenGLFreeTypeTextMapper.h" -#endif - -#ifdef _WIN32 -#include "vtkOpenGLImageMapper.h" -#include "vtkOpenGLPolyDataMapper2D.h" -#include "vtkOpenGLFreeTypeTextMapper.h" -#else -#ifdef VTK_USE_QUARTZ -#include "vtkOpenGLImageMapper.h" -#include "vtkOpenGLPolyDataMapper2D.h" -#include "vtkQuartzImageMapper.h" -#include "vtkOpenGLFreeTypeTextMapper.h" -#endif -#endif - -#ifdef VTK_USE_CARBON -#include "vtkOpenGLImageMapper.h" -#include "vtkOpenGLPolyDataMapper2D.h" -#include "vtkOpenGLFreeTypeTextMapper.h" -#endif - -#ifdef VTK_USE_COCOA -#include "vtkOpenGLImageMapper.h" -#include "vtkOpenGLPolyDataMapper2D.h" -#include "vtkOpenGLFreeTypeTextMapper.h" -#endif - #include "vtkCriticalSection.h" static vtkSimpleCriticalSection vtkUseMesaClassesCriticalSection; int vtkImagingFactory::UseMesaClasses = 0; @@ -82,21 +51,6 @@ const char *vtkImagingFactoryGetRenderLibrary() } // if nothing is set then work down the list of possible renderers - if ( !temp ) - { -#if defined(VTK_USE_OGLR) || defined(VTK_USE_OSMESA) - temp = "OpenGL"; -#endif -#ifdef _WIN32 - temp = "Win32OpenGL"; -#endif -#ifdef VTK_USE_CARBON - temp = "CarbonOpenGL"; -#endif -#ifdef VTK_USE_COCOA - temp = "CocoaOpenGL"; -#endif - } return temp; } @@ -116,79 +70,6 @@ vtkObject* vtkImagingFactory::CreateInstance(const char* vtkclassname ) vtkDebugLeaks::DestructClass(vtkclassname); #endif - const char *rl = vtkImagingFactoryGetRenderLibrary(); - -#if defined(VTK_USE_OGLR) || defined(VTK_USE_OSMESA) - if (!strcmp("OpenGL",rl)) - { - if(strcmp(vtkclassname, "vtkTextMapper") == 0) - { - return vtkOpenGLFreeTypeTextMapper::New(); - } - if(strcmp(vtkclassname, "vtkImageMapper") == 0) - { - return vtkOpenGLImageMapper::New(); - } - if(strcmp(vtkclassname, "vtkPolyDataMapper2D") == 0) - { - return vtkOpenGLPolyDataMapper2D::New(); - } - } -#endif - -#ifdef _WIN32 - if (!strcmp("Win32OpenGL",rl)) - { - if(strcmp(vtkclassname, "vtkTextMapper") == 0) - { - return vtkOpenGLFreeTypeTextMapper::New(); - } - if(strcmp(vtkclassname, "vtkImageMapper") == 0) - { - return vtkOpenGLImageMapper::New(); - } - if(strcmp(vtkclassname, "vtkPolyDataMapper2D") == 0) - { - return vtkOpenGLPolyDataMapper2D::New(); - } - } -#endif - -#ifdef VTK_USE_CARBON - if (!strcmp("CarbonOpenGL",rl)) - { - if(strcmp(vtkclassname, "vtkTextMapper") == 0) - { - return vtkOpenGLFreeTypeTextMapper::New(); - } - if(strcmp(vtkclassname, "vtkImageMapper") == 0) - { - return vtkOpenGLImageMapper::New(); - } - if(strcmp(vtkclassname, "vtkPolyDataMapper2D") == 0) - { - return vtkOpenGLPolyDataMapper2D::New(); - } - } -#endif -#ifdef VTK_USE_COCOA - if (!strcmp("CocoaOpenGL",rl)) - { - if(strcmp(vtkclassname, "vtkTextMapper") == 0) - { - return vtkOpenGLFreeTypeTextMapper::New(); - } - if(strcmp(vtkclassname, "vtkImageMapper") == 0) - { - return vtkOpenGLImageMapper::New(); - } - if(strcmp(vtkclassname, "vtkPolyDataMapper2D") == 0) - { - return vtkOpenGLPolyDataMapper2D::New(); - } - } -#endif - return 0; } diff --git a/Rendering/FreeType/CMakeLists.txt b/Rendering/FreeType/CMakeLists.txt new file mode 100644 index 00000000000..af503db6d4b --- /dev/null +++ b/Rendering/FreeType/CMakeLists.txt @@ -0,0 +1,44 @@ +set(Module_SRCS + vtkFreeTypeStringToImage.cxx + vtkFreeTypeUtilities.cxx + vtkFreeTypeTools.cxx + vtkTextActor3D.cxx + vtkTextActor.cxx + vtkScaledTextActor.cxx + vtkTextMapper.cxx + vtkTextProperty.cxx + vtkVectorText.cxx + + fonts/face_arial_bold.cxx + fonts/face_arial_bold_italic.cxx + fonts/face_arial.cxx + fonts/face_arial_italic.cxx + fonts/face_courier_bold.cxx + fonts/face_courier_bold_italic.cxx + fonts/face_courier.cxx + fonts/face_courier_italic.cxx + fonts/face_times_bold.cxx + fonts/face_times_bold_italic.cxx + fonts/face_times.cxx + fonts/face_times_italic.cxx + ) + +set_source_files_properties( + vtkFreeTypeTools + vtkFreeTypeUtilities + fonts/face_arial_bold + fonts/face_arial_bold_italic + fonts/face_arial + fonts/face_arial_italic + fonts/face_courier_bold + fonts/face_courier_bold_italic + fonts/face_courier + fonts/face_courier_italic + fonts/face_times_bold + fonts/face_times_bold_italic + fonts/face_times + fonts/face_times_italic + WRAP_EXCLUDE + ) + +vtk_module_library(${vtk-module} ${Module_SRCS}) diff --git a/Rendering/FreeType/module.cmake b/Rendering/FreeType/module.cmake new file mode 100644 index 00000000000..7761f2c9d92 --- /dev/null +++ b/Rendering/FreeType/module.cmake @@ -0,0 +1,9 @@ +vtk_module(vtkRenderingFreeType + GROUPS + Rendering + StandAlone + DEPENDS + vtkRenderingCore + vtkfreetype + vtkftgl + ) diff --git a/Rendering/Image/CMakeLists.txt b/Rendering/Image/CMakeLists.txt new file mode 100644 index 00000000000..caa2dd6ebb8 --- /dev/null +++ b/Rendering/Image/CMakeLists.txt @@ -0,0 +1,11 @@ +set(Module_SRCS + vtkImageResliceMapper.cxx + vtkImageSliceCollection.cxx + vtkImageStack.cxx + vtkImageViewer2.cxx + vtkImageViewer.cxx + vtkResliceImageViewer.cxx + vtkResliceImageViewerMeasurements.cxx + ) + +vtk_module_library(${vtk-module} ${Module_SRCS}) diff --git a/Rendering/Image/module.cmake b/Rendering/Image/module.cmake new file mode 100644 index 00000000000..00809a9fa5b --- /dev/null +++ b/Rendering/Image/module.cmake @@ -0,0 +1,10 @@ +vtk_module(vtkRenderingImage + GROUPS + StandAlone + DEPENDS + vtkRenderingCore + vtkRenderingFreeType + vtkImagingColor + vtkInteractionStyle + vtkInteractionWidgets + ) diff --git a/Rendering/LOD/CMakeLists.txt b/Rendering/LOD/CMakeLists.txt new file mode 100644 index 00000000000..f0634f50374 --- /dev/null +++ b/Rendering/LOD/CMakeLists.txt @@ -0,0 +1,5 @@ +set(Module_SRCS + vtkLODActor.cxx + vtkQuadricLODActor.cxx) + +vtk_module_library(vtkRenderingLOD ${Module_SRCS}) diff --git a/Rendering/LOD/module.cmake b/Rendering/LOD/module.cmake new file mode 100644 index 00000000000..75384c2ba72 --- /dev/null +++ b/Rendering/LOD/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkRenderingLOD + GROUPS + StandAlone + DEPENDS + vtkRenderingCore + vtkFiltersModeling + ) diff --git a/Rendering/Label/CMakeLists.txt b/Rendering/Label/CMakeLists.txt new file mode 100644 index 00000000000..22ed7e1a5ba --- /dev/null +++ b/Rendering/Label/CMakeLists.txt @@ -0,0 +1,24 @@ +set(Module_SRCS + vtkLabeledDataMapper.cxx + vtkLabeledTreeMapDataMapper.cxx + vtkLabelHierarchyAlgorithm.cxx + vtkLabelHierarchyCompositeIterator.cxx + vtkLabelHierarchy.cxx + vtkLabelHierarchyIterator.cxx + vtkLabelPlacementMapper.cxx + vtkLabelPlacer.cxx + vtkLabelRenderStrategy.cxx + vtkLabelSizeCalculator.cxx + vtkFreeTypeLabelRenderStrategy.cxx + vtkDynamic2DLabelMapper.cxx + vtkPointSetToLabelHierarchy.cxx + ) + +set_source_files_properties( + vtkLabelHierarchyIterator + vtkLabelRenderStrategy + ABSTRACT + ) + +include_directories(${VTK_SOURCE_DIR}/Utilities) # octree +vtk_module_library(vtkRenderingLabel ${Module_SRCS}) diff --git a/Rendering/Label/module.cmake b/Rendering/Label/module.cmake new file mode 100644 index 00000000000..7a3506244a5 --- /dev/null +++ b/Rendering/Label/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkRenderingLabel + GROUPS + Rendering + StandAlone + DEPENDS + vtkRenderingFreeType + ) diff --git a/Rendering/OpenGL/CMakeLists.txt b/Rendering/OpenGL/CMakeLists.txt new file mode 100644 index 00000000000..0352b0ad7d8 --- /dev/null +++ b/Rendering/OpenGL/CMakeLists.txt @@ -0,0 +1,392 @@ +# FIXME: This should probably be fixed, vtkgl generation needs some refinement +# to allow for things to split up properly. + +set(VTK_USE_X_DEFAULT OFF) + +if(APPLE) + option(VTK_USE_COCOA "Use Cocoa for VTK render windows" ON) + option(VTK_USE_CARBON "Use Carbon for VTK render windows" OFF) + mark_as_advanced(VTK_USE_COCOA VTK_USE_CARBON) + if(VTK_USE_COCOA AND VTK_USE_CARBON) + message(FATAL_ERROR "You can't enable Carbon and Cocoa - you must choose one.") + endif() +elseif(UNIX) + set(VTK_USE_X_DEFAULT ON) +endif() + +option(VTK_USE_X "Use X for VTK render windows" ${VTK_USE_X_DEFAULT}) +mark_as_advanced(VTK_USE_X) + +# FIXME: The TDx support needs some refactoring before we can build it in a +# modular fashion, for now it must remain an option on vtkRenderingOpenGL. +option(VTK_USE_TDX "Use TDx interaction devices" OFF) +mark_as_advanced(VTK_USE_TDX) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkTDxConfigure.h.in + ${CMAKE_CURRENT_BINARY_DIR}/vtkTDxConfigure.h) + +set(Module_SRCS + vtkCameraPass.cxx + vtkClearZPass.cxx + vtkColorMaterialHelper.cxx + vtkDataTransferHelper.cxx + vtkDefaultPass.cxx + vtkDepthPeelingPass.cxx + vtkFrameBufferObject.cxx + vtkGaussianBlurPass.cxx + vtkGenericOpenGLRenderWindow.cxx + vtkImageProcessingPass.cxx + vtkLightingHelper.cxx + vtkLightsPass.cxx + vtkLineIntegralConvolution2D.cxx + vtkOpaquePass.cxx + vtkOpenGLActor.cxx + vtkOpenGLCamera.cxx + vtkOpenGLClipPlanesPainter.cxx + vtkOpenGLCoincidentTopologyResolutionPainter.cxx + vtkOpenGLDisplayListPainter.cxx + vtkOpenGLExtensionManager.cxx + vtkOpenGLFreeTypeTextMapper.cxx + vtkOpenGLGlyph3DMapper.cxx + vtkOpenGLHardwareSupport.cxx + vtkOpenGLImageMapper.cxx + #vtkOpenGLImageResliceMapper.cxx + vtkOpenGLImageSliceMapper.cxx + vtkOpenGLLight.cxx + vtkOpenGLLightingPainter.cxx + vtkOpenGLPainterDeviceAdapter.cxx + vtkOpenGLPolyDataMapper2D.cxx + vtkOpenGLPolyDataMapper.cxx + vtkOpenGLProperty.cxx + vtkOpenGLRenderer.cxx + vtkOpenGLRenderWindow.cxx + vtkOpenGLRepresentationPainter.cxx + vtkOpenGLScalarsToColorsPainter.cxx + vtkOpenGLState.cxx + vtkOpenGLTexture.cxx + #vtkOSOpenGLRenderWindow.cxx # OS Mesa + vtkOverlayPass.cxx + vtkPixelBufferObject.cxx + vtkRenderPassCollection.cxx + vtkRenderPass.cxx + vtkRenderState.cxx + vtkSequencePass.cxx + vtkShader2Collection.cxx + vtkShader2.cxx + vtkShaderProgram2.cxx + vtkShadowMapBakerPass.cxx + vtkShadowMapPass.cxx + vtkSobelGradientMagnitudePass.cxx + vtkTextureObject.cxx + vtkTextureUnitManager.cxx + vtkTranslucentPass.cxx + vtkUniformVariables.cxx + vtkVolumetricPass.cxx + ${CMAKE_CURRENT_BINARY_DIR}/vtkgl.cxx + vtkGLSLShaderDeviceAdapter.cxx + vtkGLSLShaderDeviceAdapter2.cxx + vtkGLSLShader.cxx + vtkGLSLShaderProgram.cxx + ${CMAKE_CURRENT_BINARY_DIR}/vtkRenderingOpenGLObjectFactory.cxx + ) + +set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/vtkgl.cxx + GENERATED) + +set_source_files_properties( + vtkImageProcessingPass + vtkOpenGLRenderWindow + vtkRenderPass + vtkRenderState + ABSTRACT + ) + +set_source_files_properties( + vtkLightingHelper + vtkRenderState + vtkOpenGLState + vtkShader2 + vtkShader2Collection + vtkShaderProgram2 + vtkTextureUnitManager + vtkgl + vtkRenderingOpenGLObjectFactory + WRAP_EXCLUDE + ) + +find_package(OpenGL REQUIRED) + +# Configuration for vtkOpenGLExtensionManager +if(WIN32) + set(VTK_USE_WGL_GET_PROC_ADDRESS 1) + find_package(DirectX QUIET) + if(DirectX_FOUND) + set(VTK_USE_DIRECTX 1) + endif() +elseif(APPLE) + set(VTK_USE_APPLE_LOADER 1) + find_package(ApplicationServices) + find_package(IOKit) + mark_as_advanced(ApplicationServices IOKit) + if(ApplicationServices_FOUND AND IOKit_FOUND) + set(VTK_USE_CORE_GRAPHICS 1) + endif() +else() + include(CheckFunctionExists) + set(VTK_SAVE_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") + set(CMAKE_REQUIRED_LIBRARIES + ${OPENGL_LIBRARIES} + ${CMAKE_THREAD_LIBS} + ${CMAKE_REQUIRED_LIBRARIES} + -lm + ) + if(VTK_USE_X) + include(vtkTestGLX) + check_function_exists(glXGetProcAddressARB VTK_USE_GLX_GET_PROC_ADDRESS_ARB) + if(VTK_USE_GLX_GET_PROC_ADDRESS_ARB) + if(NOT "${VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS_INCLUDES}" STREQUAL "${OPENGL_INCLUDE_DIR}") + # The OpenGL includes changed. Retest glXGetProcAddressARB prototype. + set(VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS_TESTED 0) + endif() + if(NOT VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS_TESTED) + message(STATUS "Looking for glXGetProcAddressARB in GL/glx.h") + try_compile(VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/CheckglXGetProcAddressARB.cxx + CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}" + "-DINCLUDE_DIRECTORIES:STRING=${OPENGL_INCLUDE_DIR}" + OUTPUT_VARIABLE OUTPUT) + message(STATUS "Looking for glXGetProcAddressARB in GL/glx.h - ${VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS}") + file(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log + "Determining if glXGetProcAddressARB exists in GL/glx.h ${VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS} with the following output:\n" + "${OUTPUT}\n\n") + set(VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS_TESTED 1 + CACHE INTERNAL "Already set VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS") + set(VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS_INCLUDES + "${OPENGL_INCLUDE_DIR}" + CACHE INTERNAL "OpenGL includes used to test glXGetProcAddressARB prototype.") + endif() + if(NOT VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS) + set(VTK_DEFINE_GLX_GET_PROC_ADDRESS_PROTOTYPE 1) + endif() + else() + check_function_exists(glXGetProcAddress VTK_USE_GLX_GET_PROC_ADDRESS) + if(NOT VTK_USE_GLX_GET_PROC_ADDRESS) + message(STATUS "Could not find extension loader. Extensions disabled.") + set(VTK_NO_EXTENSION_LOADING 1) + endif() + endif() + find_package(NVCtrlLib QUIET) + mark_as_advanced(NVCtrlLib_INCLUDE_DIR NVCtrlLib_LIBRARY) + if(NVCtrlLib_FOUND) + set(VTK_USE_NVCONTROL 1) + endif() + else() + set(VTK_NO_EXTENSION_LOADING 1) + endif() + set(CMAKE_REQUIRED_LIBRARIES "${VTK_SAVE_CMAKE_REQUIRED_LIBRARIES}") +endif() + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/vtkOpenGLExtensionManagerConfigure.h.in + ${CMAKE_CURRENT_BINARY_DIR}/vtkOpenGLExtensionManagerConfigure.h) + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vtkgl.cxx + COMMAND vtkParseOGLExt + ARGS ${CMAKE_CURRENT_BINARY_DIR} ${VTK_GLEXT_FILE} ${VTK_GLXEXT_FILE} ${VTK_WGLEXT_FILE} + DEPENDS ${VTK_GLEXT_FILE} ${VTK_GLXEXT_FILE} ${VTK_WGLEXT_FILE} + ) + +set_source_files_properties(vtkOpenGLExtensionManager.cxx + PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vtkgl.cxx) + +include_directories(${OPENGL_INCLUDE_DIR}) + +set(shader_files + vtkColorMaterialHelper_vs.glsl + vtkDepthPeeling_fs.glsl + vtkGaussianBlurPassShader_fs.glsl + vtkLighting_s.glsl # s not vs or fs because it can be used in both. + vtkLightingHelper_s.glsl # s not vs or fs because it can be used in both. + vtkLineIntegralConvolution2D_fs.glsl + vtkLineIntegralConvolution2D_fs1.glsl + vtkLineIntegralConvolution2D_fs2.glsl + vtkOpenGLRenderer_PeelingFS.glsl + vtkOpenGLPropertyDefaultPropFunc_fs.glsl + vtkOpenGLPropertyDefaultPropFunc_vs.glsl + vtkOpenGLPropertyDefaultMain_fs.glsl + vtkOpenGLPropertyDefaultMain_vs.glsl + vtkSobelGradientMagnitudePassShader1_fs.glsl + vtkSobelGradientMagnitudePassShader2_fs.glsl + vtkShadowMapPassShader_fs.glsl + vtkShadowMapPassShader_vs.glsl + vtkSurfaceLICPainter_fs1.glsl + vtkSurfaceLICPainter_fs2.glsl + vtkSurfaceLICPainter_vs1.glsl + ) + +unset(shader_h_files) +foreach(file ${shader_files}) + get_filename_component(file_we ${file} NAME_WE) + set(src ${CMAKE_CURRENT_SOURCE_DIR}/${file}) + set(res ${CMAKE_CURRENT_BINARY_DIR}/${file_we}.cxx) + set(resh ${CMAKE_CURRENT_BINARY_DIR}/${file_we}.h) + list(APPEND shader_h_files ${resh}) + add_custom_command( + OUTPUT ${res} ${resh} + DEPENDS ${src} vtkEncodeString + COMMAND vtkEncodeString + ARGS ${res} ${src} ${file_we} --build-header VTKRENDERINGOPENGL_EXPORT vtkRenderingOpenGLModule.h + ) + list(APPEND Module_SRCS ${res}) + set_source_files_properties(${file_we} WRAP_EXCLUDE) +endforeach() + +# Now we need to generate the object factory for this module. Create a list of +# overrides, and then generate the class that overrides those classes. +macro(vtk_add_override base override) + list(APPEND vtk_module_overrides ${base}) + set(vtk_module_${base}_override ${override}) +endmacro() + +set(opengl_overrides + Actor + Camera + ClipPlanesPainter + CoincidentTopologyResolutionPainter + DisplayListPainter + Glyph3DMapper + ImageSliceMapper + Light + LightingPainter + PainterDeviceAdapter + Property + Renderer + RepresentationPainter + ScalarsToColorsPainter + Texture + # Some from the vtkImagingFactory class + ImageMapper + PolyDataMapper2D + ) + +# Some that do not follow the naming scheme... +list(APPEND vtk_module_overrides "vtkPolyDataMapper") +set(vtk_module_vtkPolyDataMapper_override "vtkPainterPolyDataMapper") +list(APPEND vtk_module_overrides "vtkTextMapper") +set(vtk_module_vtkTextMapper_override "vtkOpenGLFreeTypeTextMapper") + +# FIXME: Not sure that this is the best way to handle X... +if(VTK_USE_X) + find_package(X11 REQUIRED) + if(NOT X11_Xt_FOUND) + message(FATAL_ERROR "X11_Xt_LIB could not be found. Required for VTK X lib.") + endif() + include_directories(${X11_INCLUDE_DIR} ${X11_Xt_INCLUDE_PATH}) + # Add some custom overrides + list(APPEND vtk_module_overrides "vtkRenderWindowInteractor") + set(vtk_module_vtkRenderWindowInteractor_override "vtkXRenderWindowInteractor") + list(APPEND vtk_module_overrides "vtkRenderWindow") + set(vtk_module_vtkRenderWindow_override "vtkXOpenGLRenderWindow") + list(APPEND Module_SRCS + vtkXRenderWindowInteractor.cxx + vtkXOpenGLRenderWindow.cxx + ) +elseif(WIN32) + # Add some custom overrides + list(APPEND vtk_module_overrides "vtkRenderWindowInteractor") + set(vtk_module_vtkRenderWindowInteractor_override "vtkWin32RenderWindowInteractor") + list(APPEND vtk_module_overrides "vtkRenderWindow") + set(vtk_module_vtkRenderWindow_override "vtkWin32OpenGLRenderWindow") + list(APPEND Module_SRCS + vtkWin32RenderWindowInteractor.cxx + vtkWin32OpenGLRenderWindow.cxx + ) +elseif(VTK_USE_COCOA) + # Add some custom overrides + list(APPEND vtk_module_overrides "vtkRenderWindowInteractor") + set(vtk_module_vtkRenderWindowInteractor_override "vtkCocoaRenderWindowInteractor") + list(APPEND vtk_module_overrides "vtkRenderWindow") + set(vtk_module_vtkRenderWindow_override "vtkCocoaRenderWindow") + list(APPEND Module_SRCS + vtkCocoaRenderWindowInteractor.mm + vtkCocoaRenderWindow.mm + vtkCocoaGLView.mm + ) + set_source_files_properties(vtkCocoaGLView WRAP_EXCLUDE) +elseif(VTK_USE_CARBON) + # Add some custom overrides + list(APPEND vtk_module_overrides "vtkRenderWindowInteractor") + set(vtk_module_vtkRenderWindowInteractor_override "vtkCarbonRenderWindowInteractor") + list(APPEND vtk_module_overrides "vtkRenderWindow") + set(vtk_module_vtkRenderWindow_override "vtkCarbonRenderWindow") + list(APPEND Module_SRCS + vtkCarbonRenderWindowInteractor.mm + vtkCarbonRenderWindow.mm + ) +endif() + +# Now to see about the GPU info list. +list(APPEND vtk_module_overrides "vtkGPUInfoList") +if(VTK_USE_NVCONTROL) + list(APPEND Module_SRCS "vtkXGPUInfoList.cxx") + set(extra_libs ${NVCtrlLib_LIBRARY}) + include_directories(${NVCtrlLib_INCLUDE_DIR}) + set(vtk_module_vtkGPUInfoList_override "vtkXGPUInfoList") +elseif(VTK_USE_CORE_GRAPHICS) + list(APPEND Module_SRCS "vtkCoreGraphicsGPUInfoList.cxx") + set(extra_libs ${ApplicationServices_LIBRARY} ${IOKit_LIBRARY}) + include_directories(${ApplicationServices_INCLUDE_DIR} ${IOKit_INCLUDE_DIR}) + set(vtk_module_vtkGPUInfoList_override "vtkCoreGraphicsGPUInfoList") +elseif(VTK_USE_DIRECTX) + list(APPEND Module_SRCS "vtkDirectXGPUInfoList.cxx") + set(extra_libs ${DirectX_LIBRARY} wbemuuid) + include_directories(${DirectX_INCLUDE_DIR}) + set(vtk_module_vtkGPUInfoList_override "vtkDirectXGPUInfoList") +else() + # Shouldn't this just be the base class, and the others override if needed? + list(APPEND Module_SRCS "vtkDummyGPUInfoList.cxx") + set(vtk_module_vtkGPUInfoList_override "vtkDummyGPUInfoList") +endif() + +foreach(_override ${opengl_overrides}) + vtk_add_override(vtk${_override} vtkOpenGL${_override}) +endforeach() + +# Now we iterate and create that class file... +foreach(_class ${vtk_module_overrides}) + set(_override ${vtk_module_${_class}_override}) + set(_vtk_override_includes "${_vtk_override_includes} +#include \"${_override}.h\"") + set(_vtk_override_creates "${_vtk_override_creates} +VTK_CREATE_CREATE_FUNCTION(${_override})") + set(_vtk_override_do "${_vtk_override_do} + this->RegisterOverride(\"${_class}\", + \"${_override}\", + \"Override for ${vtk-module} module\", 1, + vtkObjectFactoryCreate${_override});") +endforeach() + +# Now lets create the object factory classes +string(TOUPPER ${vtk-module} VTK-MODULE) +configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in + ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h) +configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in + ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx) + +# Configure the module specific settings into a module configured header. +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkRenderingOpenGLConfigure.h.in + ${CMAKE_CURRENT_BINARY_DIR}/vtkRenderingOpenGLConfigure.h) + +# Set up some of the module specific preprocessor definitions. +set(${vtk-module}_EXPORT_CODE "#include \"vtkRenderingOpenGLConfigure.h\"") + +vtk_module_library(vtkRenderingOpenGL ${Module_SRCS}) +target_link_libraries(vtkRenderingOpenGL ${OPENGL_LIBRARIES} ${extra_libs}) +if(VTK_USE_X) + target_link_libraries(vtkRenderingOpenGL ${X11_LIBRARIES} ${X11_Xt_LIB}) +elseif(VTK_USE_COCOA) + target_link_libraries(vtkRenderingOpenGL "-framework Cocoa") +elseif(VTK_USE_CARBON) + target_link_libraries(vtkRenderingOpenGL "-framework Carbon") +endif() diff --git a/Rendering/OpenGL/Testing/Cxx/CMakeLists.txt b/Rendering/OpenGL/Testing/Cxx/CMakeLists.txt index c4420265dde..0aeb8e2be27 100644 --- a/Rendering/OpenGL/Testing/Cxx/CMakeLists.txt +++ b/Rendering/OpenGL/Testing/Cxx/CMakeLists.txt @@ -1,217 +1,214 @@ -SET(KIT Rendering) - SET(RenderingTests otherCoordinate.cxx TestPriorityStreaming.cxx ) -SET(RenderingTestsWithArguments) - INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ) -IF(VTK_USE_DISPLAY) - # For tests that actually use a vtkRenderWindow - SET(RenderingTestsWithArguments +# For tests that actually use a vtkRenderWindow +SET(RenderingTestsWithArguments + LoadOpenGLExtension.cxx + TestActorLightingFlag.cxx + TestAnimationScene.cxx + TestBackfaceCulling.cxx + TestBlurAndSobelPasses.cxx + #TestDynamic2DLabelMapper.cxx + TestFBO.cxx + TestFollowerPicking.cxx + TestGaussianBlurPass.cxx + TestGlyph3DMapper.cxx + TestGlyph3DMapperMasking.cxx + TestGlyph3DMapperOrientationArray.cxx + TestGlyph3DMapperPicking.cxx + TestGPUInfo.cxx + TestGradientBackground.cxx + TestHomogeneousTransformOfActor.cxx + #TestImageResliceMapperAlpha.cxx + #TestImageResliceMapperBackground.cxx + #TestImageResliceMapperBorder.cxx + #TestImageResliceMapperInterpolation.cxx + #TestImageResliceMapperOffAxis.cxx + #TestImageResliceMapperOrient3D.cxx + #TestImageResliceMapperSlab.cxx + TestImageSliceMapperAlpha.cxx + TestImageSliceMapperBackground.cxx + TestImageSliceMapperBorder.cxx + TestImageSliceMapperOrient2D.cxx + TestImageSliceMapperOrient3D.cxx + TestImageSliceMapperInterpolation.cxx + #TestImageStack.cxx + TestInteractorTimers.cxx + #TestLabelPlacer.cxx + #TestLabelPlacer2D.cxx + #TestLabelPlacerCoincidentPoints.cxx + #TestLabelPlacementMapper2D.cxx + #TestLabelPlacementMapperCoincidentPoints.cxx + TestLightActor.cxx + TestLODActor.cxx + TestManyActors.cxx + TestOffAxisStereo.cxx + TestOrderedTriangulator.cxx + TestOpacity.cxx + TestOpenGLPolyDataMapper.cxx + TestOSConeCxx.cxx + TestPOVExporter.cxx + TestResetCameraVerticalAspectRatio.cxx + TestResetCameraVerticalAspectRatioParallel.cxx + #TestSetImageOrientation.cxx + TestSobelGradientMagnitudePass.cxx + TestShadowMapPass.cxx + TestTextActorAlphaBlending.cxx + TestTextActorDepthPeeling.cxx + TestTextActor3DAlphaBlending.cxx + TestTextActor3DDepthPeeling.cxx + TestTexturedBackground.cxx + TestTextureSize.cxx + TestTDx.cxx + #TestTilingCxx.cxx + TestTransformCoordinateUseDouble.cxx + TestTranslucentLUTAlphaBlending.cxx + TestTranslucentLUTDepthPeeling.cxx + TestTranslucentLUTDepthPeelingPass.cxx + TestTranslucentLUTTextureAlphaBlending.cxx + TestTranslucentLUTTextureDepthPeeling.cxx + ) + +if(WIN32 AND NOT VTK_USE_X) + set(RenderingTestsWithArguments ${RenderingTestsWithArguments} - LoadOpenGLExtension.cxx - TestActorLightingFlag.cxx - TestAnimationScene.cxx - TestBackfaceCulling.cxx - TestBlurAndSobelPasses.cxx - TestDynamic2DLabelMapper.cxx - TestFBO.cxx - TestFollowerPicking.cxx - TestGaussianBlurPass.cxx - TestGlyph3DMapper.cxx - TestGlyph3DMapperMasking.cxx - TestGlyph3DMapperOrientationArray.cxx - TestGlyph3DMapperPicking.cxx - TestGPUInfo.cxx - TestGradientBackground.cxx - TestHomogeneousTransformOfActor.cxx - TestImageResliceMapperAlpha.cxx - TestImageResliceMapperBackground.cxx - TestImageResliceMapperBorder.cxx - TestImageResliceMapperInterpolation.cxx - TestImageResliceMapperOffAxis.cxx - TestImageResliceMapperOrient3D.cxx - TestImageResliceMapperSlab.cxx - TestImageSliceMapperAlpha.cxx - TestImageSliceMapperBackground.cxx - TestImageSliceMapperBorder.cxx - TestImageSliceMapperOrient2D.cxx - TestImageSliceMapperOrient3D.cxx - TestImageSliceMapperInterpolation.cxx - TestImageStack.cxx - TestInteractorTimers.cxx - TestLabelPlacer.cxx - TestLabelPlacer2D.cxx - TestLabelPlacerCoincidentPoints.cxx - TestLabelPlacementMapper2D.cxx - TestLabelPlacementMapperCoincidentPoints.cxx - TestLightActor.cxx - TestLODActor.cxx - TestManyActors.cxx -# TestOffAxisStereo.cxx - TestOrderedTriangulator.cxx - TestOpacity.cxx - TestOpenGLPolyDataMapper.cxx - TestOSConeCxx.cxx - TestPOVExporter.cxx - TestResetCameraVerticalAspectRatio.cxx - TestResetCameraVerticalAspectRatioParallel.cxx - TestSetImageOrientation.cxx - TestSobelGradientMagnitudePass.cxx - TestShadowMapPass.cxx - TestTextActorAlphaBlending.cxx - TestTextActorDepthPeeling.cxx - TestTextActor3DAlphaBlending.cxx - TestTextActor3DDepthPeeling.cxx - TestTexturedBackground.cxx - TestTextureSize.cxx - TestTDx.cxx - TestTilingCxx.cxx - TestTransformCoordinateUseDouble.cxx - TestTranslucentLUTAlphaBlending.cxx - TestTranslucentLUTDepthPeeling.cxx - TestTranslucentLUTDepthPeelingPass.cxx - TestTranslucentLUTTextureAlphaBlending.cxx - TestTranslucentLUTTextureDepthPeeling.cxx + TestWin32OpenGLRenderWindow.cxx ) +endif() - IF(WIN32 AND NOT VTK_USE_X) - SET(RenderingTestsWithArguments - ${RenderingTestsWithArguments} - TestWin32OpenGLRenderWindow.cxx - ) - ENDIF(WIN32 AND NOT VTK_USE_X) - - IF(VTK_DATA_ROOT) - SET(RenderingTestsWithArguments - ${RenderingTestsWithArguments} - TestAreaSelections.cxx - TestMultiTexturing.cxx - TestMultiTexturingTransform.cxx - TestGlyph3DMapperArrow.cxx - TestScalarBar.cxx - TestScenePicker.cxx - TestTextureRGBA.cxx - TestTextureRGBADepthPeeling.cxx - TestTranslucentImageActorAlphaBlending.cxx - TestTranslucentImageActorDepthPeeling.cxx - TestTStripsColorsTCoords.cxx - TestTStripsNormalsColorsTCoords.cxx - TestTStripsNormalsTCoords.cxx - TestTStripsTCoords.cxx - ) - ENDIF(VTK_DATA_ROOT) - - IF(VTK_USE_DISPLAY AND VTK_DATA_ROOT) - SET(RenderingTestsWithArguments - ${RenderingTestsWithArguments} - RenderNonFinite.cxx - SurfacePlusEdges.cxx - TestLabelPlacementMapper.cxx - ) - ENDIF(VTK_USE_DISPLAY AND VTK_DATA_ROOT) - - IF (VTK_USE_GLSL_SHADERS) - # Tests testing GLSL Shaders. - SET(RenderingTestsWithArguments - ${RenderingTestsWithArguments} - TestGenericVertexAttributesGLSLCxx.cxx - TestGenericVertexAttributesGLSLAlphaBlending.cxx - TestGenericVertexAttributesGLSLDepthPeelingPass.cxx - ) - # Temporarily disable LIC tests on Mac - IF(NOT APPLE) - IF (VTK_DATA_ROOT) - SET( RenderingTestsWithArguments +if(VTK_DATA_ROOT) + set(RenderingTestsWithArguments + ${RenderingTestsWithArguments} + TestAreaSelections.cxx + TestMultiTexturing.cxx + TestMultiTexturingTransform.cxx + TestGlyph3DMapperArrow.cxx + #TestScalarBar.cxx + TestScenePicker.cxx + TestTextureRGBA.cxx + TestTextureRGBADepthPeeling.cxx + TestTranslucentImageActorAlphaBlending.cxx + TestTranslucentImageActorDepthPeeling.cxx + TestTStripsColorsTCoords.cxx + TestTStripsNormalsColorsTCoords.cxx + TestTStripsNormalsTCoords.cxx + TestTStripsTCoords.cxx + ) +endif() + +if(VTK_USE_DISPLAY AND VTK_DATA_ROOT) + set(RenderingTestsWithArguments + ${RenderingTestsWithArguments} + RenderNonFinite.cxx + SurfacePlusEdges.cxx + TestLabelPlacementMapper.cxx + ) +endif() + +if(VTK_USE_GLSL_SHADERS) + # Tests testing GLSL Shaders. + set(RenderingTestsWithArguments + ${RenderingTestsWithArguments} + TestGenericVertexAttributesGLSLCxx.cxx + TestGenericVertexAttributesGLSLAlphaBlending.cxx + TestGenericVertexAttributesGLSLDepthPeelingPass.cxx + ) + # Temporarily disable LIC tests on Mac + if(NOT APPLE) + if(VTK_DATA_ROOT) + set(RenderingTestsWithArguments ${RenderingTestsWithArguments} TestSurfaceLIC.cxx ) - ENDIF (VTK_DATA_ROOT) - ENDIF() - ENDIF (VTK_USE_GLSL_SHADERS) - -ENDIF(VTK_USE_DISPLAY) + endif() + endif() +endif() -CREATE_TEST_SOURCELIST(Tests ${KIT}CxxTests.cxx +create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx ${RenderingTests};${RenderingTestsWithArguments} EXTRA_INCLUDE vtkTestDriver.h ) -SET (TEST_FBO_IMPLEMENTATION_EXE +set(TEST_FBO_IMPLEMENTATION_EXE TestFBOImplementation) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/TestFBOInclude.h.in +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestFBOInclude.h.in ${CMAKE_CURRENT_BINARY_DIR}/TestFBOInclude.h @ONLY IMMEDIATE ESCAPE_QUOTES) # This is used by TestFBO. Using a separate processes makes is possible to # avoid issues to OpenGL implementations segfaulting etc. from affecting the # test. -ADD_EXECUTABLE(TestFBOImplementation +vtk_module_test_executable(TestFBOImplementation TestFBOImplementation.cxx) -TARGET_LINK_LIBRARIES(TestFBOImplementation - vtkRendering ${OPENGL_gl_LIBRARY}) +target_link_libraries(TestFBOImplementation + vtkRenderingOpenGL ${OPENGL_gl_LIBRARY}) -IF (VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY) - TARGET_LINK_LIBRARIES(TestFBOImplementation ${OSMESA_LIBRARY}) -ENDIF (VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY) +if(VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY) + target_link_libraries(TestFBOImplementation ${OSMESA_LIBRARY}) +endif() -ADD_EXECUTABLE(${KIT}CxxTests ${Tests}) -TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkRendering vtkIO ${OPENGL_gl_LIBRARY}) +vtk_module_test_executable(${vtk-module}CxxTests ${Tests}) -IF (VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY) - TARGET_LINK_LIBRARIES(${KIT}CxxTests ${OSMESA_LIBRARY}) -ENDIF (VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY) +if(VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY) + target_link_libraries(${vtk-module}CxxTests ${OSMESA_LIBRARY}) +endif() -SET (TestsToRun ${Tests}) -REMOVE (TestsToRun ${KIT}CxxTests.cxx) +set(TestsToRun ${Tests}) +remove(TestsToRun ${vtk-module}CxxTests.cxx) -# # Add all the executables -FOREACH (test ${RenderingTests}) - GET_FILENAME_COMPONENT(TName ${test} NAME_WE) - ADD_TEST(${TName} ${CXX_TEST_PATH}/${KIT}CxxTests ${TName} - -T ${VTK_BINARY_DIR}/Testing/Temporary +foreach(test ${RenderingTests}) + get_filename_component(TName ${test} NAME_WE) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -T ${VTK_BINARY_DIR}/Testing/Temporary ) -ENDFOREACH (test) +endforeach() -FOREACH (test ${RenderingTestsWithArguments}) - GET_FILENAME_COMPONENT(TName ${test} NAME_WE) - IF (VTK_DATA_ROOT) - ADD_TEST(${TName} ${CXX_TEST_PATH}/${KIT}CxxTests ${TName} +foreach(test ${RenderingTestsWithArguments}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} -D ${VTK_DATA_ROOT} -T ${VTK_BINARY_DIR}/Testing/Temporary - -V Baseline/${KIT}/${TName}.png) - ELSE (VTK_DATA_ROOT) - ADD_TEST(${TName} ${CXX_TEST_PATH}/${KIT}CxxTests ${TName} - -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/Rendering/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -T ${VTK_BINARY_DIR}/Testing/Temporary ) - ENDIF (VTK_DATA_ROOT) -ENDFOREACH(test) + endif() +endforeach() -# # Add other odd tests or executables -# -FOREACH (exe - TimeRenderer - TimeRenderer2 - VTKBenchMark - ) - ADD_EXECUTABLE(${exe} ${exe}.cxx) - TARGET_LINK_LIBRARIES(${exe} vtkRendering vtkIO ${OPENGL_gl_LIBRARY}) - IF (APPLE) - TARGET_LINK_LIBRARIES(${exe} "-framework GLUT") - ENDIF (APPLE) - IF (VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY) - TARGET_LINK_LIBRARIES(${exe} ${OSMESA_LIBRARY}) - ENDIF (VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY) -ENDFOREACH (exe) +foreach(exe + TimeRenderer + TimeRenderer2 + VTKBenchMark + ) + add_executable(${exe} ${exe}.cxx) + target_link_libraries(${exe} + vtkRenderingOpenGL + vtkInteractionStyle + vtkImagingSources + vtkImagingGeneral + vtkIOCore + ${OPENGL_gl_LIBRARY}) + if(APPLE) + target_link_libraries(${exe} "-framework GLUT") + endif() + if(VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY) + target_link_libraries(${exe} ${OSMESA_LIBRARY}) + endif() +endforeach() IF(VTK_USE_GLSL_SHADERS AND VTK_USE_DISPLAY) set_tests_properties(TestGenericVertexAttributesGLSLDepthPeelingPass PROPERTIES FAIL_REGULAR_EXPRESSION "ERROR:.*vtkOpenGLProperty.*Couldn't build the shader program. At this point , it can be an error in a shader or a driver bug.") diff --git a/Rendering/OpenGL/module.cmake b/Rendering/OpenGL/module.cmake new file mode 100644 index 00000000000..02cd22ebcb6 --- /dev/null +++ b/Rendering/OpenGL/module.cmake @@ -0,0 +1,22 @@ +vtk_module(vtkRenderingOpenGL + GROUPS + Rendering + StandAlone + IMPLEMENTS + vtkRenderingCore + DEPENDS + # These are likely to be removed soon - split Rendering/OpenGL further. + vtkRenderingFreeType # For vtkTextMapper + vtkIOImage # For vtkImageExport + vtkImagingHybrid # For vtkSampleFunction + COMPILE_DEPENDS + vtkParseOGLExt + vtkUtilitiesEncodeString + TEST_DEPENDS + vtkInteractionStyle + vtkTestingRendering + vtkIOExport + vtkRenderingLOD + vtkImagingGeneral + vtkImagingSources + ) diff --git a/Rendering/OpenGL/vtkOpenGL.h b/Rendering/OpenGL/vtkOpenGL.h index 671f6f855c9..eba48a5e1ea 100644 --- a/Rendering/OpenGL/vtkOpenGL.h +++ b/Rendering/OpenGL/vtkOpenGL.h @@ -15,6 +15,7 @@ #ifndef __vtkOpenGL_h #define __vtkOpenGL_h +#include "vtkRenderingOpenGLModule.h" // For export macro #include "vtkConfigure.h" // To prevent gl.h to include glext.h provided by the system diff --git a/Rendering/OpenGL/vtkRenderingOpenGLConfigure.h.in b/Rendering/OpenGL/vtkRenderingOpenGLConfigure.h.in new file mode 100644 index 00000000000..ac213278fbc --- /dev/null +++ b/Rendering/OpenGL/vtkRenderingOpenGLConfigure.h.in @@ -0,0 +1,66 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkRenderingOpenGLConfigure.h.in + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +#ifndef __vtkRenderingOpenGLConfigure_h +#define __vtkRenderingOpenGLConfigure_h + +/* This header contains build settings for the vtkRenderingOpenGL module. */ + +/* Whether VTK was built to support Carbon or Cocoa on the Mac. */ +#cmakedefine VTK_USE_CARBON +#cmakedefine VTK_USE_COCOA + +/*--------------------------------------------------------------------------*/ +/* Rendering Configuration */ +#cmakedefine VTK_USE_X +#define VTK_USE_OPENGL_LIBRARY +#cmakedefine VTK_OPENGL_HAS_OSMESA +#cmakedefine VTK_USE_OFFSCREEN + +#cmakedefine VTK_USE_CG_SHADERS +#cmakedefine VTK_USE_GLSL_SHADERS + +#cmakedefine VTK_MATERIALS_DIRS +#ifdef VTK_MATERIALS_DIRS +# undef VTK_MATERIALS_DIRS +# define VTK_MATERIALS_DIRS "@VTK_MATERIALS_DIRS@" +#endif + +/* Should VTK use the display? */ +#cmakedefine VTK_USE_DISPLAY + +/* Options for GPUInfo */ +#cmakedefine VTK_USE_DIRECTX +#cmakedefine VTK_USE_CORE_GRAPHICS +#cmakedefine VTK_USE_NVCONTROL + +/*--------------------------------------------------------------------------*/ +/* Setup VTK based on platform features and configuration. */ + +/* OGLR */ +/* OGLR is for GLX. It can be on Unix, Mac or Windows */ +#if ((defined(VTK_USE_OPENGL_LIBRARY) && defined(VTK_USE_X) && \ + !defined(_WIN32)) || \ + (defined(VTK_USE_X) && defined(_WIN32))) && \ + !(defined (VTK_USE_CARBON) || defined(VTK_USE_COCOA)) +# define VTK_USE_OGLR +#endif + +#if (defined(VTK_OPENGL_HAS_OSMESA) && !defined(VTK_USE_OGLR) && \ + !defined(_WIN32) && !defined(VTK_USE_CARBON) && !defined(VTK_USE_COCOA)) +# define VTK_USE_OSMESA +#endif + +#endif diff --git a/Rendering/Parallel/CMakeLists.txt b/Rendering/Parallel/CMakeLists.txt new file mode 100644 index 00000000000..ab01d7b9105 --- /dev/null +++ b/Rendering/Parallel/CMakeLists.txt @@ -0,0 +1,26 @@ +find_package(MPI REQUIRED) +include_directories(${MPI_INCLUDE_PATH}) + +set(Module_SRCS + vtkClientServerCompositePass.cxx + vtkClientServerSynchronizedRenderers.cxx + vtkCompositedSynchronizedRenderers.cxx + vtkCompositer.cxx + vtkCompositeRenderManager.cxx + vtkCompositeRGBAPass.cxx + # vtkCompositeZPass.cxx # fixme shaders + # vtkCompositeZPassShader_fs.glsl + vtkCompressCompositer.cxx + vtkParallelRenderManager.cxx + vtkPHardwareSelector.cxx + vtkSynchronizedRenderers.cxx + vtkSynchronizedRenderWindows.cxx + vtkTreeCompositer.cxx + ) + +set_source_files_properties( + vtkParallelRenderManager + ABSTRACT + ) + +vtk_module_library(vtkRenderingParallel ${Module_SRCS}) diff --git a/Rendering/Parallel/module.cmake b/Rendering/Parallel/module.cmake new file mode 100644 index 00000000000..4169c0646f5 --- /dev/null +++ b/Rendering/Parallel/module.cmake @@ -0,0 +1,8 @@ +vtk_module(vtkRenderingParallel + GROUPS + StandAlone + DEPENDS + vtkParallelCore + vtkFiltersParallel + vtkRenderingOpenGL + ) diff --git a/Rendering/Qt/CMakeLists.txt b/Rendering/Qt/CMakeLists.txt new file mode 100644 index 00000000000..ddb499e23eb --- /dev/null +++ b/Rendering/Qt/CMakeLists.txt @@ -0,0 +1,14 @@ +set(LibSrcs + vtkQImageToImageSource.cxx + vtkQtInitialization.cxx + vtkQtLabelRenderStrategy.cxx + vtkQtStringToImage.cxx + vtkQtTreeRingLabelMapper.cxx + ) + +# import Qt4 build settings +find_package(Qt4 REQUIRED QtCore QtGui QUIET) +include(${QT_USE_FILE}) + +vtk_module_library(${vtk-module} ${LibSrcs}) +target_link_libraries(${vtk-module} ${QT_LIBRARIES}) diff --git a/Rendering/Qt/module.cmake b/Rendering/Qt/module.cmake new file mode 100644 index 00000000000..94dd3669592 --- /dev/null +++ b/Rendering/Qt/module.cmake @@ -0,0 +1,10 @@ +vtk_module(vtkRenderingQt + GROUPS + Qt + DEPENDS + vtkRenderingLabel + vtkGUISupportQt + vtkFiltersTexture + TEST_DEPENDS + vtkTestingCore + ) diff --git a/Rendering/Volume/CMakeLists.txt b/Rendering/Volume/CMakeLists.txt index d9b1eb33a2d..c6b7e99f815 100644 --- a/Rendering/Volume/CMakeLists.txt +++ b/Rendering/Volume/CMakeLists.txt @@ -1,88 +1,72 @@ -SET(KIT VolumeRendering) -SET(UKIT VOLUMERENDERING) - -SET(KIT_TCL_LIBS vtkRenderingTCL vtkIOTCL) -SET(KIT_PYTHON_LIBS vtkRenderingPythonD vtkIOPythonD) -SET(KIT_JAVA_LIBS vtkRenderingJava vtkIOJava) -SET(KIT_INTERFACE_LIBRARIES vtkRendering vtkIO) -SET(KIT_LIBS ${OPENGL_gl_LIBRARY}) -SET(Kit_EXTRA_SRCS) -SET(Kit_EXTRA_CMDS) -SET(Kit_TCL_EXTRA_SRCS) -SET(Kit_PYTHON_EXTRA_SRCS) -SET(Kit_JAVA_EXTRA_SRCS) -SET(KIT_TCL_DEPS) -SET(KIT_PYTHON_DEPS) -SET(KIT_JAVA_DEPS) - -SET ( Kit_SRCS -vtkDirectionEncoder.cxx -vtkEncodedGradientEstimator.cxx -vtkEncodedGradientShader.cxx -vtkFiniteDifferenceGradientEstimator.cxx -vtkFixedPointRayCastImage.cxx -vtkFixedPointVolumeRayCastCompositeGOHelper.cxx -vtkFixedPointVolumeRayCastCompositeGOShadeHelper.cxx -vtkFixedPointVolumeRayCastCompositeHelper.cxx -vtkFixedPointVolumeRayCastCompositeShadeHelper.cxx -vtkFixedPointVolumeRayCastHelper.cxx -vtkFixedPointVolumeRayCastMIPHelper.cxx -vtkFixedPointVolumeRayCastMapper.cxx -vtkVolumeRayCastSpaceLeapingImageFilter.cxx -vtkGPUVolumeRayCastMapper.cxx -vtkHAVSVolumeMapper.cxx -vtkProjectedAAHexahedraMapper.cxx -vtkProjectedTetrahedraMapper.cxx -vtkRayCastImageDisplayHelper.cxx -vtkRecursiveSphereDirectionEncoder.cxx -vtkSmartVolumeMapper.cxx -vtkSphericalDirectionEncoder.cxx -vtkVolumeMapper.cxx -vtkVolumeOutlineSource.cxx -vtkVolumePicker.cxx -vtkVolumeRayCastCompositeFunction.cxx -vtkVolumeRayCastFunction.cxx -vtkVolumeRayCastIsosurfaceFunction.cxx -vtkVolumeRayCastMIPFunction.cxx -vtkVolumeRayCastMapper.cxx -vtkVolumeRenderingFactory.cxx -vtkVolumeTextureMapper.cxx -vtkVolumeTextureMapper2D.cxx -vtkVolumeTextureMapper3D.cxx -vtkUnstructuredGridBunykRayCastFunction.cxx -vtkUnstructuredGridHomogeneousRayIntegrator.cxx -vtkUnstructuredGridLinearRayIntegrator.cxx -vtkUnstructuredGridPartialPreIntegration.cxx -vtkUnstructuredGridPreIntegration.cxx -vtkUnstructuredGridVolumeMapper.cxx -vtkUnstructuredGridVolumeRayCastFunction.cxx -vtkUnstructuredGridVolumeRayCastIterator.cxx -vtkUnstructuredGridVolumeRayIntegrator.cxx -vtkUnstructuredGridVolumeRayCastMapper.cxx -vtkUnstructuredGridVolumeZSweepMapper.cxx -) - -IF(VTK_USE_PARALLEL) - set(Kit_SRCS ${Kit_SRCS} vtkAMRVolumeMapper.cxx) - set(KIT_INTERFACE_LIBRARIES ${KIT_INTERFACE_LIBRARIES} vtkAMR) - set(KIT_TCL_LIBS ${KIT_TCL_LIBS} vtkAMRTCL) - set(KIT_PYTHON_LIBS ${KIT_PYTHON_LIBS} vtkAMRPythonD) - set(KIT_JAVA_LIBS ${KIT_JAVA_LIBS} vtkAMRJava) -ENDIF(VTK_USE_PARALLEL) - -SET( KitOpenGL_SRCS +set(Module_SRCS + vtkDirectionEncoder.cxx + vtkEncodedGradientEstimator.cxx + vtkEncodedGradientShader.cxx + vtkFiniteDifferenceGradientEstimator.cxx + vtkFixedPointRayCastImage.cxx + vtkFixedPointVolumeRayCastCompositeGOHelper.cxx + vtkFixedPointVolumeRayCastCompositeGOShadeHelper.cxx + vtkFixedPointVolumeRayCastCompositeHelper.cxx + vtkFixedPointVolumeRayCastCompositeShadeHelper.cxx + vtkFixedPointVolumeRayCastHelper.cxx + vtkFixedPointVolumeRayCastMapper.cxx + vtkFixedPointVolumeRayCastMIPHelper.cxx + vtkGPUVolumeRayCastMapper.cxx + vtkHAVSVolumeMapper.cxx vtkOpenGLGPUVolumeRayCastMapper.cxx - vtkOpenGLHAVSVolumeMapper.cxx + vtkOpenGLHAVSVolumeMapper.cxx vtkOpenGLProjectedAAHexahedraMapper.cxx vtkOpenGLProjectedTetrahedraMapper.cxx vtkOpenGLRayCastImageDisplayHelper.cxx vtkOpenGLVolumeTextureMapper2D.cxx vtkOpenGLVolumeTextureMapper3D.cxx -) + vtkProjectedAAHexahedraMapper.cxx + vtkProjectedTetrahedraMapper.cxx + vtkRayCastImageDisplayHelper.cxx + vtkRecursiveSphereDirectionEncoder.cxx + vtkSmartVolumeMapper.cxx + vtkSphericalDirectionEncoder.cxx + vtkUnstructuredGridBunykRayCastFunction.cxx + vtkUnstructuredGridHomogeneousRayIntegrator.cxx + vtkUnstructuredGridLinearRayIntegrator.cxx + vtkUnstructuredGridPartialPreIntegration.cxx + vtkUnstructuredGridPreIntegration.cxx + vtkUnstructuredGridVolumeMapper.cxx + vtkUnstructuredGridVolumeRayCastFunction.cxx + vtkUnstructuredGridVolumeRayCastIterator.cxx + vtkUnstructuredGridVolumeRayCastMapper.cxx + vtkUnstructuredGridVolumeRayIntegrator.cxx + vtkUnstructuredGridVolumeZSweepMapper.cxx + vtkVolumeMapper.cxx + vtkVolumeOutlineSource.cxx + vtkVolumePicker.cxx + vtkVolumeRayCastCompositeFunction.cxx + vtkVolumeRayCastFunction.cxx + vtkVolumeRayCastIsosurfaceFunction.cxx + vtkVolumeRayCastMapper.cxx + vtkVolumeRayCastMIPFunction.cxx + vtkVolumeRayCastSpaceLeapingImageFilter.cxx + vtkVolumeRenderingFactory.cxx + vtkVolumeTextureMapper2D.cxx + vtkVolumeTextureMapper3D.cxx + vtkVolumeTextureMapper.cxx + ) + +set_source_files_properties( + vtkDirectionEncoder + vtkEncodedGradientEstimator + vtkFixedPointVolumeRayCastHelper + vtkRayCastImageDisplayHelper + vtkVolumeMapper + vtkVolumeRayCastFunction + vtkVolumeTextureMapper + vtkUnstructuredGridVolumeMapper + vtkUnstructuredGridVolumeRayCastFunction + vtkUnstructuredGridVolumeRayCastIterator + vtkUnstructuredGridVolumeRayIntegrator + ABSTRACT + ) -# ----------------------------------------------------------------------------- -# Set of GPU shader source files -# ----------------------------------------------------------------------------- set(shader_files vtkGPUVolumeRayCastMapper_AdditiveFS.glsl vtkGPUVolumeRayCastMapper_AdditiveCroppingFS.glsl @@ -132,70 +116,21 @@ set(shader_files vtkVolumeTextureMapper3D_TwoDependentShadeFP.asm ) -# ----------------------------------------------------------------------------- -# Create custom commands to encode each glsl file into a C string literal -# in a header file -# ----------------------------------------------------------------------------- - -set(shader_h_files) +unset(shader_h_files) foreach(file ${shader_files}) - GET_FILENAME_COMPONENT(file_we ${file} NAME_WE) - set(src ${VTK_SOURCE_DIR}/VolumeRendering/${file}) - set(res ${VTK_BINARY_DIR}/VolumeRendering/${file_we}.cxx) - set(resh ${VTK_BINARY_DIR}/VolumeRendering/${file_we}.h) + get_filename_component(file_we ${file} NAME_WE) + set(src ${CMAKE_CURRENT_SOURCE_DIR}/${file}) + set(res ${CMAKE_CURRENT_BINARY_DIR}/${file_we}.cxx) + set(resh ${CMAKE_CURRENT_BINARY_DIR}/${file_we}.h) + list(APPEND shader_h_files ${resh}) add_custom_command( OUTPUT ${res} ${resh} DEPENDS ${src} vtkEncodeString - COMMAND ${VTK_ENCODESTRING_EXE} - ARGS ${res} ${src} ${file_we} --build-header VTK_VOLUMERENDERING_EXPORT vtkSystemIncludes.h + COMMAND vtkEncodeString + ARGS ${res} ${src} ${file_we} --build-header VTKRENDERINGVOLUME_EXPORT vtkRenderingVolumeModule.h ) - set(Kit_EXTRA_SRCS ${Kit_EXTRA_SRCS} ${res}) - set(shader_h_files ${shader_h_files} ${resh}) -endforeach(file) - -IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - INSTALL(FILES - ${shader_h_files} - DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24} - COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) - -SET_SOURCE_FILES_PROPERTIES( -vtkDirectionEncoder -vtkEncodedGradientEstimator -vtkFixedPointVolumeRayCastHelper -vtkRayCastImageDisplayHelper -vtkVolumeMapper -vtkVolumeRayCastFunction -vtkVolumeTextureMapper -vtkUnstructuredGridVolumeMapper -vtkUnstructuredGridVolumeRayCastFunction -vtkUnstructuredGridVolumeRayCastIterator -vtkUnstructuredGridVolumeRayIntegrator -ABSTRACT -) - -IF(VTK_OPENGL_HAS_OSMESA) - IF (OSMESA_LIBRARY) - SET(KIT_LIBS ${KIT_LIBS} ${OSMESA_LIBRARY}) - ENDIF (OSMESA_LIBRARY) -ENDIF(VTK_OPENGL_HAS_OSMESA) - -SET(Kit_SRCS ${Kit_SRCS} ${KitOpenGL_SRCS}) - -#----------------------------------------------------------------------------- -# Include CMake code common to all kits. -INCLUDE(${VTK_CMAKE_DIR}/KitCommonBlock.cmake) -#----------------------------------------------------------------------------- - -# Make sure vtkRendering is built before vtkVolumeRendering builds. -# This will make sure vtkgl.h exists. -ADD_DEPENDENCIES(vtkVolumeRendering vtkRendering) + list(APPEND Module_SRCS ${res}) + set_source_files_properties(${file_we} WRAP_EXCLUDE) +endforeach() -# when crosscompiling vtkEncodeString is imported, don't add a dependency to it -# this should be handled by cmake so it doesn't have to be done here -IF(NOT CMAKE_CROSSCOMPILING) - # Add target dependency to ensure the vtkEncodeString is built before - # VolumeRendering is. - ADD_DEPENDENCIES(vtk${KIT} vtkEncodeString) -ENDIF(NOT CMAKE_CROSSCOMPILING) +vtk_module_library(vtkRenderingVolume ${Module_SRCS}) diff --git a/Rendering/Volume/Testing/Cxx/CMakeLists.txt b/Rendering/Volume/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000000..2a4db8f6644 --- /dev/null +++ b/Rendering/Volume/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,61 @@ +set(MyTests + HomogeneousRayIntegration.cxx + LinearRayIntegration.cxx + PartialPreIntegration.cxx + PreIntegrationIncremental.cxx + PreIntegrationNonIncremental.cxx + ProjectedTetrahedraZoomIn.cxx + TestFinalColorWindowLevel.cxx + TestFixedPointRayCastLightComponents.cxx + TestGPURayCastAdditive.cxx + TestGPURayCastCompositeBinaryMask.cxx + TestGPURayCastCompositeMask.cxx + TestGPURayCastCompositeMaskBlend.cxx + TestGPURayCastCompositeShadeMask.cxx + TestGPURayCastCompositeToMIP.cxx + TestGPURayCastCropping.cxx + TestGPURayCastDataTypesMIP.cxx + TestGPURayCastDataTypesMinIP.cxx + TestGPURayCastFourComponentsComposite.cxx + TestGPURayCastFourComponentsCompositeStreaming.cxx + TestGPURayCastFourComponentsMIP.cxx + TestGPURayCastFourComponentsMinIP.cxx + TestGPURayCastMIPBinaryMask.cxx + TestGPURayCastMIPToComposite.cxx + TestGPURayCastNearestDataTypesMIP.cxx + TestGPURayCastPerspectiveParallel.cxx + TestHAVSVolumeMapper.cxx + TestMinIntensityRendering.cxx + TestProjectedHexahedra.cxx + TestProjectedTetrahedra.cxx + TestProp3DFollower.cxx + TestSmartVolumeMapper.cxx + TestSmartVolumeMapperWindowLevel.cxx + TestTM3DLightComponents.cxx + ZsweepConcavities.cxx + volProt.cxx +) + +# Use the testing object factory, to reduce boilerplate code in tests. +include("${VTK_SOURCE_DIR}/Testing/Rendering/vtkTestingObjectFactory.cmake") + +vtk_module_test_executable(${vtk-module}CxxTests ${Tests} + ExerciseUnstructuredGridRayCastMapper.cxx ) + +set(TestsToRun ${Tests}) +list(REMOVE_ITEM TestsToRun CxxTests.cxx) + +# Add all the executables +foreach(test ${TestsToRun}) + get_filename_component(TName ${test} NAME_WE) + if(VTK_DATA_ROOT) + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName} + -D ${VTK_DATA_ROOT} + -T ${VTK_BINARY_DIR}/Testing/Temporary + -V Baseline/VolumeRendering/${TName}.png) + else() + add_test(NAME ${vtk-module}Cxx-${TName} + COMMAND ${vtk-module}CxxTests ${TName}) + endif() +endforeach() diff --git a/Rendering/Volume/module.cmake b/Rendering/Volume/module.cmake new file mode 100644 index 00000000000..49eb86813dc --- /dev/null +++ b/Rendering/Volume/module.cmake @@ -0,0 +1,15 @@ +vtk_module(vtkRenderingVolume + GROUPS + Rendering + StandAlone + DEPENDS + vtkImagingCore + vtkRenderingOpenGL + TEST_DEPENDS + vtkTestingCore + vtkTestingRendering + vtkRenderingFreeType + vtkImagingSources + vtkImagingGeneral + vtkInteractionStyle + ) diff --git a/Rendering/Volume/vtkVolumeRenderingFactory.cxx b/Rendering/Volume/vtkVolumeRenderingFactory.cxx index 98cc5986b4c..d4a4f61e6b2 100644 --- a/Rendering/Volume/vtkVolumeRenderingFactory.cxx +++ b/Rendering/Volume/vtkVolumeRenderingFactory.cxx @@ -20,7 +20,6 @@ #include "vtkGraphicsFactory.h" // if using some sort of opengl, then include these files -#if defined(VTK_USE_OGLR) || defined(VTK_USE_OSMESA) ||defined(_WIN32) || defined(VTK_USE_COCOA) || defined(VTK_USE_CARBON) #include "vtkOpenGLGPUVolumeRayCastMapper.h" #include "vtkOpenGLHAVSVolumeMapper.h" #include "vtkOpenGLProjectedAAHexahedraMapper.h" @@ -28,7 +27,6 @@ #include "vtkOpenGLRayCastImageDisplayHelper.h" #include "vtkOpenGLVolumeTextureMapper2D.h" #include "vtkOpenGLVolumeTextureMapper3D.h" -#endif #include "vtkCriticalSection.h" @@ -53,9 +51,7 @@ vtkObject* vtkVolumeRenderingFactory::CreateInstance(const char* vtkclassname ) #endif const char *rl = vtkGraphicsFactory::GetRenderLibrary(); - -#if defined(VTK_USE_OGLR) || defined(VTK_USE_OSMESA) ||defined(_WIN32) || defined(VTK_USE_COCOA) || defined(VTK_USE_CARBON) - if (!strcmp("OpenGL",rl) || !strcmp("Win32OpenGL",rl) || !strcmp("CarbonOpenGL",rl) || !strcmp("CocoaOpenGL",rl)) +// if (!strcmp("OpenGL",rl) || !strcmp("Win32OpenGL",rl) || !strcmp("CarbonOpenGL",rl) || !strcmp("CocoaOpenGL",rl)) { // GPU Ray Cast Mapper if(strcmp(vtkclassname, "vtkGPUVolumeRayCastMapper") == 0) @@ -99,7 +95,6 @@ vtkObject* vtkVolumeRenderingFactory::CreateInstance(const char* vtkclassname ) return vtkOpenGLRayCastImageDisplayHelper::New(); } } -#endif return 0; } diff --git a/TODO-Modularization.txt b/TODO-Modularization.txt new file mode 100644 index 00000000000..7200c1eac88 --- /dev/null +++ b/TODO-Modularization.txt @@ -0,0 +1,14 @@ +The modular VTK build system is not yet mature. The monolithic build +files had a lot of infrastructure. The modular build files reproduce +much of the functionality but some features will need to be restored +later. Remaining tasks include: + +- Restore rest of Python and Tcl add_test calls + +- Restore Examples directory build + +- Restore HeaderTesting + +- Restore Python SIP wrapping + +- Restore Install test diff --git a/Testing/Core/CMakeLists.txt b/Testing/Core/CMakeLists.txt new file mode 100644 index 00000000000..b58241401e9 --- /dev/null +++ b/Testing/Core/CMakeLists.txt @@ -0,0 +1 @@ +vtk_module_impl(vtkTestingCore) diff --git a/Testing/Core/module.cmake b/Testing/Core/module.cmake new file mode 100644 index 00000000000..8f5bac796a6 --- /dev/null +++ b/Testing/Core/module.cmake @@ -0,0 +1,2 @@ +vtk_module(vtkTestingCore + EXCLUDE_FROM_WRAPPING) diff --git a/Testing/IOSQL/CMakeLists.txt b/Testing/IOSQL/CMakeLists.txt new file mode 100644 index 00000000000..0c394a74ef2 --- /dev/null +++ b/Testing/IOSQL/CMakeLists.txt @@ -0,0 +1,5 @@ +set(module_SRCS + DatabaseSchemaWith2Tables.cxx + ) + +vtk_module_library(vtkTestingIOSQL ${module_SRCS}) diff --git a/Testing/IOSQL/DatabaseSchemaWith2Tables.cxx b/Testing/IOSQL/DatabaseSchemaWith2Tables.cxx index 26a36ffa5dd..5404363dacf 100644 --- a/Testing/IOSQL/DatabaseSchemaWith2Tables.cxx +++ b/Testing/IOSQL/DatabaseSchemaWith2Tables.cxx @@ -20,16 +20,38 @@ // Thanks to Philippe Pebay from Sandia National Laboratories for implementing // this example of a database schema. +#include "DatabaseSchemaWith2Tables.h" + +#include <stdexcept> + +#include "vtkSQLDatabaseSchema.h" + +DatabaseSchemaWith2Tables::DatabaseSchemaWith2Tables() +{ + this->Create(); +} + +DatabaseSchemaWith2Tables::~DatabaseSchemaWith2Tables() +{ + + if(this->Schema) + { + this->Schema->Delete(); + } +} + +void DatabaseSchemaWith2Tables::Create() +{ cerr << "@@ Creating a schema..."; - vtkSQLDatabaseSchema* schema = vtkSQLDatabaseSchema::New(); - schema->SetName( "TestSchema" ); + this->Schema = vtkSQLDatabaseSchema::New(); + this->Schema->SetName( "TestSchema" ); // Create PostgreSQL-specific preambles to load the PL/PGSQL language and create a function // with this language. These will be ignored by other backends. - schema->AddPreamble( "dropplpgsql", "DROP LANGUAGE IF EXISTS PLPGSQL CASCADE", VTK_SQL_POSTGRESQL ); - schema->AddPreamble( "loadplpgsql", "CREATE LANGUAGE PLPGSQL", VTK_SQL_POSTGRESQL ); - schema->AddPreamble( "createsomefunction", + this->Schema->AddPreamble( "dropplpgsql", "DROP EXTENSION IF EXISTS PLPGSQL", VTK_SQL_POSTGRESQL ); + this->Schema->AddPreamble( "loadplpgsql", "CREATE LANGUAGE PLPGSQL", VTK_SQL_POSTGRESQL ); + this->Schema->AddPreamble( "createsomefunction", "CREATE OR REPLACE FUNCTION somefunction() RETURNS TRIGGER AS $btable$ " "BEGIN " "INSERT INTO btable (somevalue) VALUES (NEW.somenmbr); " @@ -38,7 +60,7 @@ VTK_SQL_POSTGRESQL ); // Insert in alphabetical order so that SHOW TABLES does not mix handles - int tblHandle = schema->AddTableMultipleArguments( "atable", + this->TableAHandle = this->Schema->AddTableMultipleArguments( "atable", vtkSQLDatabaseSchema::COLUMN_TOKEN, vtkSQLDatabaseSchema::SERIAL, "tablekey", 0, "", vtkSQLDatabaseSchema::COLUMN_TOKEN, vtkSQLDatabaseSchema::VARCHAR, "somename", 64, "NOT NULL", vtkSQLDatabaseSchema::COLUMN_TOKEN, vtkSQLDatabaseSchema::BIGINT, "somenmbr", 17, "DEFAULT 0", @@ -61,7 +83,12 @@ vtkSQLDatabaseSchema::END_TABLE_TOKEN ); - tblHandle = schema->AddTableMultipleArguments( "btable", + if(this->TableAHandle < 0 ) + { + throw std::runtime_error("Could not create test schema: Failed to create atable"); + } + + this->TableBHandle = this->Schema->AddTableMultipleArguments( "btable", vtkSQLDatabaseSchema::COLUMN_TOKEN, vtkSQLDatabaseSchema::SERIAL, "tablekey", 0, "", vtkSQLDatabaseSchema::COLUMN_TOKEN, vtkSQLDatabaseSchema::BIGINT, "somevalue", 12, "DEFAULT 0", vtkSQLDatabaseSchema::INDEX_TOKEN, vtkSQLDatabaseSchema::PRIMARY_KEY, "", @@ -70,10 +97,10 @@ vtkSQLDatabaseSchema::END_TABLE_TOKEN ); - if ( tblHandle < 0 ) + if ( this->TableBHandle < 0 ) { - cerr << "Could not create test schema.\n"; - schema->Delete(); - return 1; + throw std::runtime_error("Could not create test schema: Failed to create btable"); } cerr << " done." << endl; + +} diff --git a/Testing/IOSQL/DatabaseSchemaWith2Tables.h b/Testing/IOSQL/DatabaseSchemaWith2Tables.h new file mode 100644 index 00000000000..416db602320 --- /dev/null +++ b/Testing/IOSQL/DatabaseSchemaWith2Tables.h @@ -0,0 +1,35 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: DatabaseSchemaWith2Tables.cxx + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +#include "vtkTestingIOSQLModule.h" + +class vtkSQLDatabaseSchema; + +class VTKTESTINGIOSQL_EXPORT DatabaseSchemaWith2Tables +{ + public: + DatabaseSchemaWith2Tables(); + ~DatabaseSchemaWith2Tables(); + vtkSQLDatabaseSchema* GetSchema() { return Schema; }; + int GetTableAHandle() { return TableAHandle; }; + int GetTableBHandle() { return TableBHandle; }; + vtkSQLDatabaseSchema* operator->() const { return this->Schema; }; + + private: + void Create(); + vtkSQLDatabaseSchema* Schema; + int TableAHandle; + int TableBHandle; +}; diff --git a/Testing/IOSQL/module.cmake b/Testing/IOSQL/module.cmake new file mode 100644 index 00000000000..b10b4ad4e49 --- /dev/null +++ b/Testing/IOSQL/module.cmake @@ -0,0 +1,5 @@ +vtk_module(vtkTestingIOSQL + DEPENDS + vtkIOSQL + EXCLUDE_FROM_WRAPPING + ) diff --git a/Testing/Rendering/CMakeLists.txt b/Testing/Rendering/CMakeLists.txt new file mode 100644 index 00000000000..6289b8f839b --- /dev/null +++ b/Testing/Rendering/CMakeLists.txt @@ -0,0 +1,7 @@ +set(module_SRCS + vtkTesting.cxx + vtkTestingInteractor.cxx + vtkTestingObjectFactory.cxx + ) + +vtk_module_library(vtkTestingRendering ${module_SRCS}) diff --git a/Testing/Rendering/module.cmake b/Testing/Rendering/module.cmake new file mode 100644 index 00000000000..68494ba5287 --- /dev/null +++ b/Testing/Rendering/module.cmake @@ -0,0 +1,6 @@ +vtk_module(vtkTestingRendering + DEPENDS + vtkTestingCore + vtkRenderingCore + vtkImagingCore + ) diff --git a/Testing/Rendering/vtkTestingInteractor.h b/Testing/Rendering/vtkTestingInteractor.h index 54a97af36f3..f8cd9366466 100644 --- a/Testing/Rendering/vtkTestingInteractor.h +++ b/Testing/Rendering/vtkTestingInteractor.h @@ -24,13 +24,15 @@ #ifndef __vtkTestingInteractor_h #define __vtkTestingInteractor_h +#include "vtkTestingRenderingModule.h" // For export macro #include "vtkRenderWindowInteractor.h" +#include "vtkObjectFactoryCollection.h" //BTX #include <string> // STL Header; Required for string //ETX -class VTK_RENDERING_EXPORT vtkTestingInteractor : public vtkRenderWindowInteractor +class VTKTESTINGRENDERING_EXPORT vtkTestingInteractor : public vtkRenderWindowInteractor { public: // Description: diff --git a/Testing/Rendering/vtkTestingObjectFactory.cmake b/Testing/Rendering/vtkTestingObjectFactory.cmake index 6da9d2ec87f..a7e94b2c542 100644 --- a/Testing/Rendering/vtkTestingObjectFactory.cmake +++ b/Testing/Rendering/vtkTestingObjectFactory.cmake @@ -49,6 +49,15 @@ SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN vtkSmartPointer<vtkTestingObjectFactory> factory = vtkSmartPointer<vtkTestingObjectFactory>::New(); if (!interactive) { + // Disable any other overrides before registering our factory. + vtkObjectFactoryCollection *collection = vtkObjectFactory::GetRegisteredFactories(); + collection->InitTraversal(); + vtkObjectFactory *f = collection->GetNextItem(); + while (f) + { + f->Disable(\"vtkRenderWindowInteractor\"); + f = collection->GetNextItem(); + } vtkObjectFactory::RegisterFactory(factory); } " @@ -74,5 +83,5 @@ SET(CMAKE_TESTDRIVER_AFTER_TESTMAIN " ) CREATE_TEST_SOURCELIST(Tests ${KIT}CxxTests.cxx ${MyTests} - EXTRA_INCLUDE ${VTK_SOURCE_DIR}/Rendering/vtkTestingObjectFactory.h) + EXTRA_INCLUDE ${VTK_SOURCE_DIR}/Testing/Rendering/vtkTestingObjectFactory.h) diff --git a/ThirdParty/Cosmo/CMakeLists.txt b/ThirdParty/Cosmo/CMakeLists.txt index f0d2f86fcc9..5bc7f287440 100644 --- a/ThirdParty/Cosmo/CMakeLists.txt +++ b/ThirdParty/Cosmo/CMakeLists.txt @@ -1,6 +1,10 @@ project(Cosmo) +set(vtkCosmo_THIRD_PARTY 1) +set(vtkCosmo_LIBRARIES Cosmo) +vtk_module_impl() + #SET(Cosmo_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) SET(Cosmo_LIBS) @@ -36,20 +40,7 @@ SET(Cosmo_SOURCES INCLUDE_DIRECTORIES (${Cosmo_SOURCE_DIR} ${Cosmo_BINARY_DIR}) VTK_ADD_LIBRARY(Cosmo ${Cosmo_SOURCES}) -TARGET_LINK_LIBRARIES(Cosmo vtksys vtkCommon ${Cosmo_LIBS}) - -# Apply user-defined properties to the library target. Such as SO Version -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(Cosmo PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS Cosmo - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) +TARGET_LINK_LIBRARIES(Cosmo ${vtkCommonCore_LIBRARIES} ${Cosmo_LIBS}) IF(NOT VTK_INSTALL_NO_DEVELOPMENT) INSTALL(FILES diff --git a/ThirdParty/Cosmo/module.cmake b/ThirdParty/Cosmo/module.cmake new file mode 100644 index 00000000000..995855da530 --- /dev/null +++ b/ThirdParty/Cosmo/module.cmake @@ -0,0 +1,6 @@ +vtk_module(vtkCosmo + DEPENDS + vtkCommonCore + vtkParallelMPI + EXCLUDE_FROM_WRAPPING + ) diff --git a/ThirdParty/VPIC/CMakeLists.txt b/ThirdParty/VPIC/CMakeLists.txt index 4e2531f29e4..6c145ae65d5 100644 --- a/ThirdParty/VPIC/CMakeLists.txt +++ b/ThirdParty/VPIC/CMakeLists.txt @@ -1,6 +1,10 @@ project(VPIC) +set(vtkVPIC_THIRD_PARTY 1) +set(vtkVPIC_LIBRARIES VPIC) +vtk_module_impl() + SET(VPIC_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) CONFIGURE_FILE (${VPIC_SOURCE_DIR}/VPICDefinition.h.in @@ -32,19 +36,6 @@ TARGET_LINK_LIBRARIES(VPIC ${MPI_LIBRARY}) ENDIF(MPI_EXTRA_LIBRARY) ENDIF(VTK_USE_MPI) -# Apply user-defined properties to the library target. Such as SO Version -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(VPIC PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS VPIC - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) - IF(NOT VTK_INSTALL_NO_DEVELOPMENT) INSTALL(FILES ${VPIC_SOURCE_DIR}/VPICDataSet.h diff --git a/ThirdParty/VPIC/module.cmake b/ThirdParty/VPIC/module.cmake new file mode 100644 index 00000000000..05413541f58 --- /dev/null +++ b/ThirdParty/VPIC/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkVPIC + DEPENDS + vtkCommonCore + vtkParallelMPI + vtksys + EXCLUDE_FROM_WRAPPING + ) diff --git a/ThirdParty/alglib/CMakeLists.txt b/ThirdParty/alglib/CMakeLists.txt index 15b7ea1aacd..46dbdeae60e 100644 --- a/ThirdParty/alglib/CMakeLists.txt +++ b/ThirdParty/alglib/CMakeLists.txt @@ -1,5 +1,9 @@ project( alglib ) +set(vtkalglib_THIRD_PARTY 1) +set(vtkalglib_LIBRARIES vtkalglib) +vtk_module_impl() + cmake_minimum_required( VERSION 2.4 ) if ( NOT LIBRARY_OUTPUT_PATH ) @@ -37,44 +41,17 @@ vtk_add_library( vtkalglib ${ALGLIB_SRCS} ) -# Apply user-defined properties to the library target. -if ( VTK_LIBRARY_PROPERTIES ) - set_target_properties( vtkalglib PROPERTIES ${VTK_LIBRARY_PROPERTIES} ) -endif ( VTK_LIBRARY_PROPERTIES ) - # # Install rules # # Grab install locations from VTK if we are building as part of VTK -if ( VTK_INSTALL_BIN_DIR_CM24 ) - set( alglib_install_bin_dir ${VTK_INSTALL_BIN_DIR_CM24} ) -else ( VTK_INSTALL_BIN_DIR_CM24 ) - set( alglib_install_bin_dir ${CMAKE_INSTALL_PREFIX}/bin ) -endif ( VTK_INSTALL_BIN_DIR_CM24 ) - -if ( VTK_INSTALL_LIB_DIR_CM24 ) - set( alglib_install_lib_dir ${VTK_INSTALL_LIB_DIR_CM24} ) -else ( VTK_INSTALL_LIB_DIR_CM24 ) - set( alglib_install_lib_dir ${CMAKE_INSTALL_PREFIX}/lib ) -endif ( VTK_INSTALL_LIB_DIR_CM24 ) - if ( VTK_INSTALL_INCLUDE_DIR_CM24 ) set( alglib_install_inc_dir ${VTK_INSTALL_INCLUDE_DIR_CM24} ) else ( VTK_INSTALL_INCLUDE_DIR_CM24 ) set( alglib_install_inc_dir ${CMAKE_INSTALL_PREFIX}/include ) endif ( VTK_INSTALL_INCLUDE_DIR_CM24 ) -# Library: -if ( NOT VTK_INSTALL_NO_LIBRARIES ) - install( TARGETS vtkalglib - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${alglib_install_bin_dir} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${alglib_install_lib_dir} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${alglib_install_lib_dir} COMPONENT Development - ) -endif ( NOT VTK_INSTALL_NO_LIBRARIES ) - # Header files: if ( NOT VTK_INSTALL_NO_DEVELOPMENT ) install( FILES diff --git a/ThirdParty/alglib/module.cmake b/ThirdParty/alglib/module.cmake new file mode 100644 index 00000000000..9b237bfb8d5 --- /dev/null +++ b/ThirdParty/alglib/module.cmake @@ -0,0 +1 @@ +vtk_module(vtkalglib EXCLUDE_FROM_WRAPPING) diff --git a/ThirdParty/exodusII/CMakeLists.txt b/ThirdParty/exodusII/CMakeLists.txt new file mode 100644 index 00000000000..6cf4e3bfc34 --- /dev/null +++ b/ThirdParty/exodusII/CMakeLists.txt @@ -0,0 +1,4 @@ +set(vtkexodusII_THIRD_PARTY 1) +set(vtkexodusII_LIBRARIES vtkexoIIc) +vtk_module_impl() +add_subdirectory(vtkexodusII) diff --git a/ThirdParty/exodusII/module.cmake b/ThirdParty/exodusII/module.cmake new file mode 100644 index 00000000000..f6bc78107c7 --- /dev/null +++ b/ThirdParty/exodusII/module.cmake @@ -0,0 +1,5 @@ +vtk_module(vtkexodusII + DEPENDS + vtknetcdf + EXCLUDE_FROM_WRAPPING + ) diff --git a/ThirdParty/exodusII/vtk_exodusII.h b/ThirdParty/exodusII/vtk_exodusII.h index 40b05bbfa0a..881cabaf202 100644 --- a/ThirdParty/exodusII/vtk_exodusII.h +++ b/ThirdParty/exodusII/vtk_exodusII.h @@ -16,6 +16,6 @@ #define __vtk_exodusII_h /* Use the exodusII library configured for VTK. */ -#include <vtkexodus2/include/exodusII.h> +#include <vtkexodusII/include/exodusII.h> #endif diff --git a/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt b/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt index 9c33790de26..9a7ab132c89 100644 --- a/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt +++ b/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt @@ -243,18 +243,6 @@ ENDIF(APPLE) VTK_ADD_LIBRARY(vtkexoIIc ${cbind_SRCS}) TARGET_LINK_LIBRARIES(vtkexoIIc vtkNetCDF) -# Apply user-defined properties to the library target. -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(vtkexoIIc PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtkexoIIc - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) IF(NOT VTK_INSTALL_NO_DEVELOPMENT) # INSTALL_FILES(${VTK_INSTALL_INCLUDE_DIR}/vtkexodus2 .h ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) diff --git a/ThirdParty/exodusII/vtkexodusII/include/exodusII.h b/ThirdParty/exodusII/vtkexodusII/include/exodusII.h index 7223b6a234f..8d42954b5ab 100644 --- a/ThirdParty/exodusII/vtkexodusII/include/exodusII.h +++ b/ThirdParty/exodusII/vtkexodusII/include/exodusII.h @@ -45,7 +45,7 @@ #include "vtk_netcdf.h" #include "vtk_exodus2_mangle.h" -#include "vtkexodus2/include/exodusII_cfg.h" +#include "vtkexodusII/include/exodusII_cfg.h" /* EXODUS II version number */ #define EX_API_VERS 5.10f diff --git a/ThirdParty/expat/CMakeLists.txt b/ThirdParty/expat/CMakeLists.txt new file mode 100644 index 00000000000..8fd9439688d --- /dev/null +++ b/ThirdParty/expat/CMakeLists.txt @@ -0,0 +1 @@ +vtk_module_third_party(EXPAT) diff --git a/ThirdParty/expat/module.cmake b/ThirdParty/expat/module.cmake new file mode 100644 index 00000000000..612640a0a6c --- /dev/null +++ b/ThirdParty/expat/module.cmake @@ -0,0 +1 @@ +vtk_module(vtkexpat EXCLUDE_FROM_WRAPPING) diff --git a/ThirdParty/expat/vtkexpat/CMakeLists.txt b/ThirdParty/expat/vtkexpat/CMakeLists.txt index d4426a9ead2..aef6a101f84 100644 --- a/ThirdParty/expat/vtkexpat/CMakeLists.txt +++ b/ThirdParty/expat/vtkexpat/CMakeLists.txt @@ -22,18 +22,6 @@ CONFIGURE_FILE(${VTKEXPAT_SOURCE_DIR}/expatDllConfig.h.in VTK_ADD_LIBRARY(vtkexpat ${expat_SRCS}) -# Apply user-defined properties to the library target. -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(vtkexpat PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtkexpat - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) IF(NOT VTK_INSTALL_NO_DEVELOPMENT) INSTALL(FILES ${VTKEXPAT_BINARY_DIR}/expatDllConfig.h diff --git a/ThirdParty/freetype/CMakeLists.txt b/ThirdParty/freetype/CMakeLists.txt new file mode 100644 index 00000000000..230f2e3fbfd --- /dev/null +++ b/ThirdParty/freetype/CMakeLists.txt @@ -0,0 +1,3 @@ +vtk_module_third_party(Freetype + INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/vtkfreetype/include + ) diff --git a/ThirdParty/freetype/module.cmake b/ThirdParty/freetype/module.cmake new file mode 100644 index 00000000000..2eddfc06df3 --- /dev/null +++ b/ThirdParty/freetype/module.cmake @@ -0,0 +1 @@ +vtk_module(vtkfreetype EXCLUDE_FROM_WRAPPING) diff --git a/ThirdParty/freetype/vtkfreetype/CMakeLists.txt b/ThirdParty/freetype/vtkfreetype/CMakeLists.txt index 7573fc30b10..ceac6fd8d96 100644 --- a/ThirdParty/freetype/vtkfreetype/CMakeLists.txt +++ b/ThirdParty/freetype/vtkfreetype/CMakeLists.txt @@ -109,19 +109,6 @@ IF (APPLE AND VTKFREETYPE_MAC_FONT_SUPPORT) TARGET_LINK_LIBRARIES (vtkfreetype "-framework ApplicationServices -framework CoreServices") ENDIF (APPLE AND VTKFREETYPE_MAC_FONT_SUPPORT) -# Apply user-defined properties to the library target. -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(vtkfreetype PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtkfreetype - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) - # # Create the configuration file # diff --git a/ThirdParty/ftgl/CMakeLists.txt b/ThirdParty/ftgl/CMakeLists.txt index 9af07a31274..ce977c9fc02 100644 --- a/ThirdParty/ftgl/CMakeLists.txt +++ b/ThirdParty/ftgl/CMakeLists.txt @@ -1,18 +1,16 @@ PROJECT (VTKFTGL) +set(vtkftgl_THIRD_PARTY 1) +set(vtkftgl_LIBRARIES vtkftgl) +set(vtkftgl_INCLUDE_DIRS ${VTKFTGL_SOURCE_DIR}/src) +vtk_module_impl() +set(VTK_FREETYPE_LIBRARIES ${vtkfreetype_LIBRARIES}) + # # Dependency mask # INCLUDE_REGULAR_EXPRESSION(".*") -# -# Include path -# -INCLUDE_DIRECTORIES ( - ${VTKFTGL_SOURCE_DIR}/src - ${VTKFTGL_BINARY_DIR} -) - # # Collect the required libs # @@ -136,19 +134,6 @@ SET (VTKFTGL_LIBS "${VTKFTGL_LIBS};${VTK_FREETYPE_LIBRARIES}") VTK_ADD_LIBRARY (vtkftgl ${FTGL_SRCS}) TARGET_LINK_LIBRARIES(vtkftgl ${VTKFTGL_LIBS}) -# Apply user-defined properties to the library target. -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(vtkftgl PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtkftgl - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) - # # Create the configuration file # diff --git a/ThirdParty/ftgl/module.cmake b/ThirdParty/ftgl/module.cmake new file mode 100644 index 00000000000..28ff7dcff9d --- /dev/null +++ b/ThirdParty/ftgl/module.cmake @@ -0,0 +1,5 @@ +vtk_module(vtkftgl + DEPENDS + vtkfreetype + EXCLUDE_FROM_WRAPPING + ) diff --git a/ThirdParty/gl2ps/CMakeLists.txt b/ThirdParty/gl2ps/CMakeLists.txt new file mode 100644 index 00000000000..cd4442b3efa --- /dev/null +++ b/ThirdParty/gl2ps/CMakeLists.txt @@ -0,0 +1 @@ +vtk_module_third_party(GL2PS NO_LIBRARIES) diff --git a/ThirdParty/gl2ps/module.cmake b/ThirdParty/gl2ps/module.cmake new file mode 100644 index 00000000000..cf8fe7991b9 --- /dev/null +++ b/ThirdParty/gl2ps/module.cmake @@ -0,0 +1 @@ +vtk_module(vtkgl2ps EXCLUDE_FROM_WRAPPING) diff --git a/ThirdParty/hdf5/CMakeLists.txt b/ThirdParty/hdf5/CMakeLists.txt new file mode 100644 index 00000000000..cee72c6fa9a --- /dev/null +++ b/ThirdParty/hdf5/CMakeLists.txt @@ -0,0 +1,71 @@ +vtk_module_third_party(HDF5 + LIBRARIES vtkhdf5_hl vtkhdf5 + INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/vtkhdf5 + ${CMAKE_CURRENT_SOURCE_DIR}/vtkhdf5/hl/src + NO_ADD_SUBDIRECTORY + ) +if(VTK_USE_SYSTEM_HDF5) + return() +endif() + +set(HDF5_EXTERNALLY_CONFIGURED ON) +set(HDF5_EXTERNAL_LIB_PREFIX "vtk") +set(HDF5_EXPORTED_TARGETS ${VTK_INSTALL_EXPORT_NAME}) +set(HDF5_INSTALL_LIBRARY_DIR ${VTK_INSTALL_LIBRARY_DIR}) +set(HDF5_INSTALL_ARCHIVE_DIR ${VTK_INSTALL_ARCHIVE_DIR}) +set(HDF5_INSTALL_RUNTIME_DIR ${VTK_INSTALL_RUNTIME_DIR}) +set(HDF5_INSTALL_INCLUDE_DIR ${VTK_INSTALL_INCLUDE_DIR}/vtkhdf5) +set(HDF5_INSTALL_NO_DEVELOPMENT ${VTK_INSTALL_NO_DEVELOPMENT}) + +set(HDF5_INSTALL_BIN_DIR ${VTK_INSTALL_BIN_DIR_CM24}) +set(HDF5_INSTALL_LIB_DIR ${VTK_INSTALL_LIB_DIR_CM24}) + +# Configure HDF5 privately so its options do not appear to the user. +set(HDF5_ALLOW_EXTERNAL_SUPPORT OFF CACHE INTERNAL "Allow External Library Building") +set(HDF5_BUILD_CPP_LIB OFF CACHE INTERNAL "Build HDF5 C++ Library") +set(HDF5_BUILD_HL_LIB ON CACHE INTERNAL "Build HIGH Level HDF5 Library") +set(HDF5_DISABLE_COMPILER_WARNINGS ON CACHE INTERNAL "Disable HDF5 warnings") +set(HDF5_ENABLE_CODESTACK OFF CACHE INTERNAL "Enable the function stack tracing (for developer debugging).") +set(HDF5_ENABLE_COVERAGE OFF CACHE INTERNAL "Enable code coverage for Libraries and Programs") +set(HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE INTERNAL "Enable deprecated public API symbols") +set(HDF5_ENABLE_GPFS OFF CACHE INTERNAL "Enable GPFS hints for the MPI/POSIX file driver") +set(HDF5_ENABLE_HSIZET ON CACHE INTERNAL "Enable datasets larger than memory") +set(HDF5_ENABLE_LARGE_FILE ON CACHE INTERNAL "Enable support for large (64-bit) files on Linux.") +set(HDF5_ENABLE_PARALLEL OFF CACHE INTERNAL "Enable parallel build (requires MPI)") +set(HDF5_ENABLE_SZIP_SUPPORT OFF CACHE INTERNAL "Use SZip Filter") +set(HDF5_ENABLE_THREADSAFE OFF CACHE INTERNAL "Enable Threadsafety") +set(HDF5_ENABLE_TRACE OFF CACHE INTERNAL "Enable API tracing capability") +set(HDF5_ENABLE_USING_MEMCHECKER OFF CACHE INTERNAL "Indicate that a memory checker is used") +set(HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE INTERNAL "Enable HDF5 Zlib Filters") +set(HDF5_Enable_Clear_File_Buffers ON CACHE INTERNAL "Securely clear file buffers before writing to file") +set(HDF5_Enable_Instrument OFF CACHE INTERNAL "Instrument The library") +set(HDF5_METADATA_TRACE_FILE OFF CACHE INTERNAL "Enable metadata trace file collection") +set(HDF5_PACKAGE_EXTLIBS OFF CACHE INTERNAL "CPACK - include external libraries") +set(HDF5_STRICT_FORMAT_CHECKS OFF CACHE INTERNAL "Whether to perform strict file format checks") +set(HDF5_USE_16_API_DEFAULT OFF CACHE INTERNAL "Use the HDF5 1.6.x API by default") +set(HDF5_USE_FILTER_FLETCHER32 ON CACHE INTERNAL "Use the FLETCHER32 Filter") +set(HDF5_USE_FILTER_NBIT ON CACHE INTERNAL "Use the NBIT Filter") +set(HDF5_USE_FILTER_SCALEOFFSET ON CACHE INTERNAL "Use the SCALEOFFSET Filter") +set(HDF5_USE_FILTER_SHUFFLE ON CACHE INTERNAL "Use the SHUFFLE Filter") +set(HDF5_USE_H5DUMP_PACKED_BITS ON CACHE INTERNAL "Use the PACKED BITS feature in h5dump") +set(HDF5_WANT_DATA_ACCURACY ON CACHE INTERNAL "IF data accuracy is guaranteed during data conversions") +set(HDF5_WANT_DCONV_EXCEPTION ON CACHE INTERNAL "exception handling functions is checked during data conversions") +set(HDF_LEGACY_NAMING ON CACHE INTERNAL "Use Legacy Names for Libraries and Programs") + +# Setup all necessary overrides for zlib so that HDF5 uses our +# internally compiled zlib rather than any other version +if(HDF5_ENABLE_Z_LIB_SUPPORT) + # We must tell the main HDF5 library that it depends on our zlib + set(ZLIB_INCLUDE_DIRS "${vtkzlib_INCLUDE_DIRS}") + set(ZLIB_LIBRARIES "${vtkzlib_LIBRARIES}") + set(H5_ZLIB_HEADER "vtk_zlib.h") +endif(HDF5_ENABLE_Z_LIB_SUPPORT) + +add_subdirectory(vtkhdf5) + +foreach(lib + vtkhdf5 + vtkhdf5_hl + ) + vtk_target(${lib} NO_INSTALL) +endforeach() diff --git a/ThirdParty/hdf5/module.cmake b/ThirdParty/hdf5/module.cmake new file mode 100644 index 00000000000..2572e2c9fbe --- /dev/null +++ b/ThirdParty/hdf5/module.cmake @@ -0,0 +1,5 @@ +vtk_module(vtkhdf5 + DEPENDS + vtkzlib + EXCLUDE_FROM_WRAPPING + ) diff --git a/ThirdParty/jpeg/CMakeLists.txt b/ThirdParty/jpeg/CMakeLists.txt new file mode 100644 index 00000000000..2d8fd9d9c62 --- /dev/null +++ b/ThirdParty/jpeg/CMakeLists.txt @@ -0,0 +1 @@ +vtk_module_third_party(JPEG) diff --git a/ThirdParty/jpeg/module.cmake b/ThirdParty/jpeg/module.cmake new file mode 100644 index 00000000000..e761c5e7c34 --- /dev/null +++ b/ThirdParty/jpeg/module.cmake @@ -0,0 +1 @@ +vtk_module(vtkjpeg EXCLUDE_FROM_WRAPPING) diff --git a/ThirdParty/jpeg/vtkjpeg/CMakeLists.txt b/ThirdParty/jpeg/vtkjpeg/CMakeLists.txt index 020cf79f7fb..62e44460eae 100644 --- a/ThirdParty/jpeg/vtkjpeg/CMakeLists.txt +++ b/ThirdParty/jpeg/vtkjpeg/CMakeLists.txt @@ -45,18 +45,6 @@ CONFIGURE_FILE(${VTKJPEG_SOURCE_DIR}/jpegDllConfig.h.in VTK_ADD_LIBRARY(vtkjpeg ${systemdependent_SRCS} ${common_SRCS} ${compression_SRCS} ${decompression_SRCS}) -# Apply user-defined properties to the library target. -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(vtkjpeg PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtkjpeg - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) IF(NOT VTK_INSTALL_NO_DEVELOPMENT) INSTALL(FILES ${VTKJPEG_BINARY_DIR}/jpegDllConfig.h diff --git a/ThirdParty/libproj4/CMakeLists.txt b/ThirdParty/libproj4/CMakeLists.txt new file mode 100644 index 00000000000..1e059e8ca74 --- /dev/null +++ b/ThirdParty/libproj4/CMakeLists.txt @@ -0,0 +1,4 @@ +vtk_module_third_party(LIBPROJ4 + LIBRARIES vtkproj4 + INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/vtklibproj4 + ) diff --git a/ThirdParty/libproj4/module.cmake b/ThirdParty/libproj4/module.cmake new file mode 100644 index 00000000000..07ecdb1fe5d --- /dev/null +++ b/ThirdParty/libproj4/module.cmake @@ -0,0 +1 @@ +vtk_module(vtklibproj4 EXCLUDE_FROM_WRAPPING) diff --git a/ThirdParty/libproj4/vtklibproj4/CMakeLists.txt b/ThirdParty/libproj4/vtklibproj4/CMakeLists.txt index 0ce6ad4c073..b881d5730db 100644 --- a/ThirdParty/libproj4/vtklibproj4/CMakeLists.txt +++ b/ThirdParty/libproj4/vtklibproj4/CMakeLists.txt @@ -218,28 +218,16 @@ endif ( GSL_FOUND ) configure_file( ${libproj4_SOURCE_DIR}/proj_config.h.cmake - ${VTK_BINARY_DIR}/proj_config.h + ${libproj4_BINARY_DIR}/proj_config.h ) -# Apply user-defined properties to the library target. -if(VTK_LIBRARY_PROPERTIES) - set_target_properties(vtkproj4 PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -endif(VTK_LIBRARY_PROPERTIES) - #------------------------------------------------------------------------------ # Install targets -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtkproj4 - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) IF(NOT VTK_INSTALL_NO_DEVELOPMENT) INSTALL(FILES ${libproj4_SOURCE_DIR}/lib_proj.h - ${VTK_BINARY_DIR}/proj_config.h + ${libproj4_BINARY_DIR}/proj_config.h DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24}/vtklibproj4 COMPONENT Development) ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) diff --git a/ThirdParty/libxml2/CMakeLists.txt b/ThirdParty/libxml2/CMakeLists.txt new file mode 100644 index 00000000000..c0e5d6054cb --- /dev/null +++ b/ThirdParty/libxml2/CMakeLists.txt @@ -0,0 +1 @@ +vtk_module_third_party(LibXml2) diff --git a/ThirdParty/libxml2/module.cmake b/ThirdParty/libxml2/module.cmake new file mode 100644 index 00000000000..2bbe4d26c56 --- /dev/null +++ b/ThirdParty/libxml2/module.cmake @@ -0,0 +1 @@ +vtk_module(vtklibxml2 EXCLUDE_FROM_WRAPPING) diff --git a/ThirdParty/libxml2/vtklibxml2/CMakeLists.txt b/ThirdParty/libxml2/vtklibxml2/CMakeLists.txt index 7e6eaeb1e2c..75f7b768985 100644 --- a/ThirdParty/libxml2/vtklibxml2/CMakeLists.txt +++ b/ThirdParty/libxml2/vtklibxml2/CMakeLists.txt @@ -297,18 +297,6 @@ ENDIF(NOT BUILD_SHARED_LIBS) VTK_ADD_LIBRARY(vtklibxml2 ${vtklibxml2_la_SOURCES}) TARGET_LINK_LIBRARIES(vtklibxml2 ${LIBXML2_LIBS}) -# Apply user-defined properties to the library target. -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(vtklibxml2 PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtklibxml2 - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) IF(NOT VTK_INSTALL_NO_DEVELOPMENT) INSTALL(FILES ${vtklibxml2_HEADER_FILES} diff --git a/ThirdParty/mrmpi/module.cmake b/ThirdParty/mrmpi/module.cmake new file mode 100644 index 00000000000..aecb7d72841 --- /dev/null +++ b/ThirdParty/mrmpi/module.cmake @@ -0,0 +1,6 @@ +vtk_module(vtkmrmpi + DEPENDS + vtksys + EXCLUDE_FROM_ALL + EXCLUDE_FROM_WRAPPING + ) diff --git a/ThirdParty/mrmpi/mpistubs/CMakeLists.txt b/ThirdParty/mrmpi/mpistubs/CMakeLists.txt index 19841a79d3d..b0978657a58 100644 --- a/ThirdParty/mrmpi/mpistubs/CMakeLists.txt +++ b/ThirdParty/mrmpi/mpistubs/CMakeLists.txt @@ -2,17 +2,6 @@ SET (mpistubs_SOURCES mpi.cpp) VTK_ADD_LIBRARY (mpistubs ${mpistubs_SOURCES}) TARGET_LINK_LIBRARIES (mpistubs vtksys) -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(mpistubs PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS mpistubs - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) IF(NOT VTK_INSTALL_NO_DEVELOPMENT) INSTALL(FILES diff --git a/ThirdParty/mrmpi/src/CMakeLists.txt b/ThirdParty/mrmpi/src/CMakeLists.txt index 9503abeefe7..cbf0c3918b9 100644 --- a/ThirdParty/mrmpi/src/CMakeLists.txt +++ b/ThirdParty/mrmpi/src/CMakeLists.txt @@ -9,17 +9,6 @@ SET (mrmpi_SOURCES VTK_ADD_LIBRARY (MapReduceMPI ${mrmpi_SOURCES}) TARGET_LINK_LIBRARIES (MapReduceMPI ${mrmpi_LIBS}) -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(MapReduceMPI PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS MapReduceMPI - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) IF(NOT VTK_INSTALL_NO_DEVELOPMENT) INSTALL(FILES diff --git a/ThirdParty/netcdf/CMakeLists.txt b/ThirdParty/netcdf/CMakeLists.txt new file mode 100644 index 00000000000..70596fff247 --- /dev/null +++ b/ThirdParty/netcdf/CMakeLists.txt @@ -0,0 +1,4 @@ +set(vtknetcdf_THIRD_PARTY 1) +set(vtknetcdf_LIBRARIES vtkNetCDF vtkNetCDF_cxx) +vtk_module_impl() +add_subdirectory(vtknetcdf) diff --git a/ThirdParty/netcdf/module.cmake b/ThirdParty/netcdf/module.cmake new file mode 100644 index 00000000000..d75213c0c84 --- /dev/null +++ b/ThirdParty/netcdf/module.cmake @@ -0,0 +1,4 @@ +vtk_module(vtknetcdf + DEPENDS + vtkhdf5 + EXCLUDE_FROM_WRAPPING) diff --git a/ThirdParty/netcdf/vtknetcdf/CMakeLists.txt b/ThirdParty/netcdf/vtknetcdf/CMakeLists.txt index 52e5f974b13..8643c351ac9 100644 --- a/ThirdParty/netcdf/vtknetcdf/CMakeLists.txt +++ b/ThirdParty/netcdf/vtknetcdf/CMakeLists.txt @@ -340,36 +340,17 @@ IF (NETCDF_ENABLE_NETCDF4) if (VTK_USE_SYSTEM_HDF5) TARGET_LINK_LIBRARIES(vtkNetCDF ${HDF5_hdf5_LIBRARY} ${HDF5_hdf5_hl_LIBRARY}) else() - TARGET_LINK_LIBRARIES(vtkNetCDF ${VTK_HDF5_LIBRARIES}) + TARGET_LINK_LIBRARIES(vtkNetCDF ${vtkhdf5_LIBRARIES}) endif() ENDIF (NETCDF_ENABLE_NETCDF4) VTK_ADD_LIBRARY(vtkNetCDF_cxx ${netcdf_cxx_SOURCES}) TARGET_LINK_LIBRARIES(vtkNetCDF_cxx vtkNetCDF) -# Apply user-defined properties to the library target. -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(vtkNetCDF PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - #----------------------------------------------------------------------------- #package the result #----------------------------------------------------------------------------- - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - IF(NOT VTK_INSTALL_BIN_DIR_CM24) - SET(VTK_INSTALL_BIN_DIR_CM24 ${CMAKE_INSTALL_PREFIX}/bin) - ENDIF(NOT VTK_INSTALL_BIN_DIR_CM24) - IF(NOT VTK_INSTALL_LIB_DIR_CM24) - SET(VTK_INSTALL_LIB_DIR_CM24 ${CMAKE_INSTALL_PREFIX}/lib) - ENDIF(NOT VTK_INSTALL_LIB_DIR_CM24) - INSTALL(TARGETS vtkNetCDF vtkNetCDF_cxx - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) IF(NOT VTK_INSTALL_NO_DEVELOPMENT) INSTALL(FILES ${VTKNETCDF_BINARY_DIR}/ncconfig.h diff --git a/ThirdParty/netcdf/vtknetcdf/libsrc4/error4.c b/ThirdParty/netcdf/vtknetcdf/libsrc4/error4.c index 4ed3a47e0d0..9b7b141c742 100644 --- a/ThirdParty/netcdf/vtknetcdf/libsrc4/error4.c +++ b/ThirdParty/netcdf/vtknetcdf/libsrc4/error4.c @@ -18,7 +18,7 @@ $Id: error4.c,v 1.4 2010/06/01 17:48:55 ed Exp $ #include <stdlib.h> #include <stdio.h> #include "assert.h" -#include <hdf5.h> +#include <vtk_hdf5.h> /* This contents of this file get skipped if LOGGING is not defined * during compile. */ diff --git a/ThirdParty/netcdf/vtknetcdf/libsrc4/nc4internal.h b/ThirdParty/netcdf/vtknetcdf/libsrc4/nc4internal.h index afcaa0bf9ec..c453b73435d 100644 --- a/ThirdParty/netcdf/vtknetcdf/libsrc4/nc4internal.h +++ b/ThirdParty/netcdf/vtknetcdf/libsrc4/nc4internal.h @@ -18,7 +18,7 @@ #include <ctype.h> #include <stdarg.h> #include <string.h> -#include <hdf5.h> +#include <vtk_hdf5.h> #include <ncdimscale.h> #include <nc_logging.h> diff --git a/ThirdParty/oggtheora/CMakeLists.txt b/ThirdParty/oggtheora/CMakeLists.txt new file mode 100644 index 00000000000..a13d3acb04f --- /dev/null +++ b/ThirdParty/oggtheora/CMakeLists.txt @@ -0,0 +1 @@ +vtk_module_third_party(OGGTHEORA) diff --git a/ThirdParty/oggtheora/module.cmake b/ThirdParty/oggtheora/module.cmake new file mode 100644 index 00000000000..7c15d17f7db --- /dev/null +++ b/ThirdParty/oggtheora/module.cmake @@ -0,0 +1 @@ +vtk_module(vtkoggtheora EXCLUDE_FROM_WRAPPING) diff --git a/ThirdParty/oggtheora/vtkoggtheora/CMakeLists.txt b/ThirdParty/oggtheora/vtkoggtheora/CMakeLists.txt index f1faa06754e..d0f31e373c2 100644 --- a/ThirdParty/oggtheora/vtkoggtheora/CMakeLists.txt +++ b/ThirdParty/oggtheora/vtkoggtheora/CMakeLists.txt @@ -248,20 +248,6 @@ ADD_DEFINITIONS(-DHAVE_CONFIG_H) VTK_ADD_LIBRARY(vtkoggtheora ${VTKOGGTHEORA_SRCS}) -# Apply user-defined properties to the library target. -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(vtkoggtheora PROPERTIES ${VTK_LIBRARY_PROPERTIES} - ) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtkoggtheora - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) - IF(NOT VTK_INSTALL_NO_DEVELOPMENT) INSTALL(FILES ${VTKOGGTHEORA_SOURCE_DIR}/vtk_oggtheora_mangle.h diff --git a/ThirdParty/png/CMakeLists.txt b/ThirdParty/png/CMakeLists.txt new file mode 100644 index 00000000000..53d1f8cceac --- /dev/null +++ b/ThirdParty/png/CMakeLists.txt @@ -0,0 +1 @@ +vtk_module_third_party(PNG) diff --git a/ThirdParty/png/module.cmake b/ThirdParty/png/module.cmake new file mode 100644 index 00000000000..f82fc8a5620 --- /dev/null +++ b/ThirdParty/png/module.cmake @@ -0,0 +1,5 @@ +vtk_module(vtkpng + DEPENDS + vtkzlib + EXCLUDE_FROM_WRAPPING + ) diff --git a/ThirdParty/png/vtkpng/CMakeLists.txt b/ThirdParty/png/vtkpng/CMakeLists.txt index 6869935fa6b..d416b2c3a35 100644 --- a/ThirdParty/png/vtkpng/CMakeLists.txt +++ b/ThirdParty/png/vtkpng/CMakeLists.txt @@ -25,25 +25,13 @@ CONFIGURE_FILE(${VTKPNG_SOURCE_DIR}/pngDllConfig.h.in VTK_ADD_LIBRARY(vtkpng ${PNG_SRCS}) -TARGET_LINK_LIBRARIES(vtkpng ${VTK_ZLIB_LIBRARIES}) +TARGET_LINK_LIBRARIES(vtkpng ${vtkzlib_LIBRARIES}) # link against the math library IF(UNIX) TARGET_LINK_LIBRARIES(vtkpng -lm) ENDIF() -# Apply user-defined properties to the library target. -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(vtkpng PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtkpng - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) IF(NOT VTK_INSTALL_NO_DEVELOPMENT) INSTALL(FILES ${VTKPNG_BINARY_DIR}/pngDllConfig.h diff --git a/ThirdParty/sqlite/CMakeLists.txt b/ThirdParty/sqlite/CMakeLists.txt new file mode 100644 index 00000000000..794566f9ae0 --- /dev/null +++ b/ThirdParty/sqlite/CMakeLists.txt @@ -0,0 +1,4 @@ +set(vtksqlite_THIRD_PARTY 1) +set(vtksqlite_LIBRARIES vtksqlite) +vtk_module_impl() +add_subdirectory(vtksqlite) diff --git a/ThirdParty/sqlite/module.cmake b/ThirdParty/sqlite/module.cmake new file mode 100644 index 00000000000..8dbb3a78397 --- /dev/null +++ b/ThirdParty/sqlite/module.cmake @@ -0,0 +1 @@ +vtk_module(vtksqlite EXCLUDE_FROM_WRAPPING) diff --git a/ThirdParty/sqlite/vtksqlite/CMakeLists.txt b/ThirdParty/sqlite/vtksqlite/CMakeLists.txt index 719f9ed9951..f273beb43ae 100644 --- a/ThirdParty/sqlite/vtksqlite/CMakeLists.txt +++ b/ThirdParty/sqlite/vtksqlite/CMakeLists.txt @@ -41,21 +41,9 @@ ELSE (WIN32) ENDIF() ENDIF (WIN32) -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(vtksqlite PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtksqlite - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) - IF(NOT VTK_INSTALL_NO_DEVELOPMENT) INSTALL(FILES - ${VTK_SOURCE_DIR}/Utilities/vtksqlite/vtk_sqlite3.h + ${CMAKE_CURRENT_SOURCE_DIR}/vtk_sqlite3.h DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24}/vtksqlite COMPONENT Development) ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) diff --git a/ThirdParty/tiff/CMakeLists.txt b/ThirdParty/tiff/CMakeLists.txt new file mode 100644 index 00000000000..219f7bf3332 --- /dev/null +++ b/ThirdParty/tiff/CMakeLists.txt @@ -0,0 +1 @@ +vtk_module_third_party(TIFF) diff --git a/ThirdParty/tiff/module.cmake b/ThirdParty/tiff/module.cmake new file mode 100644 index 00000000000..9053ed57ed2 --- /dev/null +++ b/ThirdParty/tiff/module.cmake @@ -0,0 +1,6 @@ +vtk_module(vtktiff + DEPENDS + vtkjpeg + vtkzlib + EXCLUDE_FROM_WRAPPING + ) diff --git a/ThirdParty/tiff/vtktiff/CMakeLists.txt b/ThirdParty/tiff/vtktiff/CMakeLists.txt index a241e128e01..226e330ec3e 100644 --- a/ThirdParty/tiff/vtktiff/CMakeLists.txt +++ b/ThirdParty/tiff/vtktiff/CMakeLists.txt @@ -110,25 +110,13 @@ CONFIGURE_FILE(${VTKTIFF_SOURCE_DIR}/tif_config.h.in ${VTKTIFF_BINARY_DIR}/tif_config.h) VTK_ADD_LIBRARY(vtktiff ${common_SRCS}) -TARGET_LINK_LIBRARIES( vtktiff ${VTK_ZLIB_LIBRARIES} ${VTK_JPEG_LIBRARIES} ) +TARGET_LINK_LIBRARIES( vtktiff ${vtkzlib_LIBRARIES} ${vtkjpeg_LIBRARIES} ) # link against the math library IF(UNIX) TARGET_LINK_LIBRARIES(vtktiff -lm) ENDIF() -# Apply user-defined properties to the library target. -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(vtktiff PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtktiff - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) IF(NOT VTK_INSTALL_NO_DEVELOPMENT) INSTALL(FILES ${VTKTIFF_BINARY_DIR}/tiffDllConfig.h diff --git a/ThirdParty/verdict/CMakeLists.txt b/ThirdParty/verdict/CMakeLists.txt index 9d2321cd1c0..ef05c4c9116 100644 --- a/ThirdParty/verdict/CMakeLists.txt +++ b/ThirdParty/verdict/CMakeLists.txt @@ -57,6 +57,10 @@ else ( VERDICT_MANGLE ) set( verdict_LIBRARY "verdict" ) endif ( VERDICT_MANGLE ) +set(vtkverdict_THIRD_PARTY 1) +set(vtkverdict_LIBRARIES ${verdict_LIBRARY}) +vtk_module_impl() + # Setting the VERSION and SOVERSION of a library will include # version information either in the library, or in the library # name (depending on the platform). You may choose to exclude @@ -154,13 +158,6 @@ IF(NOT VTK_INSTALL_NO_DEVELOPMENT) ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) -install(TARGETS ${verdict_LIBRARY} - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${verdict_INSTALL_BIN_DIR} COMPONENT RuntimeLibraries # .exe, .dll - LIBRARY DESTINATION ${verdict_INSTALL_LIB_DIR} COMPONENT RuntimeLibraries # .so, mod.dll - ARCHIVE DESTINATION ${verdict_INSTALL_LIB_DIR} COMPONENT Development # .a, .lib -) - # # Packing stuff # diff --git a/ThirdParty/verdict/module.cmake b/ThirdParty/verdict/module.cmake new file mode 100644 index 00000000000..97968046745 --- /dev/null +++ b/ThirdParty/verdict/module.cmake @@ -0,0 +1 @@ +vtk_module(vtkverdict EXCLUDE_FROM_WRAPPING) diff --git a/ThirdParty/zlib/CMakeLists.txt b/ThirdParty/zlib/CMakeLists.txt new file mode 100644 index 00000000000..ddc8fdca679 --- /dev/null +++ b/ThirdParty/zlib/CMakeLists.txt @@ -0,0 +1 @@ +vtk_module_third_party(ZLIB) diff --git a/ThirdParty/zlib/module.cmake b/ThirdParty/zlib/module.cmake new file mode 100644 index 00000000000..e188a5db00f --- /dev/null +++ b/ThirdParty/zlib/module.cmake @@ -0,0 +1 @@ +vtk_module(vtkzlib EXCLUDE_FROM_WRAPPING) diff --git a/ThirdParty/zlib/vtkzlib/CMakeLists.txt b/ThirdParty/zlib/vtkzlib/CMakeLists.txt index 6e182be8ee7..129fe40bb89 100644 --- a/ThirdParty/zlib/vtkzlib/CMakeLists.txt +++ b/ThirdParty/zlib/vtkzlib/CMakeLists.txt @@ -29,19 +29,6 @@ CONFIGURE_FILE(${VTKZLIB_SOURCE_DIR}/zlibDllConfig.h.in VTK_ADD_LIBRARY(vtkzlib ${ZLIB_SRCS}) -# Apply user-defined properties to the library target. -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(vtkzlib PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtkzlib - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) - IF(NOT VTK_INSTALL_NO_DEVELOPMENT) INSTALL(FILES ${VTKZLIB_SOURCE_DIR}/zlib.h diff --git a/Utilities/DICOMParser/CMakeLists.txt b/Utilities/DICOMParser/CMakeLists.txt index b80b52e054d..e4785b905b2 100644 --- a/Utilities/DICOMParser/CMakeLists.txt +++ b/Utilities/DICOMParser/CMakeLists.txt @@ -1,5 +1,8 @@ PROJECT(DICOMParser) +set(vtkDICOMParser_LIBRARIES vtkDICOMParser) +vtk_module_impl() + INCLUDE_DIRECTORIES(${DICOMParser_SOURCE_DIR}) INCLUDE_DIRECTORIES(${DICOMParser_BINARY_DIR}) @@ -24,24 +27,12 @@ CONFIGURE_FILE(${DICOMParser_SOURCE_DIR}/DICOMCMakeConfig.h.in VTK_ADD_LIBRARY(vtkDICOMParser DICOMFile.cxx DICOMParser.cxx DICOMAppHelper.cxx) -# Apply user-defined properties to the library target. -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(vtkDICOMParser PROPERTIES ${VTK_LIBRARY_PROPERTIES}) -ENDIF(VTK_LIBRARY_PROPERTIES) - -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtkDICOMParser - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) IF(NOT VTK_INSTALL_NO_DEVELOPMENT) FILE(GLOB __install_files.h "${DICOMParser_SOURCE_DIR}/*.h") FILE(GLOB __install_files.txx "${DICOMParser_SOURCE_DIR}/*.h") INSTALL(FILES ${__install_files.h} ${__install_files.txx} ${DICOMParser_BINARY_DIR}/DICOMCMakeConfig.h - DESTINATION "${VTK_INSTALL_INCLUDE_DIR_CM24}" + DESTINATION ${VTK_INSTALL_INCLUDE_DIR} COMPONENT Development) ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) diff --git a/Utilities/DICOMParser/module.cmake b/Utilities/DICOMParser/module.cmake new file mode 100644 index 00000000000..84fd5fdc22e --- /dev/null +++ b/Utilities/DICOMParser/module.cmake @@ -0,0 +1,5 @@ +vtk_module(vtkDICOMParser + DEPENDS + vtksys + EXCLUDE_FROM_WRAPPING + ) diff --git a/Utilities/EncodeString/CMakeLists.txt b/Utilities/EncodeString/CMakeLists.txt index f08f39f3225..43459575b7e 100644 --- a/Utilities/EncodeString/CMakeLists.txt +++ b/Utilities/EncodeString/CMakeLists.txt @@ -7,7 +7,10 @@ # PURPOSE. See the above copyright notice for more information. # +vtk_module_impl() + IF(NOT CMAKE_CROSSCOMPILING) + INCLUDE_DIRECTORIES(${VTK_SOURCE_DIR}/Common/Core ${VTK_BINARY_DIR}/Common/Core) VTK_ADD_EXECUTABLE(vtkEncodeString vtkEncodeString.cxx) EXPORT(TARGETS vtkEncodeString FILE ${EXPORT_EXECUTABLES_FILE} NAMESPACE "${EXPORT_EXECUTABLES_NAMESPACE}" APPEND) IF(COMPILE_TOOLS_TARGET) @@ -16,7 +19,7 @@ IF(NOT CMAKE_CROSSCOMPILING) IF(NOT VTK_INSTALL_NO_DEVELOPMENT) INSTALL(TARGETS vtkEncodeString EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT Development + RUNTIME DESTINATION ${VTK_INSTALL_RUNTIME_DIR} COMPONENT Development ) ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) ENDIF(NOT CMAKE_CROSSCOMPILING) diff --git a/Utilities/EncodeString/module.cmake b/Utilities/EncodeString/module.cmake new file mode 100644 index 00000000000..d2bdc0a6b90 --- /dev/null +++ b/Utilities/EncodeString/module.cmake @@ -0,0 +1,4 @@ +vtk_module(vtkUtilitiesEncodeString + DEPENDS + vtksys + EXCLUDE_FROM_WRAPPING) diff --git a/Utilities/HashSource/CMakeLists.txt b/Utilities/HashSource/CMakeLists.txt index ab9e3dfbf97..c80b7b5b4d3 100644 --- a/Utilities/HashSource/CMakeLists.txt +++ b/Utilities/HashSource/CMakeLists.txt @@ -7,6 +7,8 @@ # PURPOSE. See the above copyright notice for more information. # +vtk_module_impl() + # This executable is only run from the build tree so we do not need a # launcher for it and should always use the RPATH to find shared libs. SET(CMAKE_SKIP_RPATH 0) diff --git a/Utilities/HashSource/module.cmake b/Utilities/HashSource/module.cmake new file mode 100644 index 00000000000..f29b54e088f --- /dev/null +++ b/Utilities/HashSource/module.cmake @@ -0,0 +1,5 @@ +vtk_module(vtkUtilitiesHashSource + DEPENDS + vtksys + EXCLUDE_FROM_WRAPPING + ) diff --git a/Utilities/KWSys/CMakeLists.txt b/Utilities/KWSys/CMakeLists.txt new file mode 100644 index 00000000000..ab0b641e80c --- /dev/null +++ b/Utilities/KWSys/CMakeLists.txt @@ -0,0 +1,37 @@ +set(vtksys_LIBRARIES vtksys) +vtk_module_impl() + +#----------------------------------------------------------------------------- +# Configure KWSys to be named "vtksys". +SET(KWSYS_NAMESPACE vtksys) +SET(KWSYS_USE_Base64 1) +SET(KWSYS_USE_CommandLineArguments 1) +SET(KWSYS_USE_DynamicLoader 1) +SET(KWSYS_USE_Process 1) +SET(KWSYS_USE_RegularExpression 1) +SET(KWSYS_USE_SystemTools 1) +SET(KWSYS_USE_SystemInformation 1) +SET(KWSYS_USE_FundamentalType 1) +SET(KWSYS_USE_MD5 1) +SET(KWSYS_USE_Glob 1) +SET(KWSYS_USE_DateStamp 1) +set(KWSYS_HEADER_ROOT ${CMAKE_CURRENT_BINARY_DIR}) +SET(KWSYS_PROPERTIES_CXX ${VTK_LIBRARY_PROPERTIES}) +SET(KWSYS_INSTALL_EXPORT_NAME ${VTK_INSTALL_EXPORT_NAME}) + +IF(NOT VTK_USE_ANSI_STDLIB) + SET(KWSYS_IOS_FORCE_OLD 1) +ENDIF(NOT VTK_USE_ANSI_STDLIB) + +if(NOT VTK_INSTALL_NO_LIBRARIES) + set(KWSYS_INSTALL_BIN_DIR ${VTK_INSTALL_RUNTIME_DIR}) + set(KWSYS_INSTALL_LIB_DIR ${VTK_INSTALL_LIBRARY_DIR}) + set(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME RuntimeLibraries) +endif() +if(NOT VTK_INSTALL_NO_DEVELOPMENT) + set(KWSYS_INSTALL_INCLUDE_DIR ${VTK_INSTALL_INCLUDE_DIR}) + set(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT Development) +endif() + +add_subdirectory(vtksys) +vtk_target(${KWSYS_NAMESPACE} NO_INSTALL) diff --git a/Utilities/KWSys/module.cmake b/Utilities/KWSys/module.cmake new file mode 100644 index 00000000000..614739d8e43 --- /dev/null +++ b/Utilities/KWSys/module.cmake @@ -0,0 +1,2 @@ +vtk_module(vtksys + EXCLUDE_FROM_WRAPPING) diff --git a/Utilities/LastConfigureStep/CMakeLists.txt b/Utilities/LastConfigureStep/CMakeLists.txt index f97da35472b..563c70f1d51 100644 --- a/Utilities/LastConfigureStep/CMakeLists.txt +++ b/Utilities/LastConfigureStep/CMakeLists.txt @@ -1,19 +1,14 @@ # The commands in this directory are intended to be executed as # the end of the whole configuration process, as a "last step". -# This directory is typically the last SUBDIRS in the main CMakeLists.txt. +# This directory is typically the last add_subdirectory in the main CMakeLists.txt. # It enable the above commands to use variables that might have been configured -# in previous SUBDIRS. This is especially important when it comes to +# in previous add_subdirectory. This is especially important when it comes to # the CONFIGURE_FILE command, since in IMMEDIATE mode that command will # use the current values of CMake variables instead of waiting until the # end of CMakeLists processing, i.e. instead of waiting until some variables -# are configured in SUBDIRS. +# are configured in add_subdirectory commands. #----------------------------------------------------------------------------- -GET_PROPERTY(VTK_TARGETS GLOBAL PROPERTY VTK_TARGETS) -EXPORT(TARGETS ${VTK_TARGETS} FILE ${VTK_BINARY_DIR}/${VTK_INSTALL_EXPORT_NAME}.cmake) -INSTALL(EXPORT ${VTK_INSTALL_EXPORT_NAME} DESTINATION ${VTK_INSTALL_LIB_DIR_CM24}) -GET_PROPERTY(VTK_LIBRARIES GLOBAL PROPERTY VTK_LIBRARIES) -#----------------------------------------------------------------------------- -# Create the VTKConfig.cmake file containing the VTK configuration. -# Since it might generate configuration file depending -INCLUDE(${VTK_SOURCE_DIR}/vtkGenerateVTKConfig.cmake) +get_property(VTK_TARGETS GLOBAL PROPERTY VTK_TARGETS) +export(TARGETS ${VTK_TARGETS} FILE ${VTK_BINARY_DIR}/VTKTargets.cmake) +get_property(VTK_LIBRARIES GLOBAL PROPERTY VTK_LIBRARIES) diff --git a/Utilities/MaterialLibrary/CMakeLists.txt b/Utilities/MaterialLibrary/CMakeLists.txt index d12649e2f59..f4b051db6b4 100644 --- a/Utilities/MaterialLibrary/CMakeLists.txt +++ b/Utilities/MaterialLibrary/CMakeLists.txt @@ -1,5 +1,20 @@ PROJECT(MaterialLibrary) +vtk_module_impl() + +# FIXME: Provide a reasonable default for this value in MaterialLibrary? +set(VTK_DEFAULT_SHADERS_DIR + "${VTK_BINARY_DIR}/Utilities/MaterialLibrary/Repository" + CACHE INTERNAL + "The directory that code for shaders is stored in.") +set(VTK_MATERIALS_DIRS + ${VTK_DEFAULT_SHADERS_DIR} + CACHE STRING + "A ; separated list of directories to search for materials/shaders.") + +include_directories("${VTK_SOURCE_DIR}/Common/Core" + "${VTK_BINARY_DIR}/Common/Core") + # Enable shared link forwarding support it needed. SET (ML_EXE_SUFFIX) SET (ML_EXE_INSTALL ${VTK_INSTALL_BIN_DIR}) diff --git a/Utilities/MaterialLibrary/module.cmake b/Utilities/MaterialLibrary/module.cmake new file mode 100644 index 00000000000..22f4e10a2c3 --- /dev/null +++ b/Utilities/MaterialLibrary/module.cmake @@ -0,0 +1,5 @@ +vtk_module(vtkUtilitiesMaterialLibrary + DEPENDS + vtksys + EXCLUDE_FROM_WRAPPING + ) diff --git a/Utilities/MetaIO/CMakeLists.txt b/Utilities/MetaIO/CMakeLists.txt new file mode 100644 index 00000000000..e0ff5cf02d3 --- /dev/null +++ b/Utilities/MetaIO/CMakeLists.txt @@ -0,0 +1,9 @@ +set(vtkMetaIO_INCLUDE_DIRS + ${CMAKE_CURRENT_BINARY_DIR}/vtkmetaio # metaIOConfig.h + ) +set(vtkMetaIO_LIBRARIES vtkmetaio) +vtk_module_impl() +set(METAIO_FOR_VTK 1) +set(VTK_ZLIB_LIBRARIES ${vtkzlib_LIBRARIES}) +add_subdirectory(vtkmetaio) +vtk_target(vtkmetaio NO_INSTALL) diff --git a/Utilities/MetaIO/module.cmake b/Utilities/MetaIO/module.cmake new file mode 100644 index 00000000000..e69c1e7a1db --- /dev/null +++ b/Utilities/MetaIO/module.cmake @@ -0,0 +1,5 @@ +vtk_module(vtkMetaIO + DEPENDS + vtkzlib + EXCLUDE_FROM_WRAPPING + ) diff --git a/Utilities/ParseOGLExt/CMakeLists.txt b/Utilities/ParseOGLExt/CMakeLists.txt index ca971813263..42aec1b92da 100644 --- a/Utilities/ParseOGLExt/CMakeLists.txt +++ b/Utilities/ParseOGLExt/CMakeLists.txt @@ -21,6 +21,11 @@ # or without modification, are permitted provided that this Notice and any # statement of authorship are reproduced on all copies. +vtk_module_impl() + +include_directories(${VTK_SOURCE_DIR}/Common/Core + ${VTK_BINARY_DIR}/Common/Core) + IF(NOT CMAKE_CROSSCOMPILING) ADD_EXECUTABLE(vtkParseOGLExt Tokenizer.cxx ParseOGLExt.cxx) EXPORT(TARGETS vtkParseOGLExt FILE ${EXPORT_EXECUTABLES_FILE} NAMESPACE "${EXPORT_EXECUTABLES_NAMESPACE}" APPEND) diff --git a/Utilities/ParseOGLExt/ParseOGLExt.cxx b/Utilities/ParseOGLExt/ParseOGLExt.cxx index e3bb4e2a41c..f4e32e5fee6 100644 --- a/Utilities/ParseOGLExt/ParseOGLExt.cxx +++ b/Utilities/ParseOGLExt/ParseOGLExt.cxx @@ -33,7 +33,6 @@ #include <list> #include <set> #include <map> -#include <string> #include <string.h> #include <ctype.h> @@ -154,7 +153,7 @@ bool Extension::isExtension(char *line) } return false; -} +} static Extension currentExtension; @@ -366,7 +365,7 @@ Function::Function(char *line) : extensionType(currentExtension.type) this->arguments = t.GetRemainingString(); -#ifdef DEBUG_PARSE +#ifdef DEBUG_PARSE cerr << "Function arguments: " << this->arguments << endl; #endif } @@ -569,8 +568,8 @@ static void WriteClassDeclarationGuts(ostream &hfile, int type) // BCC/VS6/VS70 cannot digest this C99 macro hfile << "#if !defined(__BORLANDC__) && (!defined(_MSC_VER) || (defined(_MSC_VER) && _MSC_VER>=1310))" << endl; } - - + + hfile << " const GLenum " << iconst->GetName().c_str() << " = static_cast<GLenum>(" << iconst->GetValue().c_str() << ");" << endl; @@ -606,7 +605,7 @@ static void WriteClassDeclarationGuts(ostream &hfile, int type) for (std::list<Function>::iterator ifunc = fExts->second.begin(); ifunc != fExts->second.end(); ifunc++) { - hfile << " extern VTK_RENDERING_EXPORT " << ifunc->GetProcType() + hfile << " extern VTKRENDERINGOPENGL_EXPORT " << ifunc->GetProcType() << " " << ifunc->GetName().c_str() << ";" << endl; } } @@ -640,7 +639,7 @@ static void WriteCode(ostream &hfile, ostream &cxxfile) // Write data for header file --------------------------------- hfile << "#ifndef __vtkgl_h" << endl << "#define __vtkgl_h" << endl << endl; - hfile << "#include \"vtkToolkits.h\"" << endl; + hfile << "#include \"vtkRenderingOpenGLConfigure.h\"" << endl; hfile << "#include \"vtkSystemIncludes.h\"" << endl; hfile << "#include \"vtkWindows.h\"" << endl; hfile << "#include \"vtkOpenGL.h\"" << endl; @@ -687,7 +686,7 @@ static void WriteCode(ostream &hfile, ostream &cxxfile) hfile << " typedef int64_t GLint64;" << endl; hfile << " typedef uint64_t GLuint64;" << endl; hfile << " typedef struct __GLsync *GLsync;" << endl; - + ConstantsAlreadyWritten.clear(); WriteClassDeclarationGuts(hfile, Extension::GL); hfile << endl << " // Method to load functions for a particular extension."; diff --git a/Utilities/ParseOGLExt/module.cmake b/Utilities/ParseOGLExt/module.cmake new file mode 100644 index 00000000000..c0f6dbc7085 --- /dev/null +++ b/Utilities/ParseOGLExt/module.cmake @@ -0,0 +1,2 @@ +vtk_module(vtkParseOGLExt + EXCLUDE_FROM_WRAPPING) diff --git a/Views/Context2D/CMakeLists.txt b/Views/Context2D/CMakeLists.txt new file mode 100644 index 00000000000..c9425942788 --- /dev/null +++ b/Views/Context2D/CMakeLists.txt @@ -0,0 +1,6 @@ +set(module_SRCS + vtkContextView.cxx + vtkContextInteractorStyle.cxx + ) + +vtk_module_library(vtkViewsContext2D ${module_SRCS}) diff --git a/Views/Context2D/module.cmake b/Views/Context2D/module.cmake new file mode 100644 index 00000000000..76278d72b10 --- /dev/null +++ b/Views/Context2D/module.cmake @@ -0,0 +1,8 @@ +vtk_module(vtkViewsContext2D + GROUPS + Views + StandAlone + DEPENDS + vtkViewsCore + vtkRenderingContext2D + ) diff --git a/Views/Core/CMakeLists.txt b/Views/Core/CMakeLists.txt new file mode 100644 index 00000000000..2d006f4d0ea --- /dev/null +++ b/Views/Core/CMakeLists.txt @@ -0,0 +1,10 @@ +set(Module_SRCS + vtkConvertSelectionDomain.cxx + vtkDataRepresentation.cxx + vtkEmptyRepresentation.cxx + vtkRenderViewBase.cxx + vtkView.cxx + vtkViewTheme.cxx + ) + +vtk_module_library(vtkViewsCore ${Module_SRCS}) diff --git a/Views/Core/module.cmake b/Views/Core/module.cmake new file mode 100644 index 00000000000..c2e3f8e83eb --- /dev/null +++ b/Views/Core/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkViewsCore + GROUPS + StandAlone + DEPENDS + vtkRenderingCore + vtkInteractionWidgets + ) diff --git a/Views/Geovis/CMakeLists.txt b/Views/Geovis/CMakeLists.txt new file mode 100644 index 00000000000..d0112a91689 --- /dev/null +++ b/Views/Geovis/CMakeLists.txt @@ -0,0 +1,6 @@ +set(Module_SRCS + vtkGeoView.cxx + vtkGeoView2D.cxx + ) + +vtk_module_library(vtkViewsGeovis ${Module_SRCS}) diff --git a/Views/Geovis/module.cmake b/Views/Geovis/module.cmake new file mode 100644 index 00000000000..d51dc7458b8 --- /dev/null +++ b/Views/Geovis/module.cmake @@ -0,0 +1,5 @@ +vtk_module(vtkViewsGeovis + DEPENDS + vtkViewsInfovis + vtkGeovisCore + ) diff --git a/Views/Infovis/CMakeLists.txt b/Views/Infovis/CMakeLists.txt new file mode 100644 index 00000000000..aca0f6d8e7a --- /dev/null +++ b/Views/Infovis/CMakeLists.txt @@ -0,0 +1,29 @@ +find_package(Boost REQUIRED) +include_directories(${Boost_INCLUDE_DIRS}) + +SET(Module_SRCS + vtkApplyColors.cxx + vtkApplyIcons.cxx + vtkGraphLayoutView.cxx + vtkHierarchicalGraphPipeline.cxx + vtkHierarchicalGraphView.cxx + vtkIcicleView.cxx + vtkInteractorStyleAreaSelectHover.cxx + vtkInteractorStyleTreeMapHover.cxx + vtkParallelCoordinatesHistogramRepresentation.cxx + vtkParallelCoordinatesRepresentation.cxx + vtkParallelCoordinatesView.cxx + vtkPipelineGraphSource.cxx + vtkRenderedGraphRepresentation.cxx + vtkRenderedHierarchyRepresentation.cxx + vtkRenderedRepresentation.cxx + vtkRenderedSurfaceRepresentation.cxx + vtkRenderedTreeAreaRepresentation.cxx + vtkRenderView.cxx + vtkTreeAreaView.cxx + vtkTreeMapView.cxx + vtkTreeRingView.cxx + vtkViewUpdater.cxx + ) + +vtk_module_library(vtkViewsInfovis ${Module_SRCS}) diff --git a/Views/Infovis/module.cmake b/Views/Infovis/module.cmake new file mode 100644 index 00000000000..6562c4aaa98 --- /dev/null +++ b/Views/Infovis/module.cmake @@ -0,0 +1,9 @@ +vtk_module(vtkViewsInfovis + DEPENDS + vtkViewsCore + vtkRenderingLabel + vtkInfovisLayout + vtkInteractionStyle + vtkFiltersModeling + vtkFiltersImaging + ) diff --git a/Views/Qt/CMakeLists.txt b/Views/Qt/CMakeLists.txt new file mode 100644 index 00000000000..4785fa0a1a1 --- /dev/null +++ b/Views/Qt/CMakeLists.txt @@ -0,0 +1,29 @@ +set(LibSrcs + vtkQtAnnotationView.cxx + vtkQtListView.cxx + vtkQtRecordView.cxx + vtkQtTableRepresentation.cxx + vtkQtTableView.cxx + vtkQtTreeView.cxx + vtkQtView.cxx + ) +set_source_files_properties(vtkQtView.cxx ABSTRACT) +set(MocHeaders + vtkQtAnnotationView.h + vtkQtListView.h + vtkQtRecordView.h + vtkQtTableView.h + vtkQtTreeView.h + vtkQtView.h + ) + +# import Qt4 build settings +set(QT_USE_QTNETWORK 1) +find_package(Qt4 REQUIRED QUIET) +include(${QT_USE_FILE}) + +qt4_wrap_cpp(LibMocSrcs ${MocHeaders}) + +vtk_module_library(${vtk-module} ${LibSrcs} ${LibMocSrcs}) + +target_link_libraries(${vtk-module} ${QT_LIBRARIES}) diff --git a/Views/Qt/module.cmake b/Views/Qt/module.cmake new file mode 100644 index 00000000000..71f31dda9f7 --- /dev/null +++ b/Views/Qt/module.cmake @@ -0,0 +1,10 @@ +vtk_module(vtkViewsQt + GROUPS + Qt + DEPENDS + vtkViewsInfovis + vtkGUISupportQt + TEST_DEPENDS + vtkTestingCore + EXCLUDE_FROM_WRAPPING + ) diff --git a/Wrapping/CMakeLists.txt b/Wrapping/CMakeLists.txt index a80d591d778..c66250b74c5 100644 --- a/Wrapping/CMakeLists.txt +++ b/Wrapping/CMakeLists.txt @@ -1,82 +1,91 @@ # Allow the user to customize their build with some local options # -INCLUDE (${VTK_SOURCE_DIR}/Wrapping/LocalUserOptions.cmake OPTIONAL) +include(${VTK_SOURCE_DIR}/Wrapping/LocalUserOptions.cmake OPTIONAL) # vtkParse.tab.c has #line markers that break #include with double quotes. -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/Python + ${VTK_SOURCE_DIR}/Common/Core + ${VTK_BINARY_DIR}/Common/Core + ${VTK_BINARY_DIR}/Wrapping + ${VTK_BINARY_DIR}/Utilities/KWSys) -IF(NOT CMAKE_CROSSCOMPILING) - IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - INSTALL(FILES vtkParse.h vtkParseType.h vtkParsePreprocess.h vtkParseMain.h - DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24} - COMPONENT Development - ) - ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkPythonConfigure.h.in + ${CMAKE_CURRENT_BINARY_DIR}/vtkPythonConfigure.h) - IF (VTK_WRAP_TCL OR VTK_WRAP_PYTHON OR VTK_WRAP_JAVA) - VTK_ADD_EXECUTABLE(vtkWrapHierarchy vtkParse.tab.c vtkParsePreprocess.c - vtkParseExtras.c vtkWrapHierarchy.c) - EXPORT(TARGETS vtkWrapHierarchy FILE ${EXPORT_EXECUTABLES_FILE} NAMESPACE "${EXPORT_EXECUTABLES_NAMESPACE}" APPEND) - IF(COMPILE_TOOLS_TARGET) - ADD_DEPENDENCIES(${COMPILE_TOOLS_TARGET} vtkWrapHierarchy) - ENDIF(COMPILE_TOOLS_TARGET) - IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - INSTALL(TARGETS vtkWrapHierarchy - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT Development) - ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) - ENDIF (VTK_WRAP_TCL OR VTK_WRAP_PYTHON OR VTK_WRAP_JAVA) +# Get our lists of modules to be wrapped, create a list of uniques that need to +# have wrap hierarchy run on them too. +get_property(_python_modules GLOBAL PROPERTY VTK_PYTHON_WRAPPED) +get_property(_java_modules GLOBAL PROPERTY VTK_JAVA_WRAPPED) - IF (VTK_WRAP_TCL) - VTK_ADD_EXECUTABLE(vtkWrapTcl vtkWrapTcl.c vtkParseMain.c vtkParse.tab.c - vtkParsePreprocess.c vtkParseExtras.c vtkParseHierarchy.c) - VTK_ADD_EXECUTABLE(vtkWrapTclInit vtkWrapTclInit.c) - EXPORT(TARGETS vtkWrapTcl vtkWrapTclInit FILE ${EXPORT_EXECUTABLES_FILE} NAMESPACE "${EXPORT_EXECUTABLES_NAMESPACE}" APPEND) - IF(COMPILE_TOOLS_TARGET) - ADD_DEPENDENCIES(${COMPILE_TOOLS_TARGET} vtkWrapTcl vtkWrapTclInit) - ENDIF(COMPILE_TOOLS_TARGET) - IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - INSTALL(TARGETS vtkWrapTcl vtkWrapTclInit - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT Development # .exe, .dll - ) - ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) - ENDIF (VTK_WRAP_TCL) +if(NOT CMAKE_CROSSCOMPILING) + if(VTK_WRAP_TCL OR VTK_WRAP_PYTHON OR VTK_WRAP_JAVA) + add_executable(vtkWrapHierarchy vtkParse.tab.c vtkParsePreprocess.c + vtkParseExtras.c vtkWrapHierarchy.c) + export(TARGETS vtkWrapHierarchy + FILE ${EXPORT_EXECUTABLES_FILE} + NAMESPACE "${EXPORT_EXECUTABLES_NAMESPACE}" APPEND) + if(COMPILE_TOOLS_TARGET) + add_dependencies(${COMPILE_TOOLS_TARGET} vtkWrapHierarchy) + endif() + + if(NOT VTK_INSTALL_NO_DEVELOPMENT) + # INSTALL(TARGETS vtkWrapHierarchy + # RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT Development) + endif() + endif() + + if(VTK_WRAP_TCL) + add_executable(vtkWrapTcl vtkWrapTcl.c vtkParseMain.c vtkParse.tab.c + vtkParsePreprocess.c vtkParseExtras.c vtkParseHierarchy.c) + add_executable(vtkWrapTclInit vtkWrapTclInit.c) + export(TARGETS vtkWrapTcl vtkWrapTclInit + FILE ${EXPORT_EXECUTABLES_FILE} + NAMESPACE "${EXPORT_EXECUTABLES_NAMESPACE}" APPEND) + if(COMPILE_TOOLS_TARGET) + add_dependencies(${COMPILE_TOOLS_TARGET} vtkWrapTcl vtkWrapTclInit) + endif() + endif() - IF (VTK_WRAP_PYTHON) - INCLUDE_DIRECTORIES("${PYTHON_INCLUDE_PATH}") + if(VTK_WRAP_PYTHON) + set(VTK_WRAP_PYTHON_FIND_LIBS ON) + include(vtkWrapPython) + include_directories("${PYTHON_INCLUDE_PATH}" + "${CMAKE_CURRENT_SOURCE_DIR}/PythonCore" + "${CMAKE_CURRENT_BINARY_DIR}/PythonCore") - VTK_ADD_EXECUTABLE(vtkWrapPython vtkWrapPython.c vtkWrap.c vtkWrapText.c + add_executable(vtkWrapPython vtkWrapPython.c vtkWrap.c vtkWrapText.c vtkParseMain.c vtkParse.tab.c vtkParsePreprocess.c vtkParseExtras.c vtkParseHierarchy.c) - VTK_ADD_EXECUTABLE(vtkWrapPythonInit vtkWrapPythonInit.c) - TARGET_LINK_LIBRARIES(vtkWrapPython ${VTK_PYTHON_LIBRARIES}) - EXPORT(TARGETS vtkWrapPython vtkWrapPythonInit FILE ${EXPORT_EXECUTABLES_FILE} NAMESPACE "${EXPORT_EXECUTABLES_NAMESPACE}" APPEND) - IF(COMPILE_TOOLS_TARGET) - ADD_DEPENDENCIES(${COMPILE_TOOLS_TARGET} vtkWrapPython vtkWrapPythonInit) - ENDIF(COMPILE_TOOLS_TARGET) - IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - INSTALL(TARGETS vtkWrapPython vtkWrapPythonInit - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT Development # .exe, .dll - ) - ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) - ENDIF (VTK_WRAP_PYTHON) + add_executable(vtkWrapPythonInit vtkWrapPythonInit.c) + target_link_libraries(vtkWrapPython ${VTK_PYTHON_LIBRARIES}) + export(TARGETS vtkWrapPython vtkWrapPythonInit + FILE ${EXPORT_EXECUTABLES_FILE} + NAMESPACE "${EXPORT_EXECUTABLES_NAMESPACE}" APPEND) + if(COMPILE_TOOLS_TARGET) + add_dependencies(${COMPILE_TOOLS_TARGET} vtkWrapPython vtkWrapPythonInit) + endif() + endif() - IF (VTK_WRAP_JAVA) - VTK_ADD_EXECUTABLE(vtkParseJava vtkParseJava.c vtkParseMain.c vtkParse.tab.c + if(VTK_WRAP_JAVA) + add_executable(vtkParseJava vtkParseJava.c vtkParseMain.c vtkParse.tab.c vtkParsePreprocess.c vtkParseExtras.c vtkParseHierarchy.c) - VTK_ADD_EXECUTABLE(vtkWrapJava vtkWrapJava.c vtkParseMain.c vtkParse.tab.c + add_executable(vtkWrapJava vtkWrapJava.c vtkParseMain.c vtkParse.tab.c vtkParsePreprocess.c vtkParseExtras.c vtkParseHierarchy.c) - EXPORT(TARGETS vtkParseJava vtkWrapJava FILE ${EXPORT_EXECUTABLES_FILE} NAMESPACE "${EXPORT_EXECUTABLES_NAMESPACE}" APPEND) - IF(COMPILE_TOOLS_TARGET) - ADD_DEPENDENCIES(${COMPILE_TOOLS_TARGET} vtkParseJava vtkWrapJava) - ENDIF(COMPILE_TOOLS_TARGET) - IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - INSTALL(TARGETS vtkParseJava vtkWrapJava - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT Development # .exe, .dll - ) - ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) - ENDIF (VTK_WRAP_JAVA) + export(TARGETS vtkParseJava vtkWrapJava + FILE ${EXPORT_EXECUTABLES_FILE} + NAMESPACE "${EXPORT_EXECUTABLES_NAMESPACE}" APPEND) + if(COMPILE_TOOLS_TARGET) + add_dependencies(${COMPILE_TOOLS_TARGET} vtkParseJava vtkWrapJava) + endif() + endif() + +endif() + +if(VTK_WRAP_PYTHON) + add_subdirectory(Python) +endif() -ENDIF(NOT CMAKE_CROSSCOMPILING) +if(VTK_WRAP_TCL) + add_subdirectory(Tcl) +endif() diff --git a/Wrapping/Java/CMakeLists.txt b/Wrapping/Java/CMakeLists.txt index 2f2f28e163f..2eabe04a0d2 100644 --- a/Wrapping/Java/CMakeLists.txt +++ b/Wrapping/Java/CMakeLists.txt @@ -1,423 +1,291 @@ -# this file is used directly from VTK/CMakeLists.txt, not from VTK/Wrapping/CMakeLists.txt - -IF(JAVA_COMPILE) +foreach(module ${VTK_MODULES_ENABLED}) + if(NOT VTK_MODULE_${module}_EXCLUDE_FROM_WRAPPING) + include(${${module}_BINARY_DIR}/JavaDependencies.cmake OPTIONAL) + string(REGEX REPLACE "^vtk" "" kit_name "${module}") + set(_MODULES_TO_WRAP ${_MODULES_TO_WRAP} ${module}) + set(KITS ${KITS} ${kit_name}) + endif() +endforeach() + +IF(NOT VTK_JAR_PATH) + SET(VTK_JAR_PATH "${LIBRARY_OUTPUT_PATH}") +ENDIF(NOT VTK_JAR_PATH) + +SET(CLASS_FILES ${VTK_JAVA_DEPENDENCIES}) +STRING(REGEX REPLACE "\\.java" ".class;" CLASS_FILES ${VTK_JAVA_DEPENDENCIES}) +ADD_CUSTOM_TARGET(VTKJava ALL) +ADD_CUSTOM_TARGET(VTKJavaJar ALL) +ADD_CUSTOM_TARGET(VTKJavaSampleJar ALL) + +# Some platforms have libjvm in a subdirectory from +# the rest of the java libraries and are missing the symlink. + +IF(JAVA_AWT_LIBRARY) + FOREACH(__java_library ${JAVA_AWT_LIBRARY}) + GET_FILENAME_COMPONENT(JAVA_LIB_DIR ${__java_library} PATH) + IF(EXISTS ${JAVA_LIB_DIR}/xawt) + LINK_DIRECTORIES(${JAVA_LIB_DIR}/xawt) + ENDIF(EXISTS ${JAVA_LIB_DIR}/xawt) + IF(EXISTS ${JAVA_LIB_DIR}/client) + LINK_DIRECTORIES(${JAVA_LIB_DIR}/client) + ENDIF(EXISTS ${JAVA_LIB_DIR}/client) + IF(EXISTS ${JAVA_LIB_DIR}/server) + LINK_DIRECTORIES(${JAVA_LIB_DIR}/server) + ENDIF(EXISTS ${JAVA_LIB_DIR}/server) + ENDFOREACH(__java_library) +ENDIF(JAVA_AWT_LIBRARY) + +SET(CMAKE_SKIP_RPATH 0) +include_directories(${vtkCommonCore_SOURCE_DIR}) +include_directories(${vtkCommonCore_BINARY_DIR}) +ADD_EXECUTABLE(VTKJavaExecutable VTKJava.cxx) +SET(JAVA_LIBRARIES) + +SET(VTK_BUILD_ALL_CONTENT "") +SET(VTK_BUILD_ALL_DEPENDS "") + +FOREACH(module ${_MODULES_TO_WRAP}) + + string(REGEX REPLACE "^vtk" "" kit "${module}") + + IF(APPLE) + SET(src ${VTK_JAR_PATH}/libvtk${kit}Java.dylib) + SET(tgt ${VTK_JAR_PATH}/libvtk${kit}Java.jnilib) + ADD_CUSTOM_COMMAND(OUTPUT ${tgt} + COMMAND ln + ARGS -sf ${src} ${tgt} + DEPENDS ${src}) + SET(JAVA_LIBRARIES ${JAVA_LIBRARIES} ${tgt}) + ENDIF(APPLE) + + TARGET_LINK_LIBRARIES(VTKJavaExecutable vtk${kit}Java) SET(VTK_JAVA_DEPENDENCIES "") - INCLUDE(${VTK_BINARY_DIR}/Common/JavaDependencies.cmake OPTIONAL) - INCLUDE(${VTK_BINARY_DIR}/Filtering/JavaDependencies.cmake OPTIONAL) - INCLUDE(${VTK_BINARY_DIR}/IO/JavaDependencies.cmake OPTIONAL) - INCLUDE(${VTK_BINARY_DIR}/Graphics/JavaDependencies.cmake OPTIONAL) - INCLUDE(${VTK_BINARY_DIR}/GenericFiltering/JavaDependencies.cmake OPTIONAL) - INCLUDE(${VTK_BINARY_DIR}/Imaging/JavaDependencies.cmake OPTIONAL) - IF (VTK_USE_RENDERING) - INCLUDE(${VTK_BINARY_DIR}/Rendering/JavaDependencies.cmake OPTIONAL) - INCLUDE(${VTK_BINARY_DIR}/VolumeRendering/JavaDependencies.cmake OPTIONAL) - INCLUDE(${VTK_BINARY_DIR}/Hybrid/JavaDependencies.cmake OPTIONAL) - INCLUDE(${VTK_BINARY_DIR}/Widgets/JavaDependencies.cmake OPTIONAL) - ENDIF(VTK_USE_RENDERING) - IF (VTK_USE_PARALLEL) - INCLUDE(${VTK_BINARY_DIR}/Parallel/JavaDependencies.cmake OPTIONAL) - ENDIF(VTK_USE_PARALLEL) - IF (VTK_USE_GEOVIS) - INCLUDE(${VTK_BINARY_DIR}/Geovis/JavaDependencies.cmake OPTIONAL) - ENDIF(VTK_USE_GEOVIS) - IF (VTK_USE_INFOVIS) - INCLUDE(${VTK_BINARY_DIR}/Infovis/JavaDependencies.cmake OPTIONAL) - ENDIF(VTK_USE_INFOVIS) - IF (VTK_USE_VIEWS) - INCLUDE(${VTK_BINARY_DIR}/Views/JavaDependencies.cmake OPTIONAL) - ENDIF(VTK_USE_VIEWS) - - SET(VTK_JAVA_NEW_STYLE 0) - IF(COMMAND VTK_GENERATE_JAVA_DEPENDENCIES) - IF(VTK_JAVA_DEPENDENCIES) - SET(VTK_JAVA_NEW_STYLE 1) - ENDIF(VTK_JAVA_DEPENDENCIES) - ENDIF(COMMAND VTK_GENERATE_JAVA_DEPENDENCIES) - - IF(NOT VTK_JAR_PATH) - SET(VTK_JAR_PATH "${LIBRARY_OUTPUT_PATH}") - ENDIF(NOT VTK_JAR_PATH) - - IF(VTK_JAVA_NEW_STYLE) - SET(CLASS_FILES ${VTK_JAVA_DEPENDENCIES}) - STRING(REGEX REPLACE "\\.java" ".class;" CLASS_FILES ${VTK_JAVA_DEPENDENCIES}) - ADD_CUSTOM_TARGET(VTKJava ALL) - ADD_CUSTOM_TARGET(VTKJavaJar ALL) - ADD_CUSTOM_TARGET(VTKJavaSampleJar ALL) - - SET(KITS Common Filtering IO Graphics GenericFiltering Imaging) - IF (VTK_USE_RENDERING) - SET(KITS ${KITS} Rendering) - SET(KITS ${KITS} VolumeRendering) - SET(KITS ${KITS} Hybrid) - SET(KITS ${KITS} Widgets) - ENDIF(VTK_USE_RENDERING) - IF (VTK_USE_PARALLEL) - SET(KITS ${KITS} Parallel) - ENDIF(VTK_USE_PARALLEL) - IF (VTK_USE_GEOVIS) - SET(KITS ${KITS} Geovis) - ENDIF(VTK_USE_GEOVIS) - IF (VTK_USE_INFOVIS) - SET(KITS ${KITS} Infovis) - ENDIF(VTK_USE_INFOVIS) - IF (VTK_USE_VIEWS) - SET(KITS ${KITS} Views) - ENDIF(VTK_USE_VIEWS) - - # Some platforms have libjvm in a subdirectory from - # the rest of the java libraries and are missing the symlink. - IF(JAVA_AWT_LIBRARY) - FOREACH(__java_library ${JAVA_AWT_LIBRARY}) - GET_FILENAME_COMPONENT(JAVA_LIB_DIR ${__java_library} PATH) - IF(EXISTS ${JAVA_LIB_DIR}/xawt) - LINK_DIRECTORIES(${JAVA_LIB_DIR}/xawt) - ENDIF(EXISTS ${JAVA_LIB_DIR}/xawt) - IF(EXISTS ${JAVA_LIB_DIR}/client) - LINK_DIRECTORIES(${JAVA_LIB_DIR}/client) - ENDIF(EXISTS ${JAVA_LIB_DIR}/client) - IF(EXISTS ${JAVA_LIB_DIR}/server) - LINK_DIRECTORIES(${JAVA_LIB_DIR}/server) - ENDIF(EXISTS ${JAVA_LIB_DIR}/server) - ENDFOREACH(__java_library) - ENDIF(JAVA_AWT_LIBRARY) - SET(CMAKE_SKIP_RPATH 0) - ADD_EXECUTABLE(VTKJavaExecutable VTKJava.cxx) - SET(JAVA_LIBRARIES) - - SET(VTK_BUILD_ALL_CONTENT "") - SET(VTK_BUILD_ALL_DEPENDS "") - - FOREACH(kit ${KITS}) - IF(APPLE) - SET(src ${VTK_JAR_PATH}/libvtk${kit}Java.dylib) - SET(tgt ${VTK_JAR_PATH}/libvtk${kit}Java.jnilib) - ADD_CUSTOM_COMMAND(OUTPUT ${tgt} - COMMAND ln - ARGS -sf ${src} ${tgt} - DEPENDS ${src}) - SET(JAVA_LIBRARIES ${JAVA_LIBRARIES} ${tgt}) - ENDIF(APPLE) - TARGET_LINK_LIBRARIES(VTKJavaExecutable vtk${kit}Java) - SET(VTK_JAVA_DEPENDENCIES "") - ADD_CUSTOM_TARGET(VTKJava${kit} ALL) - SET(VTK_BUILD_ALL_CONTENT - "${VTK_BUILD_ALL_CONTENT}\n vtk.vtkVTKJava${kit}Driver.Initialize(args);") - SET(VTK_BUILD_ALL_DEPENDS - ${VTK_BUILD_ALL_DEPENDS} - ${VTK_BINARY_DIR}/java/vtk/vtkVTKJava${kit}Driver.java) - INCLUDE(${VTK_BINARY_DIR}/${kit}/JavaDependencies.cmake OPTIONAL) - VTK_GENERATE_JAVA_DEPENDENCIES(VTKJava${kit} ${VTK_JAVA_DEPENDENCIES}) - #ADD_DEPENDENCIES(VTKJava${kit} VTKJavaExecutable) - #ADD_DEPENDENCIES(VTKJava${kit} vtk${kit}JavaJavaClasses) - #ADD_DEPENDENCIES(VTKJavaJar VTKJava${kit}) - # Make sure all .java files are build before any .class files are built. - FOREACH(otherKit ${KITS}) - ADD_DEPENDENCIES(VTKJava${kit} vtk${otherKit}JavaJavaClasses) - ENDFOREACH(otherKit) - ENDFOREACH(kit) - - CONFIGURE_FILE(${VTK_SOURCE_DIR}/Wrapping/Java/vtkBuildAllDriver.java.in - ${VTK_BINARY_DIR}/java/vtk/vtkBuildAllDriver.java) - ADD_CUSTOM_TARGET(VTKBuildAll ALL) - - CONFIGURE_FILE(${VTK_SOURCE_DIR}/Wrapping/Java/vtk/vtkSettings.java.in - ${VTK_BINARY_DIR}/java/vtk/vtkSettings.java) + ADD_CUSTOM_TARGET(VTKJava${kit} ALL) + SET(VTK_BUILD_ALL_CONTENT + "${VTK_BUILD_ALL_CONTENT}\n vtk.vtkVTKJava${kit}Driver.Initialize(args);") + SET(VTK_BUILD_ALL_DEPENDS + ${VTK_BUILD_ALL_DEPENDS} + ${VTK_BINARY_DIR}/java/vtk/vtkVTKJava${kit}Driver.java) + INCLUDE(${${module}_BINARY_DIR}/JavaDependencies.cmake OPTIONAL) + if(VTK_JAVA_DEPENDENCIES) + vtk_generate_java_dependencies(VTKJava${kit} ${VTK_JAVA_DEPENDENCIES}) + endif() + + add_dependencies(VTKJava${kit} VTKJavaExecutable) + add_dependencies(VTKJava${kit} vtk${kit}JavaJavaClasses) + add_dependencies(VTKJavaJar VTKJava${kit}) + # Make sure all .java files are build before any .class files are built. + FOREACH(otherKit ${KITS}) + ADD_DEPENDENCIES(VTKJava${kit} vtk${otherKit}JavaJavaClasses) + ENDFOREACH(otherKit) +ENDFOREACH(module) + +CONFIGURE_FILE(${VTK_SOURCE_DIR}/Wrapping/Java/vtkBuildAllDriver.java.in + ${VTK_BINARY_DIR}/java/vtk/vtkBuildAllDriver.java) +ADD_CUSTOM_TARGET(VTKBuildAll ALL) + +CONFIGURE_FILE(${VTK_SOURCE_DIR}/Wrapping/Java/vtk/vtkSettings.java.in + ${VTK_BINARY_DIR}/java/vtk/vtkSettings.java) + +ADD_CUSTOM_COMMAND( + TARGET VTKBuildAll + OUTPUTS ${VTK_BINARY_DIR}/java/vtkBuildAllDriver.class + DEPENDS ${VTK_BUILD_ALL_DEPENDS} + SOURCE ${VTK_BINARY_DIR}/java/vtk/vtkBuildAllDriver.java + COMMAND ${JAVA_COMPILE} + ARGS -classpath ${VTK_JAVA_HOME}/.. -d ${VTK_JAVA_HOME}/.. + ${VTK_BINARY_DIR}/java/vtk/vtkBuildAllDriver.java + ) + +ADD_CUSTOM_COMMAND( + TARGET VTKBuildAll + SOURCE VTKBuildAll + DEPENDS ${VTK_BINARY_DIR}/java/vtkBuildAllDriver.class + ) + +ADD_DEPENDENCIES(VTKJavaJar VTKBuildAll) + +# Make sure all the VTKJava${kit} projects build *before* VTKBuildAll. +# (All individual generated .java files should be compiled into .class +# files before compiling the "driver" sources...) +# +FOREACH(kit ${KITS}) + ADD_DEPENDENCIES(VTKBuildAll VTKJava${kit}) + ADD_DEPENDENCIES(VTKBuildAll vtk${kit}Java) +ENDFOREACH(kit) + +SET(VTK_JAVA_DEPENDENCIES + CellType + vtkReferenceInformation + vtkJavaGarbageCollector + vtkJavaMemoryManager + vtkJavaMemoryManagerImpl + vtkNativeLibrary + vtkSettings + ) + +set(VTK_JAVA_SAMPLE_DEPENDENCIES) + +if(vtkRenderingCore_ENABLED) + set(VTK_JAVA_DEPENDENCIES ${VTK_JAVA_DEPENDENCIES} + vtkJavaTesting + AxesActor + vtkRenderWindowPanel + ) +endif() + +if(vtkInteractionWidgets_ENABLED) + set(VTK_JAVA_DEPENDENCIES ${VTK_JAVA_DEPENDENCIES} + vtkCanvas) +endif() + +if(vtkRenderingCore_ENABLED AND vtkIOImage_ENABLED) + set(VTK_JAVA_DEPENDENCIES ${VTK_JAVA_DEPENDENCIES} + vtkPanel) + set(VTK_JAVA_SAMPLE_DEPENDENCIES ${VTK_JAVA_SAMPLE_DEPENDENCIES} + InternalFrames + Demo + SimpleVTK + VTKCanvas + ReleaseVtkPanel) +endif() + +if(vtkFiltersModeling_ENABLED AND vtkIOImage_ENABLED) + set(VTK_JAVA_SAMPLE_DEPENDENCIES ${VTK_JAVA_SAMPLE_DEPENDENCIES} + ImagePlaneWidget) +endif() + +FOREACH(jfile ${VTK_JAVA_DEPENDENCIES}) + SET(src ${VTK_SOURCE_DIR}/Wrapping/Java/vtk/${jfile}.java) + SET(dst ${VTK_JAVA_HOME}/${jfile}.java) + SET(class ${VTK_JAVA_HOME}/${jfile}.class) + IF(jfile MATCHES "vtkSettings") + ELSE(jfile MATCHES "vtkSettings") + CONFIGURE_FILE(${src} ${dst} COPYONLY) + ENDIF(jfile MATCHES "vtkSettings") + + ADD_CUSTOM_COMMAND( + TARGET VTKJavaJar + SOURCE ${dst} + OUTPUTS ${class} + DEPENDS ${VTK_JAVA_HOME}/vtkPanel.java + COMMAND ${JAVA_COMPILE} + ARGS -classpath ${VTK_JAVA_HOME}/.. -d ${VTK_JAVA_HOME}/.. ${dst} + ) - ADD_CUSTOM_COMMAND( - TARGET VTKBuildAll - OUTPUTS ${VTK_BINARY_DIR}/java/vtk/vtkBuildAllDriver.class - DEPENDS ${VTK_BUILD_ALL_DEPENDS} - SOURCE ${VTK_BINARY_DIR}/java/vtk/vtkBuildAllDriver.java - COMMAND ${JAVA_COMPILE} - ARGS -classpath ${VTK_JAVA_HOME}/.. -d ${VTK_JAVA_HOME}/.. - ${VTK_BINARY_DIR}/java/vtk/vtkBuildAllDriver.java - ) + SET(CLASS_FILES ${CLASS_FILES} ${class}) +ENDFOREACH(jfile) - ADD_CUSTOM_COMMAND( - TARGET VTKBuildAll - SOURCE VTKBuildAll - DEPENDS ${VTK_BINARY_DIR}/java/vtk/vtkBuildAllDriver.class - ) - - ADD_DEPENDENCIES(VTKJavaJar VTKBuildAll) - - # Make sure all the VTKJava${kit} projects build *before* VTKBuildAll. - # (All individual generated .java files should be compiled into .class - # files before compiling the "driver" sources...) - # - FOREACH(kit ${KITS}) - ADD_DEPENDENCIES(VTKBuildAll VTKJava${kit}) - ADD_DEPENDENCIES(VTKBuildAll vtk${kit}Java) - ENDFOREACH(kit) - - ADD_DEPENDENCIES(VTKJavaFiltering VTKJavaCommon) - ADD_DEPENDENCIES(VTKJavaIO VTKJavaFiltering) - ADD_DEPENDENCIES(VTKJavaGraphics VTKJavaIO) - ADD_DEPENDENCIES(VTKJavaGenericFiltering VTKJavaGraphics) - ADD_DEPENDENCIES(VTKJavaImaging VTKJavaFiltering) - - SET(VTK_JAVA_DEPENDENCIES - CellType - vtkReferenceInformation - vtkJavaGarbageCollector - vtkJavaMemoryManager - vtkJavaMemoryManagerImpl - vtkNativeLibrary - vtkSettings - vtkJavaTesting - AxesActor +ADD_DEPENDENCIES(VTKJava VTKJavaJar) + +FOREACH(jfile ${VTK_JAVA_SAMPLE_DEPENDENCIES}) + SET(src ${VTK_SOURCE_DIR}/Wrapping/Java/vtk/sample/${jfile}.java) + SET(dst ${VTK_JAVA_HOME}/sample/${jfile}.java) + SET(class ${VTK_JAVA_HOME}/sample/${jfile}.class) + CONFIGURE_FILE(${src} ${dst} COPYONLY) + + ADD_CUSTOM_COMMAND( + TARGET VTKJavaSampleJar + SOURCE ${dst} + OUTPUTS ${class} + DEPENDS ${VTK_JAVA_HOME}/vtkPanel.class + COMMAND ${JAVA_COMPILE} + ARGS -classpath ${VTK_JAVA_HOME}/.. -d ${VTK_JAVA_HOME}/.. ${dst} ) - SET(VTK_JAVA_SAMPLE_DEPENDENCIES) - IF(VTK_USE_RENDERING) - SET(VTK_JAVA_DEPENDENCIES ${VTK_JAVA_DEPENDENCIES} - vtkCanvas - vtkPanel - vtkRenderWindowPanel - ) - SET(VTK_JAVA_SAMPLE_DEPENDENCIES ${VTK_JAVA_SAMPLE_DEPENDENCIES} - ImagePlaneWidget - InternalFrames - Demo - SimpleVTK - VTKCanvas - ReleaseVtkPanel - ) - ADD_DEPENDENCIES(VTKJavaRendering VTKJavaGraphics VTKJavaImaging) - ADD_DEPENDENCIES(VTKJavaVolumeRendering VTKJavaRendering) - ADD_DEPENDENCIES(VTKJavaHybrid VTKJavaRendering) - ADD_DEPENDENCIES(VTKJavaWidgets VTKJavaHybrid) - ENDIF(VTK_USE_RENDERING) - IF(VTK_USE_PARALLEL) - ADD_DEPENDENCIES(VTKJavaParallel VTKJavaRendering) - ENDIF(VTK_USE_PARALLEL) - IF(VTK_USE_GEOVIS) - ADD_DEPENDENCIES(VTKJavaGeovis VTKJavaWidgets) - ENDIF(VTK_USE_GEOVIS) - IF(VTK_USE_INFOVIS) - ADD_DEPENDENCIES(VTKJavaInfovis VTKJavaWidgets) - ENDIF(VTK_USE_INFOVIS) - IF(VTK_USE_VIEWS) - ADD_DEPENDENCIES(VTKJavaViews VTKJavaInfovis) - ENDIF(VTK_USE_VIEWS) - - FOREACH(jfile ${VTK_JAVA_DEPENDENCIES}) - SET(src ${VTK_SOURCE_DIR}/Wrapping/Java/vtk/${jfile}.java) - SET(dst ${VTK_JAVA_HOME}/${jfile}.java) - SET(class ${VTK_JAVA_HOME}/${jfile}.class) - IF(jfile MATCHES "vtkSettings") - ELSE(jfile MATCHES "vtkSettings") - CONFIGURE_FILE(${src} ${dst} COPYONLY) - ENDIF(jfile MATCHES "vtkSettings") - - ADD_CUSTOM_COMMAND( - TARGET VTKJavaJar - SOURCE ${dst} - OUTPUTS ${class} - DEPENDS ${VTK_JAVA_HOME}/vtkPanel.java - COMMAND ${JAVA_COMPILE} - ARGS -classpath ${VTK_JAVA_HOME}/.. -d ${VTK_JAVA_HOME}/.. ${dst} - ) - - SET(CLASS_FILES ${CLASS_FILES} ${class}) - ENDFOREACH(jfile) - ADD_DEPENDENCIES(VTKJava VTKJavaJar) - - FOREACH(jfile ${VTK_JAVA_SAMPLE_DEPENDENCIES}) - SET(src ${VTK_SOURCE_DIR}/Wrapping/Java/vtk/sample/${jfile}.java) - SET(dst ${VTK_JAVA_HOME}/sample/${jfile}.java) - SET(class ${VTK_JAVA_HOME}/sample/${jfile}.class) - CONFIGURE_FILE(${src} ${dst} COPYONLY) - - ADD_CUSTOM_COMMAND( - TARGET VTKJavaSampleJar - SOURCE ${dst} - OUTPUTS ${class} - DEPENDS ${VTK_JAVA_HOME}/vtkPanel.class - COMMAND ${JAVA_COMPILE} - ARGS -classpath ${VTK_JAVA_HOME}/.. -d ${VTK_JAVA_HOME}/.. ${dst} - ) - - SET(CLASS_FILES ${CLASS_FILES} ${class}) - ENDFOREACH(jfile) - ADD_DEPENDENCIES(VTKJava VTKJavaSampleJar) - - ADD_CUSTOM_COMMAND(SOURCE ${VTK_JAVA_HOME}/vtkObject.class - COMMAND ${JAVA_ARCHIVE} - ARGS -cvf "${VTK_JAR_PATH}/vtk.jar" - -C ${VTK_BINARY_DIR}/java - vtk - TARGET VTKJavaJar - DEPENDS ${CLASS_FILES} ${JAVA_LIBRARIES} - OUTPUTS ${VTK_JAR_PATH}/vtk.jar - COMMENT "Java Archive") - - ADD_CUSTOM_COMMAND(SOURCE VTKJavaJar - TARGET VTKJavaJar - DEPENDS ${VTK_JAR_PATH}/vtk.jar) - - IF(BUILD_TESTING) - IF(WIN32) - SET(SEPARATOR "\;") - ELSE(WIN32) - SET(SEPARATOR ":") - ENDIF(WIN32) - - FOREACH(jfile - Regression - ConcurrencyGC - JavaDelete - ManualGC - JavaGCAndDelete) - ADD_CUSTOM_COMMAND( - SOURCE ${VTK_SOURCE_DIR}/Wrapping/Java/vtk/test/${jfile}.java - COMMAND ${JAVA_COMPILE} - ARGS -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java - -sourcepath ${VTK_SOURCE_DIR}/Wrapping/Java - -d ${VTK_BINARY_DIR}/Wrapping/Java - ${VTK_SOURCE_DIR}/Wrapping/Java/vtk/test/${jfile}.java - TARGET VTKJava - DEPENDS ${VTK_JAR_PATH}/vtk.jar - OUTPUTS ${VTK_BINARY_DIR}/Wrapping/Java/vtk/test/${jfile}.class - COMMENT "Java Test") - SET(JAVA_TESTS ${JAVA_TESTS} ${VTK_BINARY_DIR}/Wrapping/Java/vtk/test/${jfile}.class) - ENDFOREACH(jfile) - - # Since vtkTesting is within vtkRendering we need blockers - IF(VTK_USE_RENDERING AND VTK_USE_DISPLAY) - - # If JAVA_DATAMODEL_FLAG is set, pass it as first argument. Otherwise, it's empty. - # For example, use "-d64" to force 64-bit java jvm. - # - ADD_TEST(JavaRegression ${JAVA_RUNTIME} ${VTK_TEST_JAVA_DATAMODEL_FLAG} - -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java - vtk.test.Regression -D ${VTK_DATA_ROOT} - -V Baseline/Graphics/Cone.png - -T ${VTK_BINARY_DIR}/Testing/Temporary) - ENDIF(VTK_USE_RENDERING AND VTK_USE_DISPLAY) - - ADD_TEST(JavaGCRegression ${JAVA_RUNTIME} ${VTK_TEST_JAVA_DATAMODEL_FLAG} - -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java - vtk.test.ConcurrencyGC - -T ${VTK_BINARY_DIR}/Testing/Temporary) - - ADD_TEST(JavaDeleteRegression ${JAVA_RUNTIME} ${VTK_TEST_JAVA_DATAMODEL_FLAG} - -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java - vtk.test.JavaDelete - -T ${VTK_BINARY_DIR}/Testing/Temporary) - - ADD_TEST(JavaManualGC ${JAVA_RUNTIME} ${VTK_TEST_JAVA_DATAMODEL_FLAG} - -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java - vtk.test.ManualGC - -T ${VTK_BINARY_DIR}/Testing/Temporary) - - ADD_TEST(JavaDeleteAndGC ${JAVA_RUNTIME} ${VTK_TEST_JAVA_DATAMODEL_FLAG} - -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java - vtk.test.JavaGCAndDelete - -T ${VTK_BINARY_DIR}/Testing/Temporary) - - ENDIF(BUILD_TESTING) - - ADD_CUSTOM_COMMAND( - SOURCE VTKJava - TARGET VTKJava - DEPENDS ${VTK_JAR_PATH}/vtk.jar ${JAVA_TESTS} - ) - - ELSE(VTK_JAVA_NEW_STYLE) - - ADD_CUSTOM_TARGET(VTKJava ALL) - - ADD_CUSTOM_COMMAND(SOURCE ${VTK_JAVA_HOME}/VTKJavaWrapped - COMMAND ${JAVA_COMPILE} - ARGS ${VTK_JAVA_HOME}/vtk*.java + + SET(CLASS_FILES ${CLASS_FILES} ${class}) +ENDFOREACH(jfile) + +ADD_DEPENDENCIES(VTKJava VTKJavaSampleJar) + +ADD_CUSTOM_COMMAND(SOURCE ${VTK_JAVA_HOME}/vtkObject.class + COMMAND ${JAVA_ARCHIVE} + ARGS -cvf "${VTK_JAR_PATH}/vtk.jar" + -C ${VTK_BINARY_DIR}/java + vtk + TARGET VTKJavaJar + DEPENDS ${CLASS_FILES} ${JAVA_LIBRARIES} + OUTPUTS ${VTK_JAR_PATH}/vtk.jar + COMMENT "Java Archive") + +ADD_CUSTOM_COMMAND(SOURCE VTKJavaJar + TARGET VTKJavaJar + DEPENDS ${VTK_JAR_PATH}/vtk.jar) + +IF(BUILD_TESTING) + IF(WIN32) + SET(SEPARATOR "\;") + ELSE(WIN32) + SET(SEPARATOR ":") + ENDIF(WIN32) + + FOREACH(jfile + Regression + ConcurrencyGC + JavaDelete + ManualGC + JavaGCAndDelete) + + ADD_CUSTOM_COMMAND( + SOURCE ${VTK_SOURCE_DIR}/Wrapping/Java/vtk/test/${jfile}.java + COMMAND ${JAVA_COMPILE} + ARGS -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java + -sourcepath ${VTK_SOURCE_DIR}/Wrapping/Java + -d ${VTK_BINARY_DIR}/Wrapping/Java + ${VTK_SOURCE_DIR}/Wrapping/Java/vtk/test/${jfile}.java TARGET VTKJava - OUTPUTS ${VTK_JAVA_HOME}/vtkObject.class) - - IF(JAVA_ARCHIVE) - ADD_CUSTOM_COMMAND(SOURCE ${VTK_JAVA_HOME}/vtkObject.class - COMMAND ${CMAKE_COMMAND} - ARGS -E chdir - ${VTK_BINARY_DIR}/java ${JAVA_ARCHIVE} - -cvf "\"${VTK_JAR_PATH}/vtk.jar\"" - vtk - TARGET VTKJava - DEPENDS ${VTK_JAVA_HOME}/vtkObject.class - OUTPUTS ${VTK_JAR_PATH}/vtk.jar) - - IF(BUILD_TESTING) - IF(WIN32) - SET(SEPARATOR "\;") - ELSE(WIN32) - SET(SEPARATOR ":") - ENDIF(WIN32) - - FOREACH(jfile - Regression - ConcurrencyGC - JavaDelete - JavaGCAndDelete - ManualGC - vtkJavaTesting) - ADD_CUSTOM_COMMAND( - SOURCE ${VTK_SOURCE_DIR}/Wrapping/Java/vtk/test/${jfile}.java - COMMAND ${JAVA_COMPILE} - ARGS -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java - -sourcepath ${VTK_SOURCE_DIR}/Wrapping/Java - -d ${VTK_BINARY_DIR}/Wrapping/Java - ${VTK_SOURCE_DIR}/Wrapping/Java/vtk/test/${jfile}.java - TARGET VTKJava - DEPENDS ${VTK_JAR_PATH}/vtk.jar - OUTPUTS ${VTK_BINARY_DIR}/Wrapping/Java/vtk/test/${jfile}.class) - SET(JAVA_TESTS ${JAVA_TESTS} ${VTK_BINARY_DIR}/Wrapping/Java/${jfile}.class) - ENDFOREACH(jfile) - - # Since vtkTesting is within vtkRendering we need blockers - IF(VTK_USE_RENDERING AND VTK_USE_DISPLAY) - ADD_TEST(JavaRegression ${JAVA_RUNTIME} - -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java - vtk.test.Regression -D ${VTK_DATA_ROOT} - -V Baseline/Graphics/Cone.png - -T ${VTK_BINARY_DIR}/Testing/Temporary) - ENDIF(VTK_USE_RENDERING AND VTK_USE_DISPLAY) - - ADD_TEST(JavaGCRegression ${JAVA_RUNTIME} ${VTK_TEST_JAVA_DATAMODEL_FLAG} - -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java - vtk.test.ConcurrencyGC - -T ${VTK_BINARY_DIR}/Testing/Temporary) - - ADD_TEST(JavaDeleteRegression ${JAVA_RUNTIME} ${VTK_TEST_JAVA_DATAMODEL_FLAG} - -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java - vtk.test.JavaDelete - -T ${VTK_BINARY_DIR}/Testing/Temporary) - - ADD_TEST(JavaManualGC ${JAVA_RUNTIME} ${VTK_TEST_JAVA_DATAMODEL_FLAG} - -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java - vtk.test.ManualGC - -T ${VTK_BINARY_DIR}/Testing/Temporary) - - ADD_TEST(JavaDeleteAndGC ${JAVA_RUNTIME} ${VTK_TEST_JAVA_DATAMODEL_FLAG} - -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java - vtk.test.JavaGCAndDelete - -T ${VTK_BINARY_DIR}/Testing/Temporary) - - ENDIF(BUILD_TESTING) - - ADD_CUSTOM_COMMAND( - SOURCE VTKJava - COMMAND echo - ARGS "Checking dependencies for VTK Java" - TARGET VTKJava - DEPENDS ${VTK_JAR_PATH}/vtk.jar ${JAVA_TESTS} - ) - - ENDIF(JAVA_ARCHIVE) - ENDIF(VTK_JAVA_NEW_STYLE) - - IF(NOT VTK_INSTALL_NO_RUNTIME) - INSTALL(FILES - ${VTK_JAR_PATH}/vtk.jar - DESTINATION ${VTK_INSTALL_JAVA_DIR_CM24} - COMPONENT RuntimeLibraries) - ENDIF(NOT VTK_INSTALL_NO_RUNTIME) -ENDIF(JAVA_COMPILE) + DEPENDS ${VTK_JAR_PATH}/vtk.jar + OUTPUTS ${VTK_BINARY_DIR}/Wrapping/Java/vtk/test/${jfile}.class + COMMENT "Java Test") + SET(JAVA_TESTS ${JAVA_TESTS} ${VTK_BINARY_DIR}/Wrapping/Java/vtk/test/${jfile}.class) + ENDFOREACH(jfile) + + # Since vtkTesting is within vtkTestingRendering we need blockers + if(vtkTestingRendering_ENABLED) + + # Require Rendering + if(vtkRenderingOpenGL_ENABLED) + # If JAVA_DATAMODEL_FLAG is set, pass it as first argument. Otherwise, it's empty. + # For example, use "-d64" to force 64-bit java jvm. + # + ADD_TEST(JavaRegression ${JAVA_RUNTIME} ${VTK_TEST_JAVA_DATAMODEL_FLAG} + -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java + vtk.test.Regression -D ${VTK_DATA_ROOT} + -V Baseline/Graphics/Cone.png + -T ${VTK_BINARY_DIR}/Testing/Temporary) + endif() + + ADD_TEST(JavaGCRegression ${JAVA_RUNTIME} ${VTK_TEST_JAVA_DATAMODEL_FLAG} + -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java + vtk.test.ConcurrencyGC + -T ${VTK_BINARY_DIR}/Testing/Temporary) + + ADD_TEST(JavaDeleteRegression ${JAVA_RUNTIME} ${VTK_TEST_JAVA_DATAMODEL_FLAG} + -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java + vtk.test.JavaDelete + -T ${VTK_BINARY_DIR}/Testing/Temporary) + + ADD_TEST(JavaManualGC ${JAVA_RUNTIME} ${VTK_TEST_JAVA_DATAMODEL_FLAG} + -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java + vtk.test.ManualGC + -T ${VTK_BINARY_DIR}/Testing/Temporary) + + ADD_TEST(JavaDeleteAndGC ${JAVA_RUNTIME} ${VTK_TEST_JAVA_DATAMODEL_FLAG} + -classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java + vtk.test.JavaGCAndDelete + -T ${VTK_BINARY_DIR}/Testing/Temporary) + endif() +ENDIF(BUILD_TESTING) + +ADD_CUSTOM_COMMAND( + SOURCE VTKJava + TARGET VTKJava + DEPENDS ${VTK_JAR_PATH}/vtk.jar ${JAVA_TESTS} + ) + +# IF(NOT VTK_INSTALL_NO_RUNTIME) +# INSTALL(FILES +# ${VTK_JAR_PATH}/vtk.jar +# DESTINATION ${VTK_INSTALL_JAVA_DIR_CM24} +# COMPONENT RuntimeLibraries) +# ENDIF(NOT VTK_INSTALL_NO_RUNTIME) diff --git a/Wrapping/JavaCore/CMakeLists.txt b/Wrapping/JavaCore/CMakeLists.txt new file mode 100644 index 00000000000..c8601813b0d --- /dev/null +++ b/Wrapping/JavaCore/CMakeLists.txt @@ -0,0 +1,11 @@ + +# what does this do! +SET(__inst_files ${__inst_files} + vtkJavaUtil.h + ) + +set(JavaCore_SRCS + vtkJavaUtil.cxx + ) + +vtk_module_library(vtkWrappingJavaCore ${JavaCore_SRCS}) diff --git a/Wrapping/JavaCore/module.cmake b/Wrapping/JavaCore/module.cmake new file mode 100644 index 00000000000..30b1f00840a --- /dev/null +++ b/Wrapping/JavaCore/module.cmake @@ -0,0 +1,6 @@ +vtk_module(vtkWrappingJavaCore + DEPENDS + vtkCommonCore + EXCLUDE_FROM_ALL + EXCLUDE_FROM_WRAPPING + ) diff --git a/Wrapping/JavaCore/vtkJavaUtil.h b/Wrapping/JavaCore/vtkJavaUtil.h index 661afc1368d..957613d4cec 100644 --- a/Wrapping/JavaCore/vtkJavaUtil.h +++ b/Wrapping/JavaCore/vtkJavaUtil.h @@ -20,7 +20,7 @@ #include <jni.h> #include "vtkCommand.h" #include "vtkStdString.h" - +#include "vtkWrappingJavaCoreModule.h" extern JNIEXPORT jlong vtkJavaGetId(JNIEnv *env,jobject obj); @@ -66,7 +66,7 @@ struct vtkJavaVoidFuncArg extern JNIEXPORT void vtkJavaVoidFunc(void *); extern JNIEXPORT void vtkJavaVoidFuncArgDelete(void *); -class vtkJavaCommand : public vtkCommand +class VTKWRAPPINGJAVACORE_EXPORT vtkJavaCommand : public vtkCommand { public: static vtkJavaCommand *New() { return new vtkJavaCommand; }; diff --git a/Wrapping/Python/CMakeLists.txt b/Wrapping/Python/CMakeLists.txt index b1b8a0a0989..739c5e8e783 100644 --- a/Wrapping/Python/CMakeLists.txt +++ b/Wrapping/Python/CMakeLists.txt @@ -1,265 +1,81 @@ # this file is used directly from VTK/CMakeLists.txt, not from VTK/Wrapping/CMakeLists.txt +include_directories(${VTK_BINARY_DIR} ${VTK_BINARY_DIR}/Utilities) -#----------------------- -# for libvtkPythonCore.so, the core classes and utilities for VTK-Python -SET(VTK_PYTHON_CORE_SRCS - vtkPythonArgs.cxx - vtkPythonOverload.cxx - vtkPythonUtil.cxx - PyVTKClass.cxx - PyVTKMutableObject.cxx - PyVTKObject.cxx - PyVTKSpecialObject.cxx - PyVTKTemplate.cxx -) - -# SIP directory will be searched before other python dirs -IF(VTK_WRAP_PYTHON_SIP) - INCLUDE_DIRECTORIES(${SIP_INCLUDE_DIR}) -ENDIF(VTK_WRAP_PYTHON_SIP) - -INCLUDE_DIRECTORIES("${PYTHON_INCLUDE_PATH}") - -VTK_ADD_LIBRARY(vtkPythonCore ${VTK_PYTHON_CORE_SRCS}) -TARGET_LINK_LIBRARIES(vtkPythonCore vtkCommon) -IF(NOT VTK_INSTALL_NO_LIBRARIES) - INSTALL(TARGETS vtkPythonCore - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_LIBRARIES) - -IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - SET(__inst_files - vtkPython.h - vtkPythonUtil.h - vtkPythonArgs.h - vtkPythonOverload.h - PyVTKClass.h - PyVTKObject.h - PyVTKSpecialObject.h - PyVTKTemplate.h - PyVTKMutableObject.h - ) - INSTALL(FILES ${__inst_files} - DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24} - COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) - -# Underlinking on purpose. The following library will not compile -# with LDFLAGS=-Wl,--no-undefined by design: -# On some UNIX platforms the python library is static and therefore -# should not be linked into the shared library. Instead the symbols -# are exported from the python executable so that they can be used by -# shared libraries that are linked or loaded. On Windows and OSX we -# want to link to the python libray to resolve its symbols -# immediately. -IF(WIN32 OR APPLE) - TARGET_LINK_LIBRARIES (vtkPythonCore ${VTK_PYTHON_LIBRARIES}) - TARGET_LINK_LIBRARIES (vtkPythonCore LINK_INTERFACE_LIBRARIES ${VTK_PYTHON_LIBRARIES}) -ENDIF(WIN32 OR APPLE) - -# Apply user-defined properties to the library targets. -IF(VTK_LIBRARY_PROPERTIES) - SET_TARGET_PROPERTIES(vtkPythonCore PROPERTIES - ${VTK_LIBRARY_PROPERTIES} - ) -ENDIF(VTK_LIBRARY_PROPERTIES) +get_property(VTK_PYTHON_MODULES GLOBAL PROPERTY VTK_PYTHON_WRAPPED) #----------------------- # for the vtkpython executable -IF(VTK_USE_CARBON) - FIND_PROGRAM(VTK_APPLE_RESOURCE Rez /Developer/Tools) -ENDIF(VTK_USE_CARBON) +if(VTK_USE_CARBON) + find_program(VTK_APPLE_RESOURCE Rez /Developer/Tools) +endif() -IF(UNIX) - FIND_LIBRARY(PYTHON_UTIL_LIBRARY +if(UNIX) + find_library(PYTHON_UTIL_LIBRARY NAMES util DOC "Utility library needed for vtkpython" ) - MARK_AS_ADVANCED(PYTHON_UTIL_LIBRARY) -ENDIF(UNIX) - -# Python multithreading support -SET(_DEFAULT_SKIP_PYTHON_MULTITHREADING_SUPPORT 0) -IF(CMAKE_SYSTEM MATCHES BlueGene OR CMAKE_SYSTEM MATCHES Catamount) - SET(_DEFAULT_SKIP_PYTHON_MULTITHREADING_SUPPORT 1) -ENDIF(CMAKE_SYSTEM MATCHES BlueGene OR CMAKE_SYSTEM MATCHES Catamount) -OPTION(VTK_NO_PYTHON_THREADS "Disable multithreading support in the Python bindings" ${_DEFAULT_SKIP_PYTHON_MULTITHREADING_SUPPORT}) -MARK_AS_ADVANCED(VTK_NO_PYTHON_THREADS) - -# create vtkPythonConfigure.h -CONFIGURE_FILE(${VTK_SOURCE_DIR}/Wrapping/Python/vtkPythonConfigure.h.in - ${VTK_BINARY_DIR}/Wrapping/Python/vtkPythonConfigure.h) - -IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - SET(__inst_files - ${VTK_BINARY_DIR}/Wrapping/Python/vtkPythonConfigure.h - ) - INSTALL(FILES ${__inst_files} - DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24} - COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) + mark_as_advanced(PYTHON_UTIL_LIBRARY) +endif() -PYTHON_WRITE_MODULES_HEADER("${CMAKE_CURRENT_BINARY_DIR}/vtkpythonmodules.h") -INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}") +python_write_modules_header("${CMAKE_CURRENT_BINARY_DIR}/vtkpythonmodules.h") +include_directories("${CMAKE_CURRENT_BINARY_DIR}") # create the VTK/Python executable -CONFIGURE_FILE(${VTK_SOURCE_DIR}/Wrapping/Python/vtkPythonAppInitConfigure.h.in +configure_file(${VTK_SOURCE_DIR}/Wrapping/Python/vtkPythonAppInitConfigure.h.in ${VTK_BINARY_DIR}/Wrapping/Python/vtkPythonAppInitConfigure.h) -VTK_ADD_EXECUTABLE(vtkpython vtkPythonAppInit.cxx vtkpython.rc) +add_executable(vtkpython vtkPythonAppInit.cxx vtkpython.rc) -SET(VTKPYTHON_LINK_FLAGS) -SET(VTKPYTHON_LINK_LIBS) +set(VTKPYTHON_LINK_FLAGS) +set(VTKPYTHON_LINK_LIBS) -IF(CMAKE_SYSTEM_NAME MATCHES "AIX") - GET_FILENAME_COMPONENT(CMAKE_PYTHON_LIB_PREFIX "${PYTHON_LIBRARY}" PATH) - FIND_FILE(CMAKE_PYTHON_LIBRARY_EXPORT python.exp "${CMAKE_PYTHON_LIB_PREFIX}") - IF(CMAKE_PYTHON_LIBRARY_EXPORT) - SET(VTKPYTHON_LINK_FLAGS "-Wl,-bE:${CMAKE_PYTHON_LIBRARY_EXPORT}") - ENDIF(CMAKE_PYTHON_LIBRARY_EXPORT) -ENDIF(CMAKE_SYSTEM_NAME MATCHES "AIX") +if(CMAKE_SYSTEM_NAME MATCHES "AIX") + get_filename_component(CMAKE_PYTHON_LIB_PREFIX "${PYTHON_LIBRARY}" PATH) + find_file(CMAKE_PYTHON_LIBRARY_EXPORT python.exp "${CMAKE_PYTHON_LIB_PREFIX}") + if(CMAKE_PYTHON_LIBRARY_EXPORT) + set(VTKPYTHON_LINK_FLAGS "-Wl,-bE:${CMAKE_PYTHON_LIBRARY_EXPORT}") + endif() +endif() -IF (APPLE) - IF(VTK_USE_CARBON AND VTK_APPLE_RESOURCE) - ADD_CUSTOM_COMMAND( +if(APPLE) + if(VTK_USE_CARBON AND VTK_APPLE_RESOURCE) + add_custom_command( TARGET vtkpython POST_BUILD COMMAND ${VTK_APPLE_RESOURCE} Carbon.r -o ${VTK_EXECUTABLE_DIR}/vtkpython ) - ENDIF(VTK_USE_CARBON AND VTK_APPLE_RESOURCE) + endif() - IF(VTK_USE_MATLAB_MEX) - SET(VTKPYTHON_LINK_FLAGS "-u _PyMac_Error") - ELSE(VTK_USE_MATLAB_MEX) - SET(VTKPYTHON_LINK_FLAGS "-flat_namespace -undefined suppress -u _PyMac_Error") - ENDIF(VTK_USE_MATLAB_MEX) -ENDIF (APPLE) + if(VTK_USE_MATLAB_MEX) + set(VTKPYTHON_LINK_FLAGS "-u _PyMac_Error") + else() + set(VTKPYTHON_LINK_FLAGS "-flat_namespace -undefined suppress -u _PyMac_Error") + endif() +endif() # Link against all the kit wrappers. -SET(VTKPYTHON_LINK_LIBS +set(VTKPYTHON_LINK_LIBS ${VTK_PYTHON_LIBRARIES} vtksys - vtkCommon - vtkFiltering - vtkIO - vtkGraphics - vtkImaging) - -SET (vtkpython_pyc_depends - vtkCommonPython - vtkFilteringPython - vtkIOPython - vtkGraphicsPython - vtkImagingPython) - -IF(BORLAND) - SET(KITS Common Filtering Graphics IO Imaging) - IF (VTK_USE_PARALLEL) - SET(KITS ${KITS} Parallel) - SET(KITS ${KITS} AMR) - ENDIF(VTK_USE_PARALLEL) - IF(VTK_USE_CHARTS) - SET(KITS ${KITS} Charts) - ENDIF(VTK_USE_CHARTS) - IF(VTK_USE_CHEMISTRY) - SET(KITS ${KITS} Chemistry) - ENDIF(VTK_USE_CHEMISTRY) - IF (VTK_USE_GEOVIS) - SET(KITS ${KITS} Geovis) - ENDIF(VTK_USE_GEOVIS) - IF (VTK_USE_INFOVIS) - SET(KITS ${KITS} Infovis) - ENDIF(VTK_USE_INFOVIS) - IF (VTK_USE_VIEWS) - SET(KITS ${KITS} Views) - ENDIF(VTK_USE_VIEWS) - IF (VTK_USE_RENDERING) - SET(KITS ${KITS} Widgets) - SET(KITS ${KITS} Hybrid) - SET(KITS ${KITS} VolumeRendering) - SET(KITS ${KITS} Rendering) - ENDIF(VTK_USE_RENDERING) - FOREACH(KIT ${KITS}) - WRITE_FILE(${LIBRARY_OUTPUT_PATH}/vtk${KIT}Python.def - "EXPORTS\ninitvtk${KIT}Python=_initvtk${KIT}Python\n") - ENDFOREACH(KIT) -ENDIF(BORLAND) - -IF(PYTHON_UTIL_LIBRARY) - SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} ${PYTHON_UTIL_LIBRARY}) -ENDIF(PYTHON_UTIL_LIBRARY) - -IF (VTK_USE_RENDERING) - SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} - vtkRendering - vtkVolumeRendering - vtkHybrid - vtkWidgets ) - SET (vtkpython_pyc_depends - ${vtkpython_pyc_depends} - vtkRenderingPython - vtkVolumeRenderingPython - vtkHybridPython - vtkWidgetsPython - ) -ENDIF (VTK_USE_RENDERING) - -IF (VTK_USE_PARALLEL) - SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} vtkParallel vtkAMR) - SET(vtkpython_pyc_depends - ${vtkpython_pyc_depends} - vtkParallelPython - vtkAMRPython - ) -ENDIF (VTK_USE_PARALLEL) - -IF(VTK_USE_CHARTS) - SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} vtkCharts) - SET(vtkpython_pyc_depends - ${vtkpython_pyc_depends} - vtkChartsPython - ) -ENDIF(VTK_USE_CHARTS) - -IF(VTK_USE_CHEMISTRY) - SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} vtkChemistry) - SET(vtkpython_pyc_depends - ${vtkpython_pyc_depends} - vtkChemistryPython - ) -ENDIF(VTK_USE_CHEMISTRY) - -IF (VTK_USE_GEOVIS) - SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} vtkGeovis) - SET(vtkpython_pyc_depends - ${vtkpython_pyc_depends} - vtkGeovisPython - ) -ENDIF (VTK_USE_GEOVIS) + vtkCommonCore + ) -IF (VTK_USE_INFOVIS) - SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} vtkInfovis) - SET(vtkpython_pyc_depends - ${vtkpython_pyc_depends} - vtkInfovisPython - ) -ENDIF (VTK_USE_INFOVIS) +set(vtkpython_pyc_depends + vtkCommonPython + vtkFilteringPython + vtkIOPython + vtkGraphicsPython + vtkImagingPython + ) -IF (VTK_USE_VIEWS) - SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} vtkViews) - SET(vtkpython_pyc_depends - ${vtkpython_pyc_depends} - vtkViewsPython - ) -ENDIF (VTK_USE_VIEWS) +if(PYTHON_UTIL_LIBRARY) + set(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} ${PYTHON_UTIL_LIBRARY}) +endif() # The PYTHON_ADD_MODULE macro stores the list of static modules in a global property -GET_PROPERTY(PY_STATIC_MODULES_LIST GLOBAL PROPERTY PY_STATIC_MODULES_LIST) -IF(PY_STATIC_MODULES_LIST) - SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} ${PY_STATIC_MODULES_LIST}) -ENDIF(PY_STATIC_MODULES_LIST) +get_property(PY_STATIC_MODULES_LIST GLOBAL PROPERTY PY_STATIC_MODULES_LIST) +if(PY_STATIC_MODULES_LIST) + set(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} ${PY_STATIC_MODULES_LIST}) +endif(PY_STATIC_MODULES_LIST) # Link to rt to prevent undefined symbol 'fdatasync' IF(CMAKE_SYSTEM MATCHES "SunOS.*" AND NOT CMAKE_COMPILER_IS_GNUCXX) @@ -273,18 +89,14 @@ IF(VTK_WRAP_TCL) TARGET_LINK_LIBRARIES(vtkpython ${VTK_TK_LIBRARIES}) ENDIF(VTK_WRAP_TCL) -IF(HAVE_PTHREAD_H AND VTK_USE_PTHREADS) - TARGET_LINK_LIBRARIES(vtkpython ${CMAKE_THREAD_LIBS}) +IF(HAVE_PTHREAD_H AND CMAKE_USE_PTHREADS) + TARGET_LINK_LIBRARIES(vtkpython ${CMAKE_THREAD_LIBS_INIT}) ENDIF() IF(VTK_USE_FFMPEG_ENCODER) LIST(APPEND VTKPYTHON_LINK_LIBS ${FFMPEG_BASIC_LIBRARIES}) ENDIF(VTK_USE_FFMPEG_ENCODER) -IF(VTK_USE_SYSTEM_PNG) - LIST(APPEND VTKPYTHON_LINK_LIBS ${PNG_LIBRARY}) -ENDIF(VTK_USE_SYSTEM_PNG) - TARGET_LINK_LIBRARIES(vtkpython ${VTKPYTHON_LINK_LIBS}) TARGET_LINK_LIBRARIES(vtkpython LINK_INTERFACE_LIBRARIES ${VTK_PYTHON_LIBRARIES}) @@ -300,7 +112,7 @@ ENDIF(VTK_USE_MATLAB_MEX) SET(PVTKPYTHON_EXECUTABLE) # Create the pvtkpython Python wrapper executable with MPI support. IF (VTK_USE_PARALLEL AND VTK_USE_MPI) - INCLUDE_DIRECTORIES(${MPI_INCLUDE_PATH}) + INCLUDE_DIRECTORIES("${MPI_INCLUDE_PATH}") IF (MPI_LIBRARY) SET(MPI_LIBRARIES ${MPI_LIBRARY}) ENDIF (MPI_LIBRARY) @@ -333,28 +145,6 @@ IF (VTK_USE_PARALLEL AND VTK_USE_MPI) ENDIF(VTK_USE_CARBON AND VTK_APPLE_RESOURCE) ENDIF (VTK_USE_PARALLEL AND VTK_USE_MPI) -IF(NOT VTK_INSTALL_NO_RUNTIME AND NOT VTK_INSTALL_NO_VTKPYTHON) - IF(VTK_BUILD_FORWARDING_EXECUTABLES) - INSTALL(TARGETS vtkpython ${PVTKPYTHON_EXECUTABLE} - RUNTIME DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeExecutables # .exe, .dll - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries # .so, mod.dll - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development # .a, .lib - ) - - INSTALL(TARGETS vtkpython${VTK_EXE_SUFFIX} ${PVTKPYTHON_EXECUTABLE} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeExecutables # .exe, .dll - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries # .so, mod.dll - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development # .a, .lib - ) - ELSE(VTK_BUILD_FORWARDING_EXECUTABLES) - INSTALL(TARGETS vtkpython ${PVTKPYTHON_EXECUTABLE} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeExecutables # .exe, .dll - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries # .so, mod.dll - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development # .a, .lib - ) - ENDIF(VTK_BUILD_FORWARDING_EXECUTABLES) -ENDIF(NOT VTK_INSTALL_NO_RUNTIME AND NOT VTK_INSTALL_NO_VTKPYTHON) - # Handle out-of-source builds correctly. # # 1. Create a list of Python files to be installed/copied. @@ -377,27 +167,13 @@ IF(PYTHON_EXECUTABLE) # Wrapping/Python/vtk/*.py SET(VTK_PYTHON_FILES - vtk/__helper - vtk/__init__ - vtk/common - vtk/charts - vtk/chemistry - vtk/filtering - vtk/genericfiltering - vtk/geovis - vtk/graphics - vtk/hybrid - vtk/imaging - vtk/io - vtk/infovis - vtk/parallel - vtk/rendering - vtk/required - vtk/views - vtk/volumerendering - vtk/widgets - vtk/qvtk ) + SET(VTK_PYTHON_IMPORT_ALL "") + FOREACH(module ${VTK_PYTHON_MODULES}) + SET(VTK_PYTHON_IMPORT_ALL "${VTK_PYTHON_IMPORT_ALL}from ${module} import *\n") + CONFIGURE_FILE(vtk/module.py.in vtk/${module}.py @ONLY IMMEDIATE) + ENDFOREACH() + CONFIGURE_FILE(vtk/__init__.py.in vtk/__init__.py @ONLY IMMEDIATE) # vtk.util package SET(VTK_PYTHON_FILES @@ -486,22 +262,6 @@ IF(PYTHON_EXECUTABLE) ENDFOREACH(file) ENDIF (NOT "${VTK_BINARY_DIR}" MATCHES "^${VTK_SOURCE_DIR}$") - # handle the different configuration types (each will have identical files) - SET(VTK_PYTHON_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES}) - IF(VTK_PYTHON_CONFIGURATION_TYPES) - FOREACH(config ${VTK_PYTHON_CONFIGURATION_TYPES}) - FOREACH(file ${VTK_PYTHON_FILES}) - SET(src "${VTK_SOURCE_DIR}/Wrapping/Python/${file}.py") - SET(tgt "${VTK_BINARY_DIR}/Wrapping/Python/${config}/${file}.py") - ADD_CUSTOM_COMMAND(DEPENDS ${src} - COMMAND ${CMAKE_COMMAND} - ARGS -E copy ${src} ${tgt} - OUTPUT ${tgt} - COMMENT "source copy") - ENDFOREACH(file) - ENDFOREACH(config) - ENDIF(VTK_PYTHON_CONFIGURATION_TYPES) - # Byte compile the Python files. CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/compile_all_vtk.py.in ${CMAKE_CURRENT_BINARY_DIR}/compile_all_vtk.py @@ -536,9 +296,9 @@ IF(PYTHON_EXECUTABLE) IF(VTK_INSTALL_PYTHON_USING_CMAKE) # Install python module directory (*.py and *.pyd) - INSTALL(DIRECTORY "${VTK_BINARY_DIR}/Wrapping/Python/vtk" - DESTINATION "${VTK_INSTALL_BIN_DIR_CM24}/Python" COMPONENT RuntimeLibraries - USE_SOURCE_PERMISSIONS) + #INSTALL(DIRECTORY "${VTK_BINARY_DIR}/Wrapping/Python/vtk" + # DESTINATION "${VTK_INSTALL_BIN_DIR_CM24}/Python" COMPONENT RuntimeLibraries + # USE_SOURCE_PERMISSIONS) ENDIF(VTK_INSTALL_PYTHON_USING_CMAKE) # Add a rule to use python distutils to install the python wrappers. @@ -624,56 +384,6 @@ ELSE(CMAKE_CONFIGURATION_TYPES) SET(VTK_PYTHON_HAS_CONFIG_TYPES 0) SET(VTK_PYTHON_BUILD_TYPE "[]") ENDIF(CMAKE_CONFIGURATION_TYPES) -IF(VTK_USE_RENDERING) - SET(VTK_PYTHON_USE_RENDERING 1) -ELSE(VTK_USE_RENDERING) - SET(VTK_PYTHON_USE_RENDERING 0) -ENDIF(VTK_USE_RENDERING) -IF(VTK_USE_PARALLEL) - SET(VTK_PYTHON_USE_PARALLEL 1) -ELSE(VTK_USE_PARALLEL) - SET(VTK_PYTHON_USE_PARALLEL 0) -ENDIF(VTK_USE_PARALLEL) -IF(VTK_USE_CHARTS) - SET(VTK_PYTHON_USE_CHARTS 1) -ELSE(VTK_USE_CHARTS) - SET(VTK_PYTHON_USE_CHARTS 0) -ENDIF(VTK_USE_CHARTS) -IF(VTK_USE_CHEMISTRY) - SET(VTK_PYTHON_USE_CHEMISTRY 1) -ELSE() - SET(VTK_PYTHON_USE_CHEMISTRY 0) -ENDIF() -IF(VTK_USE_GEOVIS) - SET(VTK_PYTHON_USE_GEOVIS 1) -ELSE(VTK_USE_GEOVIS) - SET(VTK_PYTHON_USE_GEOVIS 0) -ENDIF(VTK_USE_GEOVIS) -IF(VTK_USE_INFOVIS) - SET(VTK_PYTHON_USE_INFOVIS 1) -ELSE(VTK_USE_INFOVIS) - SET(VTK_PYTHON_USE_INFOVIS 0) -ENDIF(VTK_USE_INFOVIS) -IF(VTK_USE_VIEWS) - SET(VTK_PYTHON_USE_VIEWS 1) -ELSE(VTK_USE_VIEWS) - SET(VTK_PYTHON_USE_VIEWS 0) -ENDIF(VTK_USE_VIEWS) -IF(VTK_USE_MPI) - SET(VTK_PYTHON_USE_MPI 1) -ELSE(VTK_USE_MPI) - SET(VTK_PYTHON_USE_MPI 0) -ENDIF(VTK_USE_MPI) -IF(VTK_USE_QT AND VTK_WRAP_PYTHON_SIP) - SET(VTK_PYTHON_USE_QT 1) -ELSE(VTK_USE_QT AND VTK_WRAP_PYTHON_SIP) - SET(VTK_PYTHON_USE_QT 0) -ENDIF(VTK_USE_QT AND VTK_WRAP_PYTHON_SIP) -IF(VTK_WRAP_PYTHON_SIP) - SET(VTK_PYTHON_USE_SIP 1) -ELSE(VTK_WRAP_PYTHON_SIP) - SET(VTK_PYTHON_USE_SIP 0) -ENDIF(VTK_WRAP_PYTHON_SIP) CONFIGURE_FILE(${VTK_SOURCE_DIR}/Wrapping/Python/setup.py.in ${VTK_BINARY_DIR}/Wrapping/Python/setup.py @ONLY IMMEDIATE) diff --git a/Wrapping/Python/setup.py.in b/Wrapping/Python/setup.py.in index 59e164cb9b4..e94bdfa257e 100755 --- a/Wrapping/Python/setup.py.in +++ b/Wrapping/Python/setup.py.in @@ -31,19 +31,10 @@ else: # VTK build configuration settings. vtk_version = "@VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@.@VTK_BUILD_VERSION@" -vtk_lib_dir = "@LIBRARY_OUTPUT_PATH@" -vtk_bin_dir = "@EXECUTABLE_OUTPUT_PATH@" -vtk_use_rendering = @VTK_PYTHON_USE_RENDERING@ -vtk_use_parallel = @VTK_PYTHON_USE_PARALLEL@ -vtk_use_charts = @VTK_PYTHON_USE_CHARTS@ -vtk_use_chemistry = @VTK_PYTHON_USE_CHEMISTRY@ -vtk_use_geovis = @VTK_PYTHON_USE_GEOVIS@ -vtk_use_infovis = @VTK_PYTHON_USE_INFOVIS@ -vtk_use_views = @VTK_PYTHON_USE_VIEWS@ -vtk_use_mpi = @VTK_PYTHON_USE_MPI@ +vtk_lib_dir = "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" +vtk_bin_dir = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@" vtk_has_configuration_types = @VTK_PYTHON_HAS_CONFIG_TYPES@ -vtk_use_sip = @VTK_PYTHON_USE_SIP@ -vtk_use_qt = @VTK_PYTHON_USE_QT@ +vtk_modules = """@VTK_PYTHON_MODULES@""".split(';') # The build type ('Release', 'Debug' etc.). If vtk_has_configuration_types # is true this must be set. It may be set on the command line by something @@ -51,33 +42,8 @@ vtk_use_qt = @VTK_PYTHON_USE_QT@ # python setup.py install --prefix=D:\\Python23 BUILD_TYPE=Release vtk_build_type = @VTK_PYTHON_BUILD_TYPE@ -# Construct the list of kit names to be installed. -vtk_kit_names = ['Common', 'Filtering', 'IO', 'Graphics', - 'GenericFiltering', 'Imaging'] -vtk_kit_names2 = [] -vtk_kit_names3 = [] -if vtk_use_rendering: - vtk_kit_names.extend(['Rendering', 'VolumeRendering', 'Hybrid', 'Widgets']) -if vtk_use_parallel: - vtk_kit_names.extend(['Parallel']) -if vtk_use_charts: - vtk_kit_names.extend(['Charts']) -if vtk_use_chemistry: - vtk_kit_names.extend(['Chemistry']) -if vtk_use_geovis: - vtk_kit_names.extend(['Geovis']) -if vtk_use_infovis: - vtk_kit_names.extend(['Infovis']) -if vtk_use_views: - vtk_kit_names.extend(['Views']) -if vtk_use_qt: - vtk_kit_names2.extend(['Qt']) - vtk_kit_names3.extend(['QVTK']) - # Construct the list of executable names to be installed. vtk_exe_names = ['vtkpython'] -if vtk_use_parallel and vtk_use_mpi: - vtk_exe_names.extend(['pvtkpython']) def get_libs(): """Returns a list of libraries to be installed. """ @@ -86,11 +52,9 @@ def get_libs(): # Select platform-specific components of the module file names. if os.name == 'posix': dir = vtk_lib_dir - prefix = 'vtk' suffix = get_config_var('SO') else: dir = vtk_bin_dir.replace('/', '\\') - prefix = 'vtk' suffix = '.pyd' # If this build has configuration types append the selected configuration. @@ -98,16 +62,8 @@ def get_libs(): dir = os.path.join(dir, vtk_build_type) # Enumerate the list of module files. - for kit in vtk_kit_names: - libs.append(os.path.abspath(os.path.join(dir, prefix+kit+'Python'+suffix))) - if vtk_use_sip: - libs.append(os.path.abspath(os.path.join(dir, 'vtk'+kit+'PythonSIP'+suffix))) - - for kit in vtk_kit_names2: - libs.append(os.path.abspath(os.path.join(dir, prefix+kit+'Python'+suffix))) - - for kit in vtk_kit_names3: - libs.append(os.path.abspath(os.path.join(dir, kit+'Python'+suffix))) + for mod in vtk_modules: + libs.append(os.path.abspath(os.path.join(dir, mod+'Python'+suffix))) return libs diff --git a/Wrapping/Python/vtk/__init__.py.in b/Wrapping/Python/vtk/__init__.py.in index 026304c2d85..b850b293025 100644 --- a/Wrapping/Python/vtk/__init__.py.in +++ b/Wrapping/Python/vtk/__init__.py.in @@ -24,8 +24,6 @@ except ImportError: except SystemError: dl = None -import __helper - # set the dlopen flags so that VTK does not run into problems with # shared symbols. try: @@ -37,91 +35,8 @@ except AttributeError: if dl and (os.name == 'posix'): sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL) -# Load all required kits. -from vtkCommonPython import * -from vtkFilteringPython import * -from vtkIOPython import * -from vtkImagingPython import * -from vtkGraphicsPython import * - -# the vtk.kits variable tells us which kits we actually have -kits = ['common', 'filtering', 'io', 'imaging', 'graphics'] - -# Try to load optional kits. The helper function checks if the -# ImportError is actually a link error. - -try: - from vtkGenericFilteringPython import * - kits.append('genericfiltering') -except ImportError, exc: - __helper.refine_import_err('genericfiltering', 'vtkGenericFilteringPython', - exc) -try: - from vtkRenderingPython import * - kits.append('rendering') -except ImportError, exc: - __helper.refine_import_err('rendering', 'vtkRenderingPython', exc) - -try: - from vtkVolumeRenderingPython import * - kits.append('volumerendering') -except ImportError, exc: - __helper.refine_import_err('volumerendering', - 'vtkVolumeRenderingPython', exc) - -try: - from vtkHybridPython import * - kits.append('hybrid') -except ImportError, exc: - __helper.refine_import_err('hybrid', 'vtkHybridPython', exc) - -try: - from vtkWidgetsPython import * - kits.append('widgets') -except ImportError, exc: - __helper.refine_import_err('widgets', 'vtkWidgetsPython', exc) - -try: - from vtkChartsPython import * - kits.append('charts') -except ImportError, exc: - __helper.refine_import_err('charts', 'vtkChartsPython', exc) - -try: - from vtkChemistryPython import * - kits.append('chemistry') -except ImportError, exc: - __helper.refine_import_err('chemistry', 'vtkChemistryPython', exc) - -try: - from vtkGeovisPython import * - kits.append('geovis') -except ImportError, exc: - __helper.refine_import_err('geovis', 'vtkGeovisPython', exc) - -try: - from vtkInfovisPython import * - kits.append('infovis') -except ImportError, exc: - __helper.refine_import_err('infovis', 'vtkInfovisPython', exc) - -try: - from vtkViewsPython import * - kits.append('views') -except ImportError, exc: - __helper.refine_import_err('views', 'vtkViewsPython', exc) - -try: - from vtkParallelPython import * - kits.append('parallel') -except ImportError, exc: - __helper.refine_import_err('parallel', 'vtkParallelPython', exc) - -try: - from qvtk import * - kits.append('qvtk') -except ImportError, exc: - __helper.refine_import_err('qvtk', 'vtkQtPython', exc) +# -------------------------------------- +@VTK_PYTHON_IMPORT_ALL@# -------------------------------------- # useful macro for getting type names __vtkTypeNameDict = {VTK_VOID:"void", @@ -154,5 +69,5 @@ if dl and (os.name == 'posix') and orig_dlopen_flags: sys.setdlopenflags(orig_dlopen_flags) # removing things the user shouldn't have to see. -del __helper, orig_dlopen_flags +del orig_dlopen_flags del sys, dl, os diff --git a/Wrapping/Python/vtk/module.py.in b/Wrapping/Python/vtk/module.py.in new file mode 100644 index 00000000000..f9e8c0d4d3f --- /dev/null +++ b/Wrapping/Python/vtk/module.py.in @@ -0,0 +1 @@ +from @module@Python import * diff --git a/Wrapping/Python/vtkPythonAppInit.cxx b/Wrapping/Python/vtkPythonAppInit.cxx index 71cdeaf5dfc..eb4d80bc166 100644 --- a/Wrapping/Python/vtkPythonAppInit.cxx +++ b/Wrapping/Python/vtkPythonAppInit.cxx @@ -24,55 +24,8 @@ #include "vtkVersion.h" #include "Wrapping/Python/vtkPythonAppInitConfigure.h" -#if defined(CMAKE_INTDIR) -# define VTK_PYTHON_LIBRARY_DIR VTK_PYTHON_LIBRARY_DIR_BUILD "/" CMAKE_INTDIR -#else -# define VTK_PYTHON_LIBRARY_DIR VTK_PYTHON_LIBRARY_DIR_BUILD -#endif - #include <sys/stat.h> -/* - * Make sure all the kits register their classes with vtkInstantiator. - */ -#include "vtkCommonInstantiator.h" -#include "vtkFilteringInstantiator.h" -#include "vtkIOInstantiator.h" -#include "vtkImagingInstantiator.h" -#include "vtkGraphicsInstantiator.h" - -#include "vtkpythonmodules.h" - -#ifdef VTK_USE_RENDERING -#include "vtkRenderingInstantiator.h" -#include "vtkVolumeRenderingInstantiator.h" -#include "vtkHybridInstantiator.h" -#endif - -#ifdef VTK_USE_PARALLEL -#include "vtkParallelInstantiator.h" -#endif - -#ifdef VTK_USE_CHARTS -#include "vtkChartsInstantiator.h" -#endif - -#ifdef VTK_USE_CHEMISTRY -#include "vtkChemistryInstantiator.h" -#endif - -#ifdef VTK_USE_GEOVIS -#include "vtkGeovisInstantiator.h" -#endif - -#ifdef VTK_USE_INFOVIS -#include "vtkInfovisInstantiator.h" -#endif - -#ifdef VTK_USE_VIEWS -#include "vtkViewsInstantiator.h" -#endif - #include <string> #include <vtksys/SystemTools.hxx> @@ -170,8 +123,6 @@ int main(int argc, char **argv) strcpy(argv0, av0.c_str()); Py_SetProgramName(argv0); - CMakeLoadAllPythonModules(); - // Initialize interpreter. Py_Initialize(); diff --git a/Wrapping/Python/vtkPythonAppInitConfigure.h.in b/Wrapping/Python/vtkPythonAppInitConfigure.h.in index 96aaa255f97..198db759c54 100644 --- a/Wrapping/Python/vtkPythonAppInitConfigure.h.in +++ b/Wrapping/Python/vtkPythonAppInitConfigure.h.in @@ -1,6 +1,6 @@ #ifndef __vtkPythonAppInitConfigure_h #define __vtkPythonAppInitConfigure_h -#define VTK_PYTHON_LIBRARY_DIR_BUILD "@LIBRARY_OUTPUT_PATH@" +#define VTK_PYTHON_LIBRARY_DIR "@LIBRARY_OUTPUT_PATH@" #endif diff --git a/Wrapping/PythonCore/CMakeLists.txt b/Wrapping/PythonCore/CMakeLists.txt new file mode 100644 index 00000000000..359f2945397 --- /dev/null +++ b/Wrapping/PythonCore/CMakeLists.txt @@ -0,0 +1,40 @@ +set(VTK_WRAP_PYTHON_FIND_LIBS ON) +include(vtkWrapPython) + +# Generate an extra export header for the python vtk command stuff +include(GenerateExportHeader) +generate_export_header(vtkCommonCorePythonD + EXPORT_MACRO_NAME VTK_COMMON_PYTHON_EXPORT + EXPORT_FILE_NAME vtkCommonCorePythonModule.h) + +set(PythonCore_SRCS + vtkPythonArgs.cxx + vtkPythonOverload.cxx + vtkPythonUtil.cxx + PyVTKClass.cxx + PyVTKMutableObject.cxx + PyVTKObject.cxx + PyVTKSpecialObject.cxx + PyVTKTemplate.cxx + ) + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${VTK_SOURCE_DIR}/Common/Core + ${VTK_BINARY_DIR}/Common/Core + ${VTK_SOURCE_DIR}/Utilities + ${VTK_BINARY_DIR}/Wrapping + ) + +# SIP directory will be searched before other python dirs +if(VTK_WRAP_PYTHON_SIP) + include_directories("${SIP_INCLUDE_DIR}") +endif() +include_directories("${PYTHON_INCLUDE_PATH}") + +vtk_module_library(vtkWrappingPythonCore ${PythonCore_SRCS}) + +target_link_libraries(vtkWrappingPythonCore + ${VTK_PYTHON_LIBRARIES}) +target_link_libraries(vtkWrappingPythonCore + LINK_INTERFACE_LIBRARIES ${VTK_PYTHON_LIBRARIES}) diff --git a/Wrapping/PythonCore/module.cmake b/Wrapping/PythonCore/module.cmake new file mode 100644 index 00000000000..f8b2b127d62 --- /dev/null +++ b/Wrapping/PythonCore/module.cmake @@ -0,0 +1,7 @@ +vtk_module(vtkWrappingPythonCore + DEPENDS + vtkCommonCore + vtksys + EXCLUDE_FROM_ALL + EXCLUDE_FROM_WRAPPING + ) diff --git a/Wrapping/PythonCore/vtkPython.h b/Wrapping/PythonCore/vtkPython.h index d716d94a311..5b7ac31c662 100644 --- a/Wrapping/PythonCore/vtkPython.h +++ b/Wrapping/PythonCore/vtkPython.h @@ -15,25 +15,11 @@ #ifndef __vtkPython_h #define __vtkPython_h +#include "vtkWrappingPythonCoreModule.h" // For export macro +#include "vtkCommonCorePythonModule.h" #include "vtkPythonConfigure.h" #include "vtkABI.h" -#if defined(WIN32) -# if defined(vtkPythonCore_EXPORTS) -# define VTK_PYTHON_EXPORT VTK_ABI_EXPORT -# else -# define VTK_PYTHON_EXPORT VTK_ABI_IMPORT -# endif -# if defined(vtkCommonPythonD_EXPORTS) -# define VTK_COMMON_PYTHON_EXPORT VTK_ABI_EXPORT -# else -# define VTK_COMMON_PYTHON_EXPORT VTK_ABI_IMPORT -# endif -#else -# define VTK_PYTHON_EXPORT -# define VTK_COMMON_PYTHON_EXPORT -#endif - /* Use the real python debugging library if it is provided. Otherwise use the "documented" trick involving checking for _DEBUG diff --git a/Wrapping/Tcl/CMakeLists.txt b/Wrapping/Tcl/CMakeLists.txt index 74bac28bacf..ca0ee0c2901 100644 --- a/Wrapping/Tcl/CMakeLists.txt +++ b/Wrapping/Tcl/CMakeLists.txt @@ -26,6 +26,19 @@ CONFIGURE_FILE( @ONLY IMMEDIATE ) +get_property(VTK_TCL_WRAPPED GLOBAL PROPERTY VTK_TCL_WRAPPED) +# Format the list in a way Tcl expects it +unset(VTK_TCL_WRAPPED_MODULES) +foreach(module ${VTK_TCL_WRAPPED}) + string(REGEX REPLACE "^vtk" "" tcl_module ${module}) + if("${tcl_module}" STREQUAL "RenderingContext2D") + set(tcl_module "RenderingContextIID") + elseif("${tcl_module}" STREQUAL "ViewsContext2D") + set(tcl_module "ViewsContextIID") + endif() + set(VTK_TCL_WRAPPED_MODULES "${VTK_TCL_WRAPPED_MODULES} ${tcl_module}") +endforeach() + IF (NOT TCL_LIBRARY) MESSAGE("VTK_WRAP_TCL is ON, but the Tcl library was not found. Please set TCL_LIBRARY." "Error") ENDIF (NOT TCL_LIBRARY) @@ -50,15 +63,16 @@ IF (WIN32) ENDIF (NOT BORLAND) ENDIF (WIN32) +find_package(TCL) + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${TCL_INCLUDE_PATH} + ) + # Create the vtk Tcl wrapper executable. VTK_ADD_EXECUTABLE(vtk vtkTkAppInit.cxx ${VTK_EXE_RESOURCE_FILES}) -TARGET_LINK_LIBRARIES (vtk - vtkCommonTCL - vtkFilteringTCL - vtkGraphicsTCL - vtkImagingTCL - vtkIOTCL -) +target_link_libraries(vtk vtkCommonCoreTCL) IF(VTK_USE_CARBON) FIND_PROGRAM(VTK_APPLE_RESOURCE Rez /Developer/Tools) @@ -72,65 +86,36 @@ IF(VTK_USE_CARBON) ENDIF(VTK_APPLE_RESOURCE) ENDIF(VTK_USE_CARBON) -IF (VTK_USE_RENDERING) - TARGET_LINK_LIBRARIES(vtk vtkRenderingTCL) - TARGET_LINK_LIBRARIES(vtk vtkVolumeRenderingTCL) - TARGET_LINK_LIBRARIES(vtk vtkHybridTCL) - TARGET_LINK_LIBRARIES(vtk vtkWidgetsTCL) -ENDIF (VTK_USE_RENDERING) - -IF (VTK_USE_PARALLEL) - TARGET_LINK_LIBRARIES(vtk vtkParallelTCL) -ENDIF (VTK_USE_PARALLEL) - -IF (VTK_USE_GEOVIS) - TARGET_LINK_LIBRARIES(vtk vtkGeovisTCL) -ENDIF (VTK_USE_GEOVIS) - -IF (VTK_USE_INFOVIS) - TARGET_LINK_LIBRARIES(vtk vtkInfovisTCL) -ENDIF (VTK_USE_INFOVIS) - -IF (VTK_USE_VIEWS) - TARGET_LINK_LIBRARIES(vtk vtkViewsTCL) -ENDIF (VTK_USE_VIEWS) - # Link to extra TCL libraries -FOREACH(lib ${VTK_EXTRA_TCL_LIBRARIES}) - TARGET_LINK_LIBRARIES(vtk ${lib}) -ENDFOREACH(lib) - -IF (VTK_USE_TK) - TARGET_LINK_LIBRARIES(vtk ${VTK_TK_LIBRARIES}) -ENDIF (VTK_USE_TK) - -# Setup install location for vtk tcl scripts. -SET(VTK_TCL_INSTALL_DIR ${VTK_INSTALL_TCL_DIR}/tcl) -SET(VTK_TCL_INSTALL_DIR_CM24 ${VTK_INSTALL_TCL_DIR_CM24}/tcl) - -IF(NOT VTK_INSTALL_NO_RUNTIME) - IF(VTK_BUILD_FORWARDING_EXECUTABLES) - INSTALL(TARGETS vtk - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeExecutables # .exe, .dll - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries # .so, mod.dll - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development # .a, .lib - ) - INSTALL(TARGETS vtk${VTK_EXE_SUFFIX} - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeExecutables # .exe, .dll - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries # .so, mod.dll - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development # .a, .lib - ) - ELSE(VTK_BUILD_FORWARDING_EXECUTABLES) - INSTALL(TARGETS vtk - EXPORT ${VTK_INSTALL_EXPORT_NAME} - RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeExecutables # .exe, .dll - LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries # .so, mod.dll - ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development # .a, .lib - ) - ENDIF(VTK_BUILD_FORWARDING_EXECUTABLES) -ENDIF(NOT VTK_INSTALL_NO_RUNTIME) +foreach(lib ${_tcl_modules}) + target_link_libraries(vtk ${lib}) +endforeach(lib) + +if(VTK_USE_TK) + target_link_libraries(vtk ${VTK_TK_LIBRARIES}) +endif(VTK_USE_TK) + +if(VTK_INSTALL_RUNTIME AND VTK_BUILD_FORWARDING_EXECUTABLES) + install(TARGETS vtk + EXPORT ${VTK_INSTALL_EXPORT_NAME} + RUNTIME DESTINATION ${VTK_INSTALL_LIBRARY_DIR} COMPONENT RuntimeExecutables # .exe, .dll + LIBRARY DESTINATION ${VTK_INSTALL_LIBRARY_DIR} COMPONENT RuntimeLibraries # .so, mod.dll + ARCHIVE DESTINATION ${VTK_INSTALL_LIBRARY_DIR} COMPONENT Development # .a, .lib + ) + install(TARGETS vtk${VTK_EXE_SUFFIX} + EXPORT ${VTK_INSTALL_EXPORT_NAME} + RUNTIME DESTINATION ${VTK_INSTALL_RUNTIME_DIR} COMPONENT RuntimeExecutables # .exe, .dll + LIBRARY DESTINATION ${VTK_INSTALL_LIBRARY_DIR} COMPONENT RuntimeLibraries # .so, mod.dll + ARCHIVE DESTINATION ${VTK_INSTALL_LIBRARY_DIR} COMPONENT Development # .a, .lib + ) +elseif(VTK_INSTALL_RUNTIME) + install(TARGETS vtk + EXPORT ${VTK_INSTALL_EXPORT_NAME} + RUNTIME DESTINATION ${VTK_INSTALL_RUNTIME_DIR} COMPONENT RuntimeExecutables # .exe, .dll + LIBRARY DESTINATION ${VTK_INSTALL_LIBRARY_DIR} COMPONENT RuntimeLibraries # .so, mod.dll + ARCHIVE DESTINATION ${VTK_INSTALL_LIBRARY_DIR} COMPONENT Development # .a, .lib + ) +endif() # Create the pvtk Tcl wrapper executable with MPI support. IF (VTK_USE_PARALLEL) @@ -157,143 +142,102 @@ IF (VTK_USE_PARALLEL) ENDIF(VTK_USE_CARBON) TARGET_LINK_LIBRARIES (pvtk - vtkCommonTCL - vtkFilteringTCL - vtkGraphicsTCL - vtkImagingTCL - vtkIOTCL - vtkParallelTCL ${MPI_LIBRARIES} ) - IF (VTK_USE_RENDERING) - TARGET_LINK_LIBRARIES(pvtk vtkHybridTCL) - TARGET_LINK_LIBRARIES(pvtk vtkWidgetsTCL) - TARGET_LINK_LIBRARIES(pvtk vtkVolumeRenderingTCL) - ENDIF (VTK_USE_RENDERING) - - IF (VTK_USE_GEOVIS) - TARGET_LINK_LIBRARIES(pvtk vtkGeovisTCL) - ENDIF (VTK_USE_GEOVIS) - - IF (VTK_USE_INFOVIS) - TARGET_LINK_LIBRARIES(pvtk vtkInfovisTCL) - ENDIF (VTK_USE_INFOVIS) - - IF (VTK_USE_VIEWS) - TARGET_LINK_LIBRARIES(pvtk vtkViewsTCL) - ENDIF (VTK_USE_VIEWS) - - IF(NOT VTK_INSTALL_NO_RUNTIME) + IF(VTK_INSTALL_RUNTIME) INSTALL(TARGETS pvtk EXPORT ${VTK_INSTALL_EXPORT_NAME} RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeExecutables # .exe, .dll LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries # .so, mod.dll ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development # .a, .lib ) - ENDIF(NOT VTK_INSTALL_NO_RUNTIME) + ENDIF() ENDIF (VTK_USE_MPI) ENDIF (VTK_USE_PARALLEL) -# Process all packages -ADD_SUBDIRECTORY(vtk) -ADD_SUBDIRECTORY(vtkbase) -ADD_SUBDIRECTORY(vtkcommon) -ADD_SUBDIRECTORY(vtkfiltering) -ADD_SUBDIRECTORY(vtkgraphics) -ADD_SUBDIRECTORY(vtkimaging) -ADD_SUBDIRECTORY(vtkinteraction) -ADD_SUBDIRECTORY(vtkio) -ADD_SUBDIRECTORY(vtktesting) - -IF(NOT VTK_INSTALL_NO_DOCUMENTATION) - INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/README" - DESTINATION ${VTK_TCL_INSTALL_DIR_CM24} +if(NOT VTK_INSTALL_NO_DOCUMENTATION) + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/README" + DESTINATION ${VTK_INSTALL_TCL_DIR} COMPONENT RuntimeLibraries) -ENDIF(NOT VTK_INSTALL_NO_DOCUMENTATION) -IF(NOT VTK_INSTALL_NO_DEVELOPMENT) - INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/vtktcl.c" - DESTINATION ${VTK_TCL_INSTALL_DIR_CM24} +endif() +if(NOT VTK_INSTALL_NO_DEVELOPMENT) + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/vtktcl.c" + DESTINATION ${VTK_INSTALL_TCL_DIR} COMPONENT Development) -ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) - -SET(VTK_TCL_RENDERING_CONFIG "") -SET(VTK_TCL_VOLUMERENDERING_CONFIG "") -SET(VTK_TCL_HYBRID_CONFIG "") -SET(VTK_TCL_WIDGETS_CONFIG "") -SET(VTK_TCL_PARALLEL_CONFIG "") -SET(VTK_TCL_GEOVIS_CONFIG "") -SET(VTK_TCL_INFOVIS_CONFIG "") -SET(VTK_TCL_VIEWS_CONFIG "") - -IF (VTK_USE_PARALLEL) - SET(VTK_TCL_PARALLEL_CONFIG "Parallel") - ADD_SUBDIRECTORY(vtkparallel) -ENDIF (VTK_USE_PARALLEL) - -IF (VTK_USE_GEOVIS) - SET(VTK_TCL_GEOVIS_CONFIG "Geovis") - ADD_SUBDIRECTORY(vtkgeovis) -ENDIF (VTK_USE_GEOVIS) - -IF (VTK_USE_INFOVIS) - SET(VTK_TCL_INFOVIS_CONFIG "Infovis") - ADD_SUBDIRECTORY(vtkinfovis) -ENDIF (VTK_USE_INFOVIS) - -IF (VTK_USE_VIEWS) - SET(VTK_TCL_VIEWS_CONFIG "Views") - ADD_SUBDIRECTORY(vtkviews) -ENDIF (VTK_USE_VIEWS) - -IF (VTK_USE_RENDERING) - SET(VTK_TCL_WIDGETS_CONFIG "Widgets") - ADD_SUBDIRECTORY(vtkwidgets) - SET(VTK_TCL_HYBRID_CONFIG "Hybrid") - ADD_SUBDIRECTORY(vtkhybrid) - SET(VTK_TCL_VOLUMERENDERING_CONFIG "VolumeRendering") - ADD_SUBDIRECTORY(vtkvolumerendering) - SET(VTK_TCL_RENDERING_CONFIG "Rendering") - ADD_SUBDIRECTORY(vtkrendering) -ENDIF (VTK_USE_RENDERING) +endif() # Configure the Tcl package index files for the build tree. -SET(VTK_TCL_SCRIPT_DIR "${VTK_BINARY_DIR}/Wrapping/Tcl") +set(VTK_TCL_SCRIPT_DIR "${VTK_BINARY_DIR}/Wrapping/Tcl") -SET(VTK_TCL_LIBNAME_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}") -SET(VTK_TCL_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES}) +set(VTK_TCL_LIBNAME_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}") +set(VTK_TCL_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES}) -IF(VTK_TCL_CONFIGURATION_TYPES) - FOREACH(config ${VTK_TCL_CONFIGURATION_TYPES}) - SET(VTK_TCL_LIBRARY_DIR "${LIBRARY_OUTPUT_PATH}/${config}") - CONFIGURE_FILE(${VTK_SOURCE_DIR}/Wrapping/Tcl/pkgIndex.tcl.in +if(VTK_TCL_CONFIGURATION_TYPES) + foreach(config ${VTK_TCL_CONFIGURATION_TYPES}) + set(VTK_TCL_LIBRARY_DIR "${LIBRARY_OUTPUT_PATH}/${config}") + configure_file(${VTK_SOURCE_DIR}/Wrapping/Tcl/pkgIndex.tcl.in ${VTK_BINARY_DIR}/Wrapping/Tcl/${config}/pkgIndex.tcl @ONLY IMMEDIATE) - ENDFOREACH(config) -ELSE(VTK_TCL_CONFIGURATION_TYPES) - SET(VTK_TCL_LIBRARY_DIR "${LIBRARY_OUTPUT_PATH}") - CONFIGURE_FILE(${VTK_SOURCE_DIR}/Wrapping/Tcl/pkgIndex.tcl.in + endforeach() +else() + set(VTK_TCL_LIBRARY_DIR "${LIBRARY_OUTPUT_PATH}") + configure_file(${VTK_SOURCE_DIR}/Wrapping/Tcl/pkgIndex.tcl.in ${VTK_BINARY_DIR}/Wrapping/Tcl/pkgIndex.tcl @ONLY IMMEDIATE) -ENDIF(VTK_TCL_CONFIGURATION_TYPES) +endif() + +# A few hand coded bits of Tcl to glue things together. +configure_file(vtkbase/vtkbase.tcl.in + "${VTK_TCL_HOME}/vtkbase/vtkbase.tcl" @ONLY IMMEDIATE) +configure_file(vtk/vtk.tcl.in + "${VTK_TCL_HOME}/vtk/vtk.tcl" @ONLY IMMEDIATE) +if(NOT VTK_INSTALL_NO_RUNTIME) + install(FILES ${VTK_TCL_HOME}/vtk/vtk.tcl + DESTINATION ${VTK_INSTALL_TCL_DIR}/vtk + COMPONENT RuntimeLibraries) + install(FILES ${VTK_TCL_HOME}/vtkbase/vtkbase.tcl + DESTINATION ${VTK_INSTALL_TCL_DIR}/vtkbase + COMPONENT RuntimeLibraries) +endif() + +# We must write out a file for each wrapped module to load the SO. +foreach(module ${VTK_TCL_WRAPPED}) + string(TOLOWER ${module} module_lc) + if(module_lc STREQUAL "vtkrenderingcontext2d") + set(module_lc "vtkrenderingcontextiid") + set(module "vtkRenderingContextIID") + elseif(module_lc STREQUAL "vtkviewscontext2d") + set(module_lc "vtkviewscontextiid") + set(module "vtkViewsContextIID") + endif() + configure_file(vtkmodule.tcl.in + "${VTK_TCL_HOME}/${module_lc}/${module_lc}.tcl" @ONLY IMMEDIATE) + if(NOT VTK_INSTALL_NO_RUNTIME) + install(FILES + "${VTK_TCL_HOME}/${module_lc}/${module_lc}.tcl" + DESTINATION ${VTK_INSTALL_TCL_DIR}/${module_lc} + COMPONENT RuntimeLibraries) + endif() +endforeach() # Configure the Tcl package index file for the install tree. -SET(VTK_TCL_SCRIPT_DIR "[file dirname [info script]]/tcl") +SET(VTK_TCL_SCRIPT_DIR "[file dirname [info script]]") IF(UNIX) - SET(VTK_TCL_LIBRARY_DIR "[file dirname [info script]]") + SET(VTK_TCL_LIBRARY_DIR "[file dirname [file dirname [file dirname [info script]]]]") ELSE(UNIX) SET(VTK_TCL_LIBRARY_DIR - "[file join [file dirname [file dirname [file dirname [info script]]]] bin]") + "[file join [file dirname [file dirname [file dirname [file dirname [info script]]]]] bin]") ENDIF(UNIX) -CONFIGURE_FILE(${VTK_SOURCE_DIR}/Wrapping/Tcl/pkgIndex.tcl.in +configure_file(${VTK_SOURCE_DIR}/Wrapping/Tcl/pkgIndex.tcl.in ${VTK_BINARY_DIR}/Wrapping/Tcl/Install/Hide/pkgIndex.tcl @ONLY IMMEDIATE) IF(NOT VTK_INSTALL_NO_RUNTIME) INSTALL(FILES ${VTK_BINARY_DIR}/Wrapping/Tcl/Install/Hide/pkgIndex.tcl - DESTINATION ${VTK_INSTALL_TCL_DIR_CM24} + DESTINATION ${VTK_INSTALL_TCL_DIR} COMPONENT RuntimeLibraries) -ENDIF(NOT VTK_INSTALL_NO_RUNTIME) +ENDIF() # Allow the user to customize their build with some local options # diff --git a/Wrapping/Tcl/pkgIndex.tcl.in b/Wrapping/Tcl/pkgIndex.tcl.in index 96da646abc5..e96af50a233 100644 --- a/Wrapping/Tcl/pkgIndex.tcl.in +++ b/Wrapping/Tcl/pkgIndex.tcl.in @@ -5,7 +5,7 @@ package ifneeded vtkinit {@VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@} { proc load_library_package {libName libPath {libPrefix {@VTK_TCL_LIBNAME_PREFIX@}}} { set libExt [info sharedlibextension] set currentDirectory [pwd] - set libFile [file join $libPath "$libPrefix$libName$libExt"] + set libFile [file join $libPath "$libPrefix$libName-@VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@$libExt"] if {[catch "cd {$libPath}; load {$libFile}" errorMessage]} { puts $errorMessage } @@ -21,22 +21,14 @@ package ifneeded vtkinit {@VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@} { } set version {@VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@} set kits {} - foreach kit { base Common Filtering IO Imaging Graphics - @VTK_TCL_RENDERING_CONFIG@ @VTK_TCL_VOLUMERENDERING_CONFIG@ - @VTK_TCL_HYBRID_CONFIG@ @VTK_TCL_WIDGETS_CONFIG@ - @VTK_TCL_PARALLEL_CONFIG@ @VTK_TCL_GEOVIS_CONFIG@ - @VTK_TCL_INFOVIS_CONFIG@ @VTK_TCL_VIEWS_CONFIG@} { + foreach kit { base @VTK_TCL_WRAPPED_MODULES@ } { lappend kits [string tolower "${kit}"] } } package provide vtkinit {@VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@} } -foreach kit { Common Filtering IO Imaging Graphics - @VTK_TCL_RENDERING_CONFIG@ @VTK_TCL_VOLUMERENDERING_CONFIG@ - @VTK_TCL_HYBRID_CONFIG@ @VTK_TCL_WIDGETS_CONFIG@ - @VTK_TCL_PARALLEL_CONFIG@ @VTK_TCL_GEOVIS_CONFIG@ - @VTK_TCL_INFOVIS_CONFIG@ @VTK_TCL_VIEWS_CONFIG@} { +foreach kit { @VTK_TCL_WRAPPED_MODULES@ } { package ifneeded "vtk${kit}TCL" {@VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@} " package require -exact vtkinit {@VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@} ::vtk::init::load_library_package {vtk${kit}TCL} {@VTK_TCL_LIBRARY_DIR@} diff --git a/Wrapping/Tcl/vtkTkAppInit.cxx b/Wrapping/Tcl/vtkTkAppInit.cxx index 857af94651b..8a6001416a6 100644 --- a/Wrapping/Tcl/vtkTkAppInit.cxx +++ b/Wrapping/Tcl/vtkTkAppInit.cxx @@ -33,7 +33,7 @@ PURPOSE. See the above copyright notice for more information. #include "vtkConfigure.h" #include "vtkSystemIncludes.h" #include "vtkToolkits.h" -#include "Wrapping/Tcl/vtkTkAppInitConfigure.h" +#include "vtkTkAppInitConfigure.h" #ifdef VTK_TCL_TK_COPY_SUPPORT_LIBRARY #include <sys/stat.h> @@ -45,38 +45,6 @@ PURPOSE. See the above copyright notice for more information. # include "vtkTcl.h" #endif -/* - * Make sure all the kits register their classes with vtkInstantiator. - */ -#include "vtkCommonInstantiator.h" -#include "vtkFilteringInstantiator.h" -#include "vtkIOInstantiator.h" -#include "vtkImagingInstantiator.h" -#include "vtkGraphicsInstantiator.h" - -#ifdef VTK_USE_RENDERING -#include "vtkRenderingInstantiator.h" -#include "vtkVolumeRenderingInstantiator.h" -#include "vtkHybridInstantiator.h" -#include "vtkWidgetsInstantiator.h" -#endif - -#ifdef VTK_USE_PARALLEL -#include "vtkParallelInstantiator.h" -#endif - -#ifdef VTK_USE_GEOVIS -#include "vtkGeovisInstantiator.h" -#endif - -#ifdef VTK_USE_INFOVIS -#include "vtkInfovisInstantiator.h" -#endif - -#ifdef VTK_USE_VIEWS -#include "vtkViewsInstantiator.h" -#endif - #include "vtkTclUtil.h" static void vtkTkAppInitEnableMSVCDebugHook(); @@ -246,89 +214,6 @@ int Tcl_AppInit(Tcl_Interp *interp) } #endif - /* init the core vtk stuff */ - if (Vtkcommontcl_Init(interp) == TCL_ERROR) - { - return TCL_ERROR; - } - if (Vtkfilteringtcl_Init(interp) == TCL_ERROR) - { - return TCL_ERROR; - } - if (Vtkimagingtcl_Init(interp) == TCL_ERROR) - { - return TCL_ERROR; - } - if (Vtkgraphicstcl_Init(interp) == TCL_ERROR) - { - return TCL_ERROR; - } - if (Vtkiotcl_Init(interp) == TCL_ERROR) - { - return TCL_ERROR; - } - -#ifdef VTK_USE_RENDERING - if (Vtkrenderingtcl_Init(interp) == TCL_ERROR) - { - return TCL_ERROR; - } - -#if defined(VTK_USE_TK) - if (Vtktkrenderwidget_Init(interp) == TCL_ERROR) - { - return TCL_ERROR; - } - if (Vtktkimageviewerwidget_Init(interp) == TCL_ERROR) - { - return TCL_ERROR; - } -#endif - - if (Vtkvolumerenderingtcl_Init(interp) == TCL_ERROR) - { - return TCL_ERROR; - } - - if (Vtkhybridtcl_Init(interp) == TCL_ERROR) - { - return TCL_ERROR; - } - - if (Vtkwidgetstcl_Init(interp) == TCL_ERROR) - { - return TCL_ERROR; - } -#endif - -#ifdef VTK_USE_PARALLEL - if (Vtkparalleltcl_Init(interp) == TCL_ERROR) - { - return TCL_ERROR; - } -#endif - -#ifdef VTK_USE_GEOVIS - if (Vtkgeovistcl_Init(interp) == TCL_ERROR) - { - return TCL_ERROR; - } -#endif - -#ifdef VTK_USE_INFOVIS - if (Vtkinfovistcl_Init(interp) == TCL_ERROR) - { - return TCL_ERROR; - } -#endif - -#ifdef VTK_USE_VIEWS - if (Vtkviewstcl_Init(interp) == TCL_ERROR) - { - return TCL_ERROR; - } -#endif - #ifdef VTK_EXTRA_TCL_INIT VTK_EXTRA_TCL_INIT; #endif diff --git a/Wrapping/Tcl/vtkbase/vtkbase.tcl.in b/Wrapping/Tcl/vtkbase/vtkbase.tcl.in index 174c920668f..26301247b8f 100644 --- a/Wrapping/Tcl/vtkbase/vtkbase.tcl.in +++ b/Wrapping/Tcl/vtkbase/vtkbase.tcl.in @@ -44,7 +44,7 @@ namespace eval ::vtk { } foreach dir $dirs { - set libname [file join $dir ${prefix}${name}${ext}] + set libname [file join $dir ${prefix}${name}-@VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@${ext}] if {[file exists $libname]} { if {![catch {load $libname} errormsg]} { # WARNING: it HAS to be "" so that pkg_mkIndex work (since diff --git a/Wrapping/Tcl/vtkmodule.tcl.in b/Wrapping/Tcl/vtkmodule.tcl.in index 5d84f561546..3d4d2706524 100644 --- a/Wrapping/Tcl/vtkmodule.tcl.in +++ b/Wrapping/Tcl/vtkmodule.tcl.in @@ -1,8 +1,8 @@ package require -exact vtkbase @VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@ if {[info commands ::vtk::init::require_package] != ""} { - if {[::vtk::init::require_package vtkCommonTCL @VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@]} { - package provide vtkcommon @VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@ + if {[::vtk::init::require_package @module@TCL @VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@]} { + package provide @module_lc@ @VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@ } } else { puts stderr "Warning: Your TCLLIBPATH points to the VTK source tree. \ @@ -14,7 +14,7 @@ if {[info commands ::vtk::init::require_package] != ""} { After this is done, you no longer need to set PATH or LD_LIBRARY_PATH\ to point to the VTK build tree." if {[info commands vtkObject] != "" || - [::vtk::load_component vtkCommonTCL] == ""} { - package provide vtkcommon @VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@ + [::vtk::load_component @module@TCL] == ""} { + package provide @module_lc@ @VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@ } } diff --git a/Wrapping/vtkWrapPythonInit.c b/Wrapping/vtkWrapPythonInit.c index b5c6677bbde..7b9f4024b9b 100644 --- a/Wrapping/vtkWrapPythonInit.c +++ b/Wrapping/vtkWrapPythonInit.c @@ -121,7 +121,7 @@ int main(int argc,char *argv[]) fclose(file); /* extra object for the Common module */ - if (strcmp(libName, "vtkCommonPython") == 0) + if (strcmp(libName, "vtkCommonCorePython") == 0) { /* the PyVTKMutableObject */ files[numFiles] = strdup("mutable"); diff --git a/Wrapping/vtkWrapTclInit.c b/Wrapping/vtkWrapTclInit.c index 88a242b072d..dba115ecb61 100644 --- a/Wrapping/vtkWrapTclInit.c +++ b/Wrapping/vtkWrapTclInit.c @@ -63,7 +63,7 @@ static void CreateInitFile(const char *libName, fprintf(fout,"ClientData %sNewCommand();\n",concrete[i]); } - if (!strcmp(kitName,"Vtkcommontcl")) + if (!strcmp(kitName,"Vtkcommoncoretcl")) { fprintf(fout,"int vtkCreateCommand(ClientData cd, Tcl_Interp *interp,\n" " int argc, char *argv[]);\n"); @@ -97,7 +97,7 @@ static void CreateInitFile(const char *libName, /* create an extern ref to the generic delete function */ fprintf(fout,"\nextern void vtkTclGenericDeleteObject(ClientData cd);\n"); - if (!strcmp(kitName,"Vtkcommontcl")) + if (!strcmp(kitName,"Vtkcommoncoretcl")) { fprintf(fout, "extern \"C\"\n{\nvoid vtkCommonDeleteAssocData(ClientData cd)\n"); @@ -113,7 +113,7 @@ static void CreateInitFile(const char *libName, fprintf(fout,"\n\nint VTK_EXPORT %s_Init(Tcl_Interp *interp)\n{\n", kitName); - if (!strcmp(kitName,"Vtkcommontcl")) + if (!strcmp(kitName,"Vtkcommoncoretcl")) { fprintf(fout, " vtkTclInterpStruct *info = new vtkTclInterpStruct;\n"); -- GitLab