Begin conan integration
This commit is contained in:
26
.gitignore
vendored
26
.gitignore
vendored
@@ -37,4 +37,28 @@ build_*/**
|
||||
cmake-build*/**
|
||||
.idea
|
||||
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
|
@@ -37,9 +37,9 @@ include(AddGitSubmodule)
|
||||
# -------
|
||||
if (ENABLE_TESTING)
|
||||
MESSAGE("Testing enabled")
|
||||
add_git_submodule("tests/lib/Catch2")
|
||||
add_git_submodule("tests/lib/Files")
|
||||
add_git_submodule("tests/lib/mdlp")
|
||||
find_package(Catch2 REQUIRED)
|
||||
find_package(arff-files REQUIRED)
|
||||
find_package(fimdlp REQUIRED)
|
||||
include(CTest)
|
||||
add_subdirectory(tests)
|
||||
endif (ENABLE_TESTING)
|
||||
|
1
Makefile
1
Makefile
@@ -28,6 +28,7 @@ build: ## Build a debug version of the project
|
||||
@echo ">>> Building Debug Folding...";
|
||||
@if [ -d ./$(f_debug) ]; then rm -rf ./$(f_debug); fi
|
||||
@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
|
||||
@echo ">>> Done";
|
||||
|
||||
|
11
conanfile.py
11
conanfile.py
@@ -14,6 +14,17 @@ class FoldingConan(ConanFile):
|
||||
no_copy_source = True
|
||||
exports_sources = "folding.hpp"
|
||||
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):
|
||||
# Read the CMakeLists.txt file to get the version
|
||||
|
@@ -2,11 +2,14 @@ if(ENABLE_TESTING)
|
||||
include_directories(
|
||||
${Folding_SOURCE_DIR}
|
||||
${CMAKE_BINARY_DIR}/configured_files/include
|
||||
lib/Files
|
||||
lib/mdlp/src
|
||||
)
|
||||
set(TEST_FOLDING "unit_tests_folding")
|
||||
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})
|
||||
endif(ENABLE_TESTING)
|
||||
|
Reference in New Issue
Block a user