mirror of
https://github.com/ocornut/imgui.git
synced 2025-02-17 11:08:42 +01:00
cmake for glfw_vulkan downloads glfw instead of using fixed path
This commit is contained in:
parent
99109c0b3b
commit
08c17aeaec
@ -15,14 +15,30 @@ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVK_PROTOTYPES")
|
|||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVK_PROTOTYPES")
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVK_PROTOTYPES")
|
||||||
|
|
||||||
# GLFW
|
# GLFW
|
||||||
set(GLFW_DIR ../../../glfw) # Set this to point to an up-to-date GLFW repo
|
set(GLFW_VERSION 3.4)
|
||||||
option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF)
|
include(FetchContent)
|
||||||
option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF)
|
FetchContent_Declare(
|
||||||
option(GLFW_BUILD_DOCS "Build the GLFW documentation" OFF)
|
glfw
|
||||||
option(GLFW_INSTALL "Generate installation target" OFF)
|
URL https://github.com/glfw/glfw/archive/refs/tags/${GLFW_VERSION}.tar.gz)
|
||||||
option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF)
|
#GIT_REPOSITORY https://github.com/glfw/glfw )
|
||||||
add_subdirectory(${GLFW_DIR} binary_dir EXCLUDE_FROM_ALL)
|
|
||||||
include_directories(${GLFW_DIR}/include)
|
FetchContent_GetProperties(glfw)
|
||||||
|
if (NOT glfw_POPULATED)
|
||||||
|
set(FETCHCONTENT_QUIET NO)
|
||||||
|
FetchContent_Populate(glfw)
|
||||||
|
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||||
|
if (NOT STATIC_BUILD)
|
||||||
|
set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)
|
||||||
|
endif()
|
||||||
|
add_subdirectory(${glfw_SOURCE_DIR} ${glfw_BINARY_DIR} EXCLUDE_FROM_ALL)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#if dynamic glfw then install
|
||||||
|
install(TARGETS glfw RUNTIME DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
LIBRARY DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
# Dear ImGui
|
# Dear ImGui
|
||||||
set(IMGUI_DIR ../../)
|
set(IMGUI_DIR ../../)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user