forked from mdaus/nitro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconanfile.py
More file actions
57 lines (48 loc) · 2 KB
/
conanfile.py
File metadata and controls
57 lines (48 loc) · 2 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
"""Conan recipe for building Nitro"""
from conans import ConanFile, CMake, tools
import os
import sys
class NitroConan(ConanFile):
name = "nitro"
url = "https://github.com/mdaus/nitro"
description = "library for reading and writing the National Imagery Transmission Format (NITF)"
settings = "os", "compiler", "build_type", "arch"
requires = ("coda-oss/master_1ac97fe4897896fd", )
options = {"shared": [True, False]}
default_options = {"shared": False}
exports_sources = ("CMakeLists.txt",
"LICENSE",
"README.md",
"cmake/*",
"modules/*",
)
generators = "cmake_paths"
license = "GNU LESSER GENERAL PUBLIC LICENSE Version 3"
# default to short_paths mode (Windows only)
short_paths = True
# default the short_paths home to ~/.conan_short
# this may be overridden by setting the environment variable
# CONAN_USER_HOME_SHORT or setting user_home_short in ~/.conan/conan.conf
if sys.platform.startswith('win32') and os.getenv("CONAN_USER_HOME_SHORT") is None:
os.environ["CONAN_USER_HOME_SHORT"] = os.path.join(
os.path.expanduser("~"), ".conan_short")
def set_version(self):
git = tools.Git(folder=self.recipe_folder)
self.version = git.get_revision()[:16]
def _configure_cmake(self):
cmake = CMake(self)
cmake.definitions["ENABLE_STATIC_TRES"] = True # always build static TRES
cmake.definitions["ENABLE_J2K"] = self.options["coda-oss"].ENABLE_J2K
cmake.configure()
return cmake
def build(self):
cmake = self._configure_cmake()
cmake.build()
def package(self):
cmake = self._configure_cmake()
cmake.install()
def package_id(self):
# Make any change in our dependencies' version require a new binary
self.info.requires.full_version_mode()
def package_info(self):
self.cpp_info.builddirs = ["lib/cmake"]