lutraconsulting / MDAL

Mesh Data Abstraction Library
http://www.mdal.xyz/
MIT License
160 stars 50 forks source link

Changes to Win Build #297

Closed runette closed 4 years ago

runette commented 4 years ago

I don't understand the recent changes to the scripts folder.

BEFORE

There was a win build.bash script. It was not perfect but it worked. The README instructions for building the project in Windows referred to this script.

NOW

The build.bash script has gone. The README instructions still refer to it as the way to build the project in Windows!

I am not sure if the script has been deleted in error, or if the script was deleted for a reason and the README was not updated and if the latter what the intention is for people who need to build the project in Windows?

PeterPetrik commented 4 years ago

it was migrated to github workflows, the README should be fixed accordingly. now it uses https://github.com/lutraconsulting/MDAL/blob/master/.github/workflows/windows_tests.yml

runette commented 4 years ago

I think I must have missed something obvious because I cannot see how to use that to locally build a version of mdal.dll?

runette commented 4 years ago

Re-opening this just because of a couple of minor builds. The new instructions work really well - better than before - but it should also be noted :

only works for the Enterprise version. For the community version the "enterprise" should be changed to "community". Pretty obvious but worth noting in the text. Also, for safety, it probably should be

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86 

I actually am using the following batch file and it works well :

"C:\Program files\CMake\bin\cmake" -G "Visual Studio 16 2019" ^
-DCMAKE_BUILD_TYPE=Rel  ^
-DENABLE_TESTS=ON  ^
-DNETCDF_PREFIX="C:\OSGeo4W64" ^
-DHDF5_ROOT="C:\OSGeo4W64" ^
-DGDAL_DIR="C:\OSGeo4W64" ^
-DGDAL_LIBRARY="C:\OSGeo4W64\lib\gdal_i.lib" ^
-DGDAL_INCLUDE_DIR="C:\OSGeo4W64\include" ^
-DLIBXML2_LIBRARIES="C:\OSGeo4W64\lib\libxml2.lib" ^
-DLIBXML2_INCLUDE_DIR="C:\OSGeo4W64\include\libxml2" ..

"C:\Program files\CMake\bin\cmake" --build .

copy /B mdal\debug\mdal.dll tests\debug

"C:\Program files\CMake\bin\ctest" -VV --exclude-regex mdalinfo*
PeterPetrik commented 4 years ago

if you do something like

set PATH="C:\OSGeo4W64\bin;<your_build_dir>\build\tool\Debug\;<your_build_dir>\build\mdal\Debug;%PATH%"

you maybe do not need to copy the dlls all the time..

runette commented 4 years ago

To be honest - I prefer to do it "manually" since that way I know exactly what versions I am testing against. But this is the sort of thing that should be documented.

On Fri, 28 Aug 2020 at 16:32, Peter Petrik notifications@github.com wrote:

if you do something like

set PATH="C:\OSGeo4W64\bin;\build\tool\Debug\;\build\mdal\Debug;%PATH%"

you maybe do not need to copy the dlls all the time..

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lutraconsulting/MDAL/issues/297#issuecomment-682718621, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARC2MZXQ7KRP5VNACIW6KDSC7EZRANCNFSM4QLS34FQ .

PeterPetrik commented 4 years ago

ok, no problem, fixed in https://github.com/lutraconsulting/MDAL/commit/1d302ede9ceee6b93a937581a6419ea07e3d79c5

feel free to adjust the README, I am not doing development on windows and therefore I can only copy what you suggests there.