Skip to content

Commit

Permalink
feat: replace libvpkedit, sapp, speedykeyv with sourcepp
Browse files Browse the repository at this point in the history
  • Loading branch information
craftablescience committed Jul 4, 2024
1 parent 1b724fb commit ab8dce0
Show file tree
Hide file tree
Showing 139 changed files with 168 additions and 8,929 deletions.
12 changes: 0 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,3 @@ CMakeSettings.json
build/
cmake-build-*/
out/

# CSharp
/src/lib/lang/csharp/**/bin
/src/lib/lang/csharp/**/obj
/src/lib/lang/csharp/**/TestResults
/src/lib/lang/csharp/**/*.DotSettings.user

# Generated
generated/
/include/vpkedit/Version.h
/include/vpkeditc/Version.h
/src/lib/lang/csharp/libvpkedit/libvpkedit.csproj
30 changes: 9 additions & 21 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
[submodule "src/cli/thirdparty/argparse"]
path = src/cli/thirdparty/argparse
url = https://github.com/p-ranav/argparse
[submodule "src/gui/thirdparty/sapp"]
path = src/gui/thirdparty/sapp
url = https://github.com/craftablescience/SteamAppPathProvider
[submodule "src/gui/thirdparty/speedykeyv"]
path = src/gui/thirdparty/speedykeyv
url = https://github.com/ozxybox/SpeedyKeyV
[submodule "src/gui/thirdparty/sourcepp"]
path = src/gui/thirdparty/sourcepp
url = https://github.com/craftablescience/sourcepp
[submodule "src/lib/thirdparty/minizip-ng"]
path = src/lib/thirdparty/minizip-ng
url = https://github.com/zlib-ng/minizip-ng
[submodule "src/gui/thirdparty/miniaudio"]
path = src/gui/thirdparty/miniaudio
url = https://github.com/mackron/miniaudio
[submodule "src/gui/thirdparty/discord"]
path = src/gui/thirdparty/discord
url = https://github.com/craftablescience/discord-rpc-clean
[submodule "src/cli/thirdparty/indicators"]
path = src/cli/thirdparty/indicators
url = https://github.com/p-ranav/indicators
[submodule "src/lib/thirdparty/cryptopp"]
path = src/lib/thirdparty/cryptopp
url = https://github.com/abdes/cryptopp-cmake
[submodule "src/gui/thirdparty/discord"]
path = src/gui/thirdparty/discord
url = https://github.com/craftablescience/discord-rpc-clean
[submodule "src/gui/thirdparty/miniaudio"]
path = src/gui/thirdparty/miniaudio
url = https://github.com/mackron/miniaudio
[submodule "src/shared/thirdparty/sourcepp"]
path = src/shared/thirdparty/sourcepp
url = https://github.com/craftablescience/sourcepp
45 changes: 8 additions & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25 FATAL_ERROR)

# Create project
project(vpkedit
DESCRIPTION "A library and CLI/GUI tool to create, read, and write several pack file formats."
DESCRIPTION "A CLI/GUI tool to create, read, and write several pack file formats."
VERSION "4.2.2"
HOMEPAGE_URL "https://github.com/craftablescience/VPKEdit")
set(CMAKE_CXX_STANDARD 20)
Expand Down Expand Up @@ -31,12 +31,7 @@ set(PROJECT_ORGANIZATION_NAME "craftablescience" CACHE STRING "" FORCE)
set(PROJECT_HOMEPAGE_URL_API "https://api.github.com/repos/craftablescience/VPKEdit" CACHE STRING "" FORCE)

# Options
option(VPKEDIT_BUILD_LIBC "Build VPKEdit C wrapper library" OFF)
option(VPKEDIT_BUILD_CLI "Build VPKEdit CLI application" ON)
option(VPKEDIT_BUILD_GUI "Build VPKEdit GUI application" ON)
option(VPKEDIT_BUILD_INSTALLER "Build installer for VPKEdit GUI application" ON)
option(VPKEDIT_BUILD_EXAMPLE "Build library examples" OFF)
option(VPKEDIT_BUILD_TESTS "Run library tests" OFF)
option(VPKEDIT_BUILD_FOR_STRATA_SOURCE "Build VPKEdit with the intent of the CLI/GUI going into the bin folder of a Strata Source game" OFF)
option(VPKEDIT_USE_LTO "Build VPKEdit with link-time optimization enabled" OFF)

Expand Down Expand Up @@ -109,46 +104,22 @@ function(vpkedit_configure_target TARGET)
# Don't show the console when running the executable
if(MSVC AND TARGET_IS_GUI)
target_link_options(
${PROJECT_NAME} PRIVATE
${TARGET} PRIVATE
"/ENTRY:mainCRTStartup")
endif()
endif()
endfunction()

# libvpkedit
include("${CMAKE_CURRENT_SOURCE_DIR}/src/lib/_lib.cmake")

# libvpkeditc
if(VPKEDIT_BUILD_LIBC)
include("${CMAKE_CURRENT_SOURCE_DIR}/src/lib/lang/c/_c.cmake")

# libvpkeditcs
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/src/lib/lang/csharp/libvpkedit/libvpkedit.csproj.in"
"${CMAKE_CURRENT_SOURCE_DIR}/src/lib/lang/csharp/libvpkedit/libvpkedit.csproj")
endif()
# Shared
include("${CMAKE_CURRENT_SOURCE_DIR}/src/shared/_shared.cmake")

# vpkeditcli
if(VPKEDIT_BUILD_CLI)
include("${CMAKE_CURRENT_SOURCE_DIR}/src/cli/_cli.cmake")
endif()
include("${CMAKE_CURRENT_SOURCE_DIR}/src/cli/_cli.cmake")

# vpkedit
if(VPKEDIT_BUILD_GUI)
include("${CMAKE_CURRENT_SOURCE_DIR}/src/gui/_gui.cmake")
endif()
include("${CMAKE_CURRENT_SOURCE_DIR}/src/gui/_gui.cmake")

# Installer (GUI only, or CLI+GUI)
if(VPKEDIT_BUILD_GUI AND VPKEDIT_BUILD_INSTALLER)
# Installer
if(VPKEDIT_BUILD_INSTALLER)
include("${CMAKE_CURRENT_SOURCE_DIR}/src/installer/_installer.cmake")
endif()

# vpkedit_example
if (VPKEDIT_BUILD_EXAMPLE)
include("${CMAKE_CURRENT_SOURCE_DIR}/example/_example.cmake")
endif()

# vpkedit_test
if(VPKEDIT_BUILD_TESTS)
include("${CMAKE_CURRENT_SOURCE_DIR}/test/_test.cmake")
endif()
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,4 @@ Any contributors will be added to the credits in the form of a text file shipped

## Backend

This tool is powered by an open-source pack file editing library, `libvpkedit`. This library's code is stored in this same repository,
written in C++20 and also under the MIT license. Its code was initially based off of [ValvePak](https://github.com/SteamDatabase/ValvePak)
and the Valve Developer Wiki (see [the credits](https://github.com/craftablescience/VPKEdit/blob/main/CREDITS.md) for more information).

A C wrapper library, `libvpkeditc`, is also present in this repository, and its compilation can be enabled in the CMake options. It translates the C++ library
into a C interface with largely minimal to no overhead.
This tool is powered by a collection of open-source C++20 Source engine parsers called [sourcepp](https://github.com/craftablescience/sourcepp).
15 changes: 0 additions & 15 deletions example/Example.cpp

This file was deleted.

178 changes: 0 additions & 178 deletions example/SamplePackFileImpl.cpp

This file was deleted.

Loading

0 comments on commit ab8dce0

Please sign in to comment.