Skip to content

Commit f564d1b

Browse files
scpa1055cassava
authored andcommitted
vtd: Add vtd-api-2022.3 package
1 parent 74ffe1c commit f564d1b

File tree

5 files changed

+114
-0
lines changed

5 files changed

+114
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/
2+
*.tgz
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
cmake_minimum_required(VERSION 3.7 FATAL_ERROR)
2+
3+
project(vtd_api LANGUAGES CXX VERSION 2022.3)
4+
5+
include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake)
6+
conan_basic_setup(TARGETS)
7+
8+
set(target vtd_api)
9+
10+
add_library(${target}
11+
src/Develop/Communication/VtdFramework/VtdToolkit/src/Common/RDBHandler.cc
12+
)
13+
target_include_directories(${target}
14+
PUBLIC
15+
src/Develop/Communication/VtdFramework/VtdToolkit/include
16+
)
17+
18+
# Installation -------------------------------------------------------
19+
include(GNUInstallDirs)
20+
install(TARGETS ${target}
21+
LIBRARY
22+
DESTINATION ${CMAKE_INSTALL_LIBDIR}
23+
ARCHIVE
24+
DESTINATION ${CMAKE_INSTALL_LIBDIR}
25+
)
26+
install(
27+
DIRECTORY
28+
src/Develop/Communication/VtdFramework/VtdToolkit/include/VtdToolkit
29+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
30+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Overrides will be preserved in Makefile.package.
2+
override SOURCE_DIR := src
3+
override PACKAGE_CHANNEL := cloe/stable
4+
override CLEAN_SOURCE_DIR := true
5+
6+
PROJECT_ROOT := ../../../..
7+
include ${PROJECT_ROOT}/Makefile.package
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Conan VTD-API Package
2+
=====================
3+
4+
In order to separate build and runtime dependencies, the VTD API sources files
5+
are put in their own Conan package.
6+
7+
The `vtd/2022.3@cloe-restricted/stable` package must be available. For
8+
instructions on how to build it, see the [README](../vtd/README.md) in the
9+
[vtd](../vtd) directory.
10+
11+
Then just run `make package`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
from pathlib import Path
2+
3+
from conans import CMake, ConanFile, tools
4+
from conans.errors import ConanInvalidConfiguration
5+
6+
7+
class VtdApiConan(ConanFile):
8+
name = "vtd-api"
9+
version = "2022.3"
10+
license = "Proprietary"
11+
url = "https://vires.mscsoftware.com"
12+
no_copy_source = False
13+
description = "Include binary files in C/C++"
14+
topics = ("simulator", "vires")
15+
settings = "os", "compiler", "build_type", "arch"
16+
keep_imports = True
17+
exports_sources = [
18+
"CMakeLists.txt",
19+
]
20+
options = {
21+
"shared": [True, False],
22+
"fPIC": [True, False],
23+
}
24+
default_options = {
25+
"shared": False,
26+
"fPIC": True,
27+
}
28+
build_requires = [
29+
"vtd/2022.3@cloe-restricted/stable",
30+
]
31+
generators = "cmake"
32+
33+
_cmake = None
34+
35+
def configure(self):
36+
if self.settings.os == "Windows":
37+
raise ConanInvalidConfiguration("VTD binaries do not exist for Windows")
38+
39+
def imports(self):
40+
self.copy("*", dst="src/Develop", src="Develop", root_package="vtd")
41+
42+
def _configure_cmake(self):
43+
if self._cmake:
44+
return self._cmake
45+
self._cmake = CMake(self)
46+
self._cmake.definitions["CMAKE_EXPORT_COMPILE_COMMANDS"] = True
47+
#TODO VTD project version, shared-lib....
48+
self._cmake.configure()
49+
return self._cmake
50+
51+
def build(self):
52+
cmake = self._configure_cmake()
53+
cmake.build()
54+
55+
def package(self):
56+
cmake = self._configure_cmake()
57+
cmake.install()
58+
self.copy("Develop", src="src", symlinks=True)
59+
60+
def package_info(self):
61+
if self.in_local_cache:
62+
self.cpp_info.libs = tools.collect_libs(self)
63+
else:
64+
self.cpp_info.libs = ["vtd_api"]

0 commit comments

Comments
 (0)