summaryrefslogtreecommitdiff
path: root/conanfile.py
diff options
context:
space:
mode:
authorIikka Eklund <iikka.eklund@qt.io>2021-01-29 10:30:57 +0200
committerIikka Eklund <iikka.eklund@qt.io>2021-02-03 14:03:45 +0200
commitd0adfb770bd02da36a626ed10c5c00f0f5ef0862 (patch)
tree363289af426ef420b72c5f618eb415193e0a76a5 /conanfile.py
parent13601ac62b968d47ee0a47f7c17c80427a8e5f89 (diff)
downloadqtimageformats-d0adfb770bd02da36a626ed10c5c00f0f5ef0862.tar.gz
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 Change-Id: I6bdc6fe729999dfb88c31861d427c99195e24662 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'conanfile.py')
-rw-r--r--conanfile.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/conanfile.py b/conanfile.py
index ca84e3d..d1055b5 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -43,9 +43,9 @@ class QtImageFormats(ConanFile):
description = "Additional Image Format plugins for Qt."
topics = ("qt", "qt6", "addon", "icns", "jp2", "mng", "tga", "tiff", "wbmb", "webp")
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 QtImageFormats(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