-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[question] Conan-2.x and global.conf #13798
Comments
Hi @maitrey Thanks for your questions.
|
Hi James, Thanks a lot for your reply. |
In profiles you should be setting something like:
It is important to give the |
Now it worked! Thanks James.
|
To avoid typo-squatting security attacks, someone trying to replace We have already been using lowercase for years in ConanCenter, and it was already approved by the tribe 2 years ago: conan-io/tribe#17 |
Okay thanks James for answering my questions. I donot want to check in yet as I have not yet tested my changes locally. |
It shouldn't be necessary to push the changes to the remote. |
Thanks again. On succesful creation of a package with 2.x, I get this message: How can I disable the bold parts? I want to know if package was succesfully created or failed as it was with Conan-1.x. |
Not sure what is that, it seems that someone (maybe the |
The recipe is very simple and its a header only library. from conan import ConanFile
from conan.tools.scm import Git
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps
from conan.tools.cmake import cmake_layout
from conan.tools.env import VirtualBuildEnv
from conan.tools.env import VirtualRunEnv
from conan.errors import ConanException
from conan.tools.files import load, update_conandata
class QASW(ConanFile):
name = 'qasw'
url = 'https://github.com/qasw.git'
exports_sources = "include/*", "CMakeLists.txt", "LICENSE"
settings = "os", "compiler", "arch", "build_type"
author = "Maitrey Mishra"
options = {"tests": ["true", "false"]}
default_options = {"qasw/*:tests": "false"}
package_type = "header-library"
def export(self):
git = Git(self, self.recipe_folder)
scm_url, scm_commit = git.get_url_and_commit()
update_conandata(self, {"sources": {"commit": scm_commit, "url": scm_url}})
def layout(self):
cmake_layout(self)
def generate(self):
deps = CMakeDeps(self)
deps.generate()
print(deps.content)
tc = CMakeToolchain(self)
tc.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
cmake = CMake(self)
cmake.configure()
cmake.install()
def package_info(self):
self.cpp_info.includedirs = ['include'] ` |
You are printing it yourself in |
This is silly really from my end. Sorry about that. |
NP! :) For VS Code, probably the standard CMake extension with CMakePresets is good, we have tested and seems to be working well. So terminal For Eclipse IDE I don't know, does it have a CMake integration too? There is no Conan extension that we are aware. |
No this is not what I meant. I meant extensions like these: Is there anyone from these that are recommended? |
Not at this moment, we don't know what is the status of those extensions, so not possible to recommend any. It is even likely that many of those are still not ready for 2.0, but we really don't know. |
My automation uses: |
Most the extensions/plugin approach would be to call For such custom functionality, it seems you could leverage the Conan 2.0 custom commands: https://docs.conan.io/2/reference/extensions/custom_commands.html For colleagues using other tools like Eclipse, which are unlikely to have any extension/plugin, probably the best is a script that can be executed in the project that does the necessary calls. |
Thanks a lot for your help. Next problem I have is conan lock create . |
It is the format of the lockfile itself. Lockfiles format has evolved over time, and that is a way to catch mismatches, if you try to use a lockfile what was created in an older Conan version (1.X) and it is 0.4, it will give you an error. It will also error if in the future we change the version to 0.6 or greater Lockfiles cannot easily be part of the package, I guess that you can do So were to store lockfiles, depends on the usage you plan to do:
|
Thanks for answering all my questions. I am closing the ticket. Many thanks! |
Happy to help! :) Don't hesitate to open new tickets if you have further questions. |
What is your question?
Dear Conan Folks,
I just started to use Conan-2.x. I am using : Conan version 2.0.4.
I have a couple of questions:
[conf] tools.cmake.cmaketoolchain:generator=MinGW Makefiles
I tried to port this to self written global.conf but this fails with "Error in Conan initialization: Bad conf definition: [conf]"
If I leave it in the profile , it still fails with : 'cmake' is not recognized as an internal or external command,
operable program or batch file.
While I explicilty set in profiles:
PATH+=C:/Tools/MinGW/4.8.1/bin; C:/Program Files/CMake/bin
Somewhere I am missing something. Could someone give me a hint please?
Many thanks for your help.
Thanks!
Br,
Maitrey
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: