Skip to content

Commit

Permalink
abilty to run against custom installed versions of R on linux (e.g. /…
Browse files Browse the repository at this point in the history
…usr/local/lib/R)
  • Loading branch information
jjallaire committed Mar 15, 2011
1 parent 396299b commit 968189c
Show file tree
Hide file tree
Showing 16 changed files with 371 additions and 222 deletions.
2 changes: 1 addition & 1 deletion src/cpp/CMakeLists.txt
Expand Up @@ -169,7 +169,7 @@ add_subdirectory(r)
if(RSTUDIO_DESKTOP)

add_subdirectory(desktop)
configure_file(rdesktop-dev ${CMAKE_CURRENT_BINARY_DIR}/rdesktop-dev)
configure_file(rdesktop-dev.in ${CMAKE_CURRENT_BINARY_DIR}/rdesktop-dev)
configure_file(conf/rdesktop-dev.conf ${CMAKE_CURRENT_BINARY_DIR}/conf/rdesktop-dev.conf)

endif()
Expand Down
7 changes: 7 additions & 0 deletions src/cpp/core/Error.cpp
Expand Up @@ -177,6 +177,13 @@ Error pathNotFoundError(const ErrorLocation& location)
return systemError(boost::system::errc::no_such_file_or_directory, location);
#endif
}

Error pathNotFoundError(const std::string& path, const ErrorLocation& location)
{
Error error = pathNotFoundError(location);
error.addProperty("path", path);
return error;
}

struct ErrorLocation::Impl
{
Expand Down
19 changes: 9 additions & 10 deletions src/cpp/core/ProgramOptions.cpp
Expand Up @@ -33,16 +33,6 @@ namespace program_options {

namespace {


void reportError(const std::string& errorMessage,
const ErrorLocation& location)
{
if (core::system::stderrIsTerminal())
std::cerr << errorMessage << std::endl;
else
core::log::logErrorMessage(errorMessage, location);
}

bool validateOptionsProvided(const variables_map& vm,
const options_description& optionsDescription,
const std::string& configFile = std::string())
Expand All @@ -67,6 +57,15 @@ bool validateOptionsProvided(const variables_map& vm,

}

void reportError(const std::string& errorMessage, const ErrorLocation& location)
{
if (core::system::stderrIsTerminal())
std::cerr << errorMessage << std::endl;
else
core::log::logErrorMessage(errorMessage, location);
}


ProgramStatus read(const OptionsDescription& optionsDescription,
int argc,
char * const argv[])
Expand Down
3 changes: 3 additions & 0 deletions src/cpp/core/include/core/Error.hpp
Expand Up @@ -124,6 +124,9 @@ Error systemError(int value,

Error fileExistsError(const ErrorLocation& location);
Error pathNotFoundError(const ErrorLocation& location);
Error pathNotFoundError(const std::string& path,
const ErrorLocation& location);


class ErrorLocation
{
Expand Down
3 changes: 3 additions & 0 deletions src/cpp/core/include/core/ProgramOptions.hpp
Expand Up @@ -48,6 +48,9 @@ struct OptionsDescription
ProgramStatus read(const OptionsDescription& optionsDescription,
int argc,
char * const argv[]);

void reportError(const std::string& errorMessage,
const ErrorLocation& location);

} // namespace program_options
} // namespace core
Expand Down
10 changes: 1 addition & 9 deletions src/cpp/desktop/CMakeLists.txt
Expand Up @@ -77,16 +77,8 @@ if(WIN32)
else()
set(DESKTOP_SOURCE_FILES ${DESKTOP_SOURCE_FILES}
DesktopPosixApplicationLaunch.cpp
DesktopPosixDetectRHome.cpp
)
if(APPLE)
set(DESKTOP_SOURCE_FILES ${DESKTOP_SOURCE_FILES}
DesktopMacDetectRHome.cpp
)
else()
set(DESKTOP_SOURCE_FILES ${DESKTOP_SOURCE_FILES}
DesktopPosixDetectRHome.cpp
)
endif(APPLE)
endif(WIN32)

# include directories
Expand Down
148 changes: 0 additions & 148 deletions src/cpp/desktop/DesktopMacDetectRHome.cpp

This file was deleted.

0 comments on commit 968189c

Please sign in to comment.