-
-
Notifications
You must be signed in to change notification settings - Fork 398
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
platformfolders: add package (#4095)
* platformfolders: add package * fix mingw syslinks * fix mingw syslinks
- Loading branch information
1 parent
dcf7102
commit fb365c8
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
packages/p/platformfolders/patches/4.2.0/cmake-install.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 5ae2017..30e2045 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -83,6 +83,7 @@ if(PLATFORMFOLDERS_ENABLE_INSTALL) | ||
EXPORT "platform_foldersConfig" | ||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" | ||
# Tells it where to put the header files | ||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sago" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package("platformfolders") | ||
set_homepage("https://github.com/sago007/PlatformFolders") | ||
set_description([[A C++ library to look for special directories like "My Documents" and "%APPDATA%" so that you do not need to write Linux, Windows or Mac OS X specific code]]) | ||
set_license("MIT") | ||
|
||
add_urls("https://github.com/sago007/PlatformFolders/archive/refs/tags/$(version).tar.gz", | ||
"https://github.com/sago007/PlatformFolders.git") | ||
|
||
add_versions("4.2.0", "31bb0f64a27315aec8994f226332aaafe9888d00bb69a2ff2dff9912e2f4ccf4") | ||
|
||
add_patches("4.2.0", "patches/4.2.0/cmake-install.patch", "a38850ff7e9b91034f226685af7633ff692de3aea4798cb3dddecc6b055a7601") | ||
|
||
if is_plat("windows", "mingw") then | ||
add_syslinks("ole32", "shell32", "uuid") | ||
end | ||
|
||
add_deps("cmake") | ||
|
||
on_install(function (package) | ||
local configs = {"-DPLATFORMFOLDERS_BUILD_TESTING=OFF"} | ||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) | ||
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) | ||
if package:is_plat("windows") and package:config("shared") then | ||
table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") | ||
end | ||
import("package.tools.cmake").install(package, configs) | ||
end) | ||
|
||
on_test(function (package) | ||
assert(package:check_cxxsnippets({test = [[ | ||
void test() { | ||
sago::getConfigHome(); | ||
} | ||
]]}, {configs = {languages = "c++11"}, includes = "sago/platform_folders.h"})) | ||
end) |