summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorruki <[email protected]>2021-12-17 00:03:26 +0800
committerGitHub <[email protected]>2021-12-17 00:03:26 +0800
commit369afb0809747329524839edbeab813ad3cf0de8 (patch)
tree15883de9c7855bab819ad58209836273921f67a2 /tests
parent9af42bcb37bde188b60d64d36c4e86873c2ece0b (diff)
parent0c977557c4566c6aff800320998c9b3aea0c8f1d (diff)
Merge pull request #1917 from xmake-io/package
Improve to find package and configurations
Diffstat (limited to 'tests')
-rw-r--r--tests/projects/package/cmake/.gitignore8
-rw-r--r--tests/projects/package/cmake/src/main.cpp9
-rw-r--r--tests/projects/package/cmake/xmake.lua12
-rw-r--r--tests/projects/package/conan/.gitignore8
-rw-r--r--tests/projects/package/conan/src/main.cpp9
-rw-r--r--tests/projects/package/conan/xmake.lua9
-rw-r--r--tests/projects/package/vcpkg/.gitignore8
-rw-r--r--tests/projects/package/vcpkg/src/main.cpp9
-rw-r--r--tests/projects/package/vcpkg/xmake.lua8
9 files changed, 80 insertions, 0 deletions
diff --git a/tests/projects/package/cmake/.gitignore b/tests/projects/package/cmake/.gitignore
new file mode 100644
index 000000000..152105761
--- /dev/null
+++ b/tests/projects/package/cmake/.gitignore
@@ -0,0 +1,8 @@
+# Xmake cache
+.xmake/
+build/
+
+# MacOS Cache
+.DS_Store
+
+
diff --git a/tests/projects/package/cmake/src/main.cpp b/tests/projects/package/cmake/src/main.cpp
new file mode 100644
index 000000000..7c435d251
--- /dev/null
+++ b/tests/projects/package/cmake/src/main.cpp
@@ -0,0 +1,9 @@
+#include <iostream>
+
+using namespace std;
+
+int main(int argc, char** argv)
+{
+ cout << "hello world!" << endl;
+ return 0;
+}
diff --git a/tests/projects/package/cmake/xmake.lua b/tests/projects/package/cmake/xmake.lua
new file mode 100644
index 000000000..b6490032d
--- /dev/null
+++ b/tests/projects/package/cmake/xmake.lua
@@ -0,0 +1,12 @@
+add_rules("mode.debug", "mode.release")
+
+add_requires("cmake::ZLIB", {system = true})
+add_requires("cmake::LibXml2", {system = true})
+add_requires("cmake::Boost", {system = true,
+ configs = {components = {"regex", "system"}, presets = {Boost_USE_STATIC_LIB = true}}})
+target("test")
+ set_kind("binary")
+ add_files("src/*.cpp")
+ add_packages("cmake::ZLIB", "cmake::Boost", "cmake::LibXml2")
+
+
diff --git a/tests/projects/package/conan/.gitignore b/tests/projects/package/conan/.gitignore
new file mode 100644
index 000000000..152105761
--- /dev/null
+++ b/tests/projects/package/conan/.gitignore
@@ -0,0 +1,8 @@
+# Xmake cache
+.xmake/
+build/
+
+# MacOS Cache
+.DS_Store
+
+
diff --git a/tests/projects/package/conan/src/main.cpp b/tests/projects/package/conan/src/main.cpp
new file mode 100644
index 000000000..7c435d251
--- /dev/null
+++ b/tests/projects/package/conan/src/main.cpp
@@ -0,0 +1,9 @@
+#include <iostream>
+
+using namespace std;
+
+int main(int argc, char** argv)
+{
+ cout << "hello world!" << endl;
+ return 0;
+}
diff --git a/tests/projects/package/conan/xmake.lua b/tests/projects/package/conan/xmake.lua
new file mode 100644
index 000000000..69f7d2052
--- /dev/null
+++ b/tests/projects/package/conan/xmake.lua
@@ -0,0 +1,9 @@
+add_requires("conan::zlib/1.2.11", {alias = "zlib", debug = true})
+add_requires("conan::openssl/1.1.1g", {alias = "openssl",
+ configs = {options = "OpenSSL:shared=True"}})
+
+target("test")
+ set_kind("binary")
+ add_files("src/*.cpp")
+ add_packages("openssl", "zlib")
+
diff --git a/tests/projects/package/vcpkg/.gitignore b/tests/projects/package/vcpkg/.gitignore
new file mode 100644
index 000000000..152105761
--- /dev/null
+++ b/tests/projects/package/vcpkg/.gitignore
@@ -0,0 +1,8 @@
+# Xmake cache
+.xmake/
+build/
+
+# MacOS Cache
+.DS_Store
+
+
diff --git a/tests/projects/package/vcpkg/src/main.cpp b/tests/projects/package/vcpkg/src/main.cpp
new file mode 100644
index 000000000..7c435d251
--- /dev/null
+++ b/tests/projects/package/vcpkg/src/main.cpp
@@ -0,0 +1,9 @@
+#include <iostream>
+
+using namespace std;
+
+int main(int argc, char** argv)
+{
+ cout << "hello world!" << endl;
+ return 0;
+}
diff --git a/tests/projects/package/vcpkg/xmake.lua b/tests/projects/package/vcpkg/xmake.lua
new file mode 100644
index 000000000..3f5dbcf55
--- /dev/null
+++ b/tests/projects/package/vcpkg/xmake.lua
@@ -0,0 +1,8 @@
+add_requires("vcpkg::zlib", "vcpkg::pcre2")
+add_requires("vcpkg::boost[core]", {alias = "boost"})
+
+target("test")
+ set_kind("binary")
+ add_files("src/*.cpp")
+ add_packages("vcpkg::zlib", "vcpkg::pcre2", "boost")
+