dksdk-modules(7)¶
The modules listed here are part of DkSDK CMake as part of a DkSDK subscription.
Attention
Subscriber access is required
Before you can use any of these modules you must have already
done the DkSDK Subscriber Access Guide
.
Setting up your project CMakeLists.txt¶
In your top-level CMakeLists.txt
use the following:
cmake_minimum_required(VERSION 3.22)
# This section goes before you declare your project()
include(FetchContent)
FetchContent_Declare(dksdk-cmake
GIT_REPOSITORY https://.../dksdk-cmake.git # You'll see examples below
GIT_TAG main)
FetchContent_GetProperties(dksdk-cmake)
if (NOT dksdk-cmake_POPULATED)
FetchContent_Populate(dksdk-cmake)
list(APPEND CMAKE_MODULE_PATH ${dksdk-cmake_SOURCE_DIR}/cmake)
endif ()
# ...
project(
# ...
)
The code above:
By modifying the
CMAKE_MODULE_PATH
variable your project has access to all the DkSDK CMake modules listed in this section.Downloads the DkSDK CMake source code locally using the
FetchContent
module.You will want your
FetchContent_Declare()
to look like the following when you have a cloned repository from theDkSDK Subscriber Access Guide
:FetchContent_Declare(dksdk-cmake GIT_REPOSITORY # Pick ONE of the following: # A. Cloned to a personal GitHub account? https://github.com/YOUR_PERSONAL_ACCOUNT/dksdk-cmake.git # B. Cloned to a personal GitLab group? https://gitlab.com/YOUR_PERSONAL_ACCOUNT/dksdk-cmake.git # C. Cloned to an Enterprise GitHub account? https://github.YOURDOMAIN.com/dksdk-cmake.git # D. Cloned to an GitLab Premier or Ultimate account? https://gitlab.com/YOURGROUP/dksdk-cmake.git # E. Cloned to an AWS CodeCommit repository? https://git-codecommit.us-east-2.amazonaws.com/v1/repos/dksdk-cmake GIT_TAG main)
In the rarer situation where you have been given a token to store in your CI provider's secure credentials, your
GIT_REPOSITORY
should look like:FetchContent_Declare(dksdk-cmake GIT_REPOSITORY "https://oauth2:${ENV:DKSDK_CMAKE_TOKEN}@gitlab.com/diskuv/distributions/1.0/dksdk-cmake.git" GIT_TAG main)
and you will need to configure your CI to pass the secure credentials as the environment variable
DKSDK_CMAKE_TOKEN
.
Core Modules¶
These modules are loaded using the include()
command:
For example, use any command from DkSDKProject
by first
doing:
include(DkSDKProject)