Skip to content

Commit 3a0ca4e

Browse files
committed
Revert CPM changes
1 parent 6ef0b9c commit 3a0ca4e

599 files changed

Lines changed: 257553 additions & 1574 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/buildtest.yml

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333
#
3434
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
3535
matrix:
36-
os: [ ubuntu-latest, windows-latest, macos-latest ]
37-
build_type: [ Release ]
38-
c_compiler: [ gcc, clang, cl ]
36+
os: [ubuntu-latest, windows-latest, macos-latest]
37+
build_type: [Release]
38+
c_compiler: [gcc, clang, cl]
3939
include:
4040
- os: windows-latest
4141
c_compiler: cl
@@ -62,41 +62,40 @@ jobs:
6262
c_compiler: cl
6363

6464
steps:
65-
- uses: actions/checkout@v4
65+
- uses: actions/checkout@v4
6666

67-
- name: Install dependencies
68-
# Install the dependencies required for the linux build.
69-
shell: bash
70-
run: |
71-
if [ "$RUNNER_OS" == "Linux" ]; then
72-
sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libwayland-dev libxkbcommon-dev libgtk-3-dev python3-jinja2
73-
else
74-
python -m pip install --upgrade jinja2
75-
fi
67+
- name: Install dependencies
68+
# Install the dependencies required for the linux build.
69+
shell: bash
70+
run: |
71+
if [ "$RUNNER_OS" == "Linux" ]; then
72+
sudo apt update
73+
sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libwayland-dev libxkbcommon-dev libgtk-3-dev
74+
fi
7675
77-
- name: Set reusable strings
78-
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
79-
id: strings
80-
shell: bash
81-
run: |
82-
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
76+
- name: Set reusable strings
77+
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
78+
id: strings
79+
shell: bash
80+
run: |
81+
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
8382
84-
- name: Configure CMake
85-
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
86-
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
87-
run: >
88-
cmake -B ${{ steps.strings.outputs.build-output-dir }}
89-
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
90-
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
91-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
92-
-S ${{ github.workspace }}
83+
- name: Configure CMake
84+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
85+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
86+
run: >
87+
cmake -B ${{ steps.strings.outputs.build-output-dir }}
88+
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
89+
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
90+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
91+
-S ${{ github.workspace }}
9392
94-
- name: Build
95-
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
96-
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
93+
- name: Build
94+
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
95+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
9796

98-
- name: Test
99-
working-directory: ${{ steps.strings.outputs.build-output-dir }}
100-
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
101-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
102-
run: ctest --build-config ${{ matrix.build_type }}
97+
- name: Test
98+
working-directory: ${{ steps.strings.outputs.build-output-dir }}
99+
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
100+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
101+
run: ctest --build-config ${{ matrix.build_type }}

.gitignore

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
# IDE Files
2-
/.idea/
3-
/.vscode/
4-
/.vs/
5-
/CMakeSettings.json
1+
# Project Files
2+
.zed
3+
.vscode
4+
.vs
5+
.idea
6+
*.temp
7+
*.rdproj
68

7-
# Build Files
9+
# Compiled Files
810
/cmake-build-*/
911
/bin/
1012
/out/
1113
/build/
1214
/build*/
13-
/Testing/
15+
/Testing/

CMakeLists.txt

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,62 @@
11
cmake_minimum_required(VERSION 3.30)
2-
project(LithoGen LANGUAGES C CXX)
2+
project(LithoGen VERSION 1.0.1 LANGUAGES CXX)
33

4+
# Refuse to compile on older versions of C++.
45
set(CMAKE_CXX_STANDARD 23)
56
set(CMAKE_CXX_STANDARD_REQUIRED ON)
67

7-
include(cmake/CPM.cmake)
8-
include(cmake/deps.cmake) # Manages project dependencies.
8+
# Configuration for GLFW.
9+
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
10+
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
11+
12+
# Configuration for battery embed.
13+
set(B_PRODUCTION_MODE ON CACHE BOOL "" FORCE)
14+
15+
# Include project dependencies.
16+
add_subdirectory(deps/battery-embed-1.2.19 EXCLUDE_FROM_ALL)
17+
add_subdirectory(deps/glad-2.0.8 EXCLUDE_FROM_ALL)
18+
add_subdirectory(deps/glfw-3.4 EXCLUDE_FROM_ALL)
19+
add_subdirectory(deps/glm-1.0.1 EXCLUDE_FROM_ALL)
20+
add_subdirectory(deps/imgui-1.91.8 EXCLUDE_FROM_ALL)
21+
add_subdirectory(deps/microstl EXCLUDE_FROM_ALL)
22+
add_subdirectory(deps/nativefiledialog-extended-1.2.1 EXCLUDE_FROM_ALL)
23+
add_subdirectory(deps/stb_image-2.30 EXCLUDE_FROM_ALL)
924

