Code Monkey home page Code Monkey logo

cyberpunk_cmake's Introduction

Cyberpunk CMake Mod Tools

This is a set of CMake scripts & tools to make creating, developing, depending on other mods, and releasing Cyberpunk 2077 mods easier.

Features of this toolset:

  • Configure mod and all components/options from CMakeLists.txt file
  • C++ RED4ext plugin support
    • Integrated hook address-finding with Zoltan
    • Autopopulating VersionInfo template file
  • Input loader support
  • Redscript support
    • Dependency support - compiles submodule redscripts into a local final.redscripts file to lint against
    • Compiles all redscript files into a single "packed" file for easier updating
  • TweakXL support
    • Compiles all .yaml files into a single "packed" file
  • Archive & ArchiveXL support
  • Automatic uninstall.bat script generation at relevant locations (r6/scripts & red4ext/plugins)
  • Easily generate releases with custom formats

Example CMakeLists.txt

cmake_minimum_required(VERSION 3.24)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/deps/cyberpunk_cmake")

include(CyberpunkMod)

project(project_slug VERSION 0.0.0)

configure_mod(
  NAME "Project Name"
  AUTHOR "Your Name"
  URL "https://github.com/your_name/your_repo"
  LICENSE "Licensed under the MIT license. See the license.md in the root project for details."
)

find_program(ZOLTAN_CLANG_EXE NAMES zoltan-clang.exe PATHS "${MOD_TOOLS_DIR}" CACHE)
find_program(CYBERPUNK_2077_EXE NAMES Cyberpunk2077.exe PATHS "${CYBERPUNK_2077_GAME_DIR}/bin/x64" DOC "Cyberpunk2077.exe Executable File" CACHE)
find_program(REDSCRIPT_CLI_EXE NAMES redscript-cli.exe PATHS "${MOD_TOOLS_DIR}" CACHE)

# RED4ext plugin & addresses found by Zoltan
configure_red4ext(red4ext)
configure_red4ext_addresses(Main.cpp Addresses.hpp)

# Redscript 
configure_redscript(redscript)

# Archive/.xl management
configure_archives(mod.archive mod.archive.xl)

# Tweaks
configure_tweaks(tweaks)

# Inputs
configure_inputs(inputs/${MOD_SLUG}.xml)

# Release zip file location/name
configure_release(${MOD_SLUG}_${MOD_VERSION_STR}.zip)

# Copy readme & license to any mod folders created
configure_folder_file(readme.md)
configure_folder_file(license.md)

# Install game_dir to Cyberpunk game directory
configure_install()

# Uninstall script generation
configure_uninstall()

Templates:

cyberpunk_cmake's People

Contributors

jackhumbert avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.