Skip to content

Commit

Permalink
QT 5.15.2 from conan-io/conan-center-index
Browse files Browse the repository at this point in the history
  • Loading branch information
yssource committed Jun 23, 2021
1 parent 1e5480d commit 16c5528
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 102 deletions.
2 changes: 1 addition & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abquant 分为三大模块 a) 数据获取 b) 策略回测 c) 模拟/实盘交
#+begin_src shell :exports code
git clone -b feature/withConan https://github.com/yssource/treefrog-framework.git
cd treefrog-framework && mkdir -v qbuild && cd qbuild
conan install .. --build missing
conan install .. --build missing --profile ../tf.profile
conan build ..
sudo make install
sudo ldconfig
Expand Down
2 changes: 0 additions & 2 deletions abquant.pro
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
TEMPLATE = subdirs
CONFIG += conan_basic_setup
CONFIG += ordered

SUBDIRS = cxx
16 changes: 6 additions & 10 deletions abquant.profile
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,18 @@ compiler.libcxx=libc++
build_type=Release
[options]
qt:shared=True
qt:qtdeclarative=True
qt:qttools=True
qt:qtwebsockets=True
qt:with_vulkan=True
[build_requires]
*: cmake/3.20.3, ninja/1.10.2
# *: cmake/3.20.3, ninja/1.10.2
[env]
# CC=$PROFILE_DIR/ccache-clang
# CXX=$PROFILE_DIR/ccache-clang++

CC="ccache clang"
CXX="ccache clang++"
CPP="ccache cpp"

// CC="clang"
// CXX="clang++"
// CPP="cpp"
# CC="clang"
# CXX="clang++"
# CPP="cpp"

LDFLAGS="-fuse-ld=lld"

CONAN_CMAKE_GENERATOR=Ninja
37 changes: 25 additions & 12 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,37 @@
# -*- coding: utf-8 -*-

from conans import ConanFile, CMake, tools, RunEnvironment
import os
import sys, os
import shutil
import pathlib
import shutil


class AbquantConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
options = {"shared": [True, False], "fPIC": [True, False]}
options = {
"shared": [True, False],
"with_glib": [True, False],
"with_harfbuzz": [True, False],
"fPIC": [True, False],
}
default_options = {
"shared": True,
"fPIC": True,
"qt:shared": True,
"qt:qtdeclarative": True,
"qt:qttools": True,
"qt:qtwebsockets": True,
"qt:with_vulkan": True,
"with_glib": True,
"with_harfbuzz": True,
}

generators = (
"qt",
"qmake",
"cmake",
"virtualrunenv",
"cmake_find_package",
"cmake_find_package_multi",
# "virtualrunenv",
)

@property
Expand Down Expand Up @@ -66,15 +72,15 @@ def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def build_requirements(self):
self.build_requires("cmake/3.20.3")
self.build_requires("ninja/1.10.2")
# def build_requirements(self):
# self.build_requires("cmake/3.20.3")
# self.build_requires("ninja/1.10.2")

def requirements(self):
self.requires("qt/5.15.2@")
self.requires("xtensor/0.21.3@")
self.requires("dataframe/1.15.0@")
self.requires("pybind11/2.6.2@")
self.requires("qt/5.15.2")
self.requires("xtensor/0.21.3")
self.requires("dataframe/1.15.0")
self.requires("pybind11/2.6.2")

def _build_with_qmake(self):
tools.mkdir(self.build_subfolder(kind_="qbuild"))
Expand Down Expand Up @@ -153,9 +159,16 @@ def _build_with_cmake_bind11(self):
if self.settings.os == "Macos":
cmake.definitions["CMAKE_OSX_DEPLOYMENT_TARGET"] = "10.14"
cmake.definitions["PYTHON_EXECUTABLE"] = shutil.which("python")
# cmake.definitions["PYTHON_EXECUTABLE"] = self._python_interpreter
cmake.configure()
cmake.build()

@property
def _python_interpreter(self):
if getattr(sys, "frozen", False):
return "python"
return sys.executable

def build(self):
if pathlib.Path.cwd().name == "qbuild":
self._build_with_qmake()
Expand Down
38 changes: 3 additions & 35 deletions cxx/abqbase.pri
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# QMAKE_CXXFLAGS += -Wall -Wextra -Weffc++ -Werror
# QMAKE_CXX = clang++
# QMAKE_LINK = clang++
# QMAKE_CC = clang
# QMAKE_CXXFLAGS += -std=c++1z -stdlib=libc++
# QMAKE_LFLAGS += -stdlib=libc++ -fuse-ld=lld

