mirror of
https://github.com/raysan5/raygui.git
synced 2026-01-30 10:49:19 -05:00
Update project for CMake (#167)
This commit is contained in:
@ -4,7 +4,12 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
|||||||
project(raygui C)
|
project(raygui C)
|
||||||
|
|
||||||
# Config options
|
# Config options
|
||||||
option(BUILD_RAYGUI_EXAMPLES "Build the examples." ON)
|
option(BUILD_RAYGUI_EXAMPLES "Build the examples." OFF)
|
||||||
|
|
||||||
|
# Force building examples if building in the root as standalone.
|
||||||
|
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||||
|
set(BUILD_RAYGUI_EXAMPLES TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Directory Variables
|
# Directory Variables
|
||||||
set(RAYGUI_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
|
set(RAYGUI_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
|
||||||
@ -26,14 +31,14 @@ if(${BUILD_RAYGUI_EXAMPLES})
|
|||||||
|
|
||||||
# Get the sources together
|
# Get the sources together
|
||||||
set(example_dirs
|
set(example_dirs
|
||||||
|
controls_test_suite
|
||||||
custom_file_dialog
|
custom_file_dialog
|
||||||
|
image_exporter
|
||||||
image_raw_importer
|
image_raw_importer
|
||||||
portable_window
|
portable_window
|
||||||
|
property_list
|
||||||
scroll_panel
|
scroll_panel
|
||||||
text_box_selection
|
text_box_selection
|
||||||
controls_test_suite
|
|
||||||
image_exporter
|
|
||||||
property_list
|
|
||||||
text_editor
|
text_editor
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
find_package(raylib 3.0.0 QUIET CONFIG)
|
find_package(raylib 4.0.0 QUIET CONFIG)
|
||||||
if (NOT raylib_FOUND)
|
if (NOT raylib_FOUND)
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
raylib
|
raylib
|
||||||
GIT_REPOSITORY https://github.com/raysan5/raylib.git
|
GIT_REPOSITORY https://github.com/raysan5/raylib.git
|
||||||
GIT_TAG df5c522049ddd82fba048a6bd069338999729d6a
|
GIT_TAG 0851960397f02a477d80eda2239f90fae14dec64
|
||||||
)
|
)
|
||||||
FetchContent_GetProperties(raylib)
|
FetchContent_GetProperties(raylib)
|
||||||
if (NOT raylib_POPULATED) # Have we downloaded raylib yet?
|
if (NOT raylib_POPULATED) # Have we downloaded raylib yet?
|
||||||
|
|||||||
Reference in New Issue
Block a user