-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Recipe templates with Conan 2.x support only (#25849)
* [docs] package_templates: demo non-list conandata URLs as well * [docs] autotools: do not use `-nologo` for AR with MSVC It keeps the logs slightly cleaner for a very infrequent command but has caused issues with "ar interface detection" in ./configure for several recipes. * [docs] autotools: provide tool_requires() versions These change very infrequently (except for pkgconf, somewhat). I think these can be included for convenience. * [docs] autotools: mention a common workaround for MSVC * [docs] cmake: improve recipe example * [docs] package_templates: update the conventional LicenseRef format * [docs] package_templates: improve package_type comment * [docs] package_templates: various minor improvements * [docs] package_templates: remove outdated test_package comment * [docs] meson: bump versions in template * [docs] package_templates: add a version range example * [docs] package_templates: improve transitive_headers=True examples * [docs] autotools: improve AutotoolsDeps workaround comment * [docs] autotools: revert to x.y.z tool versions * [docs] package_templates: remove outdated CMakeLists.txt comment * [docs] package_templates: add layout to prebuilt_tool_package test_package The test_package directory gets gunked up with generated VirtualBuildEnv files otherwise. * [docs] package_templates: fix some typos * Move CMake and and PkgConfig properties to the top, drop legacy generator props The CMake and PkgConfig info is the most relevant part to any consumers and should come first, imo. New recipes should not bother with the legacy generators, especially after test_v1_package is no longer included. * Simplify Cmake template Signed-off-by: Uilian Ries <[email protected]> * Simplify header-only template Signed-off-by: Uilian Ries <[email protected]> * Simplify header-only template Signed-off-by: Uilian Ries <[email protected]> * Move patches to source Signed-off-by: Uilian Ries <[email protected]> * Simplify autotools template Signed-off-by: Uilian Ries <[email protected]> * Simplify meson template Signed-off-by: Uilian Ries <[email protected]> * Simplify msbuild template Signed-off-by: Uilian Ries <[email protected]> * Simplify prebuilt template Signed-off-by: Uilian Ries <[email protected]> * Grammar typo Signed-off-by: Uilian Ries <[email protected]> * Use cxx language by default on test package Signed-off-by: Uilian Ries <[email protected]> * Remove VirtuanEnvs from test package Signed-off-by: Uilian Ries <[email protected]> * Update test package comment Signed-off-by: Uilian Ries <[email protected]> * Remove VirtuanEnvs - They are automatic Signed-off-by: Uilian Ries <[email protected]> * Comment update Co-authored-by: Daniel <[email protected]> * Comment update Co-authored-by: Daniel <[email protected]> * Comment update Co-authored-by: Daniel <[email protected]> * Comment update Co-authored-by: Daniel <[email protected]> * Comment how to install --------- Signed-off-by: Uilian Ries <[email protected]> Co-authored-by: Martin Valgur <[email protected]> Co-authored-by: Daniel <[email protected]>
- Loading branch information
1 parent
4ced948
commit 41f9b6f
Showing
33 changed files
with
224 additions
and
399 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
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
8 changes: 2 additions & 6 deletions
8
docs/package_templates/autotools_package/all/test_package/CMakeLists.txt
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 |
---|---|---|
@@ -1,11 +1,7 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
project(test_package LANGUAGES C) # if the project is pure C | ||
# project(test_package LANGUAGES CXX) # if the project uses c++ | ||
project(test_package LANGUAGES CXX) | ||
|
||
find_package(package REQUIRED CONFIG) | ||
|
||
add_executable(${PROJECT_NAME} test_package.c) | ||
# don't link to ${CONAN_LIBS} or CONAN_PKG::package | ||
add_executable(${PROJECT_NAME} test_package.cpp) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE package::package) | ||
# In case the target project need a specific C++ standard | ||
# target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) |
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
16 changes: 0 additions & 16 deletions
16
docs/package_templates/autotools_package/all/test_package/test_package.c
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
docs/package_templates/autotools_package/all/test_package/test_package.cpp
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,21 @@ | ||
#include <cstdlib> | ||
#include "package/foobar.h" | ||
|
||
|
||
int main(void) { | ||
/* | ||
* TODO: Remove this comment before pushing the testing code; | ||
* | ||
* Create a minimal usage for the target project here; | ||
* Avoid upstream full examples, or code bigger than 15 lines; | ||
* Avoid networking connections; | ||
* Avoid background apps or servers; | ||
* Avoid GUI apps; | ||
* Avoid extra files like images, sounds and other binaries; | ||
* The propose is testing the generated artifacts ONLY; | ||
*/ | ||
|
||
foobar_print_version(); // Make sure to call something that will require linkage for compiled libraries | ||
|
||
return EXIT_SUCCESS; | ||
} |
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
Oops, something went wrong.