Skip to content

QuantumFelidae/FetchDiligent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FetchDiligent

A short CMake utility to fetch, build, and link Diligent Engine within your own projects.

Remote Usage

The most simple usage just exposes the DiligentCore targets

include(FetchContent)
FetchContent_Declare(
    Diligent
    GIT_REPOSITORY https://github.com/QuantumFelidae/FetchDiligent.git
    GIT_TAG master
)
FetchContent_MakeAvailable(Diligent)

Now, DiligentCore targets are available to link against. For example:

target_link_libraries(main PRIVATE Diligent-GraphicsEngineVk-shared)

Extra Diligent Modules

Obtaining the other Diligent modules, DiligentTools and DiligentFx is done by setting the appropriate variables before calling MakeAvailable. For example:

include(FetchContent)
FetchContent_Declare(
    Diligent
    GIT_REPOSITORY https://github.com/QuantumFelidae/FetchDiligent.git
    GIT_TAG master
)
set(FETCH_DILIGENT_TOOLS TRUE)
set(FETCH_DILIGENT_FX TRUE)
FetchContent_MakeAvailable(Diligent)

Now, targets from these modules can be linked in your project.

target_link_libraries(main PRIVATE 
                        Diligent-Imgui
                        Diligent-AssetLoader 
                        Diligent-GraphicsEngineVk-shared)

Versioning

To pin a specific git tag to pull from, one can set the variables DILIGENT_CORE_GIT_TAG, DILIGENT_TOOLS_GIT_TAG, or DILIGENT_FX_GIT_TAG

Local Usage

If the CMakeLists.txt is renamed FetchDiligent.cmake, and placed in your module path, this simplifies to

cmake_minimum_required (VERSION 3.26)

project ("Sample")
list(APPEND CMAKE_MODULE_PATH "<PATH>")
set(FETCH_DILIGENT_TOOLS TRUE)
include(FetchDiligent)

add_executable (main ${MAIN_SOURCES})


target_link_libraries(main PRIVATE 
                        Diligent-Imgui
                        Diligent-AssetLoader 
                        Diligent-GraphicsEngineVk-shared)

Local Diligent Folders

If you want the tool to be completely offline by forcing it to pull from locally cloned versions of the Diligent repositories, setting FETCHCONTENT_SOURCE_DIR_<uppercaseName>, where <uppercaseName> is DILIGENTCORE, DILIGENTTOOLS, or DILIGENTFX, will override the remote source information provided, and will be instead pulled from the provided path.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages