Begin conan integration

This commit is contained in:
2025-06-28 10:52:13 +02:00
parent 72053e195a
commit 91df2f5e02
5 changed files with 46 additions and 7 deletions

26
.gitignore vendored
View File

@@ -37,4 +37,28 @@ build_*/**
cmake-build*/** cmake-build*/**
.idea .idea
puml/** puml/**
.vscode/settings.json .vscode/settings.json
# CMake generated files
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
compile_commands.json
Makefile
CTestTestfile.cmake
DartConfiguration.tcl
Testing/
CMakePresets.json
# Conan generated files
conan_toolchain.cmake
conan*.sh
deactivate_*.sh
cmakedeps*.cmake
conandeps*.cmake
*-Target-*.cmake
*-debug-*.cmake
*Config*.cmake
*Targets.cmake
Find*.cmake
module-*.cmake

View File

@@ -37,9 +37,9 @@ include(AddGitSubmodule)
# ------- # -------
if (ENABLE_TESTING) if (ENABLE_TESTING)
MESSAGE("Testing enabled") MESSAGE("Testing enabled")
add_git_submodule("tests/lib/Catch2") find_package(Catch2 REQUIRED)
add_git_submodule("tests/lib/Files") find_package(arff-files REQUIRED)
add_git_submodule("tests/lib/mdlp") find_package(fimdlp REQUIRED)
include(CTest) include(CTest)
add_subdirectory(tests) add_subdirectory(tests)
endif (ENABLE_TESTING) endif (ENABLE_TESTING)

View File

@@ -28,6 +28,7 @@ build: ## Build a debug version of the project
@echo ">>> Building Debug Folding..."; @echo ">>> Building Debug Folding...";
@if [ -d ./$(f_debug) ]; then rm -rf ./$(f_debug); fi @if [ -d ./$(f_debug) ]; then rm -rf ./$(f_debug); fi
@mkdir $(f_debug); @mkdir $(f_debug);
@conan install . --output-folder=$(f_debug) --build=missing
@cmake -S . -B $(f_debug) -D CMAKE_BUILD_TYPE=Debug -D ENABLE_TESTING=ON @cmake -S . -B $(f_debug) -D CMAKE_BUILD_TYPE=Debug -D ENABLE_TESTING=ON
@echo ">>> Done"; @echo ">>> Done";

View File

@@ -14,6 +14,17 @@ class FoldingConan(ConanFile):
no_copy_source = True no_copy_source = True
exports_sources = "folding.hpp" exports_sources = "folding.hpp"
package_type = "header-library" package_type = "header-library"
# build_type = "Debug"
def requirements(self):
# Build dependency
self.requires("libtorch/2.7.0")
def build_requirements(self):
# Test dependencies
self.test_requires("catch2/3.8.1")
self.test_requires("arff-files/1.2.0")
self.test_requires("fimdlp/2.0.1")
def init(self): def init(self):
# Read the CMakeLists.txt file to get the version # Read the CMakeLists.txt file to get the version

View File

@@ -2,11 +2,14 @@ if(ENABLE_TESTING)
include_directories( include_directories(
${Folding_SOURCE_DIR} ${Folding_SOURCE_DIR}
${CMAKE_BINARY_DIR}/configured_files/include ${CMAKE_BINARY_DIR}/configured_files/include
lib/Files
lib/mdlp/src
) )
set(TEST_FOLDING "unit_tests_folding") set(TEST_FOLDING "unit_tests_folding")
add_executable(${TEST_FOLDING} TestFolding.cc TestUtils.cc) add_executable(${TEST_FOLDING} TestFolding.cc TestUtils.cc)
target_link_libraries(${TEST_FOLDING} PUBLIC "${TORCH_LIBRARIES}" ArffFiles fimdlp Catch2::Catch2WithMain) target_link_libraries(${TEST_FOLDING} PUBLIC
${TORCH_LIBRARIES}
arff-files::arff-files
fimdlp::fimdlp
Catch2::Catch2WithMain
)
add_test(NAME ${TEST_FOLDING} COMMAND ${TEST_FOLDING}) add_test(NAME ${TEST_FOLDING} COMMAND ${TEST_FOLDING})
endif(ENABLE_TESTING) endif(ENABLE_TESTING)