win32 {
INCLUDEPATH += $$quote($$(TFDIR)\\include)
LIBS += -L$$quote($$(TFDIR)\\bin)
Expand All @@ -17,35 +10,14 @@ win32 {
unix:LIBS += -Wl,-rpath,. -Wl,-rpath,/usr/lib -L/usr/lib -ltreefrog
unix:INCLUDEPATH += /usr/include/treefrog
linux-*:LIBS += -lrt

# unix:CONFIG += link_pkgconfig
# unix:PKGCONFIG += xtl xtensor
# unix:INCLUDEPATH += /home/jimmy/workspace/git/xtensor-stack/xtl/include
# unix:INCLUDEPATH += /home/jimmy/workspace/git/xtensor-stack/xtensor/include
# header.files = $$HEADER_FILES $$HEADER_CLASSES
}

# unix {
# CONFIG += link_pkgconfig
# PKGCONFIG += xtl xtensor
# }


DEFINES += TF_DLL
DEFINES += LIBRARY_EXPORTS

DEPENDPATH += $$PWD/include
INCLUDEPATH += $$PWD/include

CONFIG += conan_basic_setup
# include($$OUT_PWD/conanbuildinfo.pri)

INCLUDEPATH += $$CONAN_INCLUDEPATH_DATAFRAME
DEPENDPATH += $$CONAN_INCLUDEPATH_DATAFRAME
INCLUDEPATH += $$CONAN_INCLUDEPATH_XTENSOR
DEPENDPATH += $$CONAN_INCLUDEPATH_XTENSOR
LIBS += $$CONAN_LIBDIRS_DATAFRAME -lDataFrame


windows:CONFIG(debug, debug|release) {
TARGET = $$join(TARGET,,,d)
}
Expand All @@ -67,9 +39,5 @@ INSTALLS += target
DEFINES += ABQ_NO_DEBUG
}

isEmpty( use_gui ) {
QT -= gui widgets
} else {
QT += gui widgets
DEFINES += ABQ_USE_GUI_MODULE
}
CONFIG += conan_basic_setup
include($$TOP_BUILD_DIR/conanbuildinfo.pri)
13 changes: 4 additions & 9 deletions cxx/src/actions/actions.pro
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
TARGET = abqaction
TEMPLATE = lib
#Bugfix: libabqaction.so -> libabqaction.a, since it is not able to port
# DataFrame to outside for binding.
CONFIG += static console release c++17
# CONFIG += shared console debug c++17
CONFIG += shared console debug c++17
# CONFIG += static console release c++17
CONFIG -= app_bundle

QMAKE_CXXFLAGS += -fPIC

include(../../abqbase.pri)
include($$OUT_PWD/../../../conanbuildinfo.pri)
include(../../abqbase.pri)

QT += network sql
QT += concurrent
QT -= gui
DEFINES += TF_DLL
DESTDIR = $$PWD/../../../lib

LIBS += -L$$PWD/../../../lib -labqmodel
LIBS += -L$$PWD/../../../lib -labqmodel -labqhelper

HEADERS = emconcept.hpp
HEADERS += emconceptbase.hpp
Expand Down
4 changes: 1 addition & 3 deletions cxx/src/controllers/controllers.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ CONFIG += shared c++17 x86_64
# CONFIG += static c++17 x86_64
QT += network sql xml qml
QT -= gui
DEFINES += TF_DLL
DESTDIR = $$PWD/../../../lib

include(../../abqbase.pri)
# INCLUDEPATH += ../helpers ../models
# DEPENDPATH += ../helpers ../models

LIBS += -L$$PWD/../../../lib -labqhelper -labqmodel
MOC_DIR = .obj/
OBJECTS_DIR = .obj/
Expand Down
1 change: 0 additions & 1 deletion cxx/src/helpers/helpers.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ CONFIG += shared c++17 x86_64
# CONFIG += static c++17 x86_64
QT += xml qml
QT -= gui
DEFINES += TF_DLL
DESTDIR = $$PWD/../../../lib

include(../../abqbase.pri)
Expand Down
1 change: 0 additions & 1 deletion cxx/src/models/models.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ CONFIG += shared c++17 x86_64
# CONFIG += static c++17 x86_64
QT += sql qml
QT -= gui
DEFINES += TF_DLL
DESTDIR = $$PWD/../../../lib
include(../../abqbase.pri)
# INCLUDEPATH += ../helpers sqlobjects mongoobjects
Expand Down
3 changes: 0 additions & 3 deletions cxx/test/actions/emconceptbase/emconceptbase.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ CONFIG -= app_bundle
# CONFIG += no_keywords # avoid clash with slots in Python.h

include(../../../abqbase.pri)
include($$OUT_PWD/../../../../conanbuildinfo.pri)

QT += network sql testlib
QT -= gui
DEFINES += TF_DLL

LIBS += -L$$PWD/../../../../lib -labqaction
LIBS += -L$$PWD/../../../../lib -labqmodel
LIBS += $$CONAN_LIBDIRS_DATAFRAME -lDataFrame

