Skip to content

Commit

Permalink
add sudo only when installing non locally
Browse files Browse the repository at this point in the history
  • Loading branch information
berdal84 committed Nov 27, 2024
1 parent 948b98a commit 039c035
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rake/_cmake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ def tasks_for_cmake_target( target )
end

task :install => :build do
cmd = "cmake --install #{build_dir} --prefix #{install_dir}"
if BUILD_OS_LINUX or BUILD_OS_MACOS
sh "sudo #{cmd}"
cmd = "cmake --install #{build_dir} --prefix #{install_dir}"
if not install_dir and (BUILD_OS_LINUX or BUILD_OS_MACOS)
sh "sudo #{cmd}"
else
sh "#{cmd}"
end
sh "#{cmd}"
end
end
end

0 comments on commit 039c035

Please sign in to comment.