Skip to content

Commit

Permalink
gtsam: handle build_type_postfixes option correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Valgur committed Jun 15, 2023
1 parent a1fc0f8 commit 26e7ded
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions recipes/gtsam/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,9 @@ def _module_file_rel_path(self):
def package_info(self):
self.cpp_info.set_property("cmake_file_name", "GTSAM")

prefix = "lib" if is_msvc(self) and not self.options.shared else ""

gtsam = self.cpp_info.components["libgtsam"]
gtsam.set_property("cmake_target_name", "gtsam")
gtsam.libs = [f"{prefix}gtsam"]
gtsam.libs = ["gtsam"]
gtsam.requires = [f"boost::{component}" for component in self._required_boost_components]
gtsam.requires.append("eigen::eigen")
if self.options.with_TBB:
Expand All @@ -301,7 +299,7 @@ def package_info(self):
if self.options.build_unstable:
gtsam_unstable = self.cpp_info.components["libgtsam_unstable"]
gtsam_unstable.set_property("cmake_target_name", "gtsam_unstable")
gtsam_unstable.libs = [f"{prefix}gtsam_unstable"]
gtsam_unstable.libs = ["gtsam_unstable"]
gtsam_unstable.requires = ["libgtsam"]

if self.options.support_nested_dissection:
Expand All @@ -316,6 +314,10 @@ def package_info(self):
cppunitlite.libs = ["CppUnitLite"]
cppunitlite.requires = ["boost::boost"]

if self.options.build_type_postfixes:
for component in self.cpp_info.components.values():
component.libs = [f"{lib}{self.settings.build_type}" for lib in component.libs]

# TODO: to remove in conan v2 once cmake_find_package* generators removed
self.cpp_info.names["cmake_find_package"] = "GTSAM"
self.cpp_info.names["cmake_find_package_multi"] = "GTSAM"
Expand Down

0 comments on commit 26e7ded

Please sign in to comment.