[tgui] Update to 1.1.0 (#34972)

* update to 1.1.0

* update version
This commit is contained in:
jim wang 2023-11-10 03:04:52 +08:00 committed by GitHub
parent b5efc39012
commit e642493369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 131 deletions

View File

@ -1,27 +1,41 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ebabb8a..4a166dc 100755
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -173,6 +173,9 @@ else()
set_target_properties(tgui PROPERTIES RELWITHDEBINFO_POSTFIX -s)
endif()
+find_path(STB_INCLUDE_DIR stb_image.h REQUIRED)
+target_include_directories(tgui PRIVATE "${STB_INCLUDE_DIR}")
+
# Add the backend files to the library.
# Without the ability to call target_link_libraries in a subdirectory (which was only added in CMake 3.13 in policy CMP0079),
# the code would be more complicated when using add_subdirectory. So we just avoid creating a new scope by using include.
diff --git a/src/Loading/ImageLoader.cpp b/src/Loading/ImageLoader.cpp
index e3ec9c5..d2f691d 100644
--- a/src/Loading/ImageLoader.cpp
+++ b/src/Loading/ImageLoader.cpp
@@ -45,7 +45,7 @@
#define STB_IMAGE_STATIC
#define STBI_WINDOWS_UTF8
#define STB_IMAGE_IMPLEMENTATION
-#include <TGUI/extlibs/stb/stb_image.h>
+#include <stb_image.h>
diff --git a/include/TGUI/extlibs/IncludeStbImage.hpp b/include/TGUI/extlibs/IncludeStbImage.hpp
index e19cccb..79d0f0c 100644
--- a/include/TGUI/extlibs/IncludeStbImage.hpp
+++ b/include/TGUI/extlibs/IncludeStbImage.hpp
@@ -64,7 +64,7 @@
#else
# define STB_IMAGE_STATIC
# define STB_IMAGE_IMPLEMENTATION
-# include <TGUI/extlibs/stb/stb_image.h>
+# include <stb_image.h>
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic pop
diff --git a/include/TGUI/extlibs/IncludeStbImageWrite.hpp b/include/TGUI/extlibs/IncludeStbImageWrite.hpp
index 2e23a5b..97ce878 100644
--- a/include/TGUI/extlibs/IncludeStbImageWrite.hpp
+++ b/include/TGUI/extlibs/IncludeStbImageWrite.hpp
@@ -52,7 +52,7 @@
#else
# define STB_IMAGE_WRITE_STATIC
# define STB_IMAGE_WRITE_IMPLEMENTATION
-# include <TGUI/extlibs/stb/stb_image_write.h>
+# include <stb_image_write.h>
#endif
#if defined(__GNUC__)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6a08458..c575036 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -225,6 +225,10 @@ else()
set_target_properties(tgui PROPERTIES MINSIZEREL_POSTFIX -s)
set_target_properties(tgui PROPERTIES RELWITHDEBINFO_POSTFIX -s)
endif()
+find_path(STB_INCLUDE_DIR stb_image.h REQUIRED)
+target_include_directories(tgui PRIVATE "${STB_INCLUDE_DIR}")
+find_path(TGUI_SYSTEM_STB_IMAGE_WRITE_INCLUDE_DIR stb_image_write.h REQUIRED)
+target_include_directories(tgui SYSTEM PRIVATE "${TGUI_SYSTEM_STB_IMAGE_WRITE_INCLUDE_DIR}")
if (TGUI_BUILD_AS_CXX_MODULE)
target_sources(tgui

View File

@ -1,100 +0,0 @@
diff --git a/cmake/TGUIConfig.cmake.in b/cmake/TGUIConfig.cmake.in
index 5b58350..c9398b7 100644
--- a/cmake/TGUIConfig.cmake.in
+++ b/cmake/TGUIConfig.cmake.in
@@ -44,6 +44,28 @@
# add_executable(myapp ...)
# target_link_libraries(myapp tgui)
+include(CMakeFindDependencyMacro)
+if("@TGUI_HAS_BACKEND_SFML@")
+ find_dependency(SFML CONFIG COMPONENTS graphics)
+endif()
+if("@TGUI_HAS_BACKEND_SDL@")
+ find_dependency(SDL2 CONFIG)
+ find_dependency(SDL2_ttf CONFIG)
+ find_dependency(Threads)
+endif()
+if("@EXPORT_USE_OPENGL@")
+ cmake_policy(PUSH)
+ if (POLICY CMP0072)
+ cmake_policy(SET CMP0072 NEW)
+ endif()
+ find_package(OpenGL REQUIRED)
+ cmake_policy(POP)
+endif()
+if("@EXPORT_USE_THREADS@")
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
+ find_package(Threads REQUIRED)
+endif()
+
set(FIND_TGUI_PATHS
"${CMAKE_CURRENT_LIST_DIR}/../.."
${TGUI_ROOT}
@@ -58,7 +80,7 @@ set(FIND_TGUI_PATHS
/opt)
# Choose which target definitions must be imported
-if (TGUI_STATIC_LIBRARIES)
+if (NOT "@BUILD_SHARED_LIBS@")
set(TGUI_IS_FRAMEWORK_INSTALL "@TGUI_BUILD_FRAMEWORKS@")
if (TGUI_IS_FRAMEWORK_INSTALL)
message(WARNING "Static frameworks are not supported by TGUI. Clear TGUI_DIR cache entry, \
@@ -77,7 +99,10 @@ if (EXISTS "${targets_config_file}")
include("${targets_config_file}")
# Search for X11 on Linux and BSD
- if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR CMAKE_SYSTEM_NAME MATCHES "^k?FreeBSD$" OR CMAKE_SYSTEM_NAME MATCHES "^OpenBSD$")
+ if(TARGET TGUI_X11)
+ find_dependency(X11)
+ set_property(TARGET TGUI_X11 APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${TGUI_X11_LIB}")
+ elseif(0)
find_library(TGUI_X11_LIB NAMES X11 PATHS ${FIND_TGUI_PATHS} PATH_SUFFIXES lib NO_SYSTEM_ENVIRONMENT_PATH)
mark_as_advanced(TGUI_X11_LIB)
if(TGUI_X11_LIB)
diff --git a/src/Backends/SDL/CMakeLists.txt b/src/Backends/SDL/CMakeLists.txt
index d86f11d..3f3f3ce 100644
--- a/src/Backends/SDL/CMakeLists.txt
+++ b/src/Backends/SDL/CMakeLists.txt
@@ -4,7 +4,11 @@ find_package(SDL2 REQUIRED)
find_package(SDL2_ttf REQUIRED)
# Link to SDL and set include and library search directories
-target_link_libraries(tgui PRIVATE SDL2::Core SDL2::TTF)
+if(TARGET SDL2_ttf::SDL2_ttf)
+ target_link_libraries(tgui PRIVATE SDL2::SDL2 SDL2_ttf::SDL2_ttf)
+else()
+ target_link_libraries(tgui PRIVATE SDL2::SDL2 SDL2_ttf::SDL2_ttf-static)
+endif()
# Add the backend source files to the library
target_sources(tgui PRIVATE
@@ -19,10 +23,15 @@ target_sources(tgui PRIVATE
)
add_library(tgui-sdl-interface INTERFACE)
-target_link_libraries(tgui-sdl-interface INTERFACE SDL2::Core SDL2::TTF SDL2::Main)
+if(TARGET SDL2_ttf::SDL2_ttf)
+ target_link_libraries(tgui-sdl-interface INTERFACE SDL2::SDL2 SDL2_ttf::SDL2_ttf SDL2::SDL2main)
+else()
+ target_link_libraries(tgui-sdl-interface INTERFACE SDL2::SDL2 SDL2_ttf::SDL2_ttf-static SDL2::SDL2main)
+endif()
# Also link to OpenGL or OpenGL ES
if(NOT TGUI_USE_GLES)
+ set(EXPORT_USE_OPENGL 1 CACHE INTERNAL "")
find_package(OpenGL REQUIRED)
target_link_libraries(tgui PRIVATE OpenGL::GL)
target_link_libraries(tgui-sdl-interface INTERFACE OpenGL::GL)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4a166dc..a53b58f 100755
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -213,6 +213,7 @@ if(TGUI_OS_LINUX OR TGUI_OS_BSD)
target_link_libraries(tgui PRIVATE TGUI_X11)
# For the FileDialog we need to link to pthreads and dl on Linux and BSD (to load system icons in the background)
+ set(EXPORT_USE_THREADS 1 CACHE INTERNAL "")
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(tgui PRIVATE Threads::Threads)

View File

@ -11,11 +11,10 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO texus/TGUI
REF v0.9.5
SHA512 68c02679598448440ffaad69ee606a8413c2bcb508c91a59c2997ac866681617dadf6b9688f6c5eb07e5e38b5094a39bd79f0753a82236ec5f48498797c11134
HEAD_REF 0.10
REF "v${VERSION}"
SHA512 0896551286a40ea5b6e778018473bd230c7c3052cf19cbecfdc00789f029e9a753e569fdd5aab6f2e1e74c5fb8873bf1f7389e66abeaa3d628d6032941af331e
HEAD_REF 1.x
PATCHES
fix-dependencies.patch
devendor-stb.patch
)
@ -50,6 +49,8 @@ vcpkg_cmake_configure(
-DTGUI_BUILD_GUI_BUILDER=OFF
MAYBE_UNUSED_VARIABLES
TGUI_BUILD_FRAMEWORK
TGUI_HAS_BACKEND_SDL
TGUI_HAS_BACKEND_SFML
)
vcpkg_cmake_install()

View File

@ -1,6 +1,6 @@
{
"name": "tgui",
"version": "0.9.5",
"version": "1.1.0",
"description": "TGUI is an easy to use, cross-platform, C++ GUI for SFML.",
"homepage": "https://tgui.eu",
"license": "Zlib",

View File

@ -8317,7 +8317,7 @@
"port-version": 4
},
"tgui": {
"baseline": "0.9.5",
"baseline": "1.1.0",
"port-version": 0
},
"theia": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "dd583943a94fda26c0fe58b498ebc8675af7e831",
"version": "1.1.0",
"port-version": 0
},
{
"git-tree": "99b11d7e5b91a6f1919402576952f951383e2c34",
"version": "0.9.5",