diff --git a/core/meson.build b/core/meson.build index 8a7309d7..14751244 100644 --- a/core/meson.build +++ b/core/meson.build @@ -28,25 +28,6 @@ core_headers = files([ 'video_options.hpp', ]) -# Generate a version string. -version_cmd = [meson.project_source_root() / 'utils' / 'version.py', meson.project_version()] - -# Check if a version.gen file is present. -# This would have been generated from the meson dist command. -fs = import('fs') -dist_version_file = meson.project_source_root() / 'version.gen' -if fs.is_file(dist_version_file) - version_cmd += fs.read(dist_version_file) -endif - -version_cpp = vcs_tag(command : version_cmd, - replace_string: '@VER@', - input : 'version.cpp.in', - output : 'version.cpp', - fallback : meson.project_version()) - -rpicam_app_src += version_cpp - install_headers(core_headers, subdir: meson.project_name() / 'core') # Install symlinks to the old header directories and names for legacy purposes. diff --git a/core/options.cpp b/core/options.cpp index bb9931c6..d1b7f883 100644 --- a/core/options.cpp +++ b/core/options.cpp @@ -368,6 +368,7 @@ bool Options::Parse(int argc, char *argv[]) if (version) { std::cout << "rpicam-apps build: " << RPiCamAppsVersion() << std::endl; + std::cout << "rpicam-apps capabilites: " << RPiCamAppsCapabilities() << std::endl; std::cout << "libcamera build: " << libcamera::CameraManager::version() << std::endl; return false; } diff --git a/core/version.cpp.in b/core/version.cpp.in index 85e6a5a7..74cec7b9 100644 --- a/core/version.cpp.in +++ b/core/version.cpp.in @@ -6,9 +6,43 @@ */ #include "core/version.hpp" -static const std::string versionString {"@VER@"}; +#if LIBEGL_PRESENT +static constexpr int egl = 1; +#else +static constexpr int egl = 0; +#endif -const std::string& RPiCamAppsVersion() +#if QT_PRESENT +static constexpr int qt = 1; +#else +static constexpr int qt = 0; +#endif + +#if LIBDRM_PRESENT +static constexpr int drm = 1; +#else +static constexpr int drm = 0; +#endif + +#if LIBAV_PRESENT +static int libav = 1; +#else +static int libav = 0; +#endif + +static const std::string version {"@VER@"}; + +static const std::string caps {"egl:" + std::to_string(egl) + + " qt:" + std::to_string(qt) + + " drm:" + std::to_string(drm) + + " libav:" + std::to_string(libav)}; + +const std::string &RPiCamAppsVersion() +{ + return version; +} + +const std::string &RPiCamAppsCapabilities() { - return versionString; + return caps; } diff --git a/core/version.hpp b/core/version.hpp index 8542d52a..3ba1896b 100644 --- a/core/version.hpp +++ b/core/version.hpp @@ -7,4 +7,5 @@ #include -const std::string& RPiCamAppsVersion(); +const std::string &RPiCamAppsVersion(); +const std::string &RPiCamAppsCapabilities(); diff --git a/meson.build b/meson.build index 265a80d0..b57d9b12 100644 --- a/meson.build +++ b/meson.build @@ -12,6 +12,8 @@ project('rpicam-apps', 'c', 'cpp', meson.add_dist_script('utils' / 'gen-dist.sh') +fs = import('fs') + cpp_arguments = ['-pedantic', '-Wno-unused-parameter', '-faligned-new'] # Needed for file sizes > 32-bits. @@ -55,6 +57,24 @@ add_project_arguments(cpp_arguments, language : 'cpp') # Must be put after add_project_arguments as it defines shared library targets. subdir('post_processing_stages') +# Generate a version string. +version_cmd = [meson.project_source_root() / 'utils' / 'version.py', meson.project_version()] + +# Check if a version.gen file is present. +# This would have been generated from the meson dist command. +dist_version_file = meson.project_source_root() / 'version.gen' +if fs.is_file(dist_version_file) + version_cmd += fs.read(dist_version_file) +endif + +version_cpp = vcs_tag(command : version_cmd, + replace_string: '@VER@', + input : meson.project_source_root() / 'core' / 'version.cpp.in', + output : 'version.cpp', + fallback : meson.project_version()) + +rpicam_app_src += version_cpp + rpicam_app = library( 'rpicam_app', rpicam_app_src, diff --git a/post_processing_stages/hailo/meson.build b/post_processing_stages/hailo/meson.build index ad3d6df9..7ab4910e 100644 --- a/post_processing_stages/hailo/meson.build +++ b/post_processing_stages/hailo/meson.build @@ -52,6 +52,7 @@ if opencv_dep.found() postproc_assets += files([ assets_dir / 'hailo_yolov8_pose.json', + assets_dir / 'hailo_yolov8_pose_and_inference.json', assets_dir / 'hailo_yolov5_segmentation.json', ]) diff --git a/utils/version.py b/utils/version.py index 3e3abe50..bbc8667d 100755 --- a/utils/version.py +++ b/utils/version.py @@ -44,14 +44,12 @@ def generate_version(): else: raise RuntimeError('Invalid number of command line arguments') - commit = f'v{sys.argv[1]} {commit}' - except RuntimeError as e: print(f'ERR: {e}', file=sys.stderr) commit = '0' * digits + '-invalid' finally: - print(f'{commit} {datetime.now().strftime("%d-%m-%Y (%H:%M:%S)")}', end="") + print(f'v{sys.argv[1]} {commit} {datetime.now().strftime("%d-%m-%Y (%H:%M:%S)")}', end="") if __name__ == "__main__":