bld.bat 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. :: cmd
  2. set LIB=%LIBRARY_LIB%;%LIB%
  3. set LIBPATH=%LIBRARY_LIB%;%LIBPATH%
  4. set INCLUDE=%LIBRARY_INC%;%INCLUDE%;%RECIPE_DIR%
  5. :: Isolate the build.
  6. mkdir Build
  7. cd Build
  8. if errorlevel 1 exit /b 1
  9. :: Generate the build files.
  10. echo "Generating the build files."
  11. cmake .. %CMAKE_ARGS% ^
  12. -G"NMake Makefiles" ^
  13. -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
  14. -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
  15. -DCMAKE_BUILD_TYPE=Release
  16. if errorlevel 1 exit 1
  17. :: Build.
  18. echo "Building..."
  19. nmake
  20. if errorlevel 1 exit /b 1
  21. :: Perforem tests.
  22. echo "Testing..."
  23. ctest -VV --output-on-failure
  24. :: Install.
  25. echo "Installing..."
  26. nmake install
  27. if errorlevel 1 exit /b 1
  28. :: Some OSS libraries are happier if z.lib exists, even though it's not typical on Windows.
  29. copy %LIBRARY_LIB%\zlib.lib %LIBRARY_LIB%\z.lib || exit 1
  30. :: Qt in particular goes looking for this one (as of 4.8.7).
  31. copy %LIBRARY_LIB%\zlib.lib %LIBRARY_LIB%\zdll.lib || exit 1
  32. :: Copy license file to the source directory so conda-build can find it.
  33. copy %RECIPE_DIR%\license.txt %SRC_DIR%\license.txt || exit 1
  34. :: python>=3.10 depend on this being at %PREFIX%
  35. copy %LIBRARY_BIN%\zlib.dll %PREFIX%\zlib.dll || exit 1
  36. :: Error free exit.
  37. echo "Error free exit!"
  38. exit 0