### Running the VTK Python Connector Example Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/README.md This command executes the example VTK Python program provided with the Omniverse Connector. Before running, the `PYTHONPATH` and `LD_LIBRARY_PATH` environment variables must be set to include the necessary libraries. The script takes the USD output directory as a command-line argument. ```shell python(3) connector_example.py ``` -------------------------------- ### Target Installation Configuration Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Volume/CMakeLists.txt This section configures the installation rules for the target `${PROJECT_NAME}`, specifying the destination directories for the library, runtime, and archive components. ```cmake install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${OMNICONNECT_RUNTIME_DESTINATION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### CMake Install Dependencies Options Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/README.md Enables the installation of USD and Omniverse dependencies alongside the plugin binaries. This ensures that the necessary dependencies are available at runtime, avoiding potential linking issues. This simplifies deployment by packaging the required dependencies with the plugin. ```CMake -D INSTALL_USD_DEPS=ON -D INSTALL_OMNIVERSE_DEPS=ON ``` -------------------------------- ### Installing OmniConnect Library Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt Installs the OmniConnect library to the specified destinations for library, runtime, and archive files. ```cmake install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${OMNICONNECT_RUNTIME_DESTINATION} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Installing Modules Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/CMakeLists.txt Installs the specified OmniConnect modules using the _vtk_module_install macro. This ensures that the modules are properly installed during the build process. ```cmake _vtk_module_install(OmniConnect_Common) _vtk_module_install(OmniConnect_Connect) _vtk_module_install(OmniConnect_Volume) _vtk_module_install(OmniConnect) ``` -------------------------------- ### Project Initialization and Setup Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/CMakeLists.txt Initializes the CMake project, sets the C++ standard, finds the ParaView package, and defines options for building shared libraries. It also includes GNUInstallDirs for standard directory layout. ```cmake message( "-------------------- Begin OmniverseConnector CmakeLists.txt ----------------------------------------") cmake_policy(SET CMP0091 NEW) # Support MSVC_RUNTIME_LIBRARY for including static crts with a project project(OmniverseConnector) cmake_minimum_required(VERSION 3.3) set(CMAKE_CXX_STANDARD 17) find_package(ParaView REQUIRED) option(BUILD_SHARED_LIBS "Build shared libraries" ON) include(GNUInstallDirs) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}") ``` -------------------------------- ### Conditional Installation of USD Dependencies Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt Conditionally installs USD dependencies based on the INSTALL_USD_DEPS option. It sets the platform install library directory and installs USD libraries and Python runtime libraries. ```cmake option(INSTALL_USD_DEPS "Enable install of USD dependencies with Omniverse Connector" OFF) if(${INSTALL_USD_DEPS}) set(PLATFORM_INSTALL_LIBDIR "<$<$>:${CMAKE_INSTALL_LIBDIR}>$<$:${CMAKE_INSTALL_BINDIR}>/") #Install USD install( DIRECTORY "${USD_LIB_DIR}/" DESTINATION ${PLATFORM_INSTALL_LIBDIR} PATTERN "*${CMAKE_STATIC_LIBRARY_SUFFIX}" EXCLUDE) install( DIRECTORY "<$<$>:${USD_ROOT_DIR_RELEASE}/bin/>$<$:${USD_ROOT_DIR_DEBUG}/bin/>" DESTINATION ${PLATFORM_INSTALL_LIBDIR} FILES_MATCHING PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}*") #Install Python message(STATUS "Python runtime library dirs: ${PY_SHARED_LIB_DIR}") if(WIN32) file(GLOB PYTHON_RUNTIME_LIBRARIES "${PY_SHARED_LIB_DIR}/python*${CMAKE_SHARED_LIBRARY_SUFFIX}*") else() file(GLOB PYTHON_RUNTIME_LIBRARIES "${PY_SHARED_LIB_DIR}/*libffi.so*" "${PY_SHARED_LIB_DIR}/*libpython*.so*") endif() message(STATUS "Found Python Runtime Libs: ${PYTHON_RUNTIME_LIBRARIES}") install( FILES ${PYTHON_RUNTIME_LIBRARIES} DESTINATION ${PLATFORM_INSTALL_LIBDIR}) endif() ``` -------------------------------- ### Project Setup and Library Creation Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Volume/CMakeLists.txt This section initializes the OmniConnect_Volume project and creates a shared library with the same name. It also defines an option, OMNICONNECT_USE_OPENVDB, to enable OpenVDB support. ```cmake project(OmniConnect_Volume) add_library(${PROJECT_NAME} SHARED) option(OMNICONNECT_USE_OPENVDB "Enable OpenVDB support for USD device" OFF) ``` -------------------------------- ### Project Setup and Minimum CMake Version Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/Qt/CMakeLists.txt This snippet sets the project name and specifies the minimum required CMake version. It also sets the C++ standard to 17. ```cmake project(OmniverseConnectorQt) cmake_minimum_required(VERSION 3.3) set(CMAKE_CXX_STANDARD 17) ``` -------------------------------- ### OmniConnect Project Setup Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Connection/CMakeLists.txt Initializes the OmniConnect_Connect project as an interface library. It also includes an option to enable or disable Omniverse support. ```cmake message( "-------------------- Begin OmniConnectConnection CmakeLists.txt ----------------------------------------") option(OMNICONNECT_USE_OMNIVERSE "Enable Omniverse support for Omniverse Connector" ON) project(OmniConnect_Connect) add_library(${PROJECT_NAME} INTERFACE) ``` -------------------------------- ### USD OpenVDB Build Configuration Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Volume/CMakeLists.txt This section configures dependency roots when using a USD source installation for OpenVDB. It sets the roots for ZLIB, TBB, BOOST, and Blosc if they are not already defined. ```cmake if(USE_USD_OPENVDB_BUILD) # Allow for using the usd install as dependency root if(NOT ZLIB_ROOT) set(ZLIB_ROOT "${OpenVDB_ROOT}") endif() if(NOT TBB_ROOT) set(TBB_ROOT "${OpenVDB_ROOT}") endif() if(NOT BOOST_ROOT) set(BOOST_ROOT "${OpenVDB_ROOT}") endif() if(NOT Blosc_ROOT) set(Blosc_ROOT "${OpenVDB_ROOT}") endif() endif() ``` -------------------------------- ### Setting Include Directories for OmniConnect Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt Sets the include directories for the OmniConnect library. It specifies both public and private include directories, including the current list directory, an install interface, the Mdl subdirectory, and the Boost include directory. ```cmake target_include_directories(${PROJECT_NAME} PRIVATE PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_LIST_DIR}/Mdl ${Boost_SEP_INCLUDE_DIR} ) ``` -------------------------------- ### Setting Include Directories for OmniConnectConnection Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Connection/CMakeLists.txt Sets the include directories for the OmniConnectConnection library, specifying both build and install interfaces. This ensures that the necessary header files are available during compilation and after installation. ```cmake target_include_directories(${PROJECT_NAME} INTERFACE $ $ ) ``` -------------------------------- ### ParaView Plugin Build Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/CMakeLists.txt Builds the ParaView plugin, specifying the runtime and library destinations. It uses `paraview_plugin_build` to create the plugin with the specified installation directories and subdirectories. ```cmake paraview_plugin_build( RUNTIME_DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}" LIBRARY_SUBDIRECTORY "${PARAVIEW_PLUGIN_SUBDIR}" PLUGINS ${plugins}) ``` -------------------------------- ### Target Sources and Include Directories Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Volume/CMakeLists.txt This section specifies the source files for the OmniConnect_Volume library and sets up the include directories. It includes OmniConnectVolumeWriter.cxx and OmniConnectVolumeWriter.h as private sources. It also defines public include directories for both build and install interfaces. ```cmake target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/OmniConnectVolumeWriter.cxx ${CMAKE_CURRENT_LIST_DIR}/OmniConnectVolumeWriter.h ) target_include_directories(${PROJECT_NAME} PUBLIC $ $ ) ``` -------------------------------- ### Conditional Qt Setup for ParaView Plugin Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/Qt/CMakeLists.txt This block conditionally configures the plugin if ParaView is using Qt. It defines moc sources, adds auto-start and toolbar functionalities, and sets up UI and resource files. It also finds the Qt5 Network component and configures auto-moc, auto-rcc, and auto-uic. ```cmake IF(PARAVIEW_USE_QT) SET(MOC_SOURCES pqOmniConnectStarter.h pqOmniConnectStarter.cxx pqOmniConnectActions.h pqOmniConnectActions.cxx pqOmniConnectBaseDialog.h pqOmniConnectBaseDialog.cxx pqOmniConnectAccountDialog.h pqOmniConnectAccountDialog.cxx pqOmniConnectSettingsDialog.h pqOmniConnectSettingsDialog.cxx pqOmniConnectAboutDialog.h pqOmniConnectAboutDialog.cxx pqOmniConnectFolderPickerDialog.h pqOmniConnectFolderPickerDialog.cxx pqOmniConnectDataItem.h pqOmniConnectDataItem.cxx pqOmniConnectFolderPickerTreeModel.h pqOmniConnectFolderPickerTreeModel.cxx pqOmniConnectPropertyLinks.h pqOmniConnectPropertyLinks.cxx pqOmniConnectViewsSettingsManager.h pqOmniConnectViewsSettingsManager.cxx pqOmniConnectLauncherClient.h pqOmniConnectLauncherClient.cxx pqOmniConnectViewOpener.h pqOmniConnectViewOpener.cxx pqOmniConnectViewClient.h pqOmniConnectViewClient.cxx pqOmniConnectUtils.h pqOmniConnectUtils.cxx pqOmniConnectFileLogger.h pqOmniConnectFileLogger.cxx pqOmniConnectLogger.h pqOmniConnectLogger.cxx pqOmniConnectConnectionDialog.h pqOmniConnectConnectionDialog.cxx ) SET(MOC_IFACES) paraview_plugin_add_auto_start( CLASS_NAME pqOmniConnectStarter STARTUP onStartup SHUTDOWN onShutdown INTERFACES OMNICONNECT_AUTOSTART_IFACE SOURCES OMNICONNECT_AUTOSTART_IFACE_SRCS ) list(APPEND MOC_IFACES ${OMNICONNECT_AUTOSTART_IFACE}) list(APPEND MOC_SOURCES ${OMNICONNECT_AUTOSTART_IFACE_SRCS}) paraview_plugin_add_toolbar( CLASS_NAME "pqOmniConnectActions" INTERFACES OMNICONNECT_TBAR_IFACE SOURCES OMNICONNECT_TBAR_IFACE_SRCS ) list(APPEND MOC_IFACES ${OMNICONNECT_TBAR_IFACE}) list(APPEND MOC_SOURCES ${OMNICONNECT_TBAR_IFACE_SRCS}) set(ui_files Resources/UI/pqOmniConnectAccountDialog.ui Resources/UI/pqOmniConnectSettingsDialog.ui Resources/UI/pqOmniConnectAboutDialog.ui Resources/UI/pqOmniConnectFolderPickerDialog.ui) set(resource_files Resources/omniComponents.qrc) find_package(Qt5 REQUIRED QUIET COMPONENTS Network) set(CMAKE_AUTOMOC 1) set(CMAKE_AUTORCC 1) set(CMAKE_AUTOUIC 1) set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/Resources/UI") source_group("Resources" FILES ${ui_files} ${resource_files}) ENDIF() ``` -------------------------------- ### Building Connect Sample Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/README.md This command builds the Connect Sample project using the `repo.sh` or `repo.bat` script. This step is necessary to download and build the required Omniverse libraries, which are then used by the ParaView Connector. ```shell repo.sh/.bat build ``` -------------------------------- ### Building ParaView Qt Plugin Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/CMakeLists.txt This code uses the `paraview_plugin_build` macro to build the Qt plugin. It specifies the runtime and library destination directories, the library subdirectory, and the plugin to build (`qtplugin`). ```cmake paraview_plugin_build( RUNTIME_DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}" LIBRARY_SUBDIRECTORY "${PARAVIEW_PLUGIN_SUBDIR}/OmniverseConnector" PLUGINS ${qtplugin}) ``` -------------------------------- ### Platform-Specific Definitions and Linking (Windows) Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt Adds definitions and link directories specific to Windows. It defines BOOST_ALL_DYN_LINK and sets the link directories for Python and USD libraries. ```cmake if (WIN32) add_definitions("-DBOOST_ALL_DYN_LINK") # Combination of boost and python causes pragma linking issues for both libraries. message(STATUS "Python link dirs: ${USD_PYTHON_LINK_DIRS}") target_link_directories(${PROJECT_NAME} PRIVATE "${USD_PYTHON_LINK_DIRS}" "${USD_LIB_DIR}") endif() ``` -------------------------------- ### Target Include Directories Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/Qt/CMakeLists.txt This snippet sets the include directories for the OmniverseConnectorQt target, specifically adding the ThirdParty directory for build interfaces. ```cmake target_include_directories( OmniverseConnectorQt PUBLIC $ ) ``` -------------------------------- ### Adding ParaView Plugin: OmniverseConnector Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/CMakeLists.txt This code uses the `paraview_add_plugin` macro to define the OmniverseConnector plugin. It specifies that the plugin is required on both the client and server, sets the version, lists the UI files and interfaces (which are empty in this case), and defines the modules that make up the plugin. It also specifies the module files and disables XML documentation generation. ```cmake paraview_add_plugin(OmniverseConnector REQUIRED_ON_CLIENT REQUIRED_ON_SERVER VERSION "1.0" UI_FILES UI_INTERFACES SOURCES MODULES OmniverseConnector::vtkOmniverseConnector OmniverseConnector::OmniConnectViews MODULE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/vtkOmniverseConnector/vtk.module" "${CMAKE_CURRENT_SOURCE_DIR}/Views/vtk.module" XML_DOCUMENTATION OFF ) ``` -------------------------------- ### Target Link Libraries Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/Qt/CMakeLists.txt This snippet links the OmniverseConnectorQt target with the necessary libraries, including vtkOmniverseConnector, OmniConnectViews, and Qt5::Network. ```cmake target_link_libraries(OmniverseConnectorQt PRIVATE OmniverseConnector::vtkOmniverseConnector OmniverseConnector::OmniConnectViews Qt5::Network) ``` -------------------------------- ### Finding pxr Package Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt This snippet uses find_package to locate the pxr (USD) package, requiring it and specifying the USD root directory as a path. ```cmake find_package(pxr REQUIRED PATHS ${USD_ROOT_DIR_CURRENT}) ``` -------------------------------- ### ParaView Plugin Definition Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/Qt/CMakeLists.txt This snippet defines the ParaView plugin, specifying its required status on the client, version, UI files, resources, interfaces, and sources. It also disables XML documentation generation. ```cmake paraview_add_plugin(OmniverseConnectorQt REQUIRED_ON_CLIENT VERSION "1.0" UI_FILES ${ui_files} UI_RESOURCES ${resource_files} UI_INTERFACES ${MOC_IFACES} SOURCES ${MOC_SOURCES} MODULES MODULE_FILES XML_DOCUMENTATION OFF ) ``` -------------------------------- ### Setting Include Directories for OmniverseConnector Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/CMakeLists.txt This command sets the include directories for the OmniverseConnector target. It adds the `ThirdParty` directory under the current source directory to the include paths, but only when building the library (BUILD_INTERFACE). ```cmake target_include_directories(OmniverseConnector PUBLIC $ ) ``` -------------------------------- ### CMake Configuration with Generator Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/README.md Configures the CMake project with a specified generator and paths to ParaView, Qt5, and Freetype. This is a fundamental step in setting up the build environment for the ParaView Omniverse Connector. The generator specifies the build system to be used (e.g., Ninja, Visual Studio). ```CMake -G -D ParaView_DIR=/lib/cmake/paraview- -D Qt5_DIR=/lib/cmake/Qt5 -D CMAKE_PREFIX_PATH= -D FREETYPE_LIBRARY= ``` -------------------------------- ### CMake Static Linking Options Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/README.md Configures static linking for OpenVDB, Blosc, Zlib, and Boost libraries. Static linking prevents potential conflicts with dynamic libraries included with ParaView. This is especially important when `OMNICONNECT_USE_OPENVDB=ON` to avoid runtime issues. ```CMake -D OPENVDB_USE_STATIC_LIBS=ON -D BLOSC_USE_STATIC_LIBS=ON -D ZLIB_USE_STATIC_LIBS=ON -D Boost_USE_STATIC_LIBS=ON ``` -------------------------------- ### CMake Dependency Paths Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/README.md Specifies the root directories for various dependencies required by the ParaView Omniverse Connector. These paths are used by CMake to locate the necessary libraries and include files for USD, Omniclient, OmniUSDResolver, Python, OpenVDB, Blosc, Zlib, TBB, and Boost. Correctly setting these paths is crucial for a successful build. ```CMake -D USD_ROOT_DIR= -D OMNICLIENT_ROOT_DIR= -D OMNIUSDRESOLVER_ROOT_DIR= -D Python3_ROOT_DIR= -D Python3_FIND_STRATEGY=LOCATION -D OpenVDB_ROOT= -D Blosc_ROOT= -D BLOSC_LIBRARYDIR= -D ZLIB_ROOT= -D ZLIB_LIBRARY= -D TBB_ROOT= -D BOOST_ROOT= ``` -------------------------------- ### Globbing Boost Include Directory Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt This snippet uses file(GLOB) to find the Boost include directory within the USD release directory and prints the result. ```cmake file(GLOB Boost_SEP_INCLUDE_DIR "${USD_ROOT_DIR_RELEASE}/include/boost*") message(STATUS "Boost_SEP_INCLUDE_DIR ${Boost_SEP_INCLUDE_DIR}") ``` -------------------------------- ### Scanning for ParaView Qt Plugins Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/CMakeLists.txt This code uses the `paraview_plugin_scan` macro to scan for Qt plugins. It specifies the plugin file, the variable to store the plugin name (`qtplugin`), the required modules, and enables the plugin by default. ```cmake paraview_plugin_scan( PLUGIN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/Qt/paraview.sub.plugin" PROVIDES_PLUGINS qtplugin REQUIRES_MODULES required_modules ENABLE_BY_DEFAULT ON) ``` -------------------------------- ### Defining OmniConnect Project and Library Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt Defines the OmniConnect project and creates a shared library named after the project. The target_sources command specifies the source files to be compiled into the library. ```cmake project(OmniConnect) add_library(${PROJECT_NAME} SHARED) target_sources(${PROJECT_NAME} PRIVATE OmniConnect.cxx OmniConnectLiveInterface.cxx OmniConnectUtilsExternal.cxx OmniConnectUsdUtils.cxx OmniConnectCaches.cxx OmniConnectDiagnosticMgrDelegate.cxx ${OMNICONNECT_MDL_SOURCES} OmniConnectUtilsExternal.h OmniConnectUsdUtils.h OmniConnect.h OmniConnectLiveInterface.h OmniConnectCaches.h OmniConnectDiagnosticMgrDelegate.h ${OMNICONNECT_MDL_HEADERS} usd.h ) ``` -------------------------------- ### Flattening and Cleaning Up USD Targets Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt This snippet appends initial USD targets to a list and then calls a function to flatten and clean up the targets. It also prints the resulting USD_TARGETS. ```cmake list(APPEND USD_INIT_TARGETS usdGeom usdVol usdShade usdLux usdUtils) # All other targets derived from these, in flatten_and_cleanup_targets flatten_and_cleanup_targets(USD_TARGETS "${USD_INIT_TARGETS}") message(STATUS "USD_TARGETS: ${USD_TARGETS}") ``` -------------------------------- ### Linking Libraries to OmniverseConnector Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/CMakeLists.txt This command links the `OmniConnect` library to the `OmniverseConnector` target. This establishes a dependency between the plugin and the OmniConnect library, ensuring that the necessary symbols are available at link time. ```cmake target_link_libraries(OmniverseConnector PUBLIC OmniConnect) ``` -------------------------------- ### Dependency Root Messages Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Volume/CMakeLists.txt This block outputs the configured root paths for various dependencies like OpenVDB, IlmBase, ZLIB, Blosc, TBB, and BOOST using CMake's `message` command, providing visibility into the dependency resolution process. ```cmake message(STATUS "OpenVDB OpenVDB_ROOT: ${OpenVDB_ROOT}") message(STATUS "OpenVDB IlmBase_ROOT: ${IlmBase_ROOT}") message(STATUS "OpenVDB ZLIB_ROOT: ${ZLIB_ROOT}") message(STATUS "OpenVDB Blosc_ROOT: ${Blosc_ROOT}") message(STATUS "OpenVDB TBB_ROOT: ${TBB_ROOT}") message(STATUS "OpenVDB BOOST_ROOT: ${BOOST_ROOT}") ``` -------------------------------- ### CMake Options for Omniverse and OpenVDB Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/README.md Enables or disables Omniverse and OpenVDB support in the ParaView Omniverse Connector build. These options control whether the connector will include functionality for interacting with Omniverse and for handling OpenVDB volumetric data. `USE_USD_OPENVDB_BUILD` indicates whether OpenVDB was built as part of the USD source tree. ```CMake -D OMNICONNECT_USE_OMNIVERSE=ON/OFF -D OMNICONNECT_USE_OPENVDB=ON/OFF -D USE_USD_OPENVDB_BUILD=ON/OFF ``` -------------------------------- ### Printing Qt Plugin Name Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/CMakeLists.txt This command prints the name of the Qt sub-plugin that was found during the plugin scan. It uses the `MESSAGE` command to display a status message to the console during the CMake configuration process. ```cmake MESSAGE(STATUS "Qt Sub plugin found with name: ${qtplugin}") ``` -------------------------------- ### Setting Source Files for OmniConnectConnection Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Connection/CMakeLists.txt Specifies the source files for the OmniConnectConnection library, including both the .cxx and .h files. This ensures that these files are compiled and linked into the library. ```cmake target_sources(${PROJECT_NAME} INTERFACE $ $ ) ``` -------------------------------- ### MIT License for Doxygen Awesome Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/LICENSES/openusd-LICENSE.txt This snippet shows the MIT License applied to the Doxygen Awesome project. It outlines the permissions granted to users, including the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software. It also includes a disclaimer of warranty and limitation of liability. ```C++ MIT License Copyright (c) 2021 - 2023 jothepro Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` -------------------------------- ### Creating OmniConnect Common Library Interface Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Common/CMakeLists.txt This snippet creates an interface library named OmniConnect_Common using CMake. It specifies the source files and include directories that are part of the interface. ```cmake project(OmniConnect_Common) add_library(${PROJECT_NAME} INTERFACE) target_sources(${PROJECT_NAME} INTERFACE $ $ $ ) target_include_directories(${PROJECT_NAME} INTERFACE $ $ ) ``` -------------------------------- ### Finding Python Package Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt This snippet configures Python by prepending the Python root directory to the CMake module path, finding the Python3 package with required components, and then removing the prepended path. It also sets variables for Python include and library directories. ```cmake list(PREPEND CMAKE_MODULE_PATH ${Python3_ROOT_DIR}) find_package(Python3 REQUIRED COMPONENTS Development) list(POP_FRONT CMAKE_MODULE_PATH) set(USD_PYTHON_TARGETS Python3::Module) set(PY_SHARED_LIB_DIR "${Python3_RUNTIME_LIBRARY_DIRS}") set(USD_PYTHON_LINK_DIRS "${Python3_LIBRARY_DIRS}") list(GET Python3_INCLUDE_DIRS 0 Python3_INCLUDE_DIR) # Required for passing pxrConfig.cmake list(GET Python3_LIBRARIES 0 Python3_LIBRARY) # Required for passing pxrConfig.cmake ``` -------------------------------- ### Finding USD Root Directory Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt This snippet finds the USD root directory using find_path and sets the USD_ROOT_DIR variable. It checks for the existence of the directory and sets different paths for Debug and Release builds. ```cmake if (NOT EXISTS ${USD_ROOT_DIR}) find_path(USD_ROOT_DIR NAMES include/pxr/pxr.h DOC "Path to USD") message(STATUS "Using USD_ROOT_DIR: ${USD_ROOT_DIR}") endif() if (NOT EXISTS ${USD_ROOT_DIR}) message(FATAL_ERROR "No valid USD_ROOT_DIR set, or found using CMAKE_PREFIX_PATH: ${USD_ROOT_DIR}") endif() message(STATUS "Using cmake value of USD_ROOT_DIR: ${USD_ROOT_DIR}") if(EXISTS "${USD_ROOT_DIR}/release") set(USD_ROOT_DIR_RELEASE "${USD_ROOT_DIR}/release") else() set(USD_ROOT_DIR_RELEASE "${USD_ROOT_DIR}") endif() if(EXISTS "${USD_ROOT_DIR}/debug") set(USD_ROOT_DIR_DEBUG "${USD_ROOT_DIR}/debug") else() set(USD_ROOT_DIR_DEBUG "${USD_ROOT_DIR}") endif() ``` -------------------------------- ### MIT License for invoke.hpp Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/LICENSES/openusd-LICENSE.txt This snippet shows the MIT License applied to the invoke.hpp file. It outlines the permissions granted to users, including the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software. It also includes a disclaimer of warranty and limitation of liability. ```C++ MIT License Copyright (C) 2018-2023, by Matvey Cherevko (blackmatov@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` -------------------------------- ### Adding Server Manager XMLs Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/Views/CMakeLists.txt Adds server manager XML files for the OmniConnectViews module. These XML files define the user interface and properties for the module within ParaView. ```cmake paraview_add_server_manager_xmls( XMLS OmniConnectViews.xml) ``` -------------------------------- ### Platform-Specific Definitions and Linking (Non-Windows) Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt Sets platform-specific libraries and compile definitions for non-Windows platforms. It links pthread, dl, and stdc++fs, and conditionally defines _GLIBCXX_USE_CXX11_ABI based on the USD_DEVICE_USE_CXX11_ABI variable. ```cmake else() set(PLATFORM_LIBS pthread dl stdc++fs) target_link_libraries(${PROJECT_NAME} PRIVATE general ${PLATFORM_LIBS} ) if(NOT ${USD_DEVICE_USE_CXX11_ABI}) target_compile_definitions(${PROJECT_NAME} PRIVATE _GLIBCXX_USE_CXX11_ABI=0 ) endif() endif() ``` -------------------------------- ### Boost Library Configuration Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Volume/CMakeLists.txt This snippet configures the usage of Boost libraries, determining whether to use static or shared libraries based on the `Boost_USE_STATIC_LIBS` variable. It sets related CMake variables accordingly. ```cmake if(Boost_USE_STATIC_LIBS OR BOOST_USE_STATIC_LIBS) set(BOOST_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_LIBS ON) set(BUILD_SHARED_LIBS OFF) else() set(BOOST_USE_STATIC_LIBS OFF) set(Boost_USE_STATIC_LIBS OFF) set(BUILD_SHARED_LIBS ON) endif() ``` -------------------------------- ### Setting USD Directory Based on Build Type Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt This snippet sets the USD root directory based on the build type (Debug or Release). It checks for the existence of include directories within the Debug or Release subfolders and sets the USD_ROOT_DIR_CURRENT variable accordingly. ```cmake if(CMAKE_BUILD_TYPE MATCHES "Debug") set(USD_ROOT_DIR_CURRENT "${USD_ROOT_DIR_RELEASE}") else() set(USD_ROOT_DIR_CURRENT "${USD_ROOT_DIR_DEBUG}") endif() if(CMAKE_BUILD_TYPE MATCHES "Debug") if(NOT EXISTS "${USD_ROOT_DIR_DEBUG}/include") message(FATAL_ERROR "USD_ROOT_DIR or its /debug subfolder does not have an /include subfolder, so it's not configured correctly at ${USD_ROOT_DIR_DEBUG}") endif() elseif(NOT EXISTS "${USD_ROOT_DIR_RELEASE}/include") message(FATAL_ERROR "USD_ROOT_DIR or its /release subfolder does not have an /include subfolder, so it's not configured correctly at ${USD_ROOT_DIR_RELEASE}") endif() ``` -------------------------------- ### Setting OmniConnect Runtime Destination Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt This snippet sets the destination directory for the OmniConnect runtime based on whether PARAVIEW_VTK_OMNIVERSE_CONNECTOR_BUILD is defined. If defined, it uses the paraview plugin directory; otherwise, it uses the standard binary directory. ```cmake if(DEFINED PARAVIEW_VTK_OMNIVERSE_CONNECTOR_BUILD) set(OMNICONNECT_RUNTIME_DESTINATION ${_paraview_build_plugin_directory}) else() set(OMNICONNECT_RUNTIME_DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() ``` -------------------------------- ### Adding Subdirectory Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/CMakeLists.txt Adds the OmniConnect subdirectory to the build process. This includes the CMakeLists.txt file in the OmniConnect directory, allowing it to be configured and built as part of the project. ```cmake add_subdirectory(OmniConnect) ``` -------------------------------- ### Checking CXX11 ABI Usage Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt This snippet checks whether USD was compiled with or without the CXX11 ABI. It reads the CMakeCache.txt file and sets the USD_DEVICE_USE_CXX11_ABI option accordingly. ```cmake if(NOT WIN32) set(CXX11_COMPILE_OFF OFF) check_file_and_substring( "${USD_ROOT_DIR_CURRENT}/BUILD_INFO/CMakeCache.txt" "-D_GLIBCXX_USE_CXX11_ABI=0" CXX11_COMPILE_OFF) if(${CXX11_COMPILE_OFF}) set(USE_CXX11_ABI_DEFAULT OFF) else() set(USE_CXX11_ABI_DEFAULT ON) endif() option(USD_DEVICE_USE_CXX11_ABI "" ${USE_CXX11_ABI_DEFAULT}) endif() ``` -------------------------------- ### Setting USD Library Directory Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt This snippet sets the USD library directory based on the build configuration (Debug or Release). It uses generator expressions when configuration types are enabled, otherwise it directly sets the directory based on the CMAKE_BUILD_TYPE. ```cmake set(USD_DIR "<$>:${USD_ROOT_DIR_RELEASE}>$<$:${USD_ROOT_DIR_DEBUG}>") if(CMAKE_CONFIGURATION_TYPES) set(USD_LIB_DIR "${USD_DIR}/lib") else() # Generator-expression-free, due to find_library later on if(CMAKE_BUILD_TYPE MATCHES "Debug") set(USD_LIB_DIR "${USD_ROOT_DIR_DEBUG}/lib") else() set(USD_LIB_DIR "${USD_ROOT_DIR_RELEASE}/lib") endif() endif() ``` -------------------------------- ### ParaView Plugin Scanning Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/CMakeLists.txt Scans for ParaView plugins in the specified directory, identifies required modules, and sets a default option for the ParaView plugin. It uses `paraview_plugin_scan` to find plugins and their dependencies. ```cmake set("_paraview_plugin_default_${CMAKE_PROJECT_NAME}" ON) paraview_plugin_scan( PLUGIN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/Plugin/paraview.plugin" PROVIDES_PLUGINS plugins REQUIRES_MODULES required_modules) ``` -------------------------------- ### Including USD Debug Targets Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt This snippet includes USD debug CMake targets if the debug and release root directories are different and the debug target file exists. It sets and unsets the _IMPORT_PREFIX variable. ```cmake if(NOT (USD_ROOT_DIR_DEBUG STREQUAL USD_ROOT_DIR_RELEASE)) set(USD_DEBUG_TARGET_CMAKE "${USD_ROOT_DIR_DEBUG}/cmake/pxrTargets-debug.cmake") if(EXISTS ${USD_DEBUG_TARGET_CMAKE}) set(_IMPORT_PREFIX ${USD_ROOT_DIR_DEBUG}) #include USD debug cmake targets include(${USD_DEBUG_TARGET_CMAKE}) set(_IMPORT_PREFIX) endif() endif() ``` -------------------------------- ### Adding Subdirectories for OmniConnect Modules Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt Adds subdirectories for different modules of the OmniConnect library, including Common, Mdl, Connection, and Volume. These subdirectories likely contain separate CMakeLists.txt files that define how to build each module. ```cmake add_subdirectory(Common) add_subdirectory(Mdl) add_subdirectory(Connection) add_subdirectory(Volume) ``` -------------------------------- ### Linking OpenVDB Library Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Volume/CMakeLists.txt This section links the OpenVDB library to the target `${PROJECT_NAME}` using `target_link_libraries`. It also defines the `USE_OPENVDB` compile definition. ```cmake target_link_libraries(${PROJECT_NAME} PRIVATE OpenVDB::openvdb ) target_compile_definitions(${PROJECT_NAME} PRIVATE USE_OPENVDB ) ``` -------------------------------- ### Target Link Libraries Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Volume/CMakeLists.txt This section links the OmniConnect_Volume library with the OmniConnect_Common library as a private dependency. ```cmake target_link_libraries(${PROJECT_NAME} PRIVATE OmniConnect_Common ) ``` -------------------------------- ### Setting CMake Minimum Version Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/CMakeLists.txt Specifies the minimum required CMake version for the project. This ensures that the CMake version used to build the project is compatible with the commands and features used in the CMakeLists.txt file. ```cmake cmake_minimum_required(VERSION 3.12 FATAL_ERROR) ``` -------------------------------- ### Boost Compiler Configuration Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Volume/CMakeLists.txt This section configures the Boost compiler and runtime library settings. It sets `Boost_USE_STATIC_RUNTIME` to ON and, on Windows, sets `Boost_COMPILER` to "vc141". ```cmake set(Boost_USE_STATIC_RUNTIME ON) # Also relevant for the Linux find process if (WIN32) set(Boost_COMPILER "vc141") endif() ``` -------------------------------- ### Windows-Specific TBB Linking Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Volume/CMakeLists.txt On Windows, this snippet links the TBB (Threading Building Blocks) library to the target `${PROJECT_NAME}` by specifying the TBB library directories. It also sets the `/bigobj` compile flag for `OmniConnectVolumeWriter.cxx`. ```cmake if(WIN32) # Due to explicit pragma lib inclusion in tbb and python target_link_directories(${PROJECT_NAME} PRIVATE ${Tbb_LIBRARY_DIRS}) set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}/OmniConnectVolumeWriter.cxx PROPERTIES COMPILE_FLAGS /bigobj) else() endif() ``` -------------------------------- ### OmniClient and OmniUsdResolver Integration Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Connection/CMakeLists.txt Conditionally integrates OmniClient and OmniUsdResolver based on the OMNICONNECT_USE_OMNIVERSE option. It calls the get_omni_dependency function to locate and configure these dependencies, and appends the library names to lists for later use. ```cmake if(${OMNICONNECT_USE_OMNIVERSE}) set(OMNICLIENT_ROOT_DIR "" CACHE PATH "Path to the OmniClient Library") set(OMNIUSDRESOLVER_ROOT_DIR "" CACHE PATH "Path to the Omni Usd Resolver Library") get_omni_dependency( OMNICLIENT_ROOT_DIR OMNICLIENT_INCLUDE_DIR OMNICLIENT_LIB_DIR "${OMNICLIENT_ROOT_DIR}" "OMNICLIENT_ROOT_DIR" "Omniverse Client" "include/OmniClient.h") get_omni_dependency( OMNIUSDRESOLVER_ROOT_DIR OMNIUSDRESOLVER_INCLUDE_DIR OMNIUSDRESOLVER_LIB_DIR "${OMNIUSDRESOLVER_ROOT_DIR}" "OMNIUSDRESOLVER_ROOT_DIR" "Omniverse USD Resolver" "include/OmniUsdResolver.h") list(APPEND OMNICLIENT_SHARED_LIBS omniclient) list(APPEND OMNIUSDRESOLVER_SHARED_LIBS omni_usd_resolver) else() MESSAGE(STATUS "OmniConnect is NOT using OmniClient for remote connections.") endif() ``` -------------------------------- ### Setting C++ Standard Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/Views/CMakeLists.txt Sets the C++ standard to version 17 for the project. This ensures that the code is compiled using the C++17 standard. ```cmake set(CMAKE_CXX_STANDARD 17) ``` -------------------------------- ### Adding vtk Module Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/CMakeLists.txt Adds a VTK module named ${OMNIVERSE_CONNECTOR_MODULE_NAME} with specified classes, headers, and sources. This defines the module's structure and components. ```cmake vtk_module_add_module(${OMNIVERSE_CONNECTOR_MODULE_NAME} CLASSES vtkOmniConnectPass vtkOmniConnectViewNodeFactory vtkOmniConnectRendererNode vtkOmniConnectActorNode vtkOmniConnectVolumeNode vtkOmniConnectPolyDataMapperNode vtkOmniConnectCompositePolyDataMapperNode vtkOmniConnectVolumeMapperNode vtkOmniConnectMultiBlockVolumeMapperNode vtkOmniConnectImageSliceMapperNode vtkOmniConnectGlyph3DMapperNode vtkOmniConnectPassArrays vtkOmniConnectTemporalArrays vtkOmniConnectUsdExporter HEADERS vtkOmniConnectVtkToOmni.h SOURCES vtkOmniConnectVtkToOmni.cxx vtkOmniConnectMapperNodeCommon.cxx vtkOmniConnectActorNodeBase.cxx vtkOmniConnectTimeStep.cxx vtkOmniConnectActorCache.cxx vtkOmniConnectTextureCache.cxx vtkOmniConnectLogCallback.cxx vtkOmniConnectImageWriter.cxx PRIVATE_HEADERS vtkOmniConnectMapperNodeCommon.h vtkOmniConnectActorNodeBase.h vtkOmniConnectTimeStep.h vtkOmniConnectActorCache.h vtkOmniConnectTextureCache.h vtkOmniConnectImageWriter.h vtkOmniConnectLogCallback.h ) ``` -------------------------------- ### Linking Libraries for OmniConnect Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt Links the OmniConnect library with other libraries, including OmniConnect_Common, OmniConnect_Volume, OmniConnect_Connect, USD targets, and USD Python targets. It distinguishes between public and private linking. ```cmake target_link_libraries(${PROJECT_NAME} PUBLIC OmniConnect_Common PRIVATE OmniConnect_Volume OmniConnect_Connect ${USD_TARGETS} ${USD_PYTHON_TARGETS} ) ``` -------------------------------- ### OpenVDB Package Finding Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Volume/CMakeLists.txt This snippet uses the `find_package` command to locate the OpenVDB library, marking it as a required dependency. It also adjusts the `CMAKE_MODULE_PATH` to ensure the custom FindOpenVDB.cmake module is used. ```cmake fix_boost_dependency() find_package(OpenVDB REQUIRED) # Pop two paths to remove current dir and OPENVDB_MODULE_DIR list(POP_FRONT CMAKE_MODULE_PATH) list(POP_FRONT CMAKE_MODULE_PATH) ``` -------------------------------- ### Setting Source Files for OmniConnectMdl Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Mdl/CMakeLists.txt This snippet sets the source files for the OmniConnectMdl module using the `set` command in CMake. The `OMNICONNECT_MDL_SOURCES` variable is defined to contain a list of `.cxx` files. The `PARENT_SCOPE` option makes the variable available in the parent scope. ```CMake set( OMNICONNECT_MDL_SOURCES Mdl/OmniConnectMdl.cxx PARENT_SCOPE) ``` -------------------------------- ### Setting Header Files for OmniConnectMdl Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Mdl/CMakeLists.txt This snippet sets the header files for the OmniConnectMdl module using the `set` command in CMake. The `OMNICONNECT_MDL_HEADERS` variable is defined to contain a list of `.h` files. The `PARENT_SCOPE` option makes the variable available in the parent scope. ```CMake set( OMNICONNECT_MDL_HEADERS Mdl/OmniConnectMdl.h Mdl/OmniConnectMdlStrings.h PARENT_SCOPE) ``` -------------------------------- ### Setting Imath and MaterialX Directories Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/CMakeLists.txt This snippet sets the Imath and MaterialX directories if they are not already defined. It checks for the existence of the Imath directory in different locations. ```cmake if(NOT DEFINED Imath_DIR) # Transitive deps set(Imath_DIR "${USD_ROOT_DIR_CURRENT}/lib64/cmake/Imath") if(NOT EXISTS ${Imath_DIR}) set(Imath_DIR "${USD_ROOT_DIR_CURRENT}/lib/cmake/Imath") endif() endif() if(NOT DEFINED MaterialX_DIR) set(MaterialX_DIR "${USD_ROOT_DIR_CURRENT}/lib/cmake/MaterialX") endif() ``` -------------------------------- ### Setting Compile Definitions Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/Views/CMakeLists.txt Sets compile definitions for the OmniConnectViews target, specifically defining PARAVIEW_SUBDIR. This allows the code to access the ParaView plugin subdirectory during compilation. ```cmake target_compile_definitions(OmniConnectViews PRIVATE "PARAVIEW_SUBDIR=\"${PARAVIEW_PLUGIN_SUBDIR}\"" ) ``` -------------------------------- ### Adding VTK Module Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/Views/CMakeLists.txt Adds a VTK module named OmniConnectViews, specifying the classes, source files, and private headers. This defines the core components of the Omniverse Connector within the ParaView environment. ```cmake vtk_module_add_module(OmniverseConnector::OmniConnectViews CLASSES vtkPVOmniConnectRenderView vtkPVOmniConnectSettings vtkPVOmniConnectSettingsPlaceholder vtkPVOmniConnectGlobalState vtkPVOmniConnectProxy vtkPVOmniConnectProxyUrlInfo vtkPVOmniConnectAnimProxy vtkPVOmniConnectSMPipelineController vtkPVOmniConnectUsdExporter vtkSMOmniConnectRenderViewProxy SOURCES vtkPVOmniConnectNamesManager.cxx PRIVATE_HEADERS vtkPVOmniConnectNamesManager.h) ``` -------------------------------- ### MSVC Runtime Library Configuration Source: https://github.com/nvidia-omniverse/paraviewconnector/blob/main/Plugin/vtkOmniverseConnector/OmniConnect/Volume/CMakeLists.txt This snippet sets the MSVC runtime library property for the target `${PROJECT_NAME}` on Windows, configuring it to use the MultiThreaded Debug runtime library in Debug configuration. ```cmake if(WIN32) set_property(TARGET ${PROJECT_NAME} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") else() if(NOT ${USD_DEVICE_USE_CXX11_ABI}) target_compile_definitions(${PROJECT_NAME} PRIVATE _GLIBCXX_USE_CXX11_ABI=0 ) endif() endif() ```