aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-10-23 14:21:24 -0200
committerHisham Muhammad <hisham@gobolinux.org>2015-10-23 14:21:24 -0200
commit552090caad52c0c00013d9286a58f1311e7b29f3 (patch)
tree321f017fca9d3d13dc30283aef3faf21e9db7d1e
parentf8179800d0eccaef960442a7e65b1e305f3a96d5 (diff)
downloadluarocks-552090caad52c0c00013d9286a58f1311e7b29f3.tar.gz
luarocks-552090caad52c0c00013d9286a58f1311e7b29f3.tar.bz2
luarocks-552090caad52c0c00013d9286a58f1311e7b29f3.zip
Support install_pass in CMake. Fixes #431.
-rw-r--r--src/luarocks/build/cmake.lua22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/luarocks/build/cmake.lua b/src/luarocks/build/cmake.lua
index 7b16fa51..34f6ada0 100644
--- a/src/luarocks/build/cmake.lua
+++ b/src/luarocks/build/cmake.lua
@@ -6,6 +6,7 @@ local cmake = {}
6local fs = require("luarocks.fs") 6local fs = require("luarocks.fs")
7local util = require("luarocks.util") 7local util = require("luarocks.util")
8local cfg = require("luarocks.cfg") 8local cfg = require("luarocks.cfg")
9local deps = require("luarocks.deps")
9 10
10--- Driver function for the "cmake" build back-end. 11--- Driver function for the "cmake" build back-end.
11-- @param rockspec table: the loaded rockspec. 12-- @param rockspec table: the loaded rockspec.
@@ -53,13 +54,26 @@ function cmake.run(rockspec)
53 return nil, "Failed cmake." 54 return nil, "Failed cmake."
54 end 55 end
55 56
56 if not fs.execute_string(rockspec.variables.CMAKE.." --build build.luarocks --config Release") then 57 local do_build, do_install
57 return nil, "Failed building." 58 if deps.format_is_at_least(rockspec, "3.0") then
59 do_build = (build.build_pass == nil) and true or build.build_pass
60 do_install = (build.install_pass == nil) and true or build.install_pass
61 else
62 do_build = true
63 do_install = true
58 end 64 end
59 65
60 if not fs.execute_string(rockspec.variables.CMAKE.." --build build.luarocks --target install --config Release") then 66 if do_build then
61 return nil, "Failed installing." 67 if not fs.execute_string(rockspec.variables.CMAKE.." --build build.luarocks --config Release") then
68 return nil, "Failed building."
69 end
62 end 70 end
71 if do_install then
72 if not fs.execute_string(rockspec.variables.CMAKE.." --build build.luarocks --target install --config Release") then
73 return nil, "Failed installing."
74 end
75 end
76
63 return true 77 return true
64end 78end
65 79