-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
348 additions
and
529 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
build/ | ||
install/ | ||
.vscode/ | ||
.vscode/ | ||
.vs/ | ||
out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,131 +1,45 @@ | ||
# This file is automatically generated from cmake.toml - DO NOT EDIT | ||
# See https://github.com/build-cpp/cmkr for more information | ||
|
||
cmake_minimum_required(VERSION 3.15) | ||
|
||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) | ||
message(FATAL_ERROR "In-tree builds are not supported. Run CMake from a separate directory: cmake -B build") | ||
endif() | ||
|
||
# Regenerate CMakeLists.txt automatically in the root project | ||
set(CMKR_ROOT_PROJECT OFF) | ||
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) | ||
set(CMKR_ROOT_PROJECT ON) | ||
|
||
# Bootstrap cmkr | ||
include(cmkr.cmake OPTIONAL RESULT_VARIABLE CMKR_INCLUDE_RESULT) | ||
if(CMKR_INCLUDE_RESULT) | ||
cmkr() | ||
endif() | ||
|
||
# Enable folder support | ||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
endif() | ||
|
||
# Create a configure-time dependency on cmake.toml to improve IDE support | ||
if(CMKR_ROOT_PROJECT) | ||
configure_file(cmake.toml cmake.toml COPYONLY) | ||
endif() | ||
|
||
cmake_minimum_required(VERSION 3.25) | ||
project(reframework-d2d) | ||
|
||
set(VCPKG_TARGET_TRIPLET x64-windows-static) | ||
|
||
if(CMKR_ROOT_PROJECT AND NOT CMKR_DISABLE_VCPKG) | ||
include(FetchContent) | ||
message(STATUS "Fetching vcpkg...") | ||
FetchContent_Declare(vcpkg URL "https://github.com/microsoft/vcpkg/archive/refs/tags/2022.06.15.tar.gz") | ||
FetchContent_MakeAvailable(vcpkg) | ||
include("${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake") | ||
endif() | ||
|
||
# Packages | ||
find_package(sol2 REQUIRED CONFIG) | ||
|
||
find_package(Lua REQUIRED) | ||
|
||
find_package(utf8cpp REQUIRED CONFIG) | ||
|
||
# Target reframework | ||
set(CMKR_TARGET reframework) | ||
set(reframework_SOURCES "") | ||
|
||
set(CMKR_SOURCES ${reframework_SOURCES}) | ||
add_library(reframework INTERFACE) | ||
|
||
if(reframework_SOURCES) | ||
target_sources(reframework INTERFACE ${reframework_SOURCES}) | ||
endif() | ||
|
||
target_include_directories(reframework INTERFACE | ||
"deps/reframework/include" | ||
include (cmake/CPM.cmake) | ||
|
||
CPMAddPackage("gh:nemtrif/[email protected]") | ||
CPMAddPackage("gh:ThePhD/[email protected]") | ||
CPMAddPackage( | ||
NAME lua | ||
GITHUB_REPOSITORY lua/lua | ||
VERSION 5.4.6 | ||
DOWNLOAD_ONLY YES | ||
) | ||
|
||
unset(CMKR_TARGET) | ||
unset(CMKR_SOURCES) | ||
|
||
# Target reframework-d2d | ||
set(CMKR_TARGET reframework-d2d) | ||
set(reframework-d2d_SOURCES "") | ||
|
||
list(APPEND reframework-d2d_SOURCES | ||
"src/D2DFont.cpp" | ||
"src/D2DImage.cpp" | ||
"src/D2DPainter.cpp" | ||
"src/D3D12Renderer.cpp" | ||
"src/DrawList.cpp" | ||
"src/Plugin.cpp" | ||
"src/D2DFont.hpp" | ||
"src/D2DImage.hpp" | ||
"src/D2DPainter.hpp" | ||
"src/D3D12Renderer.hpp" | ||
"src/D3D12Shaders.hpp" | ||
"src/DrawList.hpp" | ||
"src/LruCache.hpp" | ||
) | ||
if (lua_ADDED) | ||
FILE(GLOB lua_sources ${lua_SOURCE_DIR}/*.c) | ||
list(REMOVE_ITEM lua_sources "${lua_SOURCE_DIR}/lua.c" "${lua_SOURCE_DIR}/luac.c" "${lua_SOURCE_DIR}/onelua.c") | ||
add_library(lua STATIC ${lua_sources}) | ||
|
||
list(APPEND reframework-d2d_SOURCES | ||
cmake.toml | ||
) | ||
|
||
set(CMKR_SOURCES ${reframework-d2d_SOURCES}) | ||
add_library(reframework-d2d SHARED) | ||
|
||
if(reframework-d2d_SOURCES) | ||
target_sources(reframework-d2d PRIVATE ${reframework-d2d_SOURCES}) | ||
target_include_directories(lua | ||
PUBLIC | ||
$<BUILD_INTERFACE:${lua_SOURCE_DIR}> | ||
) | ||
endif() | ||
|
||
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${reframework-d2d_SOURCES}) | ||
|
||
target_compile_features(reframework-d2d PUBLIC | ||
cxx_std_20 | ||
add_library(reframework-d2d SHARED | ||
src/D2DFont.cpp | ||
src/D2DImage.cpp | ||
src/D2DPainter.cpp | ||
src/D3D12Renderer.cpp | ||
src/DrawList.cpp | ||
src/Plugin.cpp | ||
) | ||
|
||
target_include_directories(reframework-d2d PUBLIC | ||
${LUA_INCLUDE_DIR} | ||
target_include_directories(reframework-d2d PRIVATE | ||
src | ||
deps/reframework/include | ||
) | ||
|
||
target_link_libraries(reframework-d2d PUBLIC | ||
sol2::sol2 | ||
${LUA_LIBRARIES} | ||
utf8cpp | ||
reframework | ||
d2d1 | ||
dwrite | ||
d3d11 | ||
d3d12 | ||
dxgi | ||
d3dcompiler | ||
) | ||
|
||
unset(CMKR_TARGET) | ||
unset(CMKR_SOURCES) | ||
target_compile_features(reframework-d2d PRIVATE cxx_std_20) | ||
target_link_libraries(reframework-d2d PRIVATE utf8cpp sol2::sol2 lua d2d1 dwrite d3d11 d3d12 dxgi d3dcompiler) | ||
|
||
install( | ||
TARGETS | ||
reframework-d2d | ||
DESTINATION | ||
bin | ||
COMPONENT | ||
reframework-d2d | ||
TARGETS reframework-d2d | ||
DESTINATION bin | ||
COMPONENT reframework-d2d | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# SPDX-License-Identifier: MIT | ||
# | ||
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors | ||
|
||
set(CPM_DOWNLOAD_VERSION 0.39.0) | ||
set(CPM_HASH_SUM "66639bcac9dd2907b2918de466783554c1334446b9874e90d38e3778d404c2ef") | ||
|
||
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}) |
Oops, something went wrong.