[89] | 1 | @echo off
|
---|
| 2 |
|
---|
| 3 | echo #################################################
|
---|
| 4 | echo # ___________ ____ ______ __ __ _____ #
|
---|
| 5 | echo # \____ \__ \ _/ ___\\____ \^| ^| \/ ___/ #
|
---|
| 6 | echo # ^| ^|_^> ^> __ \\ \___^| ^|_^> ^> ^| /\___ \ #
|
---|
| 7 | echo # ^| __(____ /\___ ^> __/^|____//____ ^> #
|
---|
| 8 | echo # ^|__^| \/ \/^|__^| \/ #
|
---|
| 9 | echo # #
|
---|
| 10 | echo #################################################
|
---|
| 11 | echo:
|
---|
| 12 |
|
---|
| 13 | echo ========================================
|
---|
| 14 | echo PACPUS BUILD MSVC
|
---|
| 15 | echo ========================================
|
---|
| 16 | echo:
|
---|
| 17 |
|
---|
| 18 | :preamble
|
---|
| 19 | :: Check the args
|
---|
| 20 | if "%1" == "" goto usage
|
---|
| 21 | :: Check if the user is in the build directory
|
---|
| 22 | if not exist "%CD%\..\README.txt" goto usage
|
---|
| 23 | :: Args ok, go to build
|
---|
| 24 | goto build
|
---|
| 25 |
|
---|
| 26 | :usage
|
---|
| 27 | echo Usage:
|
---|
| 28 | echo build-msvc.bat [install_dir]
|
---|
| 29 | echo The script must be run in the build directory, which is 'trunk\build'
|
---|
| 30 | echo:
|
---|
| 31 | echo Where:
|
---|
| 32 | echo install_dir is the installation directory of the library
|
---|
| 33 | echo:
|
---|
| 34 | echo For instance, here is how to build Pacpus:
|
---|
| 35 | echo ..\scripts\build-msvc.bat "D:\Libraries\Pacpus"
|
---|
| 36 | echo:
|
---|
| 37 | goto exit
|
---|
| 38 |
|
---|
| 39 | :build
|
---|
| 40 | :: Root of the repository
|
---|
| 41 | set root_dir=%CD%\..
|
---|
| 42 | :: Initialize the environment of log4cxx
|
---|
| 43 | set LOG4CXX_ROOT=%root_dir%\3rd\apache-log4cxx
|
---|
| 44 | :: Initialize the build
|
---|
[346] | 45 | cmake .. -DPACPUS_INSTALL_DIR="%1" -DPACPUS_INSTALL_3RD=TRUE -DPACPUS_USE_LOG=TRUE -DPACPUS_INSTALL_WITH_VERSION_NUMBER=TRUE
|
---|
[89] | 46 | :: Build in debug and release
|
---|
[344] | 47 | REM msbuild Pacpus.sln /p:Configuration=Debug
|
---|
| 48 | REM msbuild Pacpus.sln /p:Configuration=Release
|
---|
[89] | 49 | :: Install
|
---|
[344] | 50 | REM msbuild INSTALL.vcxproj /p:Configuration=Debug
|
---|
| 51 | REM msbuild INSTALL.vcxproj /p:Configuration=Release
|
---|
| 52 | REM echo Build finished, do not forget to check the MSVC's output
|
---|
[89] | 53 |
|
---|
| 54 | :exit
|
---|
| 55 | pause |
---|