forked from conan-io/conan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/cmakedeps legacy adapter (conan-io#15207)
* reusing fixture, will reduce CI time * proposal for legacy cmake-like generator * better ux for VS not found error (conan-io#15250) * better ux * improve * Update conan/tools/microsoft/visual.py Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es> --------- Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es> * fix and remove more xfails (conan-io#15251) fix and remove xfails * Fix/save restore portable (conan-io#15253) * make save-restore portable * msg * require-replaces proposal (conan-io#15136) * wip * test passing * wip * wip * wip * wip * wip * wip * new approach * extra checks * more tests * review * Fix failing tests in macos (conan-io#15255) Fix tests in macos * Add test to ensure &: syntax works in `--requires` install (conan-io#15258) Add test to ensure &: syntax qorks in --requires install * add CONAN_LOG_LEVEL env-var (conan-io#15263) * add CONAN_LOG_LEVEL env-var * Update conan/cli/command.py --------- Co-authored-by: Francisco Ramírez <franchuti688@gmail.com> * review * review --------- Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es> Co-authored-by: Rubén Rincón Blanco <rubenrb@jfrog.com> Co-authored-by: Francisco Ramírez <franchuti688@gmail.com>
- Loading branch information
1 parent
9afacb4
commit 053f22a
Showing
2 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
44 changes: 44 additions & 0 deletions
44
conans/test/functional/toolchains/cmake/cmakedeps/test_cmakedeps_aggregator.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import textwrap | ||
|
||
from conans.test.assets.sources import gen_function_cpp | ||
|
||
|
||
def test_aggregator(transitive_libraries): | ||
c = transitive_libraries | ||
|
||
conanfile = textwrap.dedent(""" | ||
import os | ||
from conan import ConanFile | ||
from conan.tools.cmake import CMake, cmake_layout | ||
class Pkg(ConanFile): | ||
settings = "os", "arch", "compiler", "build_type" | ||
requires = "engine/1.0" | ||
generators = "CMakeDeps", "CMakeToolchain" | ||
exports_sources = "*" | ||
def layout(self): | ||
cmake_layout(self) | ||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
self.run(os.path.join(self.cpp.build.bindir, "app")) | ||
""") | ||
|
||
cmakelists = textwrap.dedent(""" | ||
cmake_minimum_required(VERSION 3.15) | ||
set(CMAKE_CXX_COMPILER_WORKS 1) | ||
set(CMAKE_CXX_ABI_COMPILED 1) | ||
project(app CXX) | ||
include(${CMAKE_BINARY_DIR}/generators/conandeps_legacy.cmake) | ||
add_executable(app main.cpp) | ||
target_link_libraries(app ${CONANDEPS_LEGACY}) | ||
""") | ||
|
||
c.save({ | ||
"conanfile.py": conanfile, | ||
"main.cpp": gen_function_cpp(name="main", includes=["engine"], calls=["engine"]), | ||
"CMakeLists.txt": cmakelists | ||
}, clean_first=True) | ||
c.run("build .") | ||
assert "matrix/1.0: Hello World Release!" in c.out | ||
assert "engine/1.0: Hello World Release!" in c.out |