Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tag: v0.95.245
Fetching contributors…

Cannot retrieve contributors at this time

164 lines (146 sloc) 5.326 kb
#
# CMakeGlobals.txt
#
# Copyright (C) 2009-11 by RStudio, Inc.
#
# This program is licensed to you under the terms of version 3 of the
# GNU Affero General Public License. This program is distributed WITHOUT
# ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
# AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
#
#
# version info
if ("$ENV{RSTUDIO_VERSION_MAJOR}" STREQUAL "")
set(CPACK_PACKAGE_VERSION_MAJOR "99")
else()
set(CPACK_PACKAGE_VERSION_MAJOR $ENV{RSTUDIO_VERSION_MAJOR})
endif()
if ("$ENV{RSTUDIO_VERSION_MINOR}" STREQUAL "")
set(CPACK_PACKAGE_VERSION_MINOR "9")
else()
set(CPACK_PACKAGE_VERSION_MINOR $ENV{RSTUDIO_VERSION_MINOR})
endif()
if ("$ENV{RSTUDIO_VERSION_PATCH}" STREQUAL "")
set(CPACK_PACKAGE_VERSION_PATCH "9")
else()
set(CPACK_PACKAGE_VERSION_PATCH $ENV{RSTUDIO_VERSION_PATCH})
endif()
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
# default to debug builds
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
# platform specific default for targets
if(NOT RSTUDIO_TARGET)
if(WIN32)
set(RSTUDIO_TARGET "Desktop")
else()
set(RSTUDIO_TARGET "All")
endif()
endif()
# set desktop and server build flags
if( ${RSTUDIO_TARGET} STREQUAL "All" OR ${RSTUDIO_TARGET} STREQUAL "Server")
set(RSTUDIO_SERVER TRUE)
endif()
if( ${RSTUDIO_TARGET} STREQUAL "All" OR ${RSTUDIO_TARGET} STREQUAL "Desktop" )
set(RSTUDIO_DESKTOP TRUE)
endif()
# set session64 if specified
if (${RSTUDIO_TARGET} STREQUAL "SessionWin64")
set(RSTUDIO_SESSION_WIN64 TRUE)
endif()
# required R version
set(RSTUDIO_R_MAJOR_VERSION_REQUIRED 2)
set(RSTUDIO_R_MINOR_VERSION_REQUIRED 11)
set(RSTUDIO_R_PATCH_VERSION_REQUIRED 1)
# allow opting out of version checking (for building on older distros)
if(NOT DEFINED RSTUDIO_VERIFY_R_VERSION)
if(RSTUDIO_PACKAGE_BUILD)
set(RSTUDIO_VERIFY_R_VERSION FALSE)
else()
set(RSTUDIO_VERIFY_R_VERSION TRUE)
endif()
endif()
# install freedesktop integration files if we are installing into /usr
if(NOT DEFINED RSTUDIO_INSTALL_FREEDESKTOP)
if(${CMAKE_INSTALL_PREFIX} MATCHES "/usr/.*")
set(RSTUDIO_INSTALL_WITH_PRIV TRUE)
else()
set(RSTUDIO_INSTALL_WITH_PRIV FALSE)
endif()
if(RSTUDIO_INSTALL_WITH_PRIV AND UNIX AND NOT APPLE)
set(RSTUDIO_INSTALL_FREEDESKTOP TRUE)
else()
set(RSTUDIO_INSTALL_FREEDESKTOP FALSE)
endif()
endif()
# cmake modules (compute path relative to this file)
get_filename_component(ROOT_SRC_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
set(CMAKE_MODULE_PATH "${ROOT_SRC_DIR}/cmake/modules/")
# windows dependencies
if(WIN32)
set(RSTUDIO_WINDOWS_DEPENDENCIES_DIR "${ROOT_SRC_DIR}/dependencies/windows")
endif()
# special install directories for apple desktop
if (APPLE AND RSTUDIO_DESKTOP)
set(RSTUDIO_INSTALL_BIN RStudio.app/Contents/MacOS)
set(RSTUDIO_INSTALL_SUPPORTING RStudio.app/Contents/Resources)
else()
if (RSTUDIO_SESSION_WIN64)
set(RSTUDIO_INSTALL_BIN x64)
else()
set(RSTUDIO_INSTALL_BIN bin)
endif()
set(RSTUDIO_INSTALL_SUPPORTING .)
endif()
# if the install prefix is /usr/local then tweak as appropriate
if(UNIX)
if(${CMAKE_INSTALL_PREFIX} STREQUAL "/usr/local")
if(APPLE AND RSTUDIO_DESKTOP)
set(CMAKE_INSTALL_PREFIX "/Applications")
else()
if(RSTUDIO_DESKTOP)
set(CMAKE_INSTALL_PREFIX "/usr/local/lib/rstudio")
else()
set(CMAKE_INSTALL_PREFIX "/usr/local/lib/rstudio-server")
endif()
endif()
endif()
endif()
# detect lsb release
if (UNIX AND NOT APPLE)
if(NOT RSTUDIO_LSB_RELEASE)
execute_process(COMMAND /usr/bin/lsb_release "--id" "--short"
OUTPUT_VARIABLE RSTUDIO_LSB_RELEASE)
if (RSTUDIO_LSB_RELEASE)
string(STRIP ${RSTUDIO_LSB_RELEASE} RSTUDIO_LSB_RELEASE)
string(TOLOWER ${RSTUDIO_LSB_RELEASE} RSTUDIO_LSB_RELEASE)
set(RSTUDIO_LSB_RELEASE ${RSTUDIO_LSB_RELEASE} CACHE STRING "LSB release")
message(STATUS "LSB release: ${RSTUDIO_LSB_RELEASE}")
endif()
endif()
endif()
# make sure the CMAKE_INSTALL_PREFIX uses a cmake style path
file(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX)
# if there isn't an addin path defined and this is a development build
# (detected by target=all and build-type=debug) then look for an addins
# environment variable.
# NOTE: to set environment variables for GUI apps on OSX see:
# http://snipurl.com/apple_environment
#
if(NOT RSTUDIO_ADDINS_PATH)
if(${RSTUDIO_TARGET} STREQUAL "All" AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(RSTUDIO_ADDINS_PATH $ENV{RSTUDIO_ADDINS_PATH})
endif()
endif()
# configure GWT for emulated stack frames (or not). do this here rather than
# within src/gwt/CMakeLists.txt so that even in src/cpp only configs (i.e.
# development mode) we get the RStudio.gwt.xml.in file configured
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(GWT_EMULATED_STACK "true")
else()
set(GWT_EMULATED_STACK "false")
endif()
configure_file(${ROOT_SRC_DIR}/src/gwt/src/org/rstudio/studio/RStudio.gwt.xml.in
${ROOT_SRC_DIR}/src/gwt/src/org/rstudio/studio/RStudio.gwt.xml)
Jump to Line
Something went wrong with that request. Please try again.