Skip to content

Commit

Permalink
close #16, #33.
Browse files Browse the repository at this point in the history
  • Loading branch information
atimin committed Oct 28, 2018
1 parent 5084318 commit eded1f0
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 24 deletions.
10 changes: 4 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ the root directory of the sources:
$ sh build.sh -t local


By default the installation path is $HOME/.ASNeG. You can change it at any moment:
By default, the installation path is $HOME/.ASNeG. You can change it at any moment:

::

Expand All @@ -86,16 +86,14 @@ is suitable for your target platform (e.g. Native x86) the following command:

::

$ build.bat local
$ build.bat -t local


By default the installation path is C:\\install. You can change it by typing:
By default, the installation path is C:\\ASNeG. You can change it by typing:

::
$ cd local_build
$ set DESTDIR=C:\path\witch\you\prefer
$ MSBuild INSTALL.vcxproj
$ build.bat -t local -i C:\path\witch\you\prefer



Expand Down
72 changes: 54 additions & 18 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,50 @@ REM
REM OpcUaStack build and install script
REM

REM rmdir ./build_local
REM rmdir ./build_tst

set BOOST_VERSION_MAJOR=1
set BOOST_VERSION_MINOR=58
set BOOST_LIBRARYDIR=C:\local\boost_1_58_0\lib32-msvc-12.0

set CMAKE=cmake.exe
set VS=Visual Studio 12 2013
set MSBUILD=C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe


REM ---------------------------------------------------------------------------
REM
REM main
REM
REM ---------------------------------------------------------------------------
set COMMAND=%1

set ARG_COUNT=0
for %%x in (%*) do set /A ARG_COUNT+=1

if %ARG_COUNT% LSS 2 goto :usage

set INSTALL_PREFIX=C:\ASNeG
set COMMAND="local"
set STACK_PREFIX=C:\ASNeG
set VS_GENERATOR=""

:parse
if "%~1"=="" goto :execute

if /i "%~1"=="/t" set COMMAND=%2
if /i "%~1"=="-t" set COMMAND=%2
if /i "%~1"=="--target" set COMMAND=%2

if /i "%~1"=="/i" set INSTALL_PREFIX=%~2
if /i "%~1"=="-i" set INSTALL_PREFIX=%~2
if /i "%~1"=="--install-prefix" set INSTALL_PREFIX=%~2

if /i "%~1"=="/s" set STACK_PREFIX=%~2
if /i "%~1"=="-s" set STACK_PREFIX=%~2
if /i "%~1"=="--stack-prefix" set STACK_PREFIX=%~2

if /i "%~1"=="/vs" set VS_GENERATOR="-G%~2"
if /i "%~1"=="-vs" set VS_GENERATOR="-G%~2"
if /i "%~1"=="--vs-generator" set VS_GENERATOR="-G%~2"


shift
shift
goto :parse


:execute
if "%COMMAND%" == "" (
call:build_local

Expand Down Expand Up @@ -60,13 +85,14 @@ REM ---------------------------------------------------------------------------
REM
REM build OpcUaStack
REM
%CMAKE% -G"%VS%" -H./src/ -B./build_local
%CMAKE% %VS_GENERATOR% -H./src/ -B./build_local

REM
REM install OpcUaStack
REM
set DESTDIR=C:\install
%MSBUILD% ./build_local/INSTALL.vcxproj

set DESTDIR=%INSTALL_PREFIX%
%CMAKE% --build build_local --target install
goto:eof


Expand All @@ -81,12 +107,12 @@ REM ---------------------------------------------------------------------------
REM
REM build unittest
REM
%CMAKE% -G"%VS%" -DOPCUASTACK_INSTALL_PREFIX=C:\install -H./tst/ -B./build_tst
%CMAKE% %VS_GENERATOR% -DOPCUASTACK_INSTALL_PREFIX="%STACK_PREFIX%" -H./tst/ -B./build_tst

REM
REM install OpcUaStack
REM
%MSBUILD% ./build_tst/ALL_BUILD.vcxproj
REM
%CMAKE% --build build_tst
goto:eof


Expand All @@ -96,9 +122,19 @@ REM usage function
REM
REM ---------------------------------------------------------------------------
:usage
echo build.bat (local | tst)
echo "build.bat --target (local | tst)"
echo.
echo --target, -t, /t: sets one of the folowing target:
echo local - create local build and install in folder C:/install
echo tst - build unit application
echo.
echo --stack-prefix, -s, /s STACK_PREFIX: set the path to directory
echo \twhere the OpcUaStack is installed (default: C:\ASNeG)
echo.
echo --install-prefix, -i, /i INSTALL_PREFIX: is the path to directory
echo \twhere the application should be installed (default: C:\ASNeG)
echo.
echo --vs-generator, -vs, /vs VS_GENERATOR: is the name of cmake generator
echo \t witch cmake uses during the building of the project. By default, cmake tries to figure out the generator from the environment.
echo.
goto:eof

0 comments on commit eded1f0

Please sign in to comment.