WINDOW
This commit is contained in:
@@ -1,33 +1,28 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(ImGuiProject)
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
# Set some basic project attributes
|
||||
project (Osmium
|
||||
VERSION 0.1
|
||||
DESCRIPTION "A Hello World Project")
|
||||
|
||||
# Find OpenGL
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
# Fetch GLFW
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
glfw
|
||||
GIT_REPOSITORY https://github.com/glfw/glfw.git
|
||||
GIT_TAG 3.3.8
|
||||
)
|
||||
FetchContent_MakeAvailable(glfw)
|
||||
# This project will output an executable file
|
||||
add_executable(${PROJECT_NAME} Osmium.cpp)
|
||||
|
||||
# ImGui sources
|
||||
file(GLOB IMGUI_SRC
|
||||
${CMAKE_SOURCE_DIR}/imgui/*.cpp
|
||||
${CMAKE_SOURCE_DIR}/imgui/backends/imgui_impl_glfw.cpp
|
||||
${CMAKE_SOURCE_DIR}/imgui/backends/imgui_impl_opengl3.cpp
|
||||
)
|
||||
# Create a simple configuration header
|
||||
configure_file(config.h.in config.h)
|
||||
|
||||
add_executable(ImGuiProject main.cpp ${IMGUI_SRC})
|
||||
# Include the configuration header in the build
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC "${PROJECT_BINARY_DIR}")
|
||||
add_library(glad src/glad.c)
|
||||
|
||||
target_include_directories(ImGuiProject PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/imgui
|
||||
${CMAKE_SOURCE_DIR}/imgui/backends
|
||||
)
|
||||
add_subdirectory(deps/glfw-3.4)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE include deps/glfw-3.4/include ${PROJECT_BINARY_DIR})
|
||||
target_include_directories(glad PUBLIC include)
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
PRIVATE
|
||||
glad
|
||||
glfw
|
||||
|
||||
target_link_libraries(ImGuiProject PRIVATE glfw OpenGL::GL)
|
||||
)
|
||||
Reference in New Issue
Block a user