Skip to content

Instantly share code, notes, and snippets.

@LaurentBerger
Last active April 29, 2018 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LaurentBerger/dd65f04b846a742c1457dbe5b1aa169d to your computer and use it in GitHub Desktop.
Save LaurentBerger/dd65f04b846a742c1457dbe5b1aa169d to your computer and use it in GitHub Desktop.
#!/bin/bash -e
myRepo=$(pwd)
CMAKE_CONFIG_GENERATOR="Visual Studio 15 2017 Win64"
RepoSource=opencv
cd Build/$RepoSource
CMAKE_OPTIONS='-DBUILD_opencv_world:BOOL=OFF -DBUILD_PERF_TESTS:BOOL=OFF -DBUILD_TESTS:BOOL=ON -DBUILD_DOCS:BOOL=OFF -DWITH_CUDA:BOOL=OFF -DBUILD_EXAMPLES:BOOL=ON -DWITH_LAPACK:BOOL=ON -DCV_TRACE:BOOL=OFF'
cmake -G"$CMAKE_CONFIG_GENERATOR" \
-DTesseract_INCLUDE_DIR:PATH="${myRepo}"/Install/tesseract/include -DTesseract_LIBRARY="${myRepo}"/Install/tesseract/lib/tesseract400.lib -DLept_LIBRARY="${myRepo}"/Install/leptonica/lib/leptonica-1.74.4.lib \
-DEIGEN_DIR:PATH="$myRepo"/eigen -DEIGEN_INCLUDE_DIR="$myRepo"/eigen -DEIGEN_INCLUDE_PATH="$myRepo"/eigen \
-DCeres_DIR="$myRepo"/install/ceres-solver/cmake -Dglog_DIR:PATH="$myRepo"/install/glog/lib/cmake/glog -Dgflags_DIR:PATH="$myRepo"/install/gflags/lib/cmake/gflags \
-DLAPACK_IMPL=MKL -DMKL_ROOT_DIR:PATH="C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/mkl" \
-DMKL_INCLUDE_DIRS:PATH="C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/mkl/include" \
-DBLAS_mkl_intel_lp64_LIBRARY:FILEPATH="C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/mkl/lib/intel64_win/mkl_intel_lp64.lib" \
-DBLAS_mkl_sequential_LIBRARY:FILEPATH="C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/mkl/lib/intel64_win/mkl_rt.lib" \
-DBLAS_mkl_intel_c_LIBRARY:FILEPATH="C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows/mkl/lib/intel64_win/mkl_core.lib" \
-DPYTHON_EXECUTABLE="C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/python.exe" \
-DPYTHON3_LIBRARY="C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/libs/python36.lib" \
-DPYTHON3_NUMPY_INCLUDE_DIRS="C:/Users/Laurent/AppData/Roaming/Python/Python36/site-packages/numpy/core/include" \
-DPYTHON3_PACKAGES_PATH="C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/Lib/site-packages" \
$CMAKE_OPTIONS -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-DVTK_DIR:PATH="$myRepo"/install/vtk/lib/cmake/vtk-8.1 -DINSTALL_CREATE_DISTRIB=ON -DCMAKE_INSTALL_PREFIX=../../install/"$RepoSource" ../../"$RepoSource"
cd ..
echo "************************* $Source_DIR -->devenv debug"
cmake --build $RepoSource --config debug
echo "************************* $Source_DIR -->devenv release"
cmake --build $RepoSource --target install --config debug
echo "************************* $Source_DIR -->devenv debug"
cmake --build $RepoSource --config release
echo "************************* $Source_DIR -->devenv release"
cmake --build $RepoSource --target install --config release
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment