Created
January 29, 2013 08:03
-
-
Save wush978/4662585 to your computer and use it in GitHub Desktop.
CMakeLists.txt for Rcpp Package Project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8) | |
project(RcppPackage) | |
find_package(LibR) | |
if(${LIBR_FOUND}) | |
else() | |
message(FATAL_ERROR "No R...") | |
endif() | |
message(STATUS ${CMAKE_SOURCE_DIR}) | |
execute_process( | |
COMMAND ${LIBR_EXECUTABLE} "--slave" "-e" "stopifnot(require('Rcpp'));cat(Rcpp:::Rcpp.system.file('include'))" | |
OUTPUT_VARIABLE LIBRCPP_INCLUDE_DIRS | |
) | |
include_directories(BEFORE ${LIBR_INCLUDE_DIRS}) | |
message(STATUS ${LIBR_INCLUDE_DIRS}) | |
include_directories(BEFORE ${LIBRCPP_INCLUDE_DIRS}) | |
message(STATUS ${LIBRCPP_INCLUDE_DIRS}) | |
add_custom_target(RcppPackage ALL | |
COMMAND find ${CMAKE_SOURCE_DIR} -name "*.o" -exec rm "{}" "\;" | |
COMMAND find ${CMAKE_SOURCE_DIR} -name "*.so" -exec rm "{}" "\;" | |
COMMAND ${LIBR_EXECUTABLE} "--slave" "-e" "\"stopifnot(require(roxygen2));roxygenize('${CMAKE_SOURCE_DIR}',roclets=c('rd','collate','namespace'))\"" | |
COMMAND ${LIBR_EXECUTABLE} CMD INSTALL "${CMAKE_SOURCE_DIR}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment