Commit 84bb797a authored by Ben Boeckel's avatar Ben Boeckel

cmake: update to the new module system

parent 952fbf03
vtk_module_third_party(VisItLib
LIBRARIES VisItLib
NO_ADD_SUBDIRECTORY
)
if(VTK_USE_SYSTEM_VISITLIB)
return()
endif()
add_subdirectory(VisItLib)
#any module that uses visitlib needs to know where its internal
#include directories are
list(APPEND VisItLib_INCLUDE_DIRS ${VISITBRIDGE_INCLUDE_DIRS})
vtk_module_export_info()
vtk_module_third_party_internal(
LICENSE_FILES "VisItLib/COPYRIGHT"
VERSION "2.13.0"
SUBDIRECTORY "VisItLib")
vtk_module(VisItLib
EXCLUDE_FROM_WRAPPING
DEPENDS
vtkCommonCore
vtkCommonDataModel
vtkCommonExecutionModel
vtkCommonMisc
vtkFiltersFlowPaths
vtkIOImage
vtkIOLegacy
PRIVATE_DEPENDS
vtkCommonMath
vtkCommonTransforms
vtkFiltersCore
vtkFiltersExtraction
vtkFiltersGeneral
vtkFiltersGeometry
vtkFiltersSources
vtkImagingHybrid
vtkRenderingCore
vtkRenderingVolume${VTK_RENDERING_BACKEND}
vtkpng
vtkzlib
# old modules seem not used. Will remove them in the future.
vtkFiltersAMR
vtkIOGeometry
vtkParallelCore
)
NAME
ParaView::VisItLib
LIBRARY_NAME
vtkVisItLib
DEPENDS
VTK::CommonCore
VTK::CommonDataModel
VTK::CommonExecutionModel
VTK::FiltersCore
VTK::zlib
PRIVATE_DEPENDS
VTK::CommonMath
VTK::CommonTransforms
VTK::FiltersGeneral
VTK::FiltersGeometry
VTK::IOLegacy
VTK::ImagingHybrid
VTK::RenderingCore
THIRD_PARTY
#get same cmake config as visitlib itself does
include(${CMAKE_CURRENT_SOURCE_DIR}/../Library/VisItLib/CMake/VisItCommon.cmake)
include(${VISIT_BINARY_DIR}/VisItBridgeUse.cmake)
macro(VISIT_INCLUDE_READER_SOURCE name state)
option(VISIT_BUILD_READER_${name} "Build VisIt Reader ${name}" ${state})
......@@ -81,6 +80,12 @@ endif(NOT WIN32)
#add generic vtkreader interface parent classes
add_subdirectory(AvtAlgorithms)
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(_VisItReader_output_dir
"${CMAKE_CURRENT_BINARY_DIR}")
include(VisItReader)
#add the default readers to the library
foreach(db ${DEFAULT_BRIDGE_READERS})
add_subdirectory(readers/${db})
......@@ -88,7 +93,6 @@ endforeach(db)
add_definitions("-DRC_CPP_VISIT_BUILD")
#-----------------------------------------------------------------------------
visit_include_reader_source(Silo OFF)
if(VISIT_BUILD_READER_Silo)
......@@ -127,17 +131,6 @@ if(VISIT_BUILD_READER_Mili)
endif(NOT Mili_FOUND)
endif(VISIT_BUILD_READER_Mili)
#-----------------------------------------------------------------------------
#include all the db directories before
#the visit files
include_directories(BEFORE
${VISIT_DB_INC_DIRS}
)
include_directories(
${VISITBRIDGE_INCLUDE_DIRS}
)
if(HAVE_LIBSILO AND VISIT_BUILD_READER_Silo)
include_directories(${SILO_INCLUDE_DIR})
endif(HAVE_LIBSILO AND VISIT_BUILD_READER_Silo)
......@@ -150,47 +143,54 @@ if(HAVE_LIBMILI AND VISIT_BUILD_READER_Mili)
include_directories(${Mili_INCLUDE_DIR})
endif(HAVE_LIBMILI AND VISIT_BUILD_READER_Mili)
set(Module_SRCS
${VISIT_SERVER_SOURCES}
)
set_source_files_properties(
${VISIT_DB_SOURCES}
PROPERTIES
WRAP_EXCLUDE 1
WRAP_EXCLUDE_PYTHON 1
SKIP_HEADER_INSTALL 1)
set(vtkIOVisItBridge_INCLUDE_DIRS "${vtkIOVisItBridge_INCLUDE_DIRS};${CMAKE_CURRENT_SOURCE_DIR}/AvtAlgorithms")
vtk_module_library(vtkIOVisItBridge ${Module_SRCS} ${VISIT_DB_SOURCES})
set(sources
AvtAlgorithms/vtkAvtFileFormatAlgorithm.cxx
AvtAlgorithms/vtkAvtMTMDFileFormatAlgorithm.cxx
AvtAlgorithms/vtkAvtMTSDFileFormatAlgorithm.cxx
AvtAlgorithms/vtkAvtSTMDFileFormatAlgorithm.cxx
AvtAlgorithms/vtkAvtSTSDFileFormatAlgorithm.cxx)
set(headers
AvtAlgorithms/vtkAvtFileFormatAlgorithm.h
AvtAlgorithms/vtkAvtMTMDFileFormatAlgorithm.h
AvtAlgorithms/vtkAvtMTSDFileFormatAlgorithm.h
AvtAlgorithms/vtkAvtSTMDFileFormatAlgorithm.h
AvtAlgorithms/vtkAvtSTSDFileFormatAlgorithm.h)
set(private_headers
AvtAlgorithms/vtkFileCloseSemiProperty.h)
get_property(visit_server_sources GLOBAL PROPERTY _visit_server_sources)
get_property(visit_db_sources GLOBAL PROPERTY _visit_db_sources)
get_property(visit_db_headers GLOBAL PROPERTY _visit_db_headers)
get_property(visit_include_dirs GLOBAL PROPERTY _visit_db_include_dirs)
vtk_module_add_module(ParaView::IOVisItBridge
SOURCES ${visit_server_sources} ${visit_db_sources} ${sources}
HEADERS ${headers} ${visit_db_headers}
PRIVATE_HEADERS ${private_headers})
vtk_module_include(ParaView::IOVisItBridge
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/AvtAlgorithms>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
PRIVATE
${visit_include_dirs})
paraview_add_server_manager_xmls(
XMLS visit_readers.xml)
# if you want to add vtk-module dependencies, simply add those in module.cmake,
# rather than explicitly adding those by using target_link_libraries.
if(VISIT_PARALLEL)
target_link_libraries(vtkIOVisItBridge
LINK_PRIVATE
visitcommon avtdatabase_par avtpipeline_par
visit_vtk)
else(VISIT_PARALLEL)
target_link_libraries(vtkIOVisItBridge
LINK_PRIVATE
visitcommon avtdatabase_ser avtpipeline_ser
visit_vtk)
endif(VISIT_PARALLEL)
if(HAVE_LIBSILO AND VISIT_BUILD_READER_Silo)
target_link_libraries(vtkIOVisItBridge LINK_PRIVATE ${SILO_LIBRARIES})
vtk_module_link(ParaView::IOVisItBridge PRIVATE ${SILO_LIBRARIES})
endif(HAVE_LIBSILO AND VISIT_BUILD_READER_Silo)
if(Boxlib_FOUND AND VISIT_BUILD_READER_Boxlib3D)
target_link_libraries(vtkIOVisItBridge LINK_PRIVATE ${Boxlib_LIBRARIES})
target_link_libraries(vtkIOVisItBridge LINK_PRIVATE ${GFortran_LIBRARIES})
if(VISIT_PARALLEL)
target_link_libraries(vtkIOVisItBridge LINK_PRIVATE ${MPI_CXX_LIBRARIES} ${MPI_Fortran_LIBRARIES})
endif()
vtk_module_link(ParaView::IOVisItBridge PRIVATE ${Boxlib_LIBRARIES})
vtk_module_link(ParaView::IOVisItBridge PRIVATE ${GFortran_LIBRARIES})
endif(Boxlib_FOUND AND VISIT_BUILD_READER_Boxlib3D)
if(HAVE_LIBMILI AND VISIT_BUILD_READER_Mili)
target_link_libraries(vtkIOVisItBridge LINK_PRIVATE ${Mili_LIBRARIES})
vtk_module_link(ParaView::IOVisItBridge PRIVATE ${Mili_LIBRARIES})
endif(HAVE_LIBMILI AND VISIT_BUILD_READER_Mili)
vtk_module(vtkIOVisItBridge
DEPENDS
vtkCommonDataModel
vtkCommonExecutionModel
vtkFiltersAMR
vtkParallelCore
PRIVATE_DEPENDS
VisItLib
vtkCommonSystem
vtkhdf5
vtkIOImage
vtknetcdf
vtkRendering${VTK_RENDERING_BACKEND}
vtksys
vtkzlib
TEST_DEPENDS
)
# paraview-sepecfic extensions to a module to bring in proxy xmls.
set_property (GLOBAL PROPERTY
vtkIOVisItBridge_SERVERMANAGER_XMLS
${CMAKE_CURRENT_LIST_DIR}/visit_readers.xml)
NAME
ParaView::IOVisItBridge
LIBRARY_NAME
vtkIOVisItBridge
DEPENDS
VTK::CommonCore
VTK::CommonExecutionModel
PRIVATE_DEPENDS
ParaView::Core
ParaView::VisItLib
VTK::CommonDataModel
VTK::CommonMisc
VTK::CommonSystem
VTK::CommonTransforms
VTK::FiltersAMR
VTK::FiltersCore
VTK::IOGeometry
VTK::IOImage
VTK::IOLegacy
VTK::IOParallel
VTK::ImagingCore
VTK::ParallelCore
VTK::hdf5
VTK::netcdf
VTK::zlib
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment