Skip to content

Commit

Permalink
Revert "Use conanfile.txt instead of conanfile.py"
Browse files Browse the repository at this point in the history
This reverts commit 3536f8f.
  • Loading branch information
friendlyanon committed Mar 8, 2024
1 parent 3536f8f commit ff48153
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion cmake-init/cmake_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def should_install_file(name, d):
return not d["cmake_321"]
if name == "vcpkg.json":
return d["vcpkg"]
if name == "conanfile.txt":
if name == "conanfile.py":
return d["conan"]
if name == "install-config.cmake":
return not d["exe"]
Expand Down
3 changes: 2 additions & 1 deletion cmake-init/templates/common/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
.vs/
.vscode/
build/
cmake-build-*/
cmake-build-*/{% if conan %}
conan/{% end %}
prefix/
.clangd
CMakeLists.txt.user
Expand Down
2 changes: 1 addition & 1 deletion cmake-init/templates/common/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Dependencies

For a list of dependencies, please refer to {% if vcpkg %}[vcpkg.json](vcpkg.json){% else %}[conanfile.txt](conanfile.txt){% end %}.{% end %}
For a list of dependencies, please refer to {% if vcpkg %}[vcpkg.json](vcpkg.json){% else %}[conanfile.py](conanfile.py){% end %}.{% end %}

## Build

Expand Down
2 changes: 1 addition & 1 deletion cmake-init/templates/common/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"name": "conan",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/build/generators/conan_toolchain.cmake"{% if not cmake_321 %},
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/conan/conan_toolchain.cmake"{% if not cmake_321 %},
"CMAKE_POLICY_DEFAULT_CMP0091": "NEW"{% end %}
}
},{% end %}
Expand Down
18 changes: 18 additions & 0 deletions cmake-init/templates/common/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from conan import ConanFile


class Recipe(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"

def layout(self):
self.folders.generators = "conan"

def requirements(self):{% if c %}{% if exe %}
self.requires("hedley/15"){% end %}
self.requires("json-c/0.17"){% else %}
self.requires("fmt/10.2.1"){% end %}

def build_requirements(self):{% if catch3 %}
self.test_requires("catch2/3.5.2"){% else %}
self.test_requires("catch2/2.13.10", options={"with_main": True}){% end %}
18 changes: 0 additions & 18 deletions cmake-init/templates/common/conanfile.txt

This file was deleted.

0 comments on commit ff48153

Please sign in to comment.