This repository has been archived by the owner on Jan 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup 🧹 and add documentations 📕
- Loading branch information
1 parent
69b6438
commit 272de18
Showing
17 changed files
with
1,427 additions
and
1,318 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,87 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
include(FetchContent) | ||
|
||
project(2DComputerGraphicsAndAnimation) | ||
project(HexagonPaint | ||
LANGUAGES CXX C) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") | ||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") | ||
set(FETCHCONTENT_QUIET OFF) | ||
|
||
set(BUILD_SHARED_LIBS FALSE) | ||
|
||
# SFML | ||
set(SFML_VERSION "2.5.1") | ||
FetchContent_Declare( | ||
sfml | ||
GIT_REPOSITORY "https://github.com/SFML/SFML.git" | ||
GIT_TAG "${SFML_VERSION}" | ||
sfml | ||
GIT_REPOSITORY "https://github.com/SFML/SFML.git" | ||
GIT_TAG "${SFML_VERSION}" | ||
) | ||
FetchContent_GetProperties(sfml) | ||
if(NOT sfml_POPULATED) | ||
if (NOT sfml_POPULATED) | ||
FetchContent_Populate(sfml) | ||
add_subdirectory("${sfml_SOURCE_DIR}" "${sfml_BINARY_DIR}") | ||
endif() | ||
endif () | ||
|
||
# ImGui | ||
set(IMGUI_VERSION "1.74") | ||
FetchContent_Declare( | ||
imgui | ||
GIT_REPOSITORY "https://github.com/ocornut/imgui.git" | ||
GIT_TAG "v${IMGUI_VERSION}" | ||
GIT_TAG "v${IMGUI_VERSION}" | ||
) | ||
FetchContent_GetProperties(imgui) | ||
if(NOT imgui_POPULATED) | ||
if (NOT imgui_POPULATED) | ||
FetchContent_Populate(imgui) | ||
#add_subdirectory("${imgui_SOURCE_DIR}" "${imgui_BINARY_DIR}") | ||
endif() | ||
endif () | ||
|
||
# ImGui-SFML | ||
set(IMGUI_SFML_VERSION "2.1") | ||
FetchContent_Declare( | ||
imgui_sfml | ||
GIT_REPOSITORY "https://github.com/eliasdaler/imgui-sfml.git" | ||
GIT_TAG "v${IMGUI_SFML_VERSION}" | ||
GIT_TAG "v${IMGUI_SFML_VERSION}" | ||
) | ||
|
||
set(IMGUI_DIR ${imgui_SOURCE_DIR}) | ||
set(IMGUI_SFML_FIND_SFML CACHE BOOL FALSE) | ||
|
||
FetchContent_GetProperties(imgui_sfml) | ||
if(NOT imgui_sfml_POPULATED) | ||
if (NOT imgui_sfml_POPULATED) | ||
FetchContent_Populate(imgui_sfml) | ||
add_subdirectory("${imgui_sfml_SOURCE_DIR}" "${imgui_sfml_BINARY_DIR}") | ||
endif() | ||
endif () | ||
|
||
set(SOURCE | ||
"src/main.cpp" | ||
) | ||
add_executable(HexagonPaint | ||
|
||
add_executable(2DComputerGraphicsAndAnimationApp | ||
"${SOURCE}" | ||
) | ||
"lib/tinyfiledialogs/tinyfiledialogs.c" | ||
"lib/lodepng/lodepng.cpp" | ||
"lib/lodepng/lodepng_fuzzer.cpp" | ||
"lib/lodepng/lodepng_util.cpp" | ||
|
||
target_link_libraries(2DComputerGraphicsAndAnimationApp | ||
PRIVATE | ||
"sfml-graphics" | ||
"sfml-system" | ||
"sfml-window" | ||
ImGui-SFML::ImGui-SFML | ||
) | ||
"src/main.cpp" | ||
"src/helpers.cpp" | ||
"src/helpers.hpp" | ||
"src/canvas.cpp" | ||
"src/canvas.hpp" | ||
"src/color.hpp" | ||
"src/shape/line.cpp" | ||
"src/shape/line.hpp" | ||
"src/fps.cpp" | ||
"src/fps.hpp" | ||
"src/application.cpp" | ||
"src/application.hpp") | ||
|
||
target_include_directories(HexagonPaint | ||
PRIVATE "lib/tinyfiledialogs" | ||
PRIVATE "lib/stb" | ||
PRIVATE "lib/lodepng") | ||
|
||
if(MSVC) | ||
configure_file( | ||
${imgui_sfml_BINARY_DIR}/ImGui-SFML.dll | ||
ImGui-SFML.dll | ||
COPYONLY | ||
) | ||
configure_file( | ||
${sfml_BINARY_DIR}/lib/sfml-graphics-d-2.dll | ||
sfml-graphics-d-2.dll | ||
COPYONLY | ||
) | ||
configure_file( | ||
${sfml_BINARY_DIR}/lib/sfml-window-d-2.dll | ||
sfml-window-d-2.dll | ||
COPYONLY | ||
) | ||
configure_file( | ||
${sfml_BINARY_DIR}/lib/sfml-system-d-2.dll | ||
sfml-system-d-2.dll | ||
COPYONLY | ||
) | ||
endif() | ||
target_link_libraries(HexagonPaint | ||
PUBLIC | ||
# "sfml-graphics" | ||
# "sfml-system" | ||
# "sfml-window" | ||
ImGui-SFML::ImGui-SFML | ||
) |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.