SOURCES = main.cpp

Expand Down
3 changes: 0 additions & 3 deletions cxx/test/actions/emconcepthistory/emconcepthistory.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ CONFIG -= app_bundle
# CONFIG += no_keywords # avoid clash with slots in Python.h

include(../../../abqbase.pri)
include($$OUT_PWD/../../../../conanbuildinfo.pri)

QT += network sql testlib
QT -= gui
DEFINES += TF_DLL

LIBS += -L$$PWD/../../../../lib -labqaction
LIBS += -L$$PWD/../../../../lib -labqmodel
LIBS += $$CONAN_LIBDIRS_DATAFRAME -lDataFrame

SOURCES = main.cpp

Expand Down
3 changes: 0 additions & 3 deletions cxx/test/actions/indexday/indexday.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ CONFIG -= app_bundle
# CONFIG += no_keywords # avoid clash with slots in Python.h

include(../../../abqbase.pri)
include($$OUT_PWD/../../../../conanbuildinfo.pri)

QT += network sql testlib
QT -= gui
DEFINES += TF_DLL

LIBS += -L$$PWD/../../../../lib -labqaction
LIBS += -L$$PWD/../../../../lib -labqmodel
LIBS += $$CONAN_LIBDIRS_DATAFRAME -lDataFrame

SOURCES = main.cpp

Expand Down
3 changes: 0 additions & 3 deletions cxx/test/actions/indexmin/indexmin.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ CONFIG -= app_bundle
# CONFIG += no_keywords # avoid clash with slots in Python.h

include(../../../abqbase.pri)
include($$OUT_PWD/../../../../conanbuildinfo.pri)

QT += network sql testlib
QT -= gui
DEFINES += TF_DLL

LIBS += -L$$PWD/../../../../lib -labqaction
LIBS += -L$$PWD/../../../../lib -labqmodel
LIBS += $$CONAN_LIBDIRS_DATAFRAME -lDataFrame

SOURCES = main.cpp

Expand Down
3 changes: 0 additions & 3 deletions cxx/test/actions/indicator/indicator.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ CONFIG -= app_bundle
# CONFIG += no_keywords # avoid clash with slots in Python.h

include(../../../abqbase.pri)
include($$OUT_PWD/../../../../conanbuildinfo.pri)

QT += network sql testlib
QT -= gui
DEFINES += TF_DLL

LIBS += -L$$PWD/../../../../lib -labqaction
LIBS += -L$$PWD/../../../../lib -labqmodel
LIBS += $$CONAN_LIBDIRS_DATAFRAME -lDataFrame

SOURCES = main.cpp

Expand Down
5 changes: 0 additions & 5 deletions cxx/test/actions/securitylist/securitylist.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@ CONFIG -= app_bundle
# CONFIG += no_keywords # avoid clash with slots in Python.h

include(../../../abqbase.pri)
include($$OUT_PWD/../../../../conanbuildinfo.pri)

QT += network sql testlib
QT -= gui
DEFINES += TF_DLL

LIBS += -L$$PWD/../../../../lib -labqaction
LIBS += -L$$PWD/../../../../lib -labqmodel
# Bugfix: don't know why not include DataFrame Libs from abqbase.pri, so include
# it again manually.
LIBS += $$CONAN_LIBDIRS_DATAFRAME -lDataFrame

SOURCES = main.cpp

Expand Down
5 changes: 0 additions & 5 deletions cxx/test/actions/stockday/stockday.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@ CONFIG -= app_bundle
# CONFIG += no_keywords # avoid clash with slots in Python.h

include(../../../abqbase.pri)
include($$OUT_PWD/../../../../conanbuildinfo.pri)

QT += network sql testlib
QT -= gui
DEFINES += TF_DLL

LIBS += -L$$PWD/../../../../lib -labqaction
LIBS += -L$$PWD/../../../../lib -labqmodel
# Bugfix: don't know why not include DataFrame Libs from abqbase.pri, so include
# it again manually.
LIBS += $$CONAN_LIBDIRS_DATAFRAME -lDataFrame

SOURCES = main.cpp

Expand Down
3 changes: 0 additions & 3 deletions cxx/test/actions/stockmin/stockmin.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ CONFIG -= app_bundle
# CONFIG += no_keywords # avoid clash with slots in Python.h

include(../../../abqbase.pri)
include($$OUT_PWD/../../../../conanbuildinfo.pri)

QT += network sql testlib
QT -= gui
DEFINES += TF_DLL

LIBS += -L$$PWD/../../../../lib -labqaction
LIBS += -L$$PWD/../../../../lib -labqmodel
LIBS += $$CONAN_LIBDIRS_DATAFRAME -lDataFrame

SOURCES = main.cpp

Expand Down

0 comments on commit 16c5528

Please sign in to comment.