From 8db50317c3169e1db1230b06daf6381ca8b60624 Mon Sep 17 00:00:00 2001 From: Alban Fichet Date: Tue, 30 May 2023 19:29:13 +0200 Subject: [PATCH] Update building scripts for Windows --- CMakeLists.txt | 2 +- ..._dependencies.bat => build_dependencies.ps1 | 10 +++++++--- build_windows.bat | 14 -------------- build_windows.ps1 | 18 ++++++++++++++++++ 4 files changed, 26 insertions(+), 18 deletions(-) rename build_dependencies.bat => build_dependencies.ps1 (85%) delete mode 100644 build_windows.bat create mode 100644 build_windows.ps1 diff --git a/CMakeLists.txt b/CMakeLists.txt index f4b116e..e6578cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -276,7 +276,7 @@ elseif (WIN32) install( FILES - "${ZLIB_ROOT}\\bin\\zlib.dll" # Zlib + "${ZLIB_ROOT}/bin/zlib.dll" # Zlib $ # OpenEXR $ $ diff --git a/build_dependencies.bat b/build_dependencies.ps1 similarity index 85% rename from build_dependencies.bat rename to build_dependencies.ps1 index 5816cf1..b80d745 100644 --- a/build_dependencies.bat +++ b/build_dependencies.ps1 @@ -1,3 +1,5 @@ +$start_dir = $PWD + mkdir build cd build @@ -32,9 +34,11 @@ cd ../.. cd openexr mkdir build cd build -cmake .. ^ - -DCMAKE_INSTALL_PREFIX="../../../lib"^ - -DZLIB_ROOT="../../../lib"^ +cmake .. ` + -DCMAKE_INSTALL_PREFIX="../../../lib" ` + -DZLIB_ROOT="../../../lib" ` -DImath_DIR="../../../lib/cmake/Imath" cmake --build . --target install --config Release + +cd $start_dir \ No newline at end of file diff --git a/build_windows.bat b/build_windows.bat deleted file mode 100644 index c0a80e6..0000000 --- a/build_windows.bat +++ /dev/null @@ -1,14 +0,0 @@ -cd build - -cmake .. ^ - -DCMAKE_PREFIX_PATH="C:\Qt\6.1.0\msvc2019_64"^ - -DZLIB_ROOT="%~dp0\build\depends\lib"^ - -DImath_DIR="%~dp0\build\depends\lib\lib\cmake\Imath"^ - -DOpenEXR_DIR="%~dp0\build\depends\lib\lib\cmake\OpenEXR"^ - -DCMAKE_INSTALL_PREFIX="%~dp0\build\install"^ - -DCMAKE_BUILD_TYPE="Release"^ - -DCMAKE_CONFIGURATION_TYPES="Release" - -cmake --build . --config Release - -cpack \ No newline at end of file diff --git a/build_windows.ps1 b/build_windows.ps1 new file mode 100644 index 0000000..b5d5bee --- /dev/null +++ b/build_windows.ps1 @@ -0,0 +1,18 @@ +$dir = $PWD -replace '\\', '/' + +cd build + +cmake .. ` + -DCMAKE_PREFIX_PATH="C:/Qt/6.5.1/msvc2019_64" ` + -DZLIB_ROOT="$dir/build/depends/lib" ` + -DImath_DIR="$dir/build/depends/lib/lib/cmake/Imath" ` + -DOpenEXR_DIR="$dir/build/depends/lib/lib/cmake/OpenEXR" ` + -DCMAKE_INSTALL_PREFIX="$dir/build/install" ` + -DCMAKE_BUILD_TYPE="Release" ` + -DCMAKE_CONFIGURATION_TYPES="Release" + +cmake --build . --config Release + +cpack + +cd $dir \ No newline at end of file