Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bind to full path of R executable in FindLibR.cmake

  • Loading branch information...
commit a5ed0b69edd29f136d8822908c0167020503bfab 1 parent 498d62c
@jjallaire jjallaire authored
View
10 cmake/modules/FindLibR.cmake
@@ -25,6 +25,7 @@ if(APPLE)
set(LIBR_HOME "${LIBR_LIBRARIES}/Resources" CACHE PATH "R home directory")
set(LIBR_INCLUDE_DIRS "${LIBR_HOME}/include" CACHE PATH "R include directory")
set(LIBR_DOC_DIR "${LIBR_HOME}/doc" CACHE PATH "R doc directory")
+ set(LIBR_EXECUTABLE "${LIBR_HOME}/R" CACHE PATH "R executable")
endif()
# detection for UNIX & Win32
@@ -111,6 +112,13 @@ else()
endif()
+ # look for the R executable
+ find_program(LIBR_EXECUTABLE R
+ HINTS ${LIBRARY_ARCH_HINT_PATH} ${LIBR_HOME}/bin)
+ if(LIBR_EXECUTABLE-NOTFOUND)
+ message(STATUS "Unable to locate R executable")
+ endif()
+
# look for the core R library
find_library(LIBR_CORE_LIBRARY NAMES R
HINTS ${LIBR_LIB_DIR} ${LIBRARY_ARCH_HINT_PATH} ${LIBR_HOME}/bin)
@@ -157,6 +165,7 @@ endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibR DEFAULT_MSG
LIBR_HOME
+ LIBR_EXECUTABLE
LIBR_INCLUDE_DIRS
LIBR_LIBRARIES
LIBR_DOC_DIR
@@ -168,7 +177,6 @@ endif()
# mark low-level variables from FIND_* calls as advanced
mark_as_advanced(
- LIBR_EXECUTABLE
LIBR_CORE_LIBRARY
LIBR_LAPACK_LIBRARY
LIBR_BLAS_LIBRARY
View
4 src/cpp/r/R/packages/CMakeLists.txt
@@ -28,7 +28,7 @@ set_source_files_properties(${MANIPULATE_DEPENDENCIES} PROPERTIES
add_custom_command(OUTPUT ${MANIPULATE_OUTPUT}
DEPENDS ${MANIPULATE_DEPENDENCIES}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND R
+ COMMAND ${LIBR_EXECUTABLE}
ARGS CMD INSTALL -l ${PACKAGES_LIBRARY_DIR} manipulate)
# rstudio package
@@ -42,7 +42,7 @@ set_source_files_properties(${RSTUDIO_DEPENDENCIES} PROPERTIES
add_custom_command(OUTPUT ${RSTUDIO_OUTPUT}
DEPENDS ${RSTUDIO_DEPENDENCIES}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND R
+ COMMAND ${LIBR_EXECUTABLE}
ARGS CMD INSTALL -l ${PACKAGES_LIBRARY_DIR} rstudio)
Please sign in to comment.
Something went wrong with that request. Please try again.