diff --git a/src/GmshTools.jl b/src/GmshTools.jl index 1fd67d4..a599549 100644 --- a/src/GmshTools.jl +++ b/src/GmshTools.jl @@ -3,16 +3,20 @@ module GmshTools using MLStyle const depsjl_path = joinpath(@__DIR__, "..", "deps", "deps.jl") -if !isfile(depsjl_path) - error("libgmsh not installed properly, run Pkg.build(\"GmshTools\"), restart Julia and try again") -end -include(depsjl_path) - -gmshmodule = joinpath(dirname(libgmsh), "gmsh.jl") -include(gmshmodule) function __init__() - check_deps() + try + include(depsjl_path) + gmshmodule = joinpath(dirname(libgmsh), "gmsh.jl") + include(gmshmodule) + Base.invokelatest(check_deps) # world age problem + catch ex + if isa(ex, ErrorException) + @error "libgmsh not installed properly. Please check *.travis* for additional dependencies and rebuild this package." + else + rethrow(ex) + end + end end export gmsh, @gmsh_do, @gmsh_open