1 from conan
import ConanFile
2 from conan
.tools
.cmake
import CMakeToolchain
, CMake
5 class Conan(ConanFile
):
10 author
= "tqfx tqfx@tqfx.org"
11 homepage
= url
= "https://github.com/tqfx/liba"
12 description
= "An algorithm library based on C/C++"
13 settings
= "os", "compiler", "build_type", "arch"
29 "include/a.cmake.h.in",
39 cmake
= CMakeToolchain(self
)
40 cmake
.variables
["BUILD_TESTING"] = 0
41 if self
.options
.shared
:
42 cmake
.variables
["LIBA_INSTALL"] = "shared"
44 cmake
.variables
["LIBA_INSTALL"] = "static"
45 if self
.options
.float != 8:
46 cmake
.variables
["LIBA_FLOAT"] = self
.options
.float
47 cmake
.variables
["LIBA_SYMLINK"] = self
.options
.symlink
48 cmake
.variables
["LIBA_PKGCONFIG"] = self
.options
.pkgconfig
49 if self
.settings
.build_type
!= "Debug":
50 cmake
.variables
["LIBA_IPO"] = self
.options
.ipo
52 cmake
.variables
["LIBA_IPO"] = 0
64 def package_info(self
):
65 self
.cpp_info
.libs
= ["a"]
66 if self
.settings
.os
!= "Windows":
67 self
.cpp_info
.system_libs
= ["m"]
68 if self
.options
.shared
:
69 if self
.settings
.os
== "Windows":
70 self
.cpp_info
.libs
= ["liba"]
71 self
.cpp_info
.defines
= ["A_IMPORTS"]
72 self
.cpp_info
.set_property("cmake_target_name", "liba")
74 self
.cpp_info
.set_property("cmake_target_name", "alib")
75 if self
.options
.pkgconfig
:
76 self
.cpp_info
.set_property("pkg_config_name", "liba")