diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2012-09-19 20:18:52 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2012-09-19 20:18:52 -0300 |
| commit | e44bee9563f69b992acd55ca05f20d9b2b60eb00 (patch) | |
| tree | 1a3b7e18ee640a8a248a1ffe158f2ffe799dd9a0 /src | |
| parent | 130d5309a85b3962ef354551090f4220c3840841 (diff) | |
| download | luarocks-e44bee9563f69b992acd55ca05f20d9b2b60eb00.tar.gz luarocks-e44bee9563f69b992acd55ca05f20d9b2b60eb00.tar.bz2 luarocks-e44bee9563f69b992acd55ca05f20d9b2b60eb00.zip | |
Test for cmake in path before failing randomly. Closes #92.
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/build/cmake.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/luarocks/build/cmake.lua b/src/luarocks/build/cmake.lua index 2d9abf9e..82f4ff58 100644 --- a/src/luarocks/build/cmake.lua +++ b/src/luarocks/build/cmake.lua | |||
| @@ -21,6 +21,10 @@ function run(rockspec) | |||
| 21 | variables.CMAKE_INCLUDE_PATH=os.getenv("CMAKE_INCLUDE_PATH") | 21 | variables.CMAKE_INCLUDE_PATH=os.getenv("CMAKE_INCLUDE_PATH") |
| 22 | 22 | ||
| 23 | util.variable_substitutions(variables, rockspec.variables) | 23 | util.variable_substitutions(variables, rockspec.variables) |
| 24 | |||
| 25 | if not fs.execute_string(fs.quiet(rockspec.variables.CMAKE.." --help")) then | ||
| 26 | return nil, "'"..rockspec.variables.CMAKE.."' program not found. Is cmake installed? You may want to edit variables.CMAKE" | ||
| 27 | end | ||
| 24 | 28 | ||
| 25 | -- If inline cmake is present create CMakeLists.txt from it. | 29 | -- If inline cmake is present create CMakeLists.txt from it. |
| 26 | if type(build.cmake) == "string" then | 30 | if type(build.cmake) == "string" then |
| @@ -39,15 +43,15 @@ function run(rockspec) | |||
| 39 | args = args .. ' -D' ..k.. '="' ..v.. '"' | 43 | args = args .. ' -D' ..k.. '="' ..v.. '"' |
| 40 | end | 44 | end |
| 41 | 45 | ||
| 42 | if not fs.execute(rockspec.variables.CMAKE.." . " ..args) then | 46 | if not fs.execute_string(rockspec.variables.CMAKE.." . " ..args) then |
| 43 | return nil, "Failed cmake." | 47 | return nil, "Failed cmake." |
| 44 | end | 48 | end |
| 45 | 49 | ||
| 46 | if not fs.execute(rockspec.variables.MAKE.." -fMakefile") then | 50 | if not fs.execute_string(rockspec.variables.MAKE.." -fMakefile") then |
| 47 | return nil, "Failed building." | 51 | return nil, "Failed building." |
| 48 | end | 52 | end |
| 49 | 53 | ||
| 50 | if not fs.execute(rockspec.variables.MAKE.." -fMakefile install") then | 54 | if not fs.execute_string(rockspec.variables.MAKE.." -fMakefile install") then |
| 51 | return nil, "Failed installing." | 55 | return nil, "Failed installing." |
| 52 | end | 56 | end |
| 53 | return true | 57 | return true |
