early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

View File

@@ -0,0 +1,46 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c7193fbb..50c997f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -152,8 +152,7 @@ add_subdirectory("common")
add_subdirectory("${_OSNAME}")
add_library(libui ${_LIBUI_SOURCES})
target_include_directories(libui
- PUBLIC .
- PRIVATE ${_LIBUI_INCLUEDIRS})
+ PUBLIC $<INSTALL_INTERFACE:include>)
target_compile_definitions(libui
PRIVATE ${_LIBUI_DEFS})
# cmake produces this for us by default but only for shared libraries
@@ -229,10 +228,30 @@ macro(_add_exec _name)
# TODOfor some reason these don't propagate
if(NOT WIN32)
target_include_directories(${_name}
- PUBLIC .)
+ PUBLIC $<INSTALL_INTERFACE:include>)
target_compile_options(${_name}
PUBLIC ${_COMMON_CFLAGS})
endif()
endmacro()
add_subdirectory("test")
add_subdirectory("examples")
+
+if(BUILD_SHARED_LIBS)
+ install(TARGETS ${PROJECT_NAME}
+ EXPORT ${PROJECT_NAME}-config
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+else()
+ install(TARGETS ${PROJECT_NAME}
+ EXPORT ${PROJECT_NAME}-config
+ DESTINATION ${CMAKE_INSTALL_LIBDIR})
+endif()
+
+install(EXPORT ${PROJECT_NAME}-config
+ FILE unofficial-${PROJECT_NAME}-config.cmake
+ NAMESPACE unofficial::libui::
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
+)
+
+install(FILES ui.h DESTINATION include)

View File

@@ -0,0 +1,19 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 50c997f..a23b84d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,7 +16,13 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
# TODO figure out what other variables must be set with CACHE
# TODO figure out if FORCE is needed here
# TODO figure out whether STRING "" is best or if something else is better; also what FORCE does because I forget and later I say it's needed
-set(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "" FORCE)
+
+# VCPKG PATCH NOTE: Fix build on MacOS
+# Due to a bug in CMake (https://gitlab.kitware.com/cmake/cmake/issues/18396) we change CMAKE_OSX_DEPLOYMENT_TARGET to "10.9".
+# See the discussion here:
+# * https://github.com/andlabs/libui/issues/422
+# * https://github.com/andlabs/libui/issues/457
+set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE)
# we want to disable incremental linking
# see also:

View File

@@ -0,0 +1,17 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a23b84d..9892dfc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -172,6 +172,12 @@ if(BUILD_SHARED_LIBS)
target_link_libraries(libui
PRIVATE ${_LIBUI_LIBS})
endif()
+
+if (APPLE)
+ find_library(Foundation Foundation)
+ find_library(AppKit AppKit)
+ target_link_libraries(libui PUBLIC $<$<PLATFORM_ID:Darwin>:${Foundation};${AppKit}>)
+endif()
# TODO INTERFACE libs don't inherit to grandhcildren?
# on Windows the linker for static libraries is different; don't give it the flags
if(BUILD_SHARED_LIBS)

27
externals/vcpkg/ports/libui/portfile.cmake vendored Executable file
View File

@@ -0,0 +1,27 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO andlabs/libui
REF 7138276ccfbde94873cb6e2db65642adcbd2ee19
SHA512 3a9fb27d0c376479f58ba2fc5be3579efa5f462776a7e725313b92413ce78f3ca60897e63b580c419eeaee2cd2101de2be1ee5af80a547ef433c6284a3053d45
HEAD_REF master
PATCHES
"001-fix-cmake.patch"
"002-fix-macosx-build.patch"
"003-fix-system-link.patch"
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libui TARGET_PATH share/unofficial-libui)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
configure_file("${SOURCE_PATH}/LICENSE" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)

7
externals/vcpkg/ports/libui/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,7 @@
{
"name": "libui",
"version-date": "2018-11-03",
"port-version": 2,
"description": "Simple and portable (but not inflexible) native GUI library in C.",
"homepage": "https://github.com/andlabs/libui"
}