-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
polymorphic_value: conan v2 support #13973
Changes from 4 commits
55c8f45
e01f806
84f85e4
0fc7148
0df272d
0ab6ad4
803ab4c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
cmake_minimum_required(VERSION 3.12) | ||
project(test_package CXX) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup(TARGETS) | ||
|
||
find_package(polymorphic_value REQUIRED CONFIG) | ||
|
||
add_executable(${PROJECT_NAME} test_package.cpp) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE polymorphic_value::polymorphic_value) | ||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) | ||
|
||
enable_testing() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added it to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It saves the need to track down the executable path though There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem is running it the virtualenv. Running a test from cmake command, does not guarantee which environment (conanrun, conanbuild) is being used. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -1,16 +1,21 @@ | ||||||||
from conans import ConanFile, CMake, tools | ||||||||
import os | ||||||||
from conan import ConanFile | ||||||||
from conan.tools.build import can_run | ||||||||
from conan.tools.cmake import CMake | ||||||||
|
||||||||
|
||||||||
class TestPackageConan(ConanFile): | ||||||||
settings = "os", "arch", "compiler", "build_type" | ||||||||
generators = "cmake", "cmake_find_package_multi" | ||||||||
generators = "CMakeDeps", "CMakeToolchain" | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
def requirements(self): | ||||||||
self.requires(self.tested_reference_str) | ||||||||
|
||||||||
def build(self): | ||||||||
cmake = CMake(self) | ||||||||
cmake.configure() | ||||||||
cmake.build() | ||||||||
|
||||||||
def test(self): | ||||||||
if not tools.cross_building(self): | ||||||||
self.run(os.path.join("bin", "test_package"), run_environment=True) | ||||||||
if can_run(self): | ||||||||
cmake = CMake(self) | ||||||||
cmake.test() | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The correct would run |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cmake_minimum_required(VERSION 3.12) | ||
project(test_package CXX) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup(TARGETS) | ||
|
||
find_package(polymorphic_value REQUIRED CONFIG) | ||
|
||
add_executable(${PROJECT_NAME} ../test_package/test_package.cpp) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE polymorphic_value::polymorphic_value) | ||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "cmake", "cmake_find_package_multi" | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self): | ||
self.run(os.path.join("bin", "test_package"), run_environment=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No workaround, please. It should be fixed on next releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted