22from conan .tools .cmake import CMakeDeps , CMake , CMakeToolchain
33from conans .tools import save , load
44import os
5- import shutil
65import pathlib
76import subprocess
87from rules_support import PluginBranchInfo
9- import re
108
11- def compatibility (os , compiler , compiler_version ):
12- # On macos fallback to zlib apple-clang 13
13- if os == "Macos" and compiler == "apple-clang" and bool (re .match ("14.*" , compiler_version )):
14- print ("Compatibility match" )
15- return ["zlib/1.3:compiler.version=13" ]
16- return None
179
1810class ScatterplotOPluginConan (ConanFile ):
1911 """Class to package ImageLoaderPlugin using conan
2012
2113 Packages both RELEASE and DEBUG.
22- Uses rules_support (github.com/hdps /rulessupport) to derive
14+ Uses rules_support (github.com/ManiVaultStudio /rulessupport) to derive
2315 versioninfo based on the branch naming convention
24- as described in https://github.com/hdps /core/wiki/Branch-naming-rules
16+ as described in https://github.com/ManiVaultStudio /core/wiki/Branch-naming-rules
2517 """
2618
2719 name = "ScatterplotPlugin"
28- description = """Plugins for displaying scatterplots
29- in the high-dimensional plugin system (HDPS)."""
20+ description = """Plugins for displaying scatterplots in ManiVaultStudio."""
3021 topics = ("hdps" , "plugin" , "image data" , "loading" )
31- url = "https://github.com/hdps /Scatterplot"
22+ url = "https://github.com/ManiVaultStudio /Scatterplot"
3223 author = "B. van Lew b.van_lew@lumc.nl" # conan recipe author
3324 license = "MIT"
3425
@@ -92,30 +83,29 @@ def generate(self):
9283 generator = "Xcode"
9384 if self .settings .os == "Linux" :
9485 generator = "Ninja Multi-Config"
95- # Use the Qt provided .cmake files
96- qtpath = pathlib .Path (self .deps_cpp_info ["qt" ].rootpath )
97- qt_root = str (list (qtpath .glob ("**/Qt6Config.cmake" ))[0 ].parents [3 ].as_posix ())
9886
9987 tc = CMakeToolchain (self , generator = generator )
100- if self .settings .os == "Windows" and self .options .shared :
101- tc .variables ["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS" ] = True
102- if self .settings .os == "Linux" or self .settings .os == "Macos" :
103- tc .variables ["CMAKE_CXX_STANDARD_REQUIRED" ] = "ON"
104- tc .variables ["CMAKE_PREFIX_PATH" ] = qt_root
105-
106- # Set the installation directory for ManiVault based on the MV_INSTALL_DIR environment variable
107- # or if none is specified, set it to the build/install dir.
108- if not os .environ .get ("MV_INSTALL_DIR" , None ):
109- os .environ ["MV_INSTALL_DIR" ] = os .path .join (self .build_folder , "install" )
110- print ("MV_INSTALL_DIR: " , os .environ ["MV_INSTALL_DIR" ])
111- self .install_dir = pathlib .Path (os .environ ["MV_INSTALL_DIR" ]).as_posix ()
112- # Give the installation directory to CMake
113- tc .variables ["MV_INSTALL_DIR" ] = self .install_dir
114-
115- # Find ManiVault with find_package
116- self .manivault_dir = self .install_dir + '/cmake/mv/'
117- tc .variables ["ManiVault_DIR" ] = self .manivault_dir
118-
88+
89+ tc .variables ["CMAKE_CXX_STANDARD_REQUIRED" ] = "ON"
90+
91+ # Use the Qt provided .cmake files
92+ qt_path = pathlib .Path (self .deps_cpp_info ["qt" ].rootpath )
93+ qt_cfg = list (qt_path .glob ("**/Qt6Config.cmake" ))[0 ]
94+ qt_dir = qt_cfg .parents [0 ].as_posix ()
95+ qt_root = qt_cfg .parents [3 ].as_posix ()
96+
97+ # for Qt >= 6.4.2
98+ #tc.variables["Qt6_DIR"] = qt_dir
99+
100+ # for Qt < 6.4.2
101+ tc .variables ["Qt6_ROOT" ] = qt_root
102+
103+ # Use the ManiVault .cmake file to find ManiVault with find_package
104+ mv_core_root = self .deps_cpp_info ["hdps-core" ].rootpath
105+ manivault_dir = pathlib .Path (mv_core_root , "cmake" , "mv" ).as_posix ()
106+ print ("ManiVault_DIR: " , manivault_dir )
107+ tc .variables ["ManiVault_DIR" ] = manivault_dir
108+
119109 # Set some build options
120110 tc .variables ["MV_UNITY_BUILD" ] = "ON"
121111
@@ -128,23 +118,16 @@ def _configure_cmake(self):
128118 return cmake
129119
130120 def build (self ):
131- print ("Build OS is : " , self .settings .os )
132-
133- # The BinNIO plugins expect the HDPS package to be in this install dir
134- hdps_pkg_root = self .deps_cpp_info ["hdps-core" ].rootpath
135- print ("Install dir type: " , self .install_dir )
136- shutil .copytree (hdps_pkg_root , self .install_dir )
121+ print ("Build OS is: " , self .settings .os )
137122
138123 cmake = self ._configure_cmake ()
139124 cmake .build (build_type = "Debug" )
140- cmake .install (build_type = "Debug" )
141-
142- # cmake_release = self._configure_cmake()
143125 cmake .build (build_type = "Release" )
144- cmake .install (build_type = "Release" )
145126
146127 def package (self ):
147- package_dir = os .path .join (self .build_folder , "package" )
128+ package_dir = pathlib .Path (self .build_folder , "package" )
129+ debug_dir = package_dir / "Debug"
130+ release_dir = package_dir / "Release"
148131 print ("Packaging install dir: " , package_dir )
149132 subprocess .run (
150133 [
@@ -154,7 +137,7 @@ def package(self):
154137 "--config" ,
155138 "Debug" ,
156139 "--prefix" ,
157- os . path . join ( package_dir , "Debug" ) ,
140+ debug_dir ,
158141 ]
159142 )
160143 subprocess .run (
@@ -165,15 +148,11 @@ def package(self):
165148 "--config" ,
166149 "Release" ,
167150 "--prefix" ,
168- os . path . join ( package_dir , "Release" ) ,
151+ release_dir ,
169152 ]
170153 )
171154 self .copy (pattern = "*" , src = package_dir )
172- # Add the debug support files to the package
173- # (*.pdb) if building the Visual Studio version
174- if self .settings .compiler == "Visual Studio" :
175- self .copy ("*.pdb" , dst = "Debug/Plugins" , keep_path = False )
176-
155+
177156 def package_info (self ):
178157 self .cpp_info .debug .libdirs = ["Debug/lib" ]
179158 self .cpp_info .debug .bindirs = ["Debug/Plugins" , "Debug" ]
0 commit comments