-
-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved CMakeLists.txt and scripts for Windows
Former-commit-id: bd6a13b
- Loading branch information
Showing
6 changed files
with
199 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
@echo off | ||
setlocal enabledelayedexpansion | ||
|
||
:: %%% Set build config | ||
set PYTHON=ON | ||
set LUA=OFF | ||
set JAVA=OFF | ||
set CMAKE_GENERATOR_NAME=Visual Studio 15 2017 Win64 | ||
|
||
:: %%% Set path to folder with libraries and clone/copy https://github.com/mwydmuch/ViZDoomWinDepBin to it. | ||
set LIB_DIR=C:\libs | ||
|
||
:: API dependencies | ||
:: %%% Set path to Boost library | ||
set BOOST_ROOT=%LIB_DIR%\boost | ||
set BOOST_INCLUDEDIR=%BOOST_ROOT% | ||
set BOOST_LIBRARYDIR=%BOOST_ROOT%\libs | ||
|
||
:: Python | ||
:: %%% Set Python version (27, 34, 35, 36) or change paths for other distribusions | ||
set PYTHON_VERSION=36 | ||
set PYTHON_BIG_VERSION=%PYTHON_VERSION:~0,1% | ||
set PYTHON_EXECUTABLE=C:\Python%PYTHON_VERSION%\python.exe | ||
set PYTHON_INCLUDE_DIR=C:\Python%PYTHON_VERSION%\include | ||
set PYTHON_LIBRARY=C:\Python%PYTHON_VERSION%\libs\python%PYTHON_VERSION%.lib | ||
set NUMPY_INCLUDES=C:\Python%PYTHON_VERSION%\Lib\site-packages\numpy\core\include | ||
|
||
|
||
:: Rest of the script | ||
::-------------------------------------------------------------------------------------------------------------------- | ||
|
||
:: Lua | ||
set LUA_INCLUDE_DIR=%LIB_DIR%\lua\include | ||
set LUA_LIBRARY=%LIB_DIR%\lua\lua5.1.lib | ||
|
||
:: ZDoom dependencies | ||
set FMOD_INCLUDE_DIR=%LIB_DIR%\fmod\inc | ||
set FMOD_LIBRARY=%LIB_DIR%\fmod\lib\fmodex64.lib | ||
set MPG123_INCLUDE_DIR=%LIB_DIR%\libmpg123 | ||
set MPG123_LIBRARIES=%LIB_DIR%\libmpg123\libmpg123-0.lib | ||
set SNDFILE_INCLUDE_DIR=%LIB_DIR%\libsndfile\include | ||
set SNDFILE_LIBRARY=%LIB_DIR%\libsndfile\lib\libsndfile-1.lib | ||
set OPENAL_INCLUDE_DIR=%LIB_DIR%\openal\include | ||
set OPENAL_LIBRARY=%LIB_DIR%\openal\libs\openal32.lib | ||
set YASM_PATH=%LIB_DIR%\yasm.exe | ||
|
||
:: CMake command | ||
set CMAKE_CMD=-G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=Release -DBOOST_INCLUDEDIR="%BOOST_INCLUDEDIR%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" -DBOOST_ROOT="%BOOST_ROOT%" -DFMOD_INCLUDE_DIR="%FMOD_INCLUDE_DIR%" -DFMOD_LIBRARY="%FMOD_LIBRARY%" -DMPG123_INCLUDE_DIR="%MPG123_INCLUDE_DIR%" -DMPG123_LIBRARIES="%MPG123_LIBRARIES%" -DSNDFILE_INCLUDE_DIR="%SNDFILE_INCLUDE_DIR%" -DSNDFILE_LIBRARY="%SNDFILE_LIBRARY%" -DOPENAL_INCLUDE_DIR="%OPENAL_INCLUDE_DIR%" -DOPENAL_LIBRARY="%OPENAL_LIBRARY%" -DNO_ASM=ON | ||
:: -DYASM_PATH="%YASM_PATH%" | ||
|
||
if "%LUA%"=="ON" ( | ||
set CMAKE_CMD=!CMAKE_CMD! -DBUILD_LUA=ON -DLUA_INCLUDE_DIR="%LUA_INCLUDE_DIR%" -DLUA_LIBRARY="%LUA_LIBRARY%" | ||
) | ||
|
||
if "%JAVA%"=="ON" ( | ||
set CMAKE_CMD=!CMAKE_CMD! -DBUILD_JAVA=ON | ||
) | ||
|
||
if "%PYTHON%"=="ON" ( | ||
if %PYTHON_BIG_VERSION% equ 2 ( | ||
set CMAKE_CMD=!CMAKE_CMD! -DBUILD_PYTHON=ON | ||
) | ||
|
||
if %PYTHON_BIG_VERSION% equ 3 ( | ||
set CMAKE_CMD=!CMAKE_CMD! -DBUILD_PYTHON3=ON | ||
) | ||
|
||
set CMAKE_CMD=!CMAKE_CMD! -DPYTHON_EXECUTABLE="%PYTHON_EXECUTABLE%" -DPYTHON_INCLUDE_DIR="%PYTHON_INCLUDE_DIR%" -DPYTHON_LIBRARY="%PYTHON_LIBRARY%" -DNUMPY_INCLUDES=%NUMPY_INCLUDES% | ||
) | ||
|
||
del CMakeCache.txt | ||
echo cmake !CMAKE_CMD! | ||
cmake !CMAKE_CMD! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
:: @echo off | ||
setlocal enabledelayedexpansion | ||
|
||
set PYTHON_VERSION=%1 | ||
|
||
set BIN_PATH=.\bin | ||
set PACKAGE_DEST_DIRECTORY=%BIN_PATH%\python%PYTHON_VERSION% | ||
set PACKAGE_DEST_PATH=%PACKAGE_DEST_DIRECTORY%\pip_package | ||
set PACKAGE_SOURCE=.\src\lib_python\src_python | ||
|
||
set VIZDOOM_EXEC_PATH=%BIN_PATH%\vizdoom.exe | ||
set VIZDOOM_PK3_PATH=%BIN_PATH%\vizdoom.pk3 | ||
dir dir .\bin\python3.6\vizdoom*.pyd /b /s > %PACKAGE_DEST_DIRECTORY%\tmp.txt | ||
set /p PYTHON_BIN_PATH=<%PACKAGE_DEST_DIRECTORY%\tmp.txt | ||
del %PACKAGE_DEST_DIRECTORY%\tmp.txt | ||
set PYTHON_BIN_DEST_PATH=%PACKAGE_DEST_PATH%\vizdoom.pyd | ||
|
||
set FREEDOOM_PATH=%BIN_PATH%\freedoom2.wad | ||
set SCENARIOS_DEST_DIR=%PACKAGE_DEST_PATH%\scenarios | ||
set SCENARIOS_PATH=.\scenarios | ||
set EXAMPLES_DEST_DIR=%PACKAGE_DEST_PATH%\examples | ||
set EXAMPLES_PATH=".\examples\python" | ||
|
||
if not exist "%PYTHON_BIN_PATH%" ( | ||
echo "Library for specified Python version does not exist. Aborting." | ||
exit /B 2 | ||
) | ||
|
||
if not exist "%VIZDOOM_EXEC_PATH%" ( | ||
echo "Required ViZDoom's resources do not exist. Aborting." | ||
exit /B 3 | ||
) | ||
|
||
if not exist "%VIZDOOM_PK3_PATH%" ( | ||
echo "Required ViZDoom's resources do not exist. Aborting." | ||
exit /B 3 | ||
) | ||
|
||
del %PACKAGE_DEST_PATH% | ||
md %PACKAGE_DEST_PATH% | ||
|
||
copy "%PACKAGE_SOURCE%\*" "%PACKAGE_DEST_PATH%" | ||
copy "%PYTHON_BIN_PATH%" "%PYTHON_BIN_DEST_PATH%" | ||
copy "%VIZDOOM_EXEC_PATH%" "%PACKAGE_DEST_PATH%" | ||
copy "%VIZDOOM_PK3_PATH%" "%PACKAGE_DEST_PATH%" | ||
copy "%BIN_PATH%\*.dll" "%PACKAGE_DEST_PATH%" | ||
copy "%FREEDOOM_PATH%" "%PACKAGE_DEST_PATH%" | ||
copy "%FREEDOOM_PATH%" "%PACKAGE_DEST_PATH%" | ||
md "%SCENARIOS_DEST_DIR% | ||
copy "%SCENARIOS_PATH%\*.wad" "%SCENARIOS_DEST_DIR%" | ||
copy "%SCENARIOS_PATH%\*.cfg" "%SCENARIOS_DEST_DIR%" | ||
md "%EXAMPLES_DEST_DIR% | ||
copy "%EXAMPLES_PATH%\*.py" "%EXAMPLES_DEST_DIR%" | ||
move "%SCENARIOS_DEST_DIR%\bots.cfg" "%PACKAGE_DEST_PATH%" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@echo off | ||
setlocal enabledelayedexpansion | ||
|
||
:: Checks if bin/freedoom2.wad is in place if not, the zip is downloaded (if not yet present) and freedoom2.wad is extracted to bin directory. | ||
|
||
:: Older version of freedoom | ||
::set FREEDOOM_LINK="https://github.com/freedoom/freedoom/releases/download/v0.10.1/freedoom-0.10.1.zip" | ||
set FREEDOOM_LINK="https://github.com/freedoom/freedoom/releases/download/v0.11.3/freedoom-0.11.3.zip" | ||
set FREEDOOM_ARCHIVE=%FREEDOOM_LINK:~0,-1% | ||
for %%F in (%FREEDOOM_LINK%) do set FREEDOOM_ARCHIVE=%%~nxF | ||
|
||
set FREEDOOM_OUTFILE=".\%FREEDOOM_ARCHIVE%" | ||
set FREEDOOM_DESTINATION_PATH=".\bin" | ||
set FREEDOOM_DESTINATION_FILE="%FREEDOOM_DESTINATION_PATH%\freedoom2.wad" | ||
|
||
if not exist "%FREEDOOM_DESTINATION_FILE%" ( | ||
if not exist "%FREEDOOM_DESTINATION_PATH%" md "%FREEDOOM_DESTINATION_PATH%" | ||
if not exist "%FREEDOOM_OUTFILE%" ( | ||
powershell -command "Invoke-WebRequest '%FREEDOOM_LINK%' -OutFile '%FREEDOOM_OUTFILE%'" | ||
) | ||
powershell -command "Expand-Archive '%FREEDOOM_OUTFILE%' -DestinationPath '%FREEDOOM_DESTINATION_PATH%'" | ||
copy "%FREEDOOM_DESTINATION_PATH%\%FREEDOOM_ARCHIVE:~0,-4%\freedoom2.wad" "%FREEDOOM_DESTINATION_FILE%" | ||
rd "%FREEDOOM_DESTINATION_PATH%\%FREEDOOM_ARCHIVE:~0,-4%" /S /Q | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
#!/bin/sh | ||
|
||
# Checks if bin/freedoom2.wad is in place if not, the zip is downloaded(if not yet present) and freedoom2.wad is extracted to bin directory. | ||
# Checks if bin/freedoom2.wad is in place if not, the zip is downloaded (if not yet present) and freedoom2.wad is extracted to bin directory. | ||
|
||
FREEDOOM_LINK="https://github.com/freedoom/freedoom/releases/download/v0.10.1/freedoom-0.10.1.zip" | ||
# Older version of freedoom | ||
#FREEDOOM_LINK="https://github.com/freedoom/freedoom/releases/download/v0.10.1/freedoom-0.10.1.zip" | ||
FREEDOOM_LINK="https://github.com/freedoom/freedoom/releases/download/v0.11.3/freedoom-0.11.3.zip" | ||
FREEDOOM_ARCHIVE=$(echo ${FREEDOOM_LINK} | cut -d '/' -f9) | ||
FREEDOOM_ARCHIVE_BASENAME=$(basename ${FREEDOOM_ARCHIVE} .zip) | ||
|
||
FREEDOOM_DOWNLOAD_PATH="." | ||
FREEDOOM_DESTINATION_PATH="./bin" | ||
|
||
if [ ! -e "${FREEDOOM_DESTINATION_PATH}/freedoom2.wad" ] | ||
then | ||
if [ ! -e "${FREEDOOM_DOWNLOAD_PATH}/freedoom-0.10.1.zip" ] | ||
then | ||
if [ ! -e "${FREEDOOM_DESTINATION_PATH}/freedoom2.wad" ]; then | ||
if [ ! -e "${FREEDOOM_DOWNLOAD_PATH}/${FREEDOOM_ARCHIVE}" ]; then | ||
wget --no-check-certificate ${FREEDOOM_LINK} -P ${FREEDOOM_DOWNLOAD_PATH} | ||
fi | ||
unzip -j -d ${FREEDOOM_DESTINATION_PATH} ${FREEDOOM_DOWNLOAD_PATH}/freedoom-0.10.1.zip freedoom-0.10.1/freedoom2.wad | ||
unzip -j -d ${FREEDOOM_DESTINATION_PATH} ${FREEDOOM_DOWNLOAD_PATH}/${FREEDOOM_ARCHIVE} ${FREEDOOM_ARCHIVE_BASENAME}/freedoom2.wad | ||
fi | ||
|