Init skeleton project

This commit is contained in:
Stephen Seo 2020-07-21 20:03:22 +09:00
commit 5a7f214a5d
13 changed files with 80 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
build*/

6
.gitmodules vendored Normal file
View file

@ -0,0 +1,6 @@
[submodule "third_party/imgui"]
path = third_party/imgui
url = https://github.com/ocornut/imgui.git
[submodule "third_party/imgui-sfml"]
path = third_party/imgui-sfml
url = https://github.com/eliasdaler/imgui-sfml.git

57
CMakeLists.txt Normal file
View file

@ -0,0 +1,57 @@
cmake_minimum_required(VERSION 3.0)
project(Triangles LANGUAGES CXX VERSION 1.0)
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/imgui)
message(FATAL_ERROR "third_party/imgui is missing!\nPlease update the \
GameDevTools submodule by running 'git submodule init' and 'git submodule \
update'!")
endif()
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/imgui-sfml)
message(FATAL_ERROR "third_party/imgui-sfml is missing!\nPlease update the \
GameDevTools submodule by running 'git submodule init' and 'git submodule \
update'!")
endif()
set(ImGuiDemo "")
if((NOT CMAKE_BUILD_TYPE) OR (${CMAKE_BUILD_TYPE} MATCHES "Debug"))
set(ImGuiDemo "third_party/imgui/imgui_demo.cpp")
endif()
set(Triangles_SOURCES
src/main.cpp
third_party/imgui/imgui.cpp
third_party/imgui/imgui_draw.cpp
third_party/imgui/imgui_widgets.cpp
third_party/imgui-sfml/imgui-SFML.cpp
)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -Wsuggest-override")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -D NDEBUG")
add_executable(Triangles ${Triangles_SOURCES})
target_compile_features(Triangles PUBLIC cxx_std_17)
if(BUILD_SHARED_LIBS OR (UNIX AND NOT CYGWIN))
find_package(SFML 2 REQUIRED
COMPONENTS audio network graphics window system)
else()
find_package(SFML 2 REQUIRED
COMPONENTS audio-s network-s graphics-s window-s system-s)
add_definitions(-DSFML_STATIC)
endif()
target_link_libraries(Triangles
sfml-graphics sfml-window sfml-system
GL
)
target_include_directories(Triangles PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
${SFML_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include # imgui related headers
)
# Use macro to override imgui config header
target_compile_definitions(Triangles PRIVATE
"IMGUI_USER_CONFIG=\"${CMAKE_CURRENT_SOURCE_DIR}/third_party/imgui-sfml/imconfig-SFML.h\"")

1
include/imconfig.h Symbolic link
View file

@ -0,0 +1 @@
../third_party/imgui-sfml/imconfig-SFML.h

1
include/imgui-SFML_export.h Symbolic link
View file

@ -0,0 +1 @@
../third_party/imgui-sfml/imgui-SFML_export.h

1
include/imgui.h Symbolic link
View file

@ -0,0 +1 @@
../third_party/imgui/imgui.h

1
include/imgui_internal.h Symbolic link
View file

@ -0,0 +1 @@
../third_party/imgui/imgui_internal.h

1
include/imstb_rectpack.h Symbolic link
View file

@ -0,0 +1 @@
../third_party/imgui/imstb_rectpack.h

1
include/imstb_textedit.h Symbolic link
View file

@ -0,0 +1 @@
../third_party/imgui/imstb_textedit.h

1
include/imstb_truetype.h Symbolic link
View file

@ -0,0 +1 @@
../third_party/imgui/imstb_truetype.h

7
src/main.cpp Normal file
View file

@ -0,0 +1,7 @@
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
int main(int argc, char **argv) {
return 0;
}

1
third_party/imgui vendored Submodule

@ -0,0 +1 @@
Subproject commit 9418dcb69355558f70de260483424412c5ca2fce

1
third_party/imgui-sfml vendored Submodule

@ -0,0 +1 @@
Subproject commit 488c321155547cb499697dac155aa6269d53c21f