Browse Source

Add tclap package (#306)

* Add tclap package

* Addressed required changes

I also removed the "-DBUILD_DOC=OFF" line because
docs module has been removed, and this option
was only in its CMakeLists.txt, so
no more CMake options args are required
Antoine James Tournepiche 4 years ago
parent
commit
3c64d16565
1 changed files with 27 additions and 0 deletions
  1. 27 0
      packages/t/tclap/xmake.lua

+ 27 - 0
packages/t/tclap/xmake.lua

@@ -0,0 +1,27 @@
+package("tclap")
+    set_homepage("https://sourceforge.net/projects/tclap/")
+    set_description("This is a simple templatized C++ library for parsing command line arguments.")
+    set_license("MIT")
+
+    set_urls("https://netcologne.dl.sourceforge.net/project/tclap/tclap-$(version).tar.bz2")
+    add_versions("1.4.0-rc1", "33e18c7828f76a9e5f2a00afe575156520e383693059ca9bc34ff562927e20c6")
+
+    add_deps("cmake")
+
+    on_install(function (package)
+        io.replace("CMakeLists.txt", "add_subdirectory(docs)", "", {plain = true})
+        io.replace("CMakeLists.txt", "add_subdirectory(examples)", "", {plain = true})
+        io.replace("CMakeLists.txt", "add_subdirectory(tests)", "", {plain = true})
+
+        local configs = {}
+        import("package.tools.cmake").install(package, configs)
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            #include <tclap/CmdLine.h>
+            void test() {
+                TCLAP::CmdLine cmd("Test", ' ', "0.9");
+            }
+        ]]}, {configs = {languages = "c++98"}}))
+    end)