Skip to content

Commit

Permalink
Add flags required for compilation with latest Rtools.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjmgarnier committed Oct 31, 2023
1 parent 00c66b8 commit b6e4f72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/opencv.R
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ installOpenCV <- function(path = defaultOpenCVPath(), batch = FALSE) {
gpp_path <- paste0(rtools4Path, "/x86_64-w64-mingw32.static.posix", "/bin/g++.exe")
windres_path <- paste0(rtools4Path, "/x86_64-w64-mingw32.static.posix", "/bin/windres.exe")
make_path <- paste0(rtools4Path, "/usr/bin/make.exe")
system(paste0('cmake -G "Unix Makefiles" -DCMAKE_C_COMPILER=', gcc_path, ' -DCMAKE_CXX_COMPILER=', gpp_path, ' -DCMAKE_RC_COMPILER=', windres_path, ' -DCMAKE_MAKE_PROGRAM=', make_path, ' -DENABLE_PRECOMPILED_HEADERS=OFF -DOpenCV_ARCH=', openCVArch, ' -DOpenCV_RUNTIME=mingw -DBUILD_ZLIB=ON -DOPENCV_EXTRA_MODULES_PATH=', contribDir, ' -DBUILD_LIST=calib3d,core,dnn,features2d,flann,gapi,highgui,imgcodecs,imgproc,ml,objdetect,photo,stitching,video,videoio,ximgproc -DBUILD_opencv_world=OFF -DBUILD_opencv_contrib_world=OFF -DWITH_OPENMP=ON -DWITH_TBB=ON -DWITH_FFMPEG=ON -DWITH_OPENCL=ON -DWITH_EIGEN=ON -DWITH_OPENCLAMDFFT=ON -DWITH_OPENCLAMDBLAS=ON -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DWITH_DSHOW=ON -DBUILD_PROTOBUF=ON -DOPENCV_ENABLE_ALLOCATOR_STATS=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=', path, ' -B', buildDir, ' -H', sourceDir))
system(paste0('cmake -G "Unix Makefiles" -DCMAKE_C_COMPILER=', gcc_path, ' -DCMAKE_CXX_COMPILER=', gpp_path, ' -DCMAKE_RC_COMPILER=', windres_path, ' -DCMAKE_MAKE_PROGRAM=', make_path, ' -DENABLE_PRECOMPILED_HEADERS=OFF -DOpenCV_ARCH=', openCVArch, ' -DOpenCV_RUNTIME=mingw -DBUILD_ZLIB=ON -DOPENCV_EXTRA_MODULES_PATH=', contribDir, ' -DBUILD_LIST=calib3d,core,dnn,features2d,flann,gapi,highgui,imgcodecs,imgproc,ml,objdetect,photo,stitching,video,videoio,ximgproc -DBUILD_opencv_world=OFF -DBUILD_opencv_contrib_world=OFF -DWITH_OPENMP=ON -DWITH_TBB=ON -DWITH_FFMPEG=ON -DWITH_OPENCL=ON -DWITH_EIGEN=ON -DWITH_OPENCLAMDFFT=ON -DWITH_OPENCLAMDBLAS=ON -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DWITH_DSHOW=ON -DBUILD_PROTOBUF=ON -DOPENCV_ENABLE_ALLOCATOR_STATS=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_C_FLAGS_RELEASE="-fstack-protector-strong" -DCMAKE_CXX_FLAGS_RELEASE="-fstack-protector-strong" -DCMAKE_INSTALL_PREFIX=', path, ' -B', buildDir, ' -H', sourceDir))
system(paste0(make_path, " -j", parallel::detectCores(), " -C ", buildDir))
system(paste0(make_path, " -C", buildDir, " install"))
} else {
Expand Down

0 comments on commit b6e4f72

Please sign in to comment.