cmake_minimum_required(VERSION 3.10) include(FetchContent) project( sillyeditor VERSION 1.0 DESCRIPTION "a simple level editor" ) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) add_executable(sillyeditor) set_target_properties( sillyeditor PROPERTIES DESCRIPTION ${PROJECT_DESCRIPTION} OUTPUT_NAME "editor" ) file(GLOB_RECURSE SRC_FILES "src/*.cpp" "src/*.hpp") target_sources(sillyeditor PRIVATE ${SRC_FILES}) # sfml FetchContent_Declare(sfml GIT_REPOSITORY https://github.com/SFML/SFML.git GIT_TAG 3.0.0 GIT_SHALLOW ON EXCLUDE_FROM_ALL SYSTEM) FetchContent_MakeAvailable(sfml) # imgui FetchContent_Declare( imgui GIT_REPOSITORY https://github.com/ocornut/imgui.git GIT_TAG v1.91.8 ) FetchContent_MakeAvailable(imgui) # imgui-sfml FetchContent_Declare( imgui-sfml GIT_REPOSITORY https://github.com/SFML/imgui-sfml.git GIT_TAG v3.0 ) set(SFML_DIR "${sfml_SOURCE_DIR}/cmake") set(IMGUI_DIR ${imgui_SOURCE_DIR}) set(IMGUI_SFML_FIND_SFML OFF) FetchContent_MakeAvailable(imgui-sfml) target_include_directories(sillyeditor PRIVATE ${imgui_SOURCE_DIR}) target_link_libraries(sillyeditor PRIVATE sfml-graphics ImGui-SFML::ImGui-SFML)