diff options
author | Iikka Eklund <iikka.eklund@qt.io> | 2021-02-04 08:21:48 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-02-15 06:38:36 +0000 |
commit | 614eaf0d6147f8fd6db51ae1f7cb1621070d1e6e (patch) | |
tree | c8924c3d619bba427aba45ed5638247af76130f2 /conanfile.py | |
parent | 469e45dbc489c42678dbdae9902807ee3a750e0e (diff) |
Conan: Use the 'shared' option value of the Qt build
Default to the value of the prebuilt Qt build.
The 'default' needs to be added as valid option in the list which
will be used by default if no value is given by the user or via
the conan profile.
The user is still able to override this via the profile or from
command line if needed:
"conan install ... -o shared=False"
CMakeCache.txt:
- "conan install ..."
- BUILD_SHARED_LIBS:BOOL=ON
- "conan install ... -o shared=True"
- BUILD_SHARED_LIBS:BOOL=ON
- "conan install ... -o shared=False"
- BUILD_SHARED_LIBS:BOOL=OFF
Task-number: QTBUG-90901
Change-Id: I59db7a92cfe8f37bdf0f2f4df9408386aacfac82
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit fe9b50df1545216c08aba0443988d3e3130da62b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'conanfile.py')
-rw-r--r-- | conanfile.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/conanfile.py b/conanfile.py index 43e9f357..3b66c2ea 100644 --- a/conanfile.py +++ b/conanfile.py @@ -43,9 +43,9 @@ class QtDataVisualization(ConanFile): description = "Qt Data Visualization provides UI Components for displaying 3D graphs, driven by static or dynamic data models." topics = ("qt", "qt6", "data visualization", "qtquick") settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], + options = {"shared": [True, False, "default"], "qt6": "ANY"} # this is needed to model unique package_id for the Add-on build per used Qt6 version - default_options = {"shared": False, + default_options = {"shared": "default", # default: Use the value of the Qt build "qt6": None} exports_sources = "*", "!conan*.*" @@ -87,6 +87,10 @@ class QtDataVisualization(ConanFile): install_dir = os.path.join(os.getcwd(), "_install_tmp") cmake.definitions["CMAKE_INSTALL_PREFIX"] = install_dir + # Use the value of the Qt build + if self.options.shared.value == "default": + del cmake.definitions["BUILD_SHARED_LIBS"] + cmake_toolchain_file = os.environ.get("CMAKE_TOOLCHAIN_FILE") if cmake_toolchain_file: cmake.definitions["CMAKE_TOOLCHAIN_FILE"] = cmake_toolchain_file |