Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

steps:
- name: Checkout the source
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ github.event.pull_request.head.ref }}
Expand All @@ -45,12 +45,12 @@ jobs:
sudo xcode-select -switch /Applications/Xcode_${{matrix.build-xcode-version}}.app

- name: Setup python version
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Start ssh key agent
uses: webfactory/ssh-agent@v0.7.0
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.RULESSUPPORT_DEPLOY_KEY }}

Expand All @@ -72,8 +72,8 @@ jobs:
conan-pem: ${{secrets.LKEB_UPLOAD_CERT_CHAIN}}
rs_ssh_key: ${{ secrets.RULESSUPPORT_DEPLOY_KEY }}

- name: Linux Mac build
if: "!startsWith(runner.os, 'Windows')"
- name: Linux build
if: startsWith(matrix.os, 'ubuntu')
uses: ManiVaultStudio/github-actions/conan_linuxmac_build@main
with:
conan-compiler: ${{matrix.build-compiler}}
Expand All @@ -84,3 +84,18 @@ jobs:
conan-user: ${{secrets.LKEB_UPLOAD_USER}}
conan-password: ${{secrets.LKEB_UPLOAD_USER_PASSWORD}}
conan-pem: ${{secrets.LKEB_UPLOAD_CERT_CHAIN}}
conan-cc: gcc-${{matrix.build-cversion}}
conan-cxx: g++-${{matrix.build-cversion}}

- name: Mac build
if: startsWith(matrix.os, 'macos')
uses: ManiVaultStudio/github-actions/conan_linuxmac_build@main
with:
conan-compiler: ${{matrix.build-compiler}}
conan-compiler-version: ${{matrix.build-cversion}}
conan-libcxx-version: ${{matrix.build-libcxx}}
conan-build-type: ${{matrix.build-config}}
conan-build-os: ${{matrix.build-os}}
conan-user: ${{secrets.LKEB_UPLOAD_USER}}
conan-password: ${{secrets.LKEB_UPLOAD_USER_PASSWORD}}
conan-pem: ${{secrets.LKEB_UPLOAD_CERT_CHAIN}}
85 changes: 32 additions & 53 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,24 @@
from conan.tools.cmake import CMakeDeps, CMake, CMakeToolchain
from conans.tools import save, load
import os
import shutil
import pathlib
import subprocess
from rules_support import PluginBranchInfo
import re

def compatibility(os, compiler, compiler_version):
# On macos fallback to zlib apple-clang 13
if os == "Macos" and compiler == "apple-clang" and bool(re.match("14.*", compiler_version)):
print("Compatibility match")
return ["zlib/1.3:compiler.version=13"]
return None

class ScatterplotOPluginConan(ConanFile):
"""Class to package ImageLoaderPlugin using conan

Packages both RELEASE and DEBUG.
Uses rules_support (github.com/hdps/rulessupport) to derive
Uses rules_support (github.com/ManiVaultStudio/rulessupport) to derive
versioninfo based on the branch naming convention
as described in https://github.com/hdps/core/wiki/Branch-naming-rules
as described in https://github.com/ManiVaultStudio/core/wiki/Branch-naming-rules
"""

name = "ScatterplotPlugin"
description = """Plugins for displaying scatterplots
in the high-dimensional plugin system (HDPS)."""
description = """Plugins for displaying scatterplots in ManiVaultStudio."""
topics = ("hdps", "plugin", "image data", "loading")
url = "https://github.com/hdps/Scatterplot"
url = "https://github.com/ManiVaultStudio/Scatterplot"
author = "B. van Lew b.van_lew@lumc.nl" # conan recipe author
license = "MIT"

Expand Down Expand Up @@ -92,30 +83,29 @@ def generate(self):
generator = "Xcode"
if self.settings.os == "Linux":
generator = "Ninja Multi-Config"
# Use the Qt provided .cmake files
qtpath = pathlib.Path(self.deps_cpp_info["qt"].rootpath)
qt_root = str(list(qtpath.glob("**/Qt6Config.cmake"))[0].parents[3].as_posix())

tc = CMakeToolchain(self, generator=generator)
if self.settings.os == "Windows" and self.options.shared:
tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True
if self.settings.os == "Linux" or self.settings.os == "Macos":
tc.variables["CMAKE_CXX_STANDARD_REQUIRED"] = "ON"
tc.variables["CMAKE_PREFIX_PATH"] = qt_root

# 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


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_dir = qt_cfg.parents[0].as_posix()
qt_root = qt_cfg.parents[3].as_posix()

# for Qt >= 6.4.2
#tc.variables["Qt6_DIR"] = qt_dir

# for Qt < 6.4.2
tc.variables["Qt6_ROOT"] = qt_root

# Use the ManiVault .cmake file to find ManiVault with find_package
mv_core_root = self.deps_cpp_info["hdps-core"].rootpath
manivault_dir = pathlib.Path(mv_core_root, "cmake", "mv").as_posix()
print("ManiVault_DIR: ", manivault_dir)
tc.variables["ManiVault_DIR"] = manivault_dir

# Set some build options
tc.variables["MV_UNITY_BUILD"] = "ON"

Expand All @@ -128,23 +118,16 @@ def _configure_cmake(self):
return cmake

def build(self):
print("Build OS is : ", self.settings.os)

# The BinNIO plugins expect the HDPS 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)
print("Build OS is: ", self.settings.os)

cmake = self._configure_cmake()
cmake.build(build_type="Debug")
cmake.install(build_type="Debug")

# cmake_release = self._configure_cmake()
cmake.build(build_type="Release")
cmake.install(build_type="Release")

def package(self):
package_dir = os.path.join(self.build_folder, "package")
package_dir = pathlib.Path(self.build_folder, "package")
debug_dir = package_dir / "Debug"
release_dir = package_dir / "Release"
print("Packaging install dir: ", package_dir)
subprocess.run(
[
Expand All @@ -154,7 +137,7 @@ def package(self):
"--config",
"Debug",
"--prefix",
os.path.join(package_dir, "Debug"),
debug_dir,
]
)
subprocess.run(
Expand All @@ -165,15 +148,11 @@ def package(self):
"--config",
"Release",
"--prefix",
os.path.join(package_dir, "Release"),
release_dir,
]
)
self.copy(pattern="*", src=package_dir)
# Add the debug support files to the package
# (*.pdb) if building the Visual Studio version
if self.settings.compiler == "Visual Studio":
self.copy("*.pdb", dst="Debug/Plugins", keep_path=False)


def package_info(self):
self.cpp_info.debug.libdirs = ["Debug/lib"]
self.cpp_info.debug.bindirs = ["Debug/Plugins", "Debug"]
Expand Down
Loading