Salome HOME
rely on non empty %SALOME_APPLICATION_NAME% to target URANIE
[tools/sat_salome.git] / products / compil_scripts / cython.bat
1 @echo off\r
2 \r
3 echo ##########################################################################\r
4 echo Cython %VERSION%\r
5 echo ##########################################################################\r
6 \r
7 REM install in python directly\r
8 SET INSTALL_CENTRALLY=1\r
9 \r
10 IF NOT DEFINED SAT_DEBUG (\r
11   SET SAT_DEBUG=0\r
12 )\r
13 \r
14 if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL%\r
15 \r
16 REM clean BUILD directory\r
17 if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR%\r
18 mkdir %BUILD_DIR%\r
19 \r
20 cd %SOURCE_DIR%\r
21 \r
22 echo.\r
23 echo --------------------------------------------------------------------------\r
24 echo *** Launching "python.exe setup.py build"\r
25 echo --------------------------------------------------------------------------\r
26 set BUILD_OPT=\r
27 REM not built by OCCT - see spns #20292 attached Excel document\r
28 REM if %SAT_DEBUG% == 1 (\r
29 REM    set BUILD_OPT=--debug\r
30 REM)\r
31 \r
32 %PYTHON_ROOT_DIR%\python.exe setup.py build %BUILD_OPT%\r
33 \r
34 \r
35 echo.\r
36 echo --------------------------------------------------------------------------\r
37 echo *** Launching "python.exe setup.py install"\r
38 echo --------------------------------------------------------------------------\r
39 if %INSTALL_CENTRALLY% == 1 (\r
40     %PYTHON_ROOT_DIR%\python.exe setup.py install \r
41 ) else (\r
42     %PYTHON_ROOT_DIR%\python.exe setup.py install  --single-version-externally-managed --root=/ --prefix=%PRODUCT_INSTALL% --install-lib=%PRODUCT_INSTALL%\lib\python%PYTHON_VERSION%\site-packages\r
43 )\r
44 if NOT %ERRORLEVEL% == 0  (\r
45     echo "ERROR on setup install"\r
46     exit 3\r
47 )\r
48 \r
49 REM In debug mode, we need to rename all .pyd to _d.pyd... don't ask why. Seems like a known bug in OmniORB.\r
50 if %SAT_DEBUG% == 1 (\r
51   cd %PYTHON_ROOT_DIR%\lib\site-packages\Cython-0.29.12-py3.6-win-amd64.egg\r
52   powershell -Command "Get-ChildItem -File -Recurse *.pyd| ForEach-Object {if ((!$_.Name.EndsWith('_d.pyd'))) {  $_ | Copy-Item -Destination {$_.Name  -replace '.pyd','_d.pyd'}}}"\r
53   cd %PYTHON_ROOT_DIR%lib\site-packages\Cython-0.29.12-py3.6-win-amd64.egg\Cython\Runtime\r
54   powershell -Command "Get-ChildItem -File -Recurse *.pyd| ForEach-Object {if ((!$_.Name.EndsWith('_d.pyd'))) {  $_ | Copy-Item -Destination {$_.Name  -replace '.pyd','_d.pyd'}}}"\r
55 )\r
56 \r
57 echo.\r
58 echo Product %PRODUCT_NAME% version: %VERSION%> %PRODUCT_INSTALL%\README.txt\r
59 echo Installation folder: %PYTHON_ROOT_DIR%>> %PRODUCT_INSTALL%\README.txt\r
60 \r
61 echo.\r
62 echo ########## END\r