-
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
Adding imagl recipe #4225
Adding imagl recipe #4225
Conversation
Some configurations of 'imagl/0.1.0' failed in build 1 (
|
All green in build 3 (
|
recipes/imagl/all/conanfile.py
Outdated
cmake.build() | ||
cmake.install() | ||
|
||
# Explicit way: |
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.
pls remove dead code
recipes/imagl/all/conanfile.py
Outdated
options = {"shared": [True, False]} | ||
default_options = {"shared": False} |
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.
You are missing the fPIC
option
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.
Thank you for contributing this exciting project! 🏆
I strongly recommend you take a lot at other recipes that are added already, there's a few details missing this is a good example
You most likely need the "cmake_wrapper" like this https://github.com/conan-io/conan-center-index/blob/7497b701cc07901ee3f69736c2e1b1802aa8df79/recipes/sentry-native/all/CMakeLists.txt
recipes/imagl/all/conanfile.py
Outdated
tools.replace_in_file(self.name + "-v" + self.version + "/CMakeLists.txt", "# conan insert", | ||
'''include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup()''') |
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.
patching sources needs to be done in the build method
recipes/imagl/all/conanfile.py
Outdated
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.verbose = 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.
cmake.verbose = True |
recipes/imagl/all/conanfile.py
Outdated
cmake.verbose = True | ||
cmake.configure(source_folder=self.name + "-v" + self.version, defs={"STATIC_LIB": "OFF" if self.options.shared else "ON"}) | ||
cmake.build() | ||
cmake.install() |
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.
this should be done in the package method
recipes/imagl/all/conanfile.py
Outdated
if not(self.options.shared): static_suffix = "s" | ||
self.cpp_info.libs = ["imaGL{debug}{static}".format(debug = debug_suffix, static = static_suffix)] | ||
|
||
def configure(self): |
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.
This should be higher up in the order see this https://github.com/conan-io/conan-center-index/blob/ddd8c3c7499678583061a570b03cac615d67b157/docs/reviewing.md#order-of-methods-and-attributes
For managing the c++ version requirements... I'd suggest you copy this snippet
conan-io/conan#8002
if(STATIC_LIB) | ||
add_compile_definitions(IMAGL_STATIC) | ||
endif() |
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.
this most likely needs to be in the package info
import os | ||
|
||
from conans import ConanFile, CMake, tools | ||
|
||
|
||
class ImaglTestConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
options = {"shared": [True, False]} | ||
default_options = {"shared": False} | ||
generators = "cmake" | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is | ||
# in "test_package" | ||
cmake.configure(defs={"STATIC_LIB": "OFF" if self.options.shared else "ON"}) | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self): | ||
os.chdir("bin") | ||
self.run(".%sexample" % os.sep) |
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.
Please follow our usual test package format
import os | |
from conans import ConanFile, CMake, tools | |
class ImaglTestConan(ConanFile): | |
settings = "os", "compiler", "build_type", "arch" | |
options = {"shared": [True, False]} | |
default_options = {"shared": False} | |
generators = "cmake" | |
def build(self): | |
cmake = CMake(self) | |
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is | |
# in "test_package" | |
cmake.configure(defs={"STATIC_LIB": "OFF" if self.options.shared else "ON"}) | |
cmake.build() | |
def test(self): | |
if not tools.cross_building(self): | |
os.chdir("bin") | |
self.run(".%sexample" % os.sep) | |
import os | |
from conans import ConanFile, CMake, tools | |
class TestPackageConan(ConanFile): | |
settings = "os", "compiler", "build_type", "arch" | |
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.settings): | |
bin_path = os.path.join("bin", "test_package") | |
self.run(bin_path, run_environment=True) |
Signed-off-by: Uilian Ries <uilianries@gmail.com>
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.
Prepare for CCI
All green in build 4 (
|
Thanks everyone, I went away for a few days and when I come back I see your great reviews! I merged the @uilianries pull request which includes all of your remarks. I still have a lot of things to learn to master conan. 😉 |
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.
It looks good, it might be worth losing the compiler restriction so have it available on CCI
def _compilers_minimum_version(self): | ||
return { | ||
"gcc": "9", | ||
"Visual Studio": "16.5", |
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.
"Visual Studio": "16.5", | |
"Visual Studio": "16", |
https://c3i.jfrog.io/c3i/misc/logs/pr/4225/4/imagl/0.1.0/summary.json
{
"reference": "imagl/0.1.0",
"packageID": "INVALID",
"settings": {
"os": "Windows",
"os_build": "Windows",
"arch": "x86_64",
"arch_build": "x86_64",
"compiler": "Visual Studio",
"compiler.version": "16",
"build_type": "Debug",
"compiler.runtime": "MDd"
},
"options": {
"imagl:shared": "True"
},
"status": "DUPLICATED",
"profile": null,
"build": null,
"test": null
},
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.
Is it possible for you to commit this simple change, since the pull request is now approved? Or do I have to create a new pull request / issue?
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.
You'll need to make a new PR, this way CCI can generate all new packages
Hi, the CMakeLists of this library calls |
Hi, What is wrong: calling conan install or using version ranges? |
Both are wrong in CCI:
And more generally, it's not recommended to have intrusive integration of a package manager in its CMakeLists. It makes it hard for others package managers to add the library.
|
I've opened #6279 |
Specify library name and version: imagl/0.1.0
conan-center hook activated.