Skip to content

Commit

Permalink
Fix r build.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Apr 12, 2019
1 parent 295eefa commit 3d31a81
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmake/Utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ endfunction(format_gencode_flags flags)
# if necessary, installs the main R package dependencies;
# runs R CMD INSTALL.
function(setup_rpackage_install_target rlib_target build_dir)
# backup cmake_install.cmake
install(CODE "file(COPY \"${build_dir}/R-package/cmake_install.cmake\"
DESTINATION \"${build_dir}/\")")
DESTINATION \"${build_dir}/bak\")")

install(CODE "file(REMOVE_RECURSE \"${build_dir}/R-package\")")
install(
DIRECTORY "${PROJECT_SOURCE_DIR}/R-package"
Expand All @@ -102,6 +104,8 @@ DESTINATION \"${build_dir}/\")")
install(CODE "execute_process(COMMAND \"${LIBR_EXECUTABLE}\" \"-q\" \"-e\" \"${XGB_DEPS_SCRIPT}\")")
install(CODE "execute_process(COMMAND \"${LIBR_EXECUTABLE}\" CMD INSTALL\
\"--no-multiarch\" \"--build\" \"${build_dir}/R-package\")")
install(CODE "file(COPY \"${build_dir}/cmake_install.cmake\"
DESTINATION \"${build_dir}/R-package\")")

# restore cmake_install.cmake
install(CODE "file(RENAME \"${build_dir}/bak/cmake_install.cmake\"
\"${build_dir}/R-package/cmake_install.cmake\")")
endfunction(setup_rpackage_install_target)

0 comments on commit 3d31a81

Please sign in to comment.