Continue conan integration

This commit is contained in:
2025-06-28 11:06:16 +02:00
parent 91df2f5e02
commit 8807cd513c
4 changed files with 17 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ project(Folding
) )
find_package(Torch REQUIRED) find_package(Torch REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
if (POLICY CMP0135) if (POLICY CMP0135)
cmake_policy(SET CMP0135 NEW) cmake_policy(SET CMP0135 NEW)

9
CMakeUserPresets.json Normal file
View File

@@ -0,0 +1,9 @@
{
"version": 4,
"vendor": {
"conan": {}
},
"include": [
"build_Debug/CMakePresets.json"
]
}

View File

@@ -28,8 +28,8 @@ 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 @conan install . --output-folder=$(f_debug) --build=missing --profile:build=default --profile:host=default
@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 -D CMAKE_TOOLCHAIN_FILE=$(f_debug)/conan_toolchain.cmake
@echo ">>> Done"; @echo ">>> Done";
opt = "" opt = ""

View File

@@ -1,6 +1,7 @@
import re import re
from conan import ConanFile from conan import ConanFile
from conan.tools.files import copy from conan.tools.files import copy
from conan.tools.cmake import CMakeToolchain
class FoldingConan(ConanFile): class FoldingConan(ConanFile):
@@ -26,6 +27,10 @@ class FoldingConan(ConanFile):
self.test_requires("arff-files/1.2.0") self.test_requires("arff-files/1.2.0")
self.test_requires("fimdlp/2.0.1") self.test_requires("fimdlp/2.0.1")
def generate(self):
tc = CMakeToolchain(self)
tc.generate()
def init(self): def init(self):
# Read the CMakeLists.txt file to get the version # Read the CMakeLists.txt file to get the version
with open("folding.hpp", "r") as f: with open("folding.hpp", "r") as f: