From 95d5efc508d9f5b3cfe1bc6c03fee163d796e2b2 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Wed, 9 Oct 2024 14:41:02 +0200 Subject: [PATCH] Canont have nice things --- .github/workflows/build.yml | 4 +-- ExampleLoader/src/ExampleLoaderPlugin.h | 2 ++ conanfile.py | 43 +++++++++++++++++++------ 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2afa498..821df8a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,14 +45,14 @@ jobs: - name: Checkout the source if: github.event_name != 'pull_request' - uses: actions/checkout@v4 + uses: actions/checkout@v2 with: submodules: recursive fetch-depth: 0 - name: Checkout the source - pull request if: github.event_name == 'pull_request' - uses: actions/checkout@v4 + uses: actions/checkout@v2 with: submodules: recursive fetch-depth: 0 diff --git a/ExampleLoader/src/ExampleLoaderPlugin.h b/ExampleLoader/src/ExampleLoaderPlugin.h index cb9582d..3600e0b 100644 --- a/ExampleLoader/src/ExampleLoaderPlugin.h +++ b/ExampleLoader/src/ExampleLoaderPlugin.h @@ -2,6 +2,8 @@ #include +#include + using namespace mv::plugin; // ============================================================================= diff --git a/conanfile.py b/conanfile.py index 7614315..7f70694 100644 --- a/conanfile.py +++ b/conanfile.py @@ -5,6 +5,7 @@ import os import pathlib import subprocess +import shutil class ExamplePluginsConan(ConanFile): """Class to package ExamplePlugins using conan @@ -87,29 +88,46 @@ def generate(self): tc.variables["CMAKE_CXX_STANDARD_REQUIRED"] = "ON" # Use the Qt provided .cmake files - qt_path = pathlib.Path(self.deps_cpp_info["qt"].rootpath) - qt_cfg = list(qt_path.glob("**/Qt6Config.cmake"))[0] - qt_root = qt_cfg.parents[0].as_posix() - qt_dir = qt_cfg.parents[3].as_posix() - + #qt_path = pathlib.Path(self.deps_cpp_info["qt"].rootpath) + #qt_cfg = list(qt_path.glob("**/Qt6Config.cmake"))[0] + #qt_root = qt_cfg.parents[0].as_posix() + #qt_dir = qt_cfg.parents[3].as_posix() + + qtpath = pathlib.Path(self.deps_cpp_info["qt"].rootpath) + qt_root = str(list(qtpath.glob("**/Qt6Config.cmake"))[0].parents[3].as_posix()) + tc.variables["CMAKE_PREFIX_PATH"] = qt_root + # for Qt >= 6.4.2 #print("Qt6_DIR: ", qt_root) #tc.variables["Qt6_DIR"] = qt_root # for Qt < 6.4.2 - tc.variables["CMAKE_PREFIX_PATH"] = qt_dir + #tc.variables["CMAKE_PREFIX_PATH"] = qt_dir # Use the ManiVault .cmake files - mv_core_root = self.deps_cpp_info["hdps-core"].rootpath - self.manivault_dir = pathlib.Path(mv_core_root, "cmake", "mv").as_posix() + #mv_core_root = self.deps_cpp_info["hdps-core"].rootpath + #self.manivault_dir = pathlib.Path(mv_core_root, "cmake", "mv").as_posix() # Find ManiVault with find_package - tc.variables["ManiVault_DIR"] = self.manivault_dir - print("ManiVault_DIR: ", self.manivault_dir) + #tc.variables["ManiVault_DIR"] = self.manivault_dir + #print("ManiVault_DIR: ", self.manivault_dir) # Set some build options #tc.variables["MV_UNITY_BUILD"] = "ON" + # Set the installation directory for ManiVault based on the MV_INSTALL_DIR environment variable + # or if none is specified, set it to the build/install dir. + if not os.environ.get("MV_INSTALL_DIR", None): + os.environ["MV_INSTALL_DIR"] = os.path.join(self.build_folder, "install") + print("MV_INSTALL_DIR: ", os.environ["MV_INSTALL_DIR"]) + self.install_dir = pathlib.Path(os.environ["MV_INSTALL_DIR"]).as_posix() + # Give the installation directory to CMake + tc.variables["MV_INSTALL_DIR"] = self.install_dir + + # Find ManiVault with find_package + self.manivault_dir = self.install_dir + '/cmake/mv/' + tc.variables["ManiVault_DIR"] = self.manivault_dir + # Install vcpkg dependencies if os.environ.get("VCPKG_ROOT", None): vcpkg_dir = pathlib.Path(os.environ["VCPKG_ROOT"]) @@ -145,6 +163,11 @@ def _configure_cmake(self): def build(self): print("Build OS is: ", self.settings.os) + # The ExamplePlugins build expects the ManiVaultStudio package to be in this install dir + hdps_pkg_root = self.deps_cpp_info["hdps-core"].rootpath + print("Install dir type: ", self.install_dir) + shutil.copytree(hdps_pkg_root, self.install_dir) + cmake = self._configure_cmake() cmake.build(build_type="Debug") cmake.build(build_type="Release")