diff --git a/ExampleDependencies/CMakeLists.txt b/ExampleDependencies/CMakeLists.txt index 4d91fb7..e50cc24 100644 --- a/ExampleDependencies/CMakeLists.txt +++ b/ExampleDependencies/CMakeLists.txt @@ -33,6 +33,7 @@ find_package(ManiVault COMPONENTS Core PointData CONFIG) find_package(blake3 CONFIG REQUIRED) if(NOT APPLE) + include(cmake/ci_fixes.cmake) find_package(faiss CONFIG REQUIRED) endif() diff --git a/ExampleDependencies/cmake/ci_fixes.cmake b/ExampleDependencies/cmake/ci_fixes.cmake new file mode 100644 index 0000000..c4ddca7 --- /dev/null +++ b/ExampleDependencies/cmake/ci_fixes.cmake @@ -0,0 +1,19 @@ +if(DEFINED CMAKE_TOOLCHAIN_FILE AND NOT CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg") +find_package(LAPACK CONFIG REQUIRED) +if(NOT TARGET LAPACK::LAPACK) + add_library(LAPACK::LAPACK INTERFACE IMPORTED) + set(_lapack_libs "${LAPACK_LIBRARIES}") + if(_lapack_libs AND TARGET BLAS::BLAS) + # remove the ${BLAS_LIBRARIES} from the interface and replace it + # with the BLAS::BLAS target + list(REMOVE_ITEM _lapack_libs "${BLAS_LIBRARIES}") + endif() + + if(_lapack_libs) + set_target_properties(LAPACK::LAPACK PROPERTIES + INTERFACE_LINK_LIBRARIES "${_lapack_libs}" + ) + endif() + unset(_lapack_libs) +endif() +endif() diff --git a/conanfile.py b/conanfile.py index a61f0ff..78e63ae 100644 --- a/conanfile.py +++ b/conanfile.py @@ -97,9 +97,17 @@ def generate(self): tc.variables["CMAKE_CXX_STANDARD_REQUIRED"] = "ON" # 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.variables["CMAKE_PREFIX_PATH"] = qt_root + qt_path = pathlib.Path(self.deps_cpp_info["qt"].rootpath) + qt_cfg = list(qt_path.glob("**/Qt6Config.cmake"))[0] + qt_root = str(qt_cfg.parents[0].as_posix()) + qt_dir = str(qt_cfg.parents[3].as_posix()) + + # 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 # 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. @@ -114,7 +122,7 @@ def generate(self): # Set some build options tc.variables["MV_UNITY_BUILD"] = "ON" - + # Install vcpkg dependencies vcpkg_dir = os.environ["VCPKG_ROOT"] vcpkg_exe = os.path.join(vcpkg_dir, "vcpkg.exe") if self.settings.os == "Windows" else os.path.join(vcpkg_dir, "vcpkg")