From 8ed8d3d557cbce1ca44876b1a03f59a70c0ea48d Mon Sep 17 00:00:00 2001 From: Paul Goulart Date: Tue, 9 Jul 2019 22:02:37 +0100 Subject: [PATCH 1/2] fix for CRAN/solaris --- configure/cmake/FindR.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configure/cmake/FindR.cmake b/configure/cmake/FindR.cmake index 86f8ffe47..aa3114e60 100644 --- a/configure/cmake/FindR.cmake +++ b/configure/cmake/FindR.cmake @@ -11,12 +11,23 @@ set(CMAKE_FIND_APPBUNDLE "NEVER") find_program(R_EXEC NAMES R R.exe) set(CMAKE_FIND_APPBUNDLE ${TEMP_CMAKE_FIND_APPBUNDLE}) +set(ENV{R_HOME} "blah") #---Find includes and libraries if R exists if(R_EXEC) set(R_FOUND TRUE) + # On CRAN/Solaris an R_HOME env variable is set and causes + # assignment of R_ROOT_DIR to fail since 'R RHOME' + # issues a warning as its first output. Unset if needed. + + # if((CMAKE_HOST_SOLARIS) AND (DEFINED ENV{R_HOME})) + if((TRUE) AND (DEFINED ENV{R_HOME})) + message(STATUS "Rogue R_HOME defined on Solaris. Will ignore.") + unset(ENV{R_HOME}) + endif() + execute_process(WORKING_DIRECTORY . COMMAND ${R_EXEC} RHOME OUTPUT_VARIABLE R_ROOT_DIR From 71cca7b6fcaf7e844f5b6ba4132d7cce6734ac29 Mon Sep 17 00:00:00 2001 From: Paul Goulart Date: Wed, 10 Jul 2019 21:26:18 +0100 Subject: [PATCH 2/2] solaris fix --- configure/cmake/FindR.cmake | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/configure/cmake/FindR.cmake b/configure/cmake/FindR.cmake index aa3114e60..5a39077c5 100644 --- a/configure/cmake/FindR.cmake +++ b/configure/cmake/FindR.cmake @@ -11,20 +11,13 @@ set(CMAKE_FIND_APPBUNDLE "NEVER") find_program(R_EXEC NAMES R R.exe) set(CMAKE_FIND_APPBUNDLE ${TEMP_CMAKE_FIND_APPBUNDLE}) -set(ENV{R_HOME} "blah") - #---Find includes and libraries if R exists if(R_EXEC) set(R_FOUND TRUE) - # On CRAN/Solaris an R_HOME env variable is set and causes - # assignment of R_ROOT_DIR to fail since 'R RHOME' - # issues a warning as its first output. Unset if needed. - - # if((CMAKE_HOST_SOLARIS) AND (DEFINED ENV{R_HOME})) - if((TRUE) AND (DEFINED ENV{R_HOME})) - message(STATUS "Rogue R_HOME defined on Solaris. Will ignore.") + if((CMAKE_HOST_SOLARIS) AND (DEFINED ENV{R_HOME})) + message(STATUS "Unsetting R_HOME on Solaris.") unset(ENV{R_HOME}) endif()