mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-10 11:58:30 +01:00
detect backends folder in generator and backend_test
This commit is contained in:
@@ -4,6 +4,14 @@ if(WIN32) #to mingw work as all the others
|
||||
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
||||
endif(WIN32)
|
||||
#general settings
|
||||
|
||||
|
||||
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../imgui/backends)
|
||||
set(BAKENDS_FOLDER "../imgui/backends/")
|
||||
else()
|
||||
set(BAKENDS_FOLDER "../imgui/examples/")
|
||||
endif()
|
||||
|
||||
include_directories(../imgui)
|
||||
add_definitions("-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1")
|
||||
|
||||
@@ -37,9 +45,9 @@ if(IMGUI_FREETYPE)
|
||||
endif(IMGUI_FREETYPE)
|
||||
|
||||
#opengl3
|
||||
list(APPEND IMGUI_SOURCES ../imgui/examples/imgui_impl_opengl3.cpp ../imgui/examples/libs/gl3w/GL/gl3w.c)
|
||||
list(APPEND IMGUI_SOURCES ${BAKENDS_FOLDER}imgui_impl_opengl3.cpp ${BAKENDS_FOLDER}libs/gl3w/GL/gl3w.c)
|
||||
list(APPEND IMGUI_SOURCES ./cimgui_extras.cpp)
|
||||
include_directories(../imgui/examples/libs/gl3w)
|
||||
include_directories(${BAKENDS_FOLDER}libs/gl3w)
|
||||
if(WIN32)
|
||||
list(APPEND IMGUI_LIBRARIES opengl32)
|
||||
else(WIN32)#Unix
|
||||
@@ -48,7 +56,7 @@ endif(WIN32)
|
||||
|
||||
|
||||
#sdl2
|
||||
list(APPEND IMGUI_SOURCES ../imgui/examples/imgui_impl_sdl.cpp)
|
||||
list(APPEND IMGUI_SOURCES ${BAKENDS_FOLDER}imgui_impl_sdl.cpp)
|
||||
if(DEFINED SDL_PATH)
|
||||
message(STATUS "SDL_PATH defined as " ${SDL_PATH})
|
||||
FIND_PACKAGE(SDL2 REQUIRED PATHS ${SDL_PATH})
|
||||
|
Reference in New Issue
Block a user