diff --git a/R-package/src/cmake/modules/FindLibR.cmake b/R-package/src/cmake/modules/FindLibR.cmake index 48954485e1da..733724cc3736 100644 --- a/R-package/src/cmake/modules/FindLibR.cmake +++ b/R-package/src/cmake/modules/FindLibR.cmake @@ -71,10 +71,10 @@ if(APPLE) find_library(LIBR_LIBRARIES R) if(LIBR_LIBRARIES MATCHES ".*\\.framework") - 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_EXECUTABLE "${LIBR_HOME}/R" CACHE PATH "R executable") - set(LIBR_LIB_DIR "${LIBR_HOME}/lib" CACHE PATH "R lib directory") + set(LIBR_HOME "${LIBR_LIBRARIES}/Resources") + set(LIBR_INCLUDE_DIRS "${LIBR_HOME}/include") + set(LIBR_EXECUTABLE "${LIBR_HOME}/R") + set(LIBR_LIB_DIR "${LIBR_HOME}/lib") else() get_filename_component(_LIBR_LIBRARIES "${LIBR_LIBRARIES}" REALPATH) get_filename_component(_LIBR_LIBRARIES_DIR "${_LIBR_LIBRARIES}" DIRECTORY)