Created
March 3, 2022 17:42
-
-
Save uilianries/f3deab6dfb2e37e6068ab261feb51708 to your computer and use it in GitHub Desktop.
Conan - Export cmake targets correctly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from conans import ConanFile | |
class FoobarConan(ConanFile): | |
def package_info(self): | |
self.cpp_info.filenames["cmake_find_package"] = "FooBar" | |
self.cpp_info.filenames["cmake_find_package_multi"] = "FooBar" | |
self.cpp_info.names["cmake_find_package"] = "Foo" | |
self.cpp_info.names["cmake_find_package_multi"] = "Foo" | |
self.cpp_info.components["Foo"].libs = ["foobar"] | |
self.cpp_info.components["Foo"].names["cmake_find_package"] = "Foobar" | |
self.cpp_info.components["Foo"].names["cmake_find_package_multi"] = "bar" | |
self.cpp_info.set_property("cmake_file_name", "FooBar") | |
self.cpp_info.set_property("cmake_target_name", "FooBar") | |
self.cpp_info.set_property("cmake_module_target_name", "Foo::bar") | |
self.cpp_info.libs = ["foobar"] | |
# FooBarConfig.cmake -> Foo::bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment