Fix cmakelists
Some checks failed
CI/CD Pipeline / Code Linting (push) Failing after 14s
CI/CD Pipeline / Build and Test (Debug, clang, ubuntu-latest) (push) Failing after 5m7s
CI/CD Pipeline / Build and Test (Debug, gcc, ubuntu-latest) (push) Failing after 5m52s
CI/CD Pipeline / Build and Test (Release, clang, ubuntu-20.04) (push) Failing after 5m47s
CI/CD Pipeline / Build and Test (Release, clang, ubuntu-latest) (push) Failing after 5m13s
CI/CD Pipeline / Build and Test (Release, gcc, ubuntu-20.04) (push) Failing after 5m32s
CI/CD Pipeline / Build and Test (Release, gcc, ubuntu-latest) (push) Failing after 5m46s
CI/CD Pipeline / Docker Build Test (push) Failing after 32s
CI/CD Pipeline / Performance Benchmarks (push) Has been skipped
CI/CD Pipeline / Build Documentation (push) Failing after 21s
CI/CD Pipeline / Create Release Package (push) Has been skipped

This commit is contained in:
2025-06-23 10:47:53 +02:00
parent f63f3a6b85
commit e07eb4d2ed
4 changed files with 97 additions and 52 deletions

View File

@@ -1,39 +1,42 @@
# SVMClassifierConfig.cmake.in
# CMake configuration file for SVMClassifier package
@PACKAGE_INIT@
# Set the version
set(SVMClassifier_VERSION @PACKAGE_VERSION@)
# SVMClassifier package configuration file
# Find required dependencies
# Check if components are specified
set(_supported_components )
# Handle components
foreach(_comp ${SVMClassifier_FIND_COMPONENTS})
if(NOT _comp IN_LIST _supported_components)
set(SVMClassifier_FOUND FALSE)
set(SVMClassifier_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
endif()
endforeach()
# Include dependencies that are required for using SVMClassifier
include(CMakeFindDependencyMacro)
# Find Torch dependency
find_dependency(Torch REQUIRED)
find_dependency(PkgConfig REQUIRED)
# Include nlohmann_json
if(NOT TARGET nlohmann_json::nlohmann_json)
find_package(nlohmann_json 3.11.0 REQUIRED)
endif()
# Note: nlohmann_json, libsvm, and liblinear are linked privately
# so they don't need to be found here
# Include the targets file
include("${CMAKE_CURRENT_LIST_DIR}/SVMClassifierTargets.cmake")
# Set variables for backward compatibility
# Set variables for compatibility
set(SVMClassifier_LIBRARIES SVMClassifier::svm_classifier)
set(SVMClassifier_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include")
set(SVMClassifier_INCLUDE_DIRS)
# Verify that the targets were imported
if(NOT TARGET SVMClassifier::svm_classifier)
message(FATAL_ERROR "SVMClassifier::svm_classifier target not found")
# Get the include directories from the target
get_target_property(_inc_dirs SVMClassifier::svm_classifier INTERFACE_INCLUDE_DIRECTORIES)
if(_inc_dirs)
set(SVMClassifier_INCLUDE_DIRS ${_inc_dirs})
endif()
# Check that all required components have been found
check_required_components(SVMClassifier)
# Set found flag
set(SVMClassifier_FOUND TRUE)
# Print status message
if(NOT SVMClassifier_FIND_QUIETLY)
message(STATUS "Found SVMClassifier: ${PACKAGE_PREFIX_DIR} (found version \"${SVMClassifier_VERSION}\")")
endif()
# Check version compatibility
check_required_components(SVMClassifier)
set(SVMClassifier_FOUND TRUE)