Skip to content

Commit

Permalink
fix: package_info remove cmake_paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ggulgulia committed Jul 26, 2022
1 parent dfd79a3 commit 3b54cde
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
2 changes: 0 additions & 2 deletions recipes/ignition-tools/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def package_info(self):
self.cpp_info.set_property("cmake_file_name", "ignition-tools")
self.cpp_info.components["backward"].names["cmake_find_package"] = "backward"
self.cpp_info.components["backward"].names["cmake_find_package_multi"] = "backward"
self.cpp_info.components["backward"].names["cmake_paths"] = "backward"
self.cpp_info.components["backward"].bindirs = ["bin"]

self.cpp_info.components["backward"].libs = []
Expand All @@ -132,7 +131,6 @@ def package_info(self):
self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path])
self.cpp_info.components["backward"].build_modules["cmake_find_package"] = [self._module_file_rel_path]
self.cpp_info.components["backward"].build_modules["cmake_find_package_multi"] = [self._module_file_rel_path]
self.cpp_info.components["backward"].build_modules["cmake_paths"] = [self._module_file_rel_path]

@property
def _module_dir_rel_path(self):
Expand Down
14 changes: 14 additions & 0 deletions recipes/ignition-tools/all/test_package_cmake_paths/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.8)
project(test_package)

include(${CMAKE_BINARY_DIR}/conan_paths.cmake)

find_package(ignition-tools REQUIRED COMPONENTS backward)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} ignition-tools::backward)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS ON
)
17 changes: 17 additions & 0 deletions recipes/ignition-tools/all/test_package_cmake_paths/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# pylint: skip-file
from conans import ConanFile, CMake, tools
import os

class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake_paths", "cmake_find_package"

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not tools.cross_building(self.settings):
bin_path = os.path.abspath(os.path.join("test_package"))
self.run(bin_path, run_environment=True)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <iostream>


int main(int argc, char **argv)
{
std::cout << "Hello from ignition-tools test_package\n";
}

0 comments on commit 3b54cde

Please sign in to comment.