1025
# Automatically recursively gather all source files under src.
11-
file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/src/*)
26+
file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
1227

13-
add_executable(LithoGen_App ${SOURCE_FILES})
28+
if (WIN32) # Windows
29+
# Create the executable, with additional files for Windows.
30+
add_executable(LithoGen_App ${SOURCE_FILES} res/resource.rc)
31+
32+
# Windows specific compiler definitions:
33+
# WIN32_LEAN_AND_MEAN - Active optional windows api optimisation features.
34+
# OS_WINDOWS - For the codebase to ask if the program will be compiling to windows.
35+
# GLFW_EXPOSE_NATIVE_WIN32 - Allows the codebase to access the native windows handle through GLFW.
36+
target_compile_definitions(LithoGen_App PRIVATE OS_WINDOWS WIN32_LEAN_AND_MEAN)
37+
38+
# Link the Windows Desktop Window Manager API to interface with the title bar.
39+
target_link_libraries(LithoGen_App PRIVATE dwmapi)
40+
41+
# Set the application type to windowed and force the use of the default entry point main().
42+
#target_link_options(LithoGen_App PRIVATE "/subsystem:windows" PRIVATE "/entry:mainCRTStartup")
43+
elseif (UNIX AND NOT APPLE) # Linux
44+
# Create the executable.
45+
add_executable(LithoGen_App ${SOURCE_FILES})
46+
elseif (APPLE) # MacOS
47+
# Create the executable.
48+
add_executable(LithoGen_App ${SOURCE_FILES})
49+
endif ()
1450

1551
# GLFW_INCLUDE_NONE - Prevent a compatability issue between Glad and GLFW.
16-
target_compile_definitions(LithoGen_App PRIVATE "GLFW_INCLUDE_NONE")
52+
target_compile_definitions(LithoGen_App PRIVATE GLFW_INCLUDE_NONE)
1753

1854
# Embed these files into the executable.
19-
b_embed(LithoGen_App "res/shaders/vertex.glsl")
20-
b_embed(LithoGen_App "res/shaders/fragment.glsl")
55+
b_embed(LithoGen_App res/shaders/vertex.glsl)
56+
b_embed(LithoGen_App res/shaders/fragment.glsl)
2157

2258
# Manually set the file name of the executable.
2359
set_target_properties(LithoGen_App PROPERTIES OUTPUT_NAME "lithogen")
2460

2561
# Link dependencies to the application.
2662
target_link_libraries(LithoGen_App PRIVATE glad glfw glm imgui microstl nfd stb_image)
27-
28-
if (WIN32) # Windows
29-
target_sources(LithoGen_App PRIVATE "res/resource.rc")
30-
31-
# WIN32_LEAN_AND_MEAN - Active optional windows api optimisation features.
32-
target_compile_definitions(LithoGen_App PRIVATE "WIN32_LEAN_AND_MEAN")
33-
34-
# Set the application type to windowed and force the use of the default entry point main().
35-
#target_link_options(LithoGen_App PRIVATE "/subsystem:windows" PRIVATE "/entry:mainCRTStartup")
36-
endif ()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ The official name, source and version of the project dependencies.
2929
| Dear ImGui | 1.91.8 | https://github.com/ocornut/imgui |
3030
| microstl | Commit ec3868a | https://github.com/cry-inc/microstl/tree/ec3868a14d8eff40f7945b39758edf623f609b6f |
3131
| Native File Dialog Extended | 1.2.1 | https://github.com/btzy/nativefiledialog-extended |
32-
| std_image | 2.30 | https://github.com/nothings/stb |
32+
| std_image | 2.30 | https://github.com/nothings/stb |

0 commit comments

Comments
 (0)