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
23 changes: 5 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@ on:
push:
pull_request:
workflow_dispatch:
inputs:
forceMacBuild:
description: 'If set true override the ENABLE_MACOS_BUILD to force a build'
type: boolean
default: false

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
MACENABLED: ${{ inputs.forceMacBuild }}

# for matrix check https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners
jobs:
Expand Down Expand Up @@ -41,14 +35,14 @@ jobs:
steps:
- name: Checkout the source
if: github.event_name != 'pull_request'
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Checkout the source - pull request
if: github.event_name == 'pull_request'
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
Expand All @@ -60,19 +54,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"

# windows-2016 need the SSHAgentFeature added
- name: Start ssh key agent
if: matrix.os == 'windows-2016'
run: |
choco install --no-progress -my openssh --params '"/SSHAgentFeature"'
refreshenv

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

Expand Down Expand Up @@ -110,7 +97,7 @@ jobs:
conan-cxx: g++-${{matrix.build-cversion}}

- name: Mac build
if: startsWith(matrix.os, 'macos') && (env.MACENABLED == 'true' || vars.ENABLE_MACOS_BUILD == 'True')
if: startsWith(matrix.os, 'macos')
uses: ManiVaultStudio/github-actions/conan_linuxmac_build@main
with:
conan-compiler: ${{matrix.build-compiler}}
Expand Down
77 changes: 33 additions & 44 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,21 @@
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 PointDataConversionPluginConan(ConanFile):
"""Class to package the PointDataConversionPlugin 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 = "PointDataConversionPlugin"
description = "Convert point data"
topics = ("hdps", "plugin", "data", "point data conversion")
url = "https://github.com/hdps/PointDataConversionPlugin"
url = "https://github.com/ManiVaultStudio/PointDataConversionPlugin"
author = "B. van Lew b.van_lew@lumc.nl" # conan recipe author
license = "MIT" # conan recipe license

Expand Down Expand Up @@ -88,30 +81,32 @@ 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"

tc.generate()

def _configure_cmake(self):
Expand All @@ -121,22 +116,16 @@ def _configure_cmake(self):
return cmake

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

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 @@ -146,7 +135,7 @@ def package(self):
"--config",
"Debug",
"--prefix",
os.path.join(package_dir, "Debug"),
debug_dir,
]
)
subprocess.run(
Expand All @@ -157,11 +146,11 @@ def package(self):
"--config",
"Release",
"--prefix",
os.path.join(package_dir, "Release"),
release_dir,
]
)
self.copy(pattern="*", src=package_dir)

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