Initial project setup
Some checks failed
Build / Build (push) Failing after 31s

This commit is contained in:
2026-05-31 22:33:57 -04:00
commit 2bd126f46f
24 changed files with 794 additions and 0 deletions

24
cmake/CPM.cmake.required Normal file
View File

@@ -0,0 +1,24 @@
# SPDX-License-Identifier: MIT
#
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors
set(CPM_DOWNLOAD_VERSION 0.42.1)
set(CPM_HASH_SUM "f3a6dcc6a04ce9e7f51a127307fa4f699fb2bade357a8eb4c5b45df76e1dc6a5")
if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
else()
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
endif()
# Expand relative path. This is important if the provided path contains a tilde (~)
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
file(DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
)
include(${CPM_DOWNLOAD_LOCATION})

View File

@@ -0,0 +1,14 @@
##### SETUP COMPILE COMMANDS #####
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
endif()
if(EXISTS "${CMAKE_BINARY_DIR}/compile_commands.json")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
file(
COPY "${CMAKE_BINARY_DIR}/compile_commands.json"
DESTINATION "${CMAKE_BINARY_DIR}/../"
)
endif()
endif()

11
cmake/copy_files.cmake Normal file
View File

@@ -0,0 +1,11 @@
function(create_copy_folder_target target_name src dst)
add_custom_target(${target_name}
COMMAND
${CMAKE_COMMAND}
-E copy_directory
${src}
${dst}
COMMENT "Copying ${src} to ${dst}"
)
endfunction()

11
cmake/dpp.cmake Normal file
View File

@@ -0,0 +1,11 @@
CPMAddPackage(
URI "gh:brainboxdotcc/DPP@10.1.5"
OPTIONS "BUILD_VOICE_SUPPORT ON"
OPTIONS "RUN_LDCONFIG OFF"
OPTIONS "DPP_INSTALL OFF"
OPTIONS "DPP_BUILD_TEST OFF"
OPTIONS "DPP_NO_VCPKG ON"
OPTIONS "DPP_NO_CONAN ON"
OPTIONS "DPP_FORMATTERS ON"
OPTIONS "DPP_USE_PCH ON"
)

14
cmake/macros.cmake Normal file
View File

@@ -0,0 +1,14 @@
macro(SET_OUTPUT_NAMES projname)
if (UNIX)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set_target_properties(${projname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/Debug")
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set_target_properties(${projname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/Release")
endif()
if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set_target_properties(${projname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/Relwithdeb")
endif()
endif()
endmacro()

10
cmake/platform.cmake Normal file
View File

@@ -0,0 +1,10 @@
message("System name: ${CMAKE_HOST_SYSTEM_NAME}")
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
add_compile_definitions(PLATFORM_WINDOWS)
elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
add_compile_definitions(PLATFORM_LINUX)
elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
add_compile_definitions(PLATFORM_MACOS)
else()
add_compile_definitions(PLATFORM_UNKNOWN)
endif()