### Installing VSG Example Executable - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/utils/vsgshaderset/CMakeLists.txt The `install` command specifies that the 'vsgshaderset' executable target should be installed. It sets the installation type to `RUNTIME` and specifies the destination directory as `bin` relative to the installation prefix. ```CMake install(TARGETS vsgshaderset RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing CMake Target Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/ui/vsginput/CMakeLists.txt Configures the installation rules for the 'vsginput' executable. It specifies that the runtime binary should be placed in the 'bin' directory relative to the installation prefix. ```CMake install(TARGETS vsginput RUNTIME DESTINATION bin) ``` -------------------------------- ### Configuring and Installing vsgreallocations Executable - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/tests/vsgreallocations/CMakeLists.txt This CMake snippet defines the build steps for the 'vsgreallocations' executable. It starts by setting the primary source file, then creates the executable target by including headers and the specified sources. It links the target against the 'vsg::vsg' library, which is a necessary dependency. Finally, it sets up an installation rule to place the compiled executable in the 'bin' directory at install time. ```CMake set(SOURCES vsgreallocations.cpp) add_executable(vsgreallocations ${HEADERS} ${SOURCES}) target_link_libraries(vsgreallocations vsg::vsg) install(TARGETS vsgreallocations RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/commands/vsgocclusionquery/CMakeLists.txt Specifies the installation rules for the built `vsgocclusionquery` executable using the `install` command. It designates the target type as `RUNTIME` and sets the destination directory to `bin`. ```CMake install(TARGETS vsgocclusionquery RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable Target in CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgaxes/CMakeLists.txt This command defines installation rules for the 'vsgaxes' executable target. It specifies that the runtime artifact should be installed to the 'bin' directory relative to the installation prefix. ```CMake install(TARGETS vsgaxes RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable Target CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/core/vsgvalues/CMakeLists.txt Configures the installation rule for the `vsgvalues` executable, specifying that the runtime binary should be installed into the 'bin' directory relative to the installation prefix. ```CMake install(TARGETS vsgvalues RUNTIME DESTINATION bin) ``` -------------------------------- ### Define Installation Rule for Target - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgoverlay/CMakeLists.txt This command specifies how the `vsgoverlay` executable should be installed. It defines that the executable (runtime component) should be placed in the 'bin' directory within the installation prefix. ```CMake install(TARGETS vsgoverlay RUNTIME DESTINATION bin) ``` -------------------------------- ### Building and Installing vsgcompute Executable (CMake) Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/vk/vsgcompute/CMakeLists.txt This snippet defines the build steps for the `vsgcompute` example using CMake. It sets the source file, creates an executable target named `vsgcompute` using that source, links the target against the required `vsg::vsg` library, and specifies that the built executable's runtime should be installed to the `bin` directory. ```CMake set(SOURCES vsgcompute.cpp) add_executable(vsgcompute ${SOURCES}) target_link_libraries(vsgcompute vsg::vsg) install(TARGETS vsgcompute RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgcolorspace/CMakeLists.txt This command sets up the installation rule for the `vsgcolorspace` executable target. When the `install` target is built, the executable will be copied to the `bin` subdirectory within the installation destination. ```CMake install(TARGETS vsgcolorspace RUNTIME DESTINATION bin) ``` -------------------------------- ### Building and Linking vsgimgui Example - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/ui/vsgimgui_example/CMakeLists.txt This CMake script sets up the build process for the 'vsgimgui_example' executable. It defines the source file, creates the executable target, links it against the necessary vsgImGui and vsg libraries, and conditionally links vsgXchange if found. Finally, it configures the installation path for the executable. ```CMake set(SOURCES vsgimgui_example.cpp ) add_executable(vsgimgui_example ${SOURCES}) target_link_libraries(vsgimgui_example vsgImGui::vsgImGui vsg::vsg) if (vsgXchange_FOUND) target_compile_definitions(vsgimgui_example PRIVATE vsgXchange_FOUND) target_link_libraries(vsgimgui_example vsgXchange::vsgXchange) endif() install(TARGETS vsgimgui_example RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/utils/vsgbuilder/CMakeLists.txt Specifies that the `vsgbuilder` executable target should be installed. The `RUNTIME` keyword ensures it's installed alongside runtime libraries, and `DESTINATION bin` places it in the `bin` subdirectory of the install prefix. ```CMake install(TARGETS vsgbuilder RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing CMake Target Runtime - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/core/vsgvisitorcustomtype/CMakeLists.txt This command sets up an installation rule for the 'vsgvisitorcustomtype' target. It specifies that the executable's runtime components (the executable itself) should be installed to the 'bin' directory within the installation prefix. ```CMake install(TARGETS vsgvisitorcustomtype RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable (CMake) Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgrendertotexturearray/CMakeLists.txt Defines the installation rule for the executable target. It will be installed to the 'bin' directory within the installation prefix. ```CMake install(TARGETS vsgrendertotexturearray RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable (CMake) Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/text/vsgtextgroup/CMakeLists.txt Specifies the installation rule for the 'vsgtextgroup' executable, designating that the runtime binary should be placed in the 'bin' directory within the installation prefix. ```CMake install(TARGETS vsgtextgroup RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/maths/vsgmaths/CMakeLists.txt This command defines the installation rules for the 'vsgmaths' executable target. It specifies that the 'RUNTIME' component (the executable itself) should be installed to the 'bin' directory within the installation prefix determined by the user or CMake configuration. ```CMake install(TARGETS vsgmaths RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Data Directory Source: https://github.com/vsg-dev/vsgexamples/blob/master/CMakeLists.txt Configures the installation of the project's 'data' directory. The entire contents of the data directory are installed into a 'share/vsgExamples' subdirectory under the installation prefix. ```CMake install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/ DESTINATION share/vsgExamples) ``` -------------------------------- ### Configuring vsgextendstate Executable Build with CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/state/vsgextendstate/CMakeLists.txt This CMake snippet configures the build process for the `vsgextendstate` executable. It defines the source file, creates the executable target named `vsgextendstate`, links it to the `vsg::vsg` library, and specifies that the built executable should be installed to the `bin` directory. ```CMake set(SOURCES vsgextendstate.cpp) add_executable(vsgextendstate ${SOURCES}) target_link_libraries(vsgextendstate vsg::vsg) install(TARGETS vsgextendstate RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable Target (CMake) Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/state/vsgtexturearray/CMakeLists.txt Defines the installation rule for the `vsgtexturearray` executable. The `RUNTIME` keyword specifies that the executable itself should be installed. It is directed to be installed into the `bin` subdirectory relative to the installation prefix. ```CMake install(TARGETS vsgtexturearray RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable Target CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/io/vsglog_mt/CMakeLists.txt Defines installation rules for the `vsglog_mt` executable target, specifying where it should be placed after the build process. It specifies that the runtime components of the target should be installed to the 'bin' subdirectory relative to the defined installation prefix. ```CMake install(TARGETS vsglog_mt RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable with CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/utils/vsgintersection/CMakeLists.txt Defines the installation rule for the built 'vsgintersection' executable. It specifies that the runtime component of the target should be installed into the 'bin' directory relative to the installation prefix set during CMake configuration. ```CMake install(TARGETS vsgintersection RUNTIME DESTINATION bin) ``` -------------------------------- ### Building and Installing Executable using CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/commands/vsginterleaved/CMakeLists.txt This snippet defines the build steps for the 'vsginterleaved' executable. It specifies the source file, creates the executable target, links it to the 'vsg::vsg' library, and sets up the installation rule to place the executable in the 'bin' directory. ```CMake set(SOURCES vsginterleaved.cpp) add_executable(vsginterleaved ${SOURCES}) target_link_libraries(vsginterleaved vsg::vsg) install(TARGETS vsginterleaved RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable (CMake) Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/nodes/vsgtextureprojection/CMakeLists.txt Specifies that the `vsgtextureprojection` executable should be installed. It designates the executable as a `RUNTIME` component and sets the installation destination to the `bin` directory. ```CMake install(TARGETS vsgtextureprojection RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing VSG Executable Target with CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/lighting/vsgshadow/CMakeLists.txt This command configures the installation rule for the 'vsgshadow' executable target. It specifies that the runtime component (the executable itself) should be installed into the 'bin' directory within the installation prefix. ```CMake install(TARGETS vsgshadow RUNTIME DESTINATION bin) ``` -------------------------------- ### Configuring Build for VSG Example Executable - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/state/vsgcomputevertex/CMakeLists.txt This CMake script block sets up the build configuration for the `vsgcomputevertex` executable. It specifies the primary source file, links the core `vsg::vsg` library, defines the installation location for the executable, and conditionally adds a compile definition and links the `vsgXchange::vsgXchange` library if the `vsgXchange_FOUND` variable is true. ```CMake set(SOURCES vsgcomputevertex.cpp) add_executable(vsgcomputevertex ${SOURCES}) target_link_libraries(vsgcomputevertex vsg::vsg) install(TARGETS vsgcomputevertex RUNTIME DESTINATION bin) if (vsgXchange_FOUND) target_compile_definitions(vsgcomputevertex PRIVATE vsgXchange_FOUND) target_link_libraries(vsgcomputevertex vsgXchange::vsgXchange) endif() ``` -------------------------------- ### Installing VSG Executable CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/nodes/vsgtiledatabase/CMakeLists.txt Defines an installation rule for the `vsgtiledatabase` executable target. It specifies that the runtime component (the executable itself) should be installed into the `bin` directory within the installation prefix. ```cmake install(TARGETS vsgtiledatabase RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgrendertotexture/CMakeLists.txt This command defines an installation rule for the `vsgrendertotexture` executable target. It specifies that the runtime component (the executable file itself) should be installed into the `bin` directory relative to the installation prefix. ```CMake install(TARGETS vsgrendertotexture RUNTIME DESTINATION bin) ``` -------------------------------- ### Configuring Build for VSG Example using CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/state/vsgdynamicstate/CMakeLists.txt This CMake script sets up the build for the 'vsgdynamicstate' executable. It defines the source file, creates the executable target, links the necessary VSG core and ImGui libraries, conditionally links 'vsgXchange' if available, and finally sets up installation for the executable. ```CMake set(SOURCES vsgdynamicstate.cpp) add_executable(vsgdynamicstate ${SOURCES}) target_link_libraries(vsgdynamicstate vsg::vsg vsgImGui::vsgImGui) if (vsgXchange_FOUND) target_compile_definitions(vsgdynamicstate PRIVATE vsgXchange_FOUND) target_link_libraries(vsgdynamicstate vsgXchange::vsgXchange) endif() install(TARGETS vsgdynamicstate RUNTIME DESTINATION bin) ``` -------------------------------- ### Configuring VSG Example Build using CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/core/vsgallocator/CMakeLists.txt This CMake script sets up the build for the 'vsgallocator' executable. It lists the source file, creates the executable target, links the core 'vsg::vsg' library, and conditionally links the 'vsgXchange::vsgXchange' library and adds a compile definition if 'vsgXchange_FOUND' is true. Finally, it defines the installation rule to place the executable in the 'bin' directory. ```CMake set(SOURCES vsgallocator.cpp ) add_executable(vsgallocator ${SOURCES}) target_link_libraries(vsgallocator vsg::vsg) if (vsgXchange_FOUND) target_compile_definitions(vsgallocator PRIVATE vsgXchange_FOUND) target_link_libraries(vsgallocator vsgXchange::vsgXchange) endif() install(TARGETS vsgallocator RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable Target CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/utils/vsgstoragebuffer/CMakeLists.txt This command configures the installation process, ensuring the built 'vsgstoragebuffer' executable is placed in the 'bin' directory when the 'install' target is run. ```CMake install(TARGETS vsgstoragebuffer RUNTIME DESTINATION bin) ``` -------------------------------- ### Configuring vsghelloworld Executable Build with CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsghelloworld/CMakeLists.txt This CMake snippet configures the build process for the `vsghelloworld` executable. It specifies the source file `vsghelloworld.cpp`, defines the executable target, links against the core `vsg::vsg` library, and conditionally links against `vsgXchange::vsgXchange` if the `vsgXchange_FOUND` variable is set. Finally, it sets up the installation rule to place the executable in the `bin` directory. Dependencies include CMake, VSG library, and potentially vsgXchange. ```cmake set(SOURCES vsghelloworld.cpp ) add_executable(vsghelloworld ${SOURCES}) target_link_libraries(vsghelloworld vsg::vsg) if (vsgXchange_FOUND) target_compile_definitions(vsghelloworld PRIVATE vsgXchange_FOUND) target_link_libraries(vsghelloworld vsgXchange::vsgXchange) endif() install(TARGETS vsghelloworld RUNTIME DESTINATION bin) ``` -------------------------------- ### Running vsgmaths Example - Bash Source: https://github.com/vsg-dev/vsgexamples/blob/master/README.md Executes the vsgmaths example program. This program typically runs simple tests related to the VulkanSceneGraph mathematics functionality. Ensure the vsgExamples/bin directory is in your PATH environment variable. ```bash vsgmaths # run simple tests of vsg/maths functionality ``` -------------------------------- ### Configuring CMake Build for Vsg Example Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/state/vsgdynamictexture/CMakeLists.txt This CMake snippet defines the build steps for the 'vsgdynamictexture' executable. It sets the source file, creates the executable target, links it against the required 'vsg::vsg' library provided by VulkanSceneGraph, and specifies that the executable should be installed to the 'bin' directory. ```CMake set(SOURCES vsgdynamictexture.cpp) add_executable(vsgdynamictexture ${SOURCES}) target_link_libraries(vsgdynamictexture vsg::vsg) install(TARGETS vsgdynamictexture RUNTIME DESTINATION bin) ``` -------------------------------- ### Configuring VSG Device Selection Example CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgdeviceselection/CMakeLists.txt This CMake script defines the source file `vsgdeviceselection.cpp`, creates an executable named `vsgdeviceselection`, and links it against the `vsg::vsg` library. It conditionally links against `vsgXchange::vsgXchange` and adds a compile definition if `vsgXchange_FOUND` is true. Finally, it configures the installation of the executable to the `bin` directory. ```CMake set(SOURCES vsgdeviceselection.cpp ) add_executable(vsgdeviceselection ${SOURCES}) target_link_libraries(vsgdeviceselection vsg::vsg) if (vsgXchange_FOUND) target_compile_definitions(vsgdeviceselection PRIVATE vsgXchange_FOUND) target_link_libraries(vsgdeviceselection vsgXchange::vsgXchange) endif() install(TARGETS vsgdeviceselection RUNTIME DESTINATION bin) ``` -------------------------------- ### Running vsgdraw Example - Bash Source: https://github.com/vsg-dev/vsgexamples/blob/master/README.md Executes the vsgdraw example program. This example is described as a port of the Vulkan Tutorial, demonstrating basic rendering concepts using VulkanSceneGraph. Ensure the vsgExamples/bin directory is in your PATH environment variable. ```bash vsgdraw # run the vsgdraw example (a port of VulkanTutorial) ``` -------------------------------- ### Installing CMake Target Executable - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgwindows/CMakeLists.txt Configures the installation rule for the `vsgwindows` executable target. It specifies that the runtime executable should be installed into the `bin` subdirectory relative to the installation prefix defined during the CMake configuration step. ```CMake install(TARGETS vsgwindows RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable Target in CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/core/vsgmemory/CMakeLists.txt Specifies that the runtime component (the executable) of the `vsgmemory` target should be installed. The `DESTINATION bin` argument tells CMake to place the executable in the `bin` subdirectory of the installation prefix when `make install` is run. ```CMake install(TARGETS vsgmemory RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable Target in CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/core/vsgarrays/CMakeLists.txt Configures the installation rule for the `vsgarrays` executable target. When the 'install' target is built, the executable will be copied to the `bin` directory relative to the installation prefix. This snippet relies on the `vsgarrays` target being defined. ```CMake install(TARGETS vsgarrays RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgmultiviews/CMakeLists.txt Specifies the installation rule for the built vsgmultiviews executable. When the 'install' target is executed, the executable will be copied to the 'bin' directory within the configured installation prefix. ```CMake install(TARGETS vsgmultiviews RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable Target CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/state/vsgdynamicvertex/CMakeLists.txt Specifies the installation rules for the built executable. It designates the 'vsgdynamicvertex' target as a runtime component and sets its installation destination to the 'bin' directory. ```CMake install(TARGETS vsgdynamicvertex RUNTIME DESTINATION bin) ``` -------------------------------- ### Configuring Build with CMake for vsgcustomshaderset Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/utils/vsgcustomshaderset/CMakeLists.txt This CMake snippet configures the build process for the `vsgcustomshaderset` executable. It sets the source files, creates the executable target, links against the core `vsg::vsg` library, and conditionally links against `vsgXchange::vsgXchange` and adds a preprocessor definition if `vsgXchange` is found. Finally, it specifies the installation directory for the built executable. ```CMake set(SOURCES custom_pbr.cpp vsgcustomshaderset.cpp ) add_executable(vsgcustomshaderset ${SOURCES}) target_link_libraries(vsgcustomshaderset vsg::vsg) if (vsgXchange_FOUND) target_compile_definitions(vsgcustomshaderset PRIVATE vsgXchange_FOUND) target_link_libraries(vsgcustomshaderset vsgXchange::vsgXchange) endif() install(TARGETS vsgcustomshaderset RUNTIME DESTINATION bin) ``` -------------------------------- ### Configuring VSG Example Executable Build with CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/threading/vsgdynamicwindows/CMakeLists.txt This CMake script configures the build process for the `vsgdynamicwindows` executable. It sets the source file, defines the executable target, links the required `vsg::vsg` library, and conditionally links `vsgXchange::vsgXchange` if the `vsgXchange_FOUND` variable is true, also adding a corresponding compile definition. Finally, it specifies that the compiled executable should be installed in the `bin` directory. ```CMake set(SOURCES vsgdynamicwindows.cpp ) add_executable(vsgdynamicwindows ${SOURCES}) target_link_libraries(vsgdynamicwindows vsg::vsg) if (vsgXchange_FOUND) target_compile_definitions(vsgdynamicwindows PRIVATE vsgXchange_FOUND) target_link_libraries(vsgdynamicwindows vsgXchange::vsgXchange) endif() install(TARGETS vsgdynamicwindows RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable Target in CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsganaglyphicstereo/CMakeLists.txt Defines an installation rule for the `vsganaglyphicstereo` executable target. It specifies that the executable's runtime component should be installed to the `bin` directory relative to the CMake installation prefix. ```CMake install(TARGETS vsganaglyphicstereo RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable Target in CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/meshshaders/vsgmeshshader/CMakeLists.txt This command configures the installation of the `vsgmeshshader` executable target. It specifies that the runtime component (the executable itself) should be placed in the `bin` directory relative to the installation prefix during the installation process. ```CMake install(TARGETS vsgmeshshader RUNTIME DESTINATION bin) ``` -------------------------------- ### Including VSG Example Subdirectories - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/nodes/CMakeLists.txt This snippet includes various subdirectories containing examples for different VSG features. It unconditionally includes core examples and conditionally includes examples requiring the vsgXchange dependency, such as those for coordinate frames, paged LOD, and tiled databases, checking for the vsgXchange_FOUND CMake variable. ```CMake add_subdirectory(vsgannotation) add_subdirectory(vsggroups) add_subdirectory(vsgtransform) add_subdirectory(vsgtextureprojection) add_subdirectory(vsglayers) if (vsgXchange_FOUND) add_subdirectory(vsgcoordinateframe) add_subdirectory(vsgpagedlod) add_subdirectory(vsgtiledatabase) endif() ``` -------------------------------- ### Setting vsgExamples Environment Variables - Bash Source: https://github.com/vsg-dev/vsgexamples/blob/master/README.md Shows how to set the PATH and VSG_FILE_PATH environment variables in a Unix-like shell. This is necessary to easily run the compiled example executables and allow them to find required data files. Replace /path/to/vsgExamples with the actual installation directory. ```bash export PATH="$PATH:/path/to/vsgExamples/bin" export VSG_FILE_PATH=/path/to/vsgExamples/data ``` -------------------------------- ### Installing Executable CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/utils/vsginstrumentation/CMakeLists.txt Specifies the installation rule for the `vsginstrumentation` executable, instructing CMake to install it as a runtime target to the `bin` subdirectory within the installation prefix. ```CMake install(TARGETS vsginstrumentation RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing CMake Executable Target - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/raytracing/vsgraytracing/CMakeLists.txt The `install` command defines installation rules for the `vsgraytracing` executable. It specifies that the target should be installed as a `RUNTIME` component and placed in the `bin` directory within the installation root. ```CMake install(TARGETS vsgraytracing RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable Target CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgheadless/CMakeLists.txt Specifies that the `vsgheadless` executable target should be installed. The `RUNTIME` keyword indicates it's an application executable, and `DESTINATION bin` sets the installation directory within the install prefix to `bin`. ```CMake install(TARGETS vsgheadless RUNTIME DESTINATION bin) ``` -------------------------------- ### Defining Source Files for VSG Example - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/utils/vsgshaderset/CMakeLists.txt This snippet uses the `set` command to define a list of source files that will be used to build the executable. These files contain the C++ code for the 'vsgshaderset' example. ```CMake set(SOURCES text.cpp flat.cpp phong.cpp pbr.cpp vsgshaderset.cpp ) ``` -------------------------------- ### Building vsgdynamicload Executable (CMake) Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/threading/vsgdynamicload/CMakeLists.txt This CMake script defines the build steps for the `vsgdynamicload` executable. It specifies the source file, links the core vsg library, and conditionally links `vsgXchange` and `Tracy` if they are found. It also configures compile definitions and sets up installation. ```CMake set(SOURCES vsgdynamicload.cpp ) add_executable(vsgdynamicload ${SOURCES}) target_link_libraries(vsgdynamicload vsg::vsg) if (vsgXchange_FOUND) target_compile_definitions(vsgdynamicload PRIVATE vsgXchange_FOUND) target_link_libraries(vsgdynamicload vsgXchange::vsgXchange) endif() if (Tracy_FOUND) target_compile_definitions(vsgdynamicload PRIVATE Tracy_FOUND) target_link_libraries(vsgdynamicload Tracy::TracyClient) endif() install(TARGETS vsgdynamicload RUNTIME DESTINATION bin) ``` -------------------------------- ### Adding Core VSG Examples Subdirectories (CMake) Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/CMakeLists.txt This snippet adds a series of core VSG example project subdirectories to the CMake build. Each `add_subdirectory` command processes the CMakeLists.txt file found within the specified directory, integrating its build targets and settings into the main project build. It covers a wide range of VSG features like headless rendering, multi-GPU, rendering techniques, utilities, and viewer components. ```CMake add_subdirectory(vsgheadless) add_subdirectory(vsgmultigpu) add_subdirectory(vsgmultiviews) add_subdirectory(vsgortho) add_subdirectory(vsgoverlay) add_subdirectory(vsgrendertotexture) add_subdirectory(vsgrendertotexturearray) add_subdirectory(vsgscreenshot) add_subdirectory(vsgoffscreenshot) add_subdirectory(vsgsubpass) add_subdirectory(vsgskybox) add_subdirectory(vsgviewer) add_subdirectory(vsgdeviceselection) add_subdirectory(vsganaglyphicstereo) add_subdirectory(vsgwindows) add_subdirectory(vsgcameras) add_subdirectory(vsgvalidate) add_subdirectory(vsgaxes) add_subdirectory(vsgcolorspace) ``` -------------------------------- ### Configuring and Building vsgdraw Executable - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/commands/vsgdraw/CMakeLists.txt This snippet sets the source file for the executable, defines the executable target, links it against the necessary VSG library (vsg::vsg), and specifies the installation location for the built executable's runtime target. ```CMake set(SOURCES vsgdraw.cpp) add_executable(vsgdraw ${SOURCES}) target_link_libraries(vsgdraw vsg::vsg) install(TARGETS vsgdraw RUNTIME DESTINATION bin) ``` -------------------------------- ### Configure Build for vsgexecutecommands Executable - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/commands/vsgexecutecommands/CMakeLists.txt This snippet defines the source file, creates an executable target named 'vsgexecutecommands', links it against the required 'vsg::vsg' library, and conditionally links against 'vsgXchange::vsgXchange' and adds a compile definition if vsgXchange is found. Finally, it sets up the installation rule for the executable. ```CMake set(SOURCES vsgexecutecommands.cpp ) add_executable(vsgexecutecommands ${SOURCES}) target_link_libraries(vsgexecutecommands vsg::vsg) if (vsgXchange_FOUND) target_compile_definitions(vsgexecutecommands PRIVATE vsgXchange_FOUND) target_link_libraries(vsgexecutecommands vsgXchange::vsgXchange) endif() install(TARGETS vsgexecutecommands RUNTIME DESTINATION bin) ``` -------------------------------- ### Defining Installation Rule CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgscreenshot/CMakeLists.txt This command specifies the installation rule for the `vsgscreenshot` target. It indicates that the executable should be installed as a runtime component into the `bin` directory relative to the installation prefix when `cmake --install` is executed. ```CMake install(TARGETS vsgscreenshot RUNTIME DESTINATION bin) ``` -------------------------------- ### Configuring vsgannotation Executable - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/nodes/vsgannotation/CMakeLists.txt This snippet configures the CMake build process for the `vsgannotation` executable. It defines the source and header files, adds the executable target, links it against the necessary `vsg::vsg` library, and conditionally links against `vsgXchange::vsgXchange` and adds a compile definition if `vsgXchange_FOUND` is true. Finally, it sets up the executable for installation. ```CMake set(HEADERS Annotation.h) set(SOURCES vsgannotation.cpp) add_executable(vsgannotation ${HEADERS} ${SOURCES}) target_link_libraries(vsgannotation vsg::vsg) if (vsgXchange_FOUND) target_compile_definitions(vsgannotation PRIVATE vsgXchange_FOUND) target_link_libraries(vsgannotation vsgXchange::vsgXchange) endif() install(TARGETS vsgannotation RUNTIME DESTINATION bin) ``` -------------------------------- ### Including Example and Test Subdirectories Source: https://github.com/vsg-dev/vsgexamples/blob/master/CMakeLists.txt Includes the CMakeLists.txt files located in various example and test subdirectories. This incorporates the build configurations for individual examples and tests into the main project build. ```CMake add_subdirectory(examples/animation) add_subdirectory(examples/app) add_subdirectory(examples/commands) add_subdirectory(examples/core) add_subdirectory(examples/io) add_subdirectory(examples/lighting) add_subdirectory(examples/maths) add_subdirectory(examples/meshshaders) add_subdirectory(examples/nodes) add_subdirectory(examples/platform) add_subdirectory(examples/raytracing) add_subdirectory(examples/state) add_subdirectory(examples/text) add_subdirectory(examples/threading) add_subdirectory(examples/ui) add_subdirectory(examples/utils) add_subdirectory(examples/vk) add_subdirectory(examples/volume) # VSG tests add_subdirectory(tests) ``` -------------------------------- ### Configuring CMake Build for vsgvisitor Executable Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/core/vsgvisitor/CMakeLists.txt This CMake code block defines the build setup for the `vsgvisitor` executable. It sets the source file, creates the executable target, links it against the required `vsg::vsg` library, and specifies that the executable should be installed in the `bin` directory. ```CMake set(SOURCES vsgvisitor.cpp) add_executable(vsgvisitor ${SOURCES}) target_link_libraries(vsgvisitor vsg::vsg) install(TARGETS vsgvisitor RUNTIME DESTINATION bin) ``` -------------------------------- ### Setting Source Files CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/commands/vsgocclusionquery/CMakeLists.txt Defines the source files required to build the `vsgocclusionquery` executable using the `set` command. Specifies the single source file `vsgocclusionquery.cpp`. ```CMake set(SOURCES vsgocclusionquery.cpp) ``` -------------------------------- ### Defining Executable and Linking in CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgsubpass/CMakeLists.txt This CMake snippet defines the source files for the `vsgsubpass` executable, creates the executable target, links it against the required `vsg::vsg` library, and sets up the installation path for the runtime executable. ```CMake set(SOURCES vsgsubpass.cpp) add_executable(vsgsubpass ${SOURCES}) target_link_libraries(vsgsubpass vsg::vsg) install(TARGETS vsgsubpass RUNTIME DESTINATION bin) ``` -------------------------------- ### Building vsgtriangles Executable with CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/tests/vsgtriangles/CMakeLists.txt This snippet defines the build process for the `vsgtriangles` executable using CMake. It starts by setting the source file (`vsgtriangles.cpp`), creates the executable target, links it against the required `vsg::vsg` library, and specifies that the executable should be installed in the 'bin' directory upon project installation. ```CMake set(SOURCES vsgtriangles.cpp) add_executable(vsgtriangles ${SOURCES}) target_link_libraries(vsgtriangles vsg::vsg) install(TARGETS vsgtriangles RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing CMake Executable Target (CMake) Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/platform/vsgwin32/CMakeLists.txt Specifies that the runtime component (the executable file itself) of the `vsgwin32` target should be installed to the 'bin' directory within the installation prefix when the install command is executed. ```CMake install(TARGETS vsgwin32 RUNTIME DESTINATION bin) ``` -------------------------------- ### Building and Installing vsgpath Executable using CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/io/vsgpath/CMakeLists.txt This snippet defines the source files for the `vsgpath` executable (`vsgpath.cpp`), creates the executable target named `vsgpath`, links it against the required `vsg::vsg` library, and configures the installation of the executable binary to the `bin` directory within the installation prefix. ```CMake set(SOURCES vsgpath.cpp) add_executable(vsgpath ${SOURCES}) target_link_libraries(vsgpath vsg::vsg) install(TARGETS vsgpath RUNTIME DESTINATION bin) ``` -------------------------------- ### Configuring vsgcameras Executable Build - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgcameras/CMakeLists.txt This CMake script defines the build configuration for the `vsgcameras` executable. It specifies the source file (`vsgcameras.cpp`), links the necessary `vsg::vsg` library, conditionally links `vsgXchange::vsgXchange` and adds a compile definition if `vsgXchange_FOUND` is true, and sets up the installation target. ```CMake set(SOURCES vsgcameras.cpp ) add_executable(vsgcameras ${SOURCES}) target_link_libraries(vsgcameras vsg::vsg) if (vsgXchange_FOUND) target_compile_definitions(vsgcameras PRIVATE vsgXchange_FOUND) target_link_libraries(vsgcameras vsgXchange::vsgXchange) endif() install(TARGETS vsgcameras RUNTIME DESTINATION bin) ``` -------------------------------- ### Configuring the vsglights Executable Build (CMake) Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/lighting/vsglights/CMakeLists.txt This snippet sets the source file (`vsglights.cpp`) for the `vsglights` executable, links the core vsg library (`vsg::vsg`), conditionally links `vsgXchange::vsgXchange` based on the `vsgXchange_FOUND` variable, sets a compile definition (`vsgXchange_FOUND`) if the conditional library is linked, and defines the installation target for the executable. ```CMake set(SOURCES vsglights.cpp ) add_executable(vsglights ${SOURCES}) target_link_libraries(vsglights vsg::vsg) if (vsgXchange_FOUND) target_compile_definitions(vsglights PRIVATE vsgXchange_FOUND) target_link_libraries(vsglights vsgXchange::vsgXchange) endif() install(TARGETS vsglights RUNTIME DESTINATION bin) ``` -------------------------------- ### Conditionally Adding Hello World Example (CMake) Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/CMakeLists.txt This snippet conditionally adds the `vsghelloworld` example subdirectory to the CMake build process. The `add_subdirectory` command is executed only if the CMake variable `vsgXchange_FOUND` is evaluated as true, indicating that the required vsgXchange library dependency was successfully located during CMake configuration. This pattern ensures examples with external dependencies are only included when those dependencies are available. ```CMake if (vsgXchange_FOUND) add_subdirectory(vsghelloworld) endif() ``` -------------------------------- ### Configuring CMake Build for vsgtext Executable Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/text/vsgtext/CMakeLists.txt This CMake snippet defines the build target `vsgtext`. It lists the source files required, adds the executable, links it against the necessary VSG libraries (`vsg::vsg` and conditionally `vsgXchange::vsgXchange`), sets a compile definition based on `vsgXchange` availability, and specifies the installation path for the built executable. ```CMake set(SOURCES vsgtext.cpp ) add_executable(vsgtext ${SOURCES}) target_link_libraries(vsgtext vsg::vsg) if (vsgXchange_FOUND) target_compile_definitions(vsgtext PRIVATE vsgXchange_FOUND) target_link_libraries(vsgtext vsgXchange::vsgXchange) endif() install(TARGETS vsgtext RUNTIME DESTINATION bin) ``` -------------------------------- ### Conditionally Adding VSG ImGui Example Subdirectory CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/ui/CMakeLists.txt Adds the 'vsgimgui_example' subdirectory to the CMake build process only if the CMake variable 'vsgImGui_FOUND' is true. This is typically used to include optional examples or features that depend on external libraries like ImGui. ```CMake if (vsgImGui_FOUND) add_subdirectory(vsgimgui_example) endif() ``` -------------------------------- ### Building and Installing Executable CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgvalidate/CMakeLists.txt This CMake snippet defines the source files, creates an executable target named `vsgvalidate`, links it against the `vsg::vsg` library and optionally `vsgXchange::vsgXchange` if `vsgXchange_FOUND` is true, and sets up the installation of the executable to the `bin` directory. ```CMake set(SOURCES vsgvalidate.cpp ) add_executable(vsgvalidate ${SOURCES}) target_link_libraries(vsgvalidate vsg::vsg) if (vsgXchange_FOUND) target_compile_definitions(vsgvalidate PRIVATE vsgXchange_FOUND) target_link_libraries(vsgvalidate vsgXchange::vsgXchange) endif() install(TARGETS vsgvalidate RUNTIME DESTINATION bin) ``` -------------------------------- ### Building and Installing Executable with CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/io/vsglog/CMakeLists.txt This CMake script configures the build and installation steps for the 'vsglog' executable. It sets the source file, defines the executable target name, links it to the required vsg library, and specifies the destination directory for the runtime executable during installation. ```CMake set(SOURCES vsglog.cpp) add_executable(vsglog ${SOURCES}) target_link_libraries(vsglog vsg::vsg) install(TARGETS vsglog RUNTIME DESTINATION bin) ``` -------------------------------- ### Setting Source Files in CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgaxes/CMakeLists.txt This command defines the source files that will be used to build the target executable. The listed files are assigned to the 'SOURCES' variable. ```CMake set(SOURCES vsgaxes.cpp ) ``` -------------------------------- ### Linking Core Libraries in CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgaxes/CMakeLists.txt This command links the previously defined 'vsgaxes' executable target against the core 'vsg::vsg' library. This provides the necessary vsg framework dependencies. ```CMake target_link_libraries(vsgaxes vsg::vsg) ``` -------------------------------- ### Configuring and Building VsgStateSwitch Executable using CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/state/vsgstateswitch/CMakeLists.txt This snippet uses CMake commands to set source files, declare an executable target named `vsgstateswitch`, link it against the `vsg::vsg` library, and conditionally link `vsgXchange::vsgXchange` if `vsgXchange_FOUND` is true. It also defines a private compilation definition for `vsgstateswitch` when `vsgXchange` is found and sets up installation rules for the executable. ```CMake set(SOURCES vsgstateswitch.cpp ) add_executable(vsgstateswitch ${SOURCES}) target_link_libraries(vsgstateswitch vsg::vsg) if (vsgXchange_FOUND) target_compile_definitions(vsgstateswitch PRIVATE vsgXchange_FOUND) target_link_libraries(vsgstateswitch vsgXchange::vsgXchange) endif() install(TARGETS vsgstateswitch RUNTIME DESTINATION bin) ``` -------------------------------- ### Installing Executable with CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/nodes/vsgtransform/CMakeLists.txt Configures the installation of the built `vsgtransform` executable. It specifies that the target should be installed as a runtime executable to the `bin` directory. ```CMake install(TARGETS vsgtransform RUNTIME DESTINATION bin) ``` -------------------------------- ### Adding Unconditional Example Subdirectories CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/state/CMakeLists.txt These lines add specific example project subdirectories to the build configuration unconditionally using the `add_subdirectory` command. Each subdirectory is expected to contain its own CMakeLists.txt file defining its build process, targets, and dependencies. ```CMake add_subdirectory(vsgdynamictexture) add_subdirectory(vsgdynamictexture_cs) add_subdirectory(vsgtexturearray) add_subdirectory(vsgstateswitch) add_subdirectory(vsgcomputevertex) add_subdirectory(vsgdynamicvertex) add_subdirectory(vsgclip) add_subdirectory(vsgextendstate) ``` -------------------------------- ### Install Executable Target in CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/io/vsgio/CMakeLists.txt Configures the installation rule for the `vsgio` executable target. It specifies that the executable's runtime component should be installed into the `bin` subdirectory relative to the installation prefix. Requires the `vsgio` executable target to exist. ```CMake install(TARGETS vsgio RUNTIME DESTINATION bin) ``` -------------------------------- ### Linking Core VSG Library in CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/lighting/vsgshadow/CMakeLists.txt This command links the main vsg library target ('vsg::vsg') to the 'vsgshadow' executable target. This provides the core VulkanSceneGraph functionality required by the example. ```CMake target_link_libraries(vsgshadow vsg::vsg) ``` -------------------------------- ### Setting CMake Source Files - CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/core/vsgvisitorcustomtype/CMakeLists.txt This command sets the CMake variable 'SOURCES' to the list of source files required to build the target executable. It defines the primary source file for the 'vsgvisitorcustomtype' example. ```CMake set(SOURCES vsgvisitorcustomtype.cpp) ``` -------------------------------- ### Setting Source Files (CMake) Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/text/vsgtextgroup/CMakeLists.txt Defines the 'SOURCES' variable, listing the source files required to build the 'vsgtextgroup' executable. ```CMake set(SOURCES vsgtextgroup.cpp ) ``` -------------------------------- ### Setting Up VSG Build Variables Source: https://github.com/vsg-dev/vsgexamples/blob/master/CMakeLists.txt Invokes VSG-specific CMake functions to set up directories and build variables. These functions are provided by the VSG CMake configuration. ```CMake vsg_setup_dir_vars() vsg_setup_build_vars() ``` -------------------------------- ### Defining Project Details in CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/CMakeLists.txt Defines the CMake project name, version, description, and enabled languages. This sets up the core project configuration for the vsgExamples suite. ```CMake project(vsgExamples VERSION 1.1.8 DESCRIPTION "Set of example programs that test and illustrate how to use the VulkanSceneGraph" LANGUAGES CXX C ) ``` -------------------------------- ### Setting Source Files CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/core/vsgvalues/CMakeLists.txt Defines the list of source files required to build the target executable using the CMake `set` command, storing them in the `SOURCES` variable. ```CMake set(SOURCES vsgvalues.cpp) ``` -------------------------------- ### Building Executable and Linking Library (CMake) Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/core/vsgtypes/CMakeLists.txt This CMake snippet defines a target executable named `vsgtypes` using the source file specified by the `SOURCES` variable (`vsgtypes.cpp`). It then links this executable against the `vsg::vsg` target library, which is required for the executable's functionality. Finally, it sets up an installation rule to place the built executable in the 'bin' directory relative to the installation prefix. ```CMake set(SOURCES vsgtypes.cpp) add_executable(vsgtypes ${SOURCES}) target_link_libraries(vsgtypes vsg::vsg) install(TARGETS vsgtypes RUNTIME DESTINATION bin) ``` -------------------------------- ### Defining Source Files for CMake Target Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/ui/vsginput/CMakeLists.txt Sets the list of source files required to build the 'vsginput' executable. The `SOURCES` variable is a standard convention used by subsequent CMake commands. ```CMake set(SOURCES vsginput.cpp ) ``` -------------------------------- ### Configuring Runtime Output Directory Source: https://github.com/vsg-dev/vsgexamples/blob/master/CMakeLists.txt Sets the directory where executable targets will be placed after building. It directs all built executables into a 'bin' subdirectory within the main project binary directory. ```CMake set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) ``` -------------------------------- ### Linking VSG Library CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/state/vsgdynamicvertex/CMakeLists.txt Links the 'vsgdynamicvertex' executable target against the core Visual Scene Graph (VSG) library. This dependency is essential for the example program to use VSG functionalities. ```CMake target_link_libraries(vsgdynamicvertex vsg::vsg) ``` -------------------------------- ### Setting Source Files (CMake) Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/app/vsgrendertotexturearray/CMakeLists.txt Defines the 'SOURCES' variable, which lists the C++ source files required to build the vsgrendertotexturearray executable. ```CMake set(SOURCES vsgrendertotexturearray.cpp ) ``` -------------------------------- ### Linking Libraries to CMake Target Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/ui/vsginput/CMakeLists.txt Links the specified library, `vsg::vsg`, to the 'vsginput' executable target. This ensures that the executable can use functions and classes from the VSG library. ```CMake target_link_libraries(vsginput vsg::vsg) ``` -------------------------------- ### Creating Executable Target in CMake Source: https://github.com/vsg-dev/vsgexamples/blob/master/examples/ui/vsginput/CMakeLists.txt Defines an executable target named 'vsginput' using the source files specified in the `SOURCES` variable. This command registers the target with the build system. ```CMake add_executable(vsginput ${SOURCES}) ```