From b21f043dea0e4401fd59bed069d6fe306c37ab22 Mon Sep 17 00:00:00 2001 From: Stephen Rhodes Date: Mon, 1 Apr 2024 23:46:36 -0400 Subject: [PATCH] fix windows compilation issues --- README.md | 12 ++++++++---- assets/scripts/build_pkgs | 12 ++++++++++++ assets/scripts/build_pkgs.bat | 17 +++++++++++++++++ assets/scripts/clean | 5 +++++ assets/scripts/clean.bat | 13 +++++++++++++ assets/scripts/compile | 2 ++ assets/scripts/compile.bat | 1 + assets/scripts/make_env.bat | 2 ++ libavio | 2 +- libonvif/CMakeLists.txt | 18 +++++++++++++----- libonvif/pyproject.toml | 2 +- libonvif/setup.py | 2 +- onvif-gui/MANIFEST.in | 1 - onvif-gui/gui/main.py | 2 +- onvif-gui/pyproject.toml | 12 ++++++------ onvif-gui/setup.py | 2 +- 16 files changed, 84 insertions(+), 21 deletions(-) create mode 100755 assets/scripts/build_pkgs create mode 100755 assets/scripts/build_pkgs.bat create mode 100755 assets/scripts/clean.bat create mode 100755 assets/scripts/make_env.bat diff --git a/README.md b/README.md index 2e9a2a5..3f5a1bb 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,6 @@ A client side implementation of the ONVIF specification for Linux, Mac and Windo Description   ---- - Onvif GUI is an integrated camera management and NVR system with an intuitive user interface that can easily manage a fleet of cameras and create high resolution recordings based on alarm conditions. A best of breed YOLO detector is included with the system to facilitate accurate alarm signals without false detections. The system is designed to scale with available hardware and will run on simple configurations with minimal hardware requirements as well as high end multi core CPUs with NVIDIA GPU for maximum performance. The system can be configured with auto start settings and a user friendly icon so that non-technical users can feel comfortable working with the application without specialized training. @@ -85,6 +83,7 @@ Here is the application running 14 cameras through the yolox detector on an RTX ``` onvif-gui ``` +
@@ -168,10 +167,10 @@ Here is the application running 14 cameras through the yolox detector on an RTX onvif-gui ``` -
- --- + +
Windows @@ -264,6 +263,7 @@ Here is the application running 14 cameras through the yolox detector on an RTX ``` onvif-gui ``` +
@@ -368,6 +368,8 @@ Here is the application running 14 cameras through the yolox detector on an RTX onvif-gui ``` +--- +
@@ -424,6 +426,7 @@ In order to build from source on Windows, development tools and python are requi
Linux +  In order to add an icon to the desktop, administrator privileges are required. The location of the virtual environment folder must also be known and is required when invoking the command to create the desktop icon. To add the icon, use the following command, substituting the local host virtual environment configuration as appropriate. @@ -439,6 +442,7 @@ Upon completion of the command, the icon may be found in the Applications Folder
Windows +  To install a desktop icon on windows, please make sure the virtual environment is activated and then add the winshell python module. diff --git a/assets/scripts/build_pkgs b/assets/scripts/build_pkgs new file mode 100755 index 0000000..fef78b2 --- /dev/null +++ b/assets/scripts/build_pkgs @@ -0,0 +1,12 @@ +#!/bin/bash +pip install build +cd libonvif +python -m build +cd ../libavio +python -m build +cd ../onvif-gui +python -m build +cd .. +for FILE in libonvif/dist/*.whl; do pip install $FILE; done +for FILE in libavio/dist/*.whl; do pip install $FILE; done +for FILE in onvif-gui/dist/*.whl; do pip install $FILE; done diff --git a/assets/scripts/build_pkgs.bat b/assets/scripts/build_pkgs.bat new file mode 100755 index 0000000..0dfdd22 --- /dev/null +++ b/assets/scripts/build_pkgs.bat @@ -0,0 +1,17 @@ +pip install build +cd libonvif +set CMAKE_CURRENT_SOURCE_DIR=%CD% +python -m build +cd .. +cd libavio +set CMAKE_CURRENT_SOURCE_DIR=%CD% +set FFMPEG_INSTALL_DIR=%CD%/ffmpeg +set SDL2_INSTALL_DIR=%CD%/sdl +python -m build +cd .. +cd onvif-gui +python -m build +cd .. +for /R libonvif\dist %%F in (*.whl) do pip install %%F +for /R libavio\dist %%F in (*.whl) do pip install %%F +for /R onvif-gui\dist %%F in (*.whl) do pip install %%F diff --git a/assets/scripts/clean b/assets/scripts/clean index aa77b5d..11a818d 100755 --- a/assets/scripts/clean +++ b/assets/scripts/clean @@ -1,9 +1,14 @@ +#!/bin/bash cd libonvif rm -R build rm -R libonvif.egg-info +rm -R dist cd ../libavio rm -R build rm -R avio.egg-info +rm -R dist cd ../onvif-gui rm -R build rm -R onvif_gui.egg-info +rm -R dist +cd .. diff --git a/assets/scripts/clean.bat b/assets/scripts/clean.bat new file mode 100755 index 0000000..5db4097 --- /dev/null +++ b/assets/scripts/clean.bat @@ -0,0 +1,13 @@ +cd libonvif +rmdir /q /s build +rmdir /q /s libonvif.egg-info +rmdir /q /s dist +cd ../libavio +rmdir /q /s build +rmdir /q /s avio.egg-info +rmdir /q /s dist +cd ../onvif-gui +rmdir /q /s build +rmdir /q /s onvif_gui.egg-info +rmdir /q /s dist +cd .. diff --git a/assets/scripts/compile b/assets/scripts/compile index e51fbd2..527ee81 100755 --- a/assets/scripts/compile +++ b/assets/scripts/compile @@ -1,3 +1,4 @@ +#!/bin/bash cd libonvif rm -R build rm -R libonvif.egg-info @@ -10,3 +11,4 @@ cd ../onvif-gui rm -R build rm -R onvif_gui.egg-info pip install . +cd .. diff --git a/assets/scripts/compile.bat b/assets/scripts/compile.bat index c95939e..463a72d 100755 --- a/assets/scripts/compile.bat +++ b/assets/scripts/compile.bat @@ -10,3 +10,4 @@ cd ../onvif-gui rmdir /s /q build rmdir /s /q onvif_gui.egg-info pip install . +cd .. diff --git a/assets/scripts/make_env.bat b/assets/scripts/make_env.bat new file mode 100755 index 0000000..b587286 --- /dev/null +++ b/assets/scripts/make_env.bat @@ -0,0 +1,2 @@ +python -m venv myenv +myenv\Scripts\activate diff --git a/libavio b/libavio index a8da1f2..664f8d5 160000 --- a/libavio +++ b/libavio @@ -1 +1 @@ -Subproject commit a8da1f2050c3ef7fcc4c0bfa7d5ec12be59200af +Subproject commit 664f8d5dbb942dcc1eb526c05321bb634d77ea70 diff --git a/libonvif/CMakeLists.txt b/libonvif/CMakeLists.txt index 4a48215..5fd9a0c 100644 --- a/libonvif/CMakeLists.txt +++ b/libonvif/CMakeLists.txt @@ -21,16 +21,23 @@ cmake_minimum_required(VERSION 3.17) -project(libonvif VERSION 3.1.0) +project(libonvif VERSION 3.1.1) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) add_definitions(-w) +# pass current dir in from host when building in virtual env +set (MY_CURRENT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +if (DEFINED ENV{CMAKE_CURRENT_SOURCE_DIR}) + set(MY_CURRENT_DIR $ENV{CMAKE_CURRENT_SOURCE_DIR}) +endif() +file(TO_CMAKE_PATH "${MY_CURRENT_DIR}" MY_DIR_VAR) + if (WIN32) - set(LIBXML2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/libxml2/include/libxml2) - set(LIBXML2_LIBRARIES ${CMAKE_CURRENT_SOURCE_DIR}/libxml2/lib/libxml2.lib) + set(LIBXML2_INCLUDE_DIRS ${MY_DIR_VAR}/libxml2/include/libxml2) + set(LIBXML2_LIBRARIES ${MY_DIR_VAR}/libxml2/lib/libxml2.lib) else() find_package(LibXml2 REQUIRED) endif() @@ -56,7 +63,6 @@ if (NOT WITHOUT_LIBS) target_include_directories(libonvif PUBLIC include - ${Iconv_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIRS} ) @@ -81,9 +87,11 @@ IF (NOT WITHOUT_PYTHON) ${LIBXML2_LIBRARIES} ) + message("-- LIBXML2_INCLUDE_DIRS: "${LIBXML2_INCLUDE_DIRS}) + message("-- LIBXML2_LIBRARIES: "${LIBXML2_LIBRARIES}) + target_include_directories(pyonvif PUBLIC include - ${Iconv_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIRS} ) diff --git a/libonvif/pyproject.toml b/libonvif/pyproject.toml index ba78d18..e8ac330 100644 --- a/libonvif/pyproject.toml +++ b/libonvif/pyproject.toml @@ -25,7 +25,7 @@ build-backend = "setuptools.build_meta" [project] name = "libonvif" -version = "3.1.0" +version = "3.1.1" authors = [ { name="Stephen Rhodes", email="sr99622@gmail.com" }, ] diff --git a/libonvif/setup.py b/libonvif/setup.py index e439ecf..5b47533 100644 --- a/libonvif/setup.py +++ b/libonvif/setup.py @@ -26,7 +26,7 @@ from setuptools.command.build_ext import build_ext PKG_NAME = "libonvif" -VERSION = "3.1.0" +VERSION = "3.1.1" class CMakeExtension(Extension): def __init__(self, name, sourcedir=""): diff --git a/onvif-gui/MANIFEST.in b/onvif-gui/MANIFEST.in index 458adde..6fe4525 100644 --- a/onvif-gui/MANIFEST.in +++ b/onvif-gui/MANIFEST.in @@ -1,3 +1,2 @@ include README.md LICENSE recursive-include gui/resources * - diff --git a/onvif-gui/gui/main.py b/onvif-gui/gui/main.py index 050b0f9..f5c2c59 100644 --- a/onvif-gui/gui/main.py +++ b/onvif-gui/gui/main.py @@ -47,7 +47,7 @@ import shutil import avio -VERSION = "2.0.5" +VERSION = "2.0.9" class PipeManager(): def __init__(self, mw, uri): diff --git a/onvif-gui/pyproject.toml b/onvif-gui/pyproject.toml index 06dba19..4b9575b 100644 --- a/onvif-gui/pyproject.toml +++ b/onvif-gui/pyproject.toml @@ -19,15 +19,15 @@ [project] name = "onvif-gui" -version = "2.0.5" +version = "2.0.9" dynamic = ["gui-scripts"] -description = "A client gui for Onvif" -readme = "README.md" +description = "A client gui for Onvif" +readme = "README.md" requires-python = ">=3.10" license = {file = "LICENSE.txt"} -keywords = ["sample", "setuptools", "development"] +keywords = ["sample", "setuptools", "development"] authors = [ - {name = "Stephen Rhodes", email = "sr99622@gmail.com" } + {name = "Stephen Rhodes", email = "sr99622@gmail.com" } ] classifiers = [ "Development Status :: 5 - Production/Stable", @@ -38,7 +38,7 @@ classifiers = [ ] dependencies = [ - "libonvif==3.1.0", "avio==3.1.1", "PyQt6-Qt6==6.6.1", "pyqt6==6.6.1", "numpy", "loguru", "opencv-python" + "libonvif==3.1.1", "avio==3.1.2", "PyQt6-Qt6==6.6.1", "pyqt6==6.6.1", "numpy", "loguru", "opencv-python" ] [project.urls] diff --git a/onvif-gui/setup.py b/onvif-gui/setup.py index eab5476..4e7ecc2 100644 --- a/onvif-gui/setup.py +++ b/onvif-gui/setup.py @@ -25,7 +25,7 @@ setup( name="onvif-gui", - version="2.0.5", + version="2.0.9", author="Stephen Rhodes", author_email="sr99622@gmail.com", description="GUI program for onvif",