Skip to content

Commit bfc0590

Browse files
committed
tolua: custom vcpkg overlay
TODO: move custom ports to their own repo?
1 parent 47e2962 commit bfc0590

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed

custom-overlay/tolua/portfile.cmake

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Common Ambient Variables:
2+
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
3+
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
4+
# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT}
5+
# CURRENT_INSTALLED_DIR = ${VCPKG_ROOT_DIR}\installed\${TRIPLET}
6+
# DOWNLOADS = ${VCPKG_ROOT_DIR}\downloads
7+
# PORT = current port name (zlib, etc)
8+
# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc)
9+
# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic)
10+
# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic)
11+
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
12+
# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
13+
# VCPKG_TOOLCHAIN = ON OFF
14+
# TRIPLET_SYSTEM_ARCH = arm x86 x64
15+
# BUILD_ARCH = "Win32" "x64" "ARM"
16+
# MSBUILD_PLATFORM = "Win32"/"x64"/${TRIPLET_SYSTEM_ARCH}
17+
# DEBUG_CONFIG = "Debug Static" "Debug Dll"
18+
# RELEASE_CONFIG = "Release Static"" "Release DLL"
19+
# VCPKG_TARGET_IS_WINDOWS
20+
# VCPKG_TARGET_IS_UWP
21+
# VCPKG_TARGET_IS_LINUX
22+
# VCPKG_TARGET_IS_OSX
23+
# VCPKG_TARGET_IS_FREEBSD
24+
# VCPKG_TARGET_IS_ANDROID
25+
# VCPKG_TARGET_IS_MINGW
26+
# VCPKG_TARGET_EXECUTABLE_SUFFIX
27+
# VCPKG_TARGET_STATIC_LIBRARY_SUFFIX
28+
# VCPKG_TARGET_SHARED_LIBRARY_SUFFIX
29+
#
30+
# See additional helpful variables in /docs/maintainers/vcpkg_common_definitions.md
31+
32+
# # Specifies if the port install should fail immediately given a condition
33+
# vcpkg_fail_port_install(MESSAGE "tolua currently only supports Linux and Mac platforms" ON_TARGET "Windows")
34+
35+
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
36+
37+
vcpkg_from_github(
38+
OUT_SOURCE_PATH SOURCE_PATH
39+
REPO ennorehling/tolua
40+
REF 097c40f49d0391851d800ce2be747eaf45af99b9
41+
SHA512 9ae24deee8e10c993a21c209e70795ee9216d7d629a69456924825e8fefd74d9bc1e08d75e8ff51f29e03d4c160d638385cd431cb76df32276f79fdea2234e28
42+
HEAD_REF master
43+
)
44+
45+
# # Check if one or more features are a part of a package installation.
46+
# # See /docs/maintainers/vcpkg_check_features.md for more details
47+
# vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
48+
# FEATURES # <- Keyword FEATURES is required because INVERTED_FEATURES are being used
49+
# tbb WITH_TBB
50+
# INVERTED_FEATURES
51+
# tbb ROCKSDB_IGNORE_PACKAGE_TBB
52+
# )
53+
54+
vcpkg_cmake_configure(
55+
SOURCE_PATH ${SOURCE_PATH}
56+
DISABLE_PARALLEL_CONFIGURE
57+
)
58+
vcpkg_cmake_install(
59+
ADD_BIN_TO_PATH
60+
)
61+
vcpkg_copy_tools(TOOL_NAMES tolua AUTO_CLEAN)
62+
file(REMOVE_RECURSE
63+
"${CURRENT_PACKAGES_DIR}/debug/include"
64+
"${CURRENT_PACKAGES_DIR}/debug/share"
65+
)
66+
67+
# # Moves all .cmake files from /debug/share/tolua/ to /share/tolua/
68+
# # See /docs/maintainers/vcpkg_fixup_cmake_targets.md for more details
69+
# vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/tolua)
70+
71+
# # Handle copyright
72+
73+
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
74+
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

custom-overlay/tolua/usage

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
tolua provides CMake targets:
2+
3+
find_package(tolua CONFIG REQUIRED)
4+
target_link_libraries(main PRIVATE tolua::tolua)

custom-overlay/tolua/vcpkg.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "tolua",
3+
"version-string": "5.2.5",
4+
"description": "tolua is a tool that greatly simplifies the integration of C/C++ code with Lua.",
5+
"homepage": "http://webserver2.tecgraf.puc-rio.br/~celes/tolua/",
6+
"dependencies": [
7+
"lua",
8+
{
9+
"name": "vcpkg-cmake",
10+
"host": true
11+
}
12+
]
13+
}

0 commit comments

Comments
 (0)