-
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
qwt 6.1.6 #5887
Merged
Merged
qwt 6.1.6 #5887
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
7f72560
added recipe for qwt 6.1.6
boussaffawalid e89990d
Update recipes/qwt/all/conanfile.py
boussaffawalid 9cf0e1b
Update recipes/qwt/all/conanfile.py
boussaffawalid e7d9db7
fixed conan test
boussaffawalid 0354156
Update recipes/qwt/all/conanfile.py
boussaffawalid fe562e5
Update recipes/qwt/all/conanfile.py
boussaffawalid fb23049
del self.options.fPIC for test package
boussaffawalid 44abab3
del self.options.fPIC for test package
boussaffawalid fc700ae
use get_safe to check fPIC option
boussaffawalid 07171bd
Merge remote-tracking branch 'upstream/master' into qwt
boussaffawalid b3c4f56
set target_compile_options to -fPIC
boussaffawalid 716a6e4
fix debug lib name for non windows system
boussaffawalid 3f4a501
Update recipes/qwt/all/conanfile.py
boussaffawalid 7aa4fc3
Update recipes/qwt/all/test_package/CMakeLists.txt
boussaffawalid af7f204
Revert "Update recipes/qwt/all/test_package/CMakeLists.txt"
boussaffawalid b6cc391
Update recipes/qwt/all/conanfile.py
boussaffawalid 2808537
Update recipes/qwt/all/conanfile.py
boussaffawalid 2ae9cc1
specify required_conan_version
ericLemanissier 126f9c6
Apply suggestions from code review
ericLemanissier ff0457c
use jom instead of nmake
ericLemanissier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sources: | ||
"6.1.6": | ||
url: "https://sourceforge.net/projects/qwt/files/qwt/6.1.6/qwt-6.1.6.zip" | ||
sha256: "4b2452662ae64656aca92f1bef44a281229f77056689100af62c4b9f24462873" |
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,120 @@ | ||
import os | ||
from conans import ConanFile, tools | ||
|
||
required_conan_version = ">=1.33.0" | ||
|
||
class QwtConan(ConanFile): | ||
name = "qwt" | ||
license = "LGPL-2.1-or-later" | ||
url = "https://github.com/conan-io/conan-center-index" | ||
homepage = "https://qwt.sourceforge.io/" | ||
topics = ("conan", "archive", "compression") | ||
description = ( | ||
"The Qwt library contains GUI Components and utility classes which are primarily useful for programs " | ||
"with a technical background. Beside a framework for 2D plots it provides scales, sliders, dials, compasses, " | ||
"thermometers, wheels and knobs to control or display values, arrays, or ranges of type double." | ||
) | ||
settings = "os", "compiler", "build_type", "arch" | ||
options = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
"shared": [True, False], | ||
"fPIC": [True, False], | ||
"plot": [True, False], | ||
"widgets": [True, False], | ||
"svg": [True, False], | ||
"opengl": [True, False], | ||
"mathml": [True, False], | ||
"designer": [True, False] | ||
} | ||
default_options = { | ||
"shared": False, | ||
"fPIC": True, | ||
"plot": True, | ||
"widgets": True, | ||
"opengl": True, | ||
"designer": True, | ||
"mathml": False, | ||
"svg": False | ||
|
||
} | ||
generators = "qmake" | ||
|
||
@property | ||
def _source_subfolder(self): | ||
return "source_subfolder" | ||
|
||
def build_requirements(self): | ||
if self.settings.os == "Windows" and self.settings.compiler == "Visual Studio": | ||
self.build_requires("jom/1.1.3") | ||
|
||
def config_options(self): | ||
if self.settings.os == "Windows": | ||
del self.options.fPIC | ||
|
||
def configure(self): | ||
if self.options.shared: | ||
del self.options.fPIC | ||
|
||
def requirements(self): | ||
self.requires("qt/5.15.2") | ||
|
||
def source(self): | ||
tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) | ||
|
||
def _patch_qwt_config_files(self): | ||
# qwtconfig.pri | ||
qwtconfig_path = os.path.join(self.source_folder, self._source_subfolder, "qwtconfig.pri") | ||
qwtconfig = tools.load(qwtconfig_path) | ||
|
||
qwtconfig = "CONFIG += conan_basic_setup\ninclude(../conanbuildinfo.pri)\n" + qwtconfig | ||
qwtconfig += "QWT_CONFIG {}= QwtDll\n".format("+" if self.options.shared else "-") | ||
qwtconfig += "QWT_CONFIG {}= QwtPlot\n".format("+" if self.options.plot else "-") | ||
qwtconfig += "QWT_CONFIG {}= QwtWidgets\n".format("+" if self.options.widgets else "-") | ||
qwtconfig += "QWT_CONFIG {}= QwtSvg\n".format("+" if self.options.svg else "-") | ||
qwtconfig += "QWT_CONFIG {}= QwtOpenGL\n".format("+" if self.options.opengl else "-") | ||
qwtconfig += "QWT_CONFIG {}= QwtMathML\n".format("+" if self.options.mathml else "-") | ||
qwtconfig += "QWT_CONFIG {}= QwtDesigner\n".format("+" if self.options.designer else "-") | ||
tools.save(qwtconfig_path, qwtconfig) | ||
|
||
# qwtbuild.pri | ||
qwtbuild_path = os.path.join(self.source_folder, self._source_subfolder, "qwtbuild.pri") | ||
qwtbuild = tools.load(qwtbuild_path) | ||
# set build type | ||
qwtbuild += "CONFIG -= debug_and_release\n" | ||
qwtbuild += "CONFIG -= build_all\n" | ||
qwtbuild += "CONFIG -= release\n" | ||
qwtbuild += "CONFIG += {}\n".format("debug" if self.settings.build_type == "Debug" else "release") | ||
if self.settings.build_type == "RelWithDebInfo": | ||
qwtbuild += "CONFIG += force_debug_info\n" | ||
tools.save(qwtbuild_path, qwtbuild) | ||
|
||
def build(self): | ||
self._patch_qwt_config_files() | ||
|
||
if self.settings.compiler == "Visual Studio": | ||
vcvars = tools.vcvars_command(self.settings) | ||
self.run("{} && qmake {}".format(vcvars, self._source_subfolder), run_environment=True) | ||
self.run("{} && jom".format(vcvars)) | ||
else: | ||
self.run("qmake {}".format(self._source_subfolder), run_environment=True) | ||
self.run("make -j {}".format(tools.cpu_count())) | ||
|
||
def package(self): | ||
self.copy("COPYING", src=os.path.join(self._source_subfolder), dst="licenses") | ||
self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "src")) | ||
self.copy("*.dll", dst="bin", keep_path=False) | ||
self.copy("*.lib", dst="lib", keep_path=False) | ||
self.copy("*.so*", dst="lib", keep_path=False, symlinks=True) | ||
self.copy("*.dylib", dst="lib", keep_path=False) | ||
self.copy("*.a", dst="lib", keep_path=False) | ||
|
||
def package_info(self): | ||
postfix = "" | ||
if self.settings.build_type == "Debug": | ||
if self.settings.os == "Windows": | ||
postfix += "d" | ||
elif self.settings.os == "Macos": | ||
postfix += "_debug" | ||
self.cpp_info.libs = ["qwt" + postfix] | ||
self.env_info.QT_PLUGIN_PATH.append(os.path.join(self.package_folder, 'bin')) | ||
self.env_info.QT_PLUGIN_PATH.append(os.path.join(self.package_folder, 'lib')) | ||
self.cpp_info.defines = ['HAVE_QWT', 'QWT_DLL'] if self.options.shared else ['HAVE_QWT'] |
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,12 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(PackageTest CXX) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup(TARGETS) | ||
|
||
add_executable(example example.cpp) | ||
# Must compile with "-fPIC" since Qt was built with -reduce-relocations. | ||
target_compile_options(example PRIVATE -fPIC) | ||
ericLemanissier marked this conversation as resolved.
Show resolved
Hide resolved
|
||
target_link_libraries(example CONAN_PKG::qt CONAN_PKG::qwt) | ||
set_property(TARGET example PROPERTY CXX_STANDARD 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
|
||
class QwtTestConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "cmake" | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self): | ||
bin_path = os.path.join("bin", "example") | ||
self.run(bin_path, run_environment=True) |
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,10 @@ | ||
#include <QDebug> | ||
#include <QDateTime> | ||
|
||
#include <qwt_date.h> | ||
|
||
int main() | ||
{ | ||
qDebug() << QwtDate::toString(QwtDate::toDateTime(10), "MMM dd hh:mm ", QwtDate::FirstThursday); | ||
return 0; | ||
} |
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,3 @@ | ||
versions: | ||
"6.1.6": | ||
folder: "all" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
tar.gz?