Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: SpaceIm <[email protected]>
  • Loading branch information
gocarlos and SpaceIm authored Sep 23, 2020
1 parent 62074c0 commit 13d1458
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 7 additions & 5 deletions recipes/libcoap/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@ def package(self):
cmake = self._configure_cmake()
cmake.install()
tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
tools.rmdir(os.path.join(self.package_folder,
"lib", "libcoap", "cmake"))

def package_info(self):
self.cpp_info.libs = ["coap"]
self.cpp_info.names['pkg_config'] = "libcoap-2{}".format("-{}".format(self.options.dtls_backend) if self.options.dtls_backend else "")
pkgconfig_filename = "libcoap-2{}".format("-{}".format(self.options.dtls_backend) if self.options.dtls_backend else "")
self.cpp_info.names["pkg_config"] = pkgconfig_filename
self.cpp_info.components["coap"].names["cmake_find_package"] = "coap"
self.cpp_info.components["coap"].names["cmake_find_package_multi"] = "coap"
self.cpp_info.components["coap"].names["pkg_config"] = pkgconfig_filename
self.cpp_info.components["coap"].libs = ["coap"]
if self.settings.os == "Linux":
self.cpp_info.system_libs = ["pthread"]
self.cpp_info.components["coap"].system_libs = ["pthread"]
4 changes: 3 additions & 1 deletion recipes/libcoap/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ project(test_package)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

find_package(libcoap REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
target_link_libraries(${PROJECT_NAME} libcoap::coap)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
2 changes: 1 addition & 1 deletion recipes/libcoap/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class TestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
generators = "cmake", "cmake_find_package_multi"

def build(self):
cmake = CMake(self)
Expand Down

0 comments on commit 13d1458

Please sign in to comment.