Skip to content

Commit 71a2641

Browse files
committed
Try to fix MACOS build
1 parent 3f66e5c commit 71a2641

File tree

5 files changed

+29
-4
lines changed

5 files changed

+29
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
*.jl.*.cov
55
*.jl.mem
66

7-
Manifest.toml
7+
Manifest.toml
8+
deps/build.log

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
1212
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
1313
GeometryTypes = "4d00f742-c7ba-57c2-abde-4428a4b178cb"
1414
Mmap = "a63ad114-7e13-5084-954f-fe012c677804"
15+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1516
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
1617

1718
[compat]

deps/build.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@info "Downloading LasTools"
2+
import Pkg
3+
if Sys.isapple()
4+
Pkg.add("LibGit2")
5+
using LibGit2
6+
resource_path = joinpath(dirname(@__DIR__), "resources")
7+
lastools_path = joinpath(dirname(@__DIR__), "LAStools")
8+
lastools_build_path = joinpath(lastools_path, "build")
9+
lastools_install_path = joinpath(lastools_build_path, "install")
10+
lastools_executable_path = joinpath(lastools_install_path, "bin")
11+
if !isdir(lastools_path)
12+
LibGit2.clone("https://github.com/LAStools/LAStools", lastools_path)
13+
end
14+
15+
mkpath(lastools_build_path)
16+
cd(lastools_build_path)
17+
run(`cmake -DCMAKE_INSTALL_PREFIX=$(lastools_install_path) ../`)
18+
run(`cmake --build . --target install --config Release`)
19+
20+
# find the las executable
21+
laszip_executables = filter(x -> startswith(x, "laszip"), readdir(lastools_executable_path))
22+
length(laszip_executables) == 0 && error("Unable to build a laszip executable for $(Sys.MACHINE)")
23+
cp(joinpath(lastools_executable_path, laszip_executables[1]), joinpath(resource_path, "laszip"), force=true)
24+
rm(lastools_path, recursive=true)
25+
end

resources/laszip

1020 KB
Binary file not shown.

src/fileio.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ using Mmap
33
function get_laszip_executable_path()
44
if Sys.iswindows()
55
return joinpath(dirname(@__DIR__), "resources", "laszip.exe")
6-
elseif Sys.islinux()
6+
else # point to the linux build of the executable
77
return joinpath(dirname(@__DIR__), "resources", "laszip")
8-
else
9-
error("LasIO with ZIP functionality is only suported for windows and linux!")
108
end
119
end
1210

0 commit comments

Comments
 (0)