-
Notifications
You must be signed in to change notification settings - Fork 80
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
17 changed files
with
4,641 additions
and
483 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
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
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
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,4 +1,4 @@ | ||
[submodule "imgui"] | ||
path = imgui | ||
path = src/imgui | ||
url = https://github.com/ocornut/imgui | ||
shallow = true |
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,121 @@ | ||
# BEGIN CMake setup | ||
|
||
# 3.12 added add_compile_definitions | ||
cmake_minimum_required(VERSION 3.12) | ||
|
||
# Include repo local modules | ||
set( | ||
CMAKE_MODULE_PATH | ||
${CMAKE_MODULE_PATH} | ||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake-includes/modules" | ||
) | ||
|
||
# END CMake setup | ||
|
||
# BEGIN Project config | ||
|
||
# Build target for CXX project "anura" | ||
project(anura LANGUAGES CXX) | ||
|
||
# Use ccache to accelerate iterating on CXX files, if available | ||
find_program(CCACHE "ccache") | ||
if(CCACHE) | ||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE}") | ||
endif(CCACHE) | ||
|
||
# Add the source code | ||
file( | ||
GLOB | ||
anura_SRC | ||
"${CMAKE_CURRENT_LIST_DIR}/src/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/hex/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/imgui/imgui_draw.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/imgui/imgui_tables.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/imgui/imgui_widgets.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/imgui/imgui.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/imgui_additions/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/kre/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/svg/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/tiled/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/treetree/*.cpp" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/xhtml/*.cpp" | ||
) | ||
|
||
# Configure compiling against system provided libraries | ||
# XXX - At the moment (2023-07) we have no idea of the upper and lower bounds | ||
find_package(Freetype REQUIRED) | ||
find_package(Boost REQUIRED COMPONENTS filesystem regex) | ||
find_package(SDL2 REQUIRED) | ||
find_package(OpenGL REQUIRED) | ||
find_package(Cairo REQUIRED) | ||
find_package(ZLIB REQUIRED) | ||
find_package(GLEW REQUIRED) | ||
find_package(SDL2_ttf REQUIRED) | ||
|
||
# Add the headers | ||
include_directories( | ||
"${CMAKE_CURRENT_LIST_DIR}/src" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/hex" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/imgui" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/imgui_additions" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/kre" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/svg" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/tiled" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/treetree" | ||
"${CMAKE_CURRENT_LIST_DIR}/src/xhtml" | ||
"${FREETYPE_INCLUDE_DIR_ft2build}" | ||
"${SDL2_INCLUDE_DIRS}" | ||
) | ||
|
||
# END Project config | ||
|
||
# BEGIN Compiler config | ||
|
||
# Good things, to keep | ||
|
||
# Set C++ standard to C++17 | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
# Turn off (GNU) extensions (-std=c++17 vs. -std=gnu++17) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
# -O2 per default | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") | ||
|
||
# Warnings as errors, raise all warnings | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror") | ||
|
||
# Inject our own imgui config for our own vector operations | ||
add_compile_definitions(IMGUI_USER_CONFIG="${CMAKE_CURRENT_LIST_DIR}/src/imgui_additions/imconfig_anura.h") | ||
|
||
# Bad things, to get rid of | ||
|
||
# Use imgui provided vector math | ||
# XXX - imgui_custom.cpp relies on these | ||
add_compile_definitions(IMGUI_DEFINE_MATH_OPERATORS) | ||
|
||
# We need to hide a ton of warnings | ||
include("${CMAKE_CURRENT_LIST_DIR}/cmake-includes/silence-warnings/CMakeLists.txt") | ||
|
||
# END Compiler config | ||
|
||
# BEGIN Linker config | ||
|
||
# Output an executable from the anura sources for anura | ||
add_executable(anura "${anura_SRC}") | ||
|
||
# Link libraries | ||
target_link_libraries( | ||
anura | ||
PRIVATE | ||
"${SDL2_LIBRARIES}" | ||
"${OPENGL_LIBRARIES}" | ||
"${Boost_LIBRARIES}" | ||
"${CAIRO_LIBRARIES}" | ||
"${FREETYPE_LIBRARIES}" | ||
"${ZLIB_LIBRARIES}" | ||
"${GLEW_LIBRARIES}" | ||
"${SDL2_TTF_LIBRARIES}" | ||
) | ||
|
||
# END Linker config |
Oops, something went wrong.