Skip to content
Snippets Groups Projects
build.bat 1.16 KiB
@echo off

rem call VsDevCmd.bat

title Build lib4neuro project

rem Build type (Release/Debug)
set BUILD_TYPE=Debug
rem Should we rebuild BOOST? (yes/no)
set REBUILD_BOOST=yes

rem Should we build the examples? (yes/no)
set BUILD_EXAMPLES=yes

rem Should we build the unit-tests? (yes/no)
set BUILD_TESTS=yes

rem Should we build the lib4neuro library? (yes)
set BUILD_LIB=yes

rem C++ compiler
set CXX_COMPILER=cl
set C_COMPILER=cl

rem Makefile generator
rem For the complete list type "cmake --help"
rem Example: "MSYS Makefiles", "MinGW Makefiles", "NMake Makefiles"
set MAKEFILE_GENERATOR="Visual Studio 15 2017 Win64"

call clean.bat
cmake -G %MAKEFILE_GENERATOR% -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_CXX_COMPILER=%CXX_COMPILER% -DCMAKE_C_COMPILER=%C_COMPILER% -DBOOST_ROOT=%BOOST_ROOT% -DBOOST_LIBRARYDIR=%BOOST_LIBRARYDIR% -DBOOST_INCLUDEDIR=%BOOST_INCLUDEDIR% -DBUILD_TESTS=%BUILD_TESTS% -DBUILD_EXAMPLES=%BUILD_EXAMPLES% -DBUILD_LIB=%BUILD_LIB% -DLIB4NEURO_DIR=build\lib .
cmake --build . --config %BUILD_TYPE% && (echo (Build complete.); echo (For examples have a look at the folder build/examples.)) || (echo "Build finished with errors!")