forked from OpenSees/OpenSees
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconanfile.py
More file actions
62 lines (48 loc) · 2.09 KB
/
conanfile.py
File metadata and controls
62 lines (48 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout
from conan.tools.files import copy
from conan.errors import ConanInvalidConfiguration
import os
class OpenSeesDependencies(ConanFile):
name = "OpenSeesDependencies"
version = "1.0.0"
description = "Provides Software Packages needed to build OpenSees"
license = "BSD 3-Clause"
author = "fmk fmckenna@berkeley.edu"
# 1. Settings: Explicitly define the settings needed for compilation
settings = "os", "compiler", "build_type", "arch"
options = {}
default_options = {}
exports_sources = "CMakeLists.txt", "src/*", "applications/*", "LICENSE"
def layout(self):
# 5. Layout: This standardizes where source/build files go.
# It replaces the manual '_source_subfolder' logic.
cmake_layout(self)
def requirements(self):
self.requires("hdf5/1.14.0")
self.requires("tcl/8.6.11")
self.requires("zlib/1.3.1")
self.requires("eigen/3.4.0")
# Note: If you rely on 'mkl-static', you must add self.requires("mkl-static/...") here.
def generate(self):
# 6. Generators: Standard toolchain and dependency generator
tc = CMakeToolchain(self)
tc.generate()
deps = CMakeDeps(self)
deps.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
# 7. Packaging: Use 'self.source_folder' which is auto-set by cmake_layout()
copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
cmake = CMake(self)
cmake.install()
# Copy extra applications if CMake install didn't catch them
copy(self, "*",
src=os.path.join(self.source_folder, "applications"),
dst=os.path.join(self.package_folder, "bin"))
def package_info(self):
# 8. RunEnv: Correctly add the bin folder to PATH for consumers
self.runenv_info.append_path("PATH", os.path.join(self.package_folder, "bin"))