Building (CMake)
This depends mostly on the way the DCC plug-in has to be built. For Nuke the common way to build the C++ plug-in is using CMake. This is an example configuration for that:
cmake_minimum_required(VERSION 3.25 FATAL_ERROR)
project(ExampleUVOverlayProject)
set(CMAKE_CXX_STANDARD ${CPP_BUILD_VERSION})
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_BUILD_TYPE "Release")
find_package(Nuke REQUIRED)
if(WIN32)
add_compile_definitions(NOMINMAX)
add_compile_definitions(_USE_MATH_DEFINES)
add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
set(CMAKE_C_RUNTIME_LIBRARY "MultiThreadedDLL")
endif()
set(CMAKE_MODULE_PATH "CMake;${CMAKE_MODULE_PATH}")
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
include(FetchContent)
FetchContent_Declare(
Corrosion
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
GIT_TAG v0.5
)
FetchContent_MakeAvailable(Corrosion)
corrosion_import_crate(MANIFEST_PATH Cargo.toml CRATE_TYPES "staticlib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
include_directories(./include)
function(add_plugin PLUGIN_NAME)
add_nuke_plugin(${PLUGIN_NAME} ${ARGN})
target_link_libraries(${PLUGIN_NAME} PRIVATE example_uv_overlay )
target_compile_definitions(${PLUGIN_NAME} PRIVATE FN_PLUGIN)
endfunction()
add_plugin(ExampleUVOverlay ExampleUVOverlay.cpp)
This also includes automatic building of the Rust code using corrosion-rs, which makes it easy to bridge the gap between CMake and Rust.
After it has been built, it is also linked using target_link_libraries.
Note: For speed improvements when building it for multiple versions of Nuke: consider building the lib once, then link it manually in each build step per Nuke version.
DCC Oxidizer header files
To generate the header files for the data objects of DCC Oxidizer, built the project at least once with the environment DCC_OXIDIZER_HEADER_FILE set to the path where the header files should be written to. It will generate it automatically. More information at Create build.rs.