Skip to content

Commit

Permalink
[MyGUI] Add new port (#11991)
Browse files Browse the repository at this point in the history
* [MyGUI] Add new port

* fix
  • Loading branch information
Pospelove authored Jul 9, 2020
1 parent b385e54 commit d7be068
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ports/mygui/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Source: mygui
Version: 2020-06-17
Build-Depends: freetype, sdl2-image
Homepage: http://mygui.info
Description: Fast, flexible and simple GUI

Feature: opengl
Description: Use OpenGL render system.
Build-Depends: opengl
55 changes: 55 additions & 0 deletions ports/mygui/fix-generation.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
diff --git a/CMake/CMakeLists.txt b/CMake/CMakeLists.txt
index b0fc12a82..6e545edea 100644
--- a/CMake/CMakeLists.txt
+++ b/CMake/CMakeLists.txt
@@ -5,7 +5,7 @@
#############################################################

if(WIN32)
- set(MYGUI_CMAKE_DIR "CMake")
+ set(MYGUI_CMAKE_DIR "share")
else(WIN32)
set(MYGUI_CMAKE_DIR "lib/MYGUI/cmake")
endif(WIN32)
diff --git a/CMake/Utils/MyGUIConfigTargets.cmake b/CMake/Utils/MyGUIConfigTargets.cmake
index d1dbd016d..25c8bbac6 100644
--- a/CMake/Utils/MyGUIConfigTargets.cmake
+++ b/CMake/Utils/MyGUIConfigTargets.cmake
@@ -6,10 +6,10 @@ if (WIN32)
set(MYGUI_RELWDBG_PATH "/RelWithDebInfo")
set(MYGUI_MINSIZE_PATH "/MinSizeRel")
set(MYGUI_DEBUG_PATH "/Debug")
- set(MYGUI_LIB_RELEASE_PATH "/Release")
+ set(MYGUI_LIB_RELEASE_PATH "")
set(MYGUI_LIB_RELWDBG_PATH "/RelWithDebInfo")
set(MYGUI_LIB_MINSIZE_PATH "/MinSizeRel")
- set(MYGUI_LIB_DEBUG_PATH "/Debug")
+ set(MYGUI_LIB_DEBUG_PATH "")
set(MYGUI_PLUGIN_PATH "/opt")
elseif (UNIX)
set(MYGUI_RELEASE_PATH "")
diff --git a/CMake/Utils/PrecompiledHeader.cmake b/CMake/Utils/PrecompiledHeader.cmake
index a8bf3ce49..104703282 100644
--- a/CMake/Utils/PrecompiledHeader.cmake
+++ b/CMake/Utils/PrecompiledHeader.cmake
@@ -16,7 +16,7 @@
macro(use_precompiled_header TARGET HEADER_FILE SRC_FILE)
get_filename_component(HEADER ${HEADER_FILE} NAME)

- if (MSVC AND NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+ if (FALSE)
add_definitions(/Yu"${HEADER}")
set_source_files_properties(${SRC_FILE}
PROPERTIES COMPILE_FLAGS /Yc"${HEADER}"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fea0bff8b..5831dfa8a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,7 @@ cmake_minimum_required(VERSION 2.6)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
cmake_policy(SET CMP0003 NEW)
cmake_policy(SET CMP0011 NEW)
+cmake_policy(SET CMP0021 OLD)

project(MYGUI)

44 changes: 44 additions & 0 deletions ports/mygui/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# MyGUI supports compiling itself as a DLL,
# but it seems platform-related stuff doesn't support dynamic linkage
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO MyGUI/mygui
REF 26109822f36a4f7d72d5d8ecd41659897f085a40
SHA512 4d1f001e8c04d08ad911bc0345a2287b5e17e21284728cf23d7a930e8befb2f85902053e3c90283444bf9e32c7dada2f37c498e735d6314732b297d97ed339e4
HEAD_REF master
PATCHES
fix-generation.patch
)

if("opengl" IN_LIST FEATURES)
set(MYGUI_RENDERSYSTEM 4)
else()
set(MYGUI_RENDERSYSTEM 1)
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DMYGUI_STATIC=TRUE
-DMYGUI_BUILD_DEMOS=FALSE
-DMYGUI_BUILD_PLUGINS=TRUE
-DMYGUI_BUILD_TOOLS=FALSE
-DMYGUI_BUILD_UNITTESTS=FALSE
-DMYGUI_BUILD_TEST_APP=FALSE
-DMYGUI_BUILD_WRAPPER=FALSE
-DMYGUI_BUILD_DOCS=FALSE
-DMYGUI_RENDERSYSTEM=${MYGUI_RENDERSYSTEM}
)

vcpkg_install_cmake()

file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/share
)

# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING.MIT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

0 comments on commit d7be068

Please sign in to comment.