Skip to content
Snippets Groups Projects
Verified Commit 11ee742b authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: conan

parent abf848db
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
from conans import ConanFile, CMake, tools from conans import ConanFile, CMake, tools
class LibcaosdbConan(ConanFile): class CaosdbConan(ConanFile):
name = "libcaosdb" name = "libcaosdb"
version = "0.0.1" version = "0.0.2"
license = "AGPL-3.0-or-later" license = "AGPL-3.0-or-later"
author = "Timm C. Fitschen <t.fitschen@indiscale.com>" author = "Timm C. Fitschen <t.fitschen@indiscale.com>"
url = "https://gitlab.indiscale.com/caosdb/src/caosdb-cpplib.git" url = "https://gitlab.indiscale.com/caosdb/src/caosdb-cpplib.git"
...@@ -21,8 +21,9 @@ class LibcaosdbConan(ConanFile): ...@@ -21,8 +21,9 @@ class LibcaosdbConan(ConanFile):
if self.settings.os == "Windows": if self.settings.os == "Windows":
del self.options.fPIC del self.options.fPIC
def source(self): # def source(self):
self.run("git clone https://gitlab.indiscale.com/caosdb/src/caosdb-cpplib.git") # self.run("git clone https://gitlab.indiscale.com/caosdb/src/caosdb-cpplib.git")
# self.run("cd caosdb-cpplib && git submodule update --init")
def imports(self): def imports(self):
self.copy("protoc*", "build_tools", "bin") self.copy("protoc*", "build_tools", "bin")
......
cmake_minimum_required(VERSION 3.1)
project(PackageTest CXX)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
add_executable(example example.cpp)
target_link_libraries(example ${CONAN_LIBS})
# CTest is a testing tool that can be used to test your project.
# enable_testing()
# add_test(NAME example
# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
# COMMAND example)
import os
from conans import ConanFile, CMake, tools
class LibcaosdbTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def build(self):
cmake = CMake(self)
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is
# in "test_package"
cmake.configure()
cmake.build()
def imports(self):
self.copy("*.dll", dst="bin", src="bin")
self.copy("*.dylib*", dst="bin", src="lib")
self.copy('*.so*', dst='bin', src='lib')
def test(self):
if not tools.cross_building(self):
os.chdir("bin")
self.run(".%sexample" % os.sep)
#include <iostream>
#include "caosdb/connection.h"
int main() {
caosdb::connection::InsecureCaosDBConnectionConfig config("localhost", 8443);
std::cout << config << "\n";
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment