Repository: conan-io/conan-center-index

Issue:
[package] arrow/1.0.0: doesn't compile with parquet=True
<!-- 
  Please don't forget to update the issue title.
  Include all applicable information to help us reproduce your problem.
-->

### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **arrow/1.0.0**
  * Operating System+version: **Linux Ubuntu 18.04**
  * Compiler+version: **GCC 8.4.0**
  * Conan version: **conan 1.28.1**
  * Python version: **Python 3.6.9**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
Configuration for profile default:

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=8
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]
```


### Steps to reproduce (Include if Applicable)
Trying to add arrow dependency with parquet support, in my conanfile.txt:
```
[requires]
arrow/1.0.0

[generators]
cmake

[options]
arrow:parquet=True

[imports]
include,* -> ./include
lib,* -> ./lib
bin,* -> ./bin
```
Thrift cannot be found by cmake:
```
-- Checking for module 'thrift'                                                                                                                                                          
--   No package 'thrift' found                                                                                                                                                           
CMake Error at /usr/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):                                                                                          
  Could NOT find Thrift (missing: THRIFT_STATIC_LIB) (found suitable version                                                                                                             
  "0.13.0", minimum required is "0.11.0")
```

### Logs (Include/Attach if Applicable)
<details><summary>Click to expand log</summary>

cmake logs:
```
-- Conan: checking conan executable
-- Conan: Found program /usr/local/bin/conan
-- Conan: Version found Conan version 1.28.1

-- Conan: Automatic detection of conan settings from cmake
-- Conan: Settings= -s;build_type=Debug;-s;compiler=gcc;-s;compiler.version=8;-s;compiler.libcxx=libstdc++11
-- Conan: checking conan executable
-- Conan: Found program /usr/local/bin/conan
-- Conan: Version found Conan version 1.28.1

-- Conan executing: /usr/local/bin/conan install /home/ms/dev/test_project/conanfile.txt -s build_type=Debug -s compiler=gcc -s compiler.version=8 -s compiler.libcxx=libstdc++11 -g=cmake --build=missing
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=8
os=Linux
os_build=Linux
[options]
[build_requires]
[env]

conanfile.txt: Installing package
Requirements
    arrow/1.0.0 from 'conan-center' - Cache
    boost/1.73.0 from 'conan-center' - Cache
    bzip2/1.0.8 from 'conan-center' - Cache
    libevent/2.1.11 from 'conan-center' - Cache
    openssl/1.1.1g from 'conan-center' - Cache
    thrift/0.13.0 from 'conan-center' - Cache
    zlib/1.2.11 from 'conan-center' - Cache
Packages
    arrow/1.0.0:c26df1c75dece9af94f65101d5889aff3f16bc48 - Build
    boost/1.73.0:5055c0c4fc0c2164e2d11dde7ef188260ed3ce3a - Cache
    bzip2/1.0.8:d666801fbcdc3fd37cf8b2a827d72e84b1878ff5 - Cache
    libevent/2.1.11:83c8982ab18513337f2443e7a495baa4bda7ad12 - Cache
    openssl/1.1.1g:761432f3453a17c960259b5b2605153e3bcffd7d - Cache
    thrift/0.13.0:cc79aaa29cb36348c899a8f538ff485dbf9c2481 - Cache
    zlib/1.2.11:761432f3453a17c960259b5b2605153e3bcffd7d - Cache

Installing (downloading, building) binaries...
bzip2/1.0.8: Already installed!
openssl/1.1.1g: Already installed!
zlib/1.2.11: Already installed!
boost/1.73.0: Already installed!
boost/1.73.0: LIBRARIES: ['boost_wave', 'boost_container', 'boost_contract', 'boost_exception', 'boost_graph', 'boost_iostreams', 'boost_locale', 'boost_log', 'boost_program_options', 'boost_random', 'boost_regex', 'boost_serialization', 'boost_wserialization', 'boost_coroutine', 'boost_fiber', 'boost_context', 'boost_timer', 'boost_thread', 'boost_chrono', 'boost_date_time', 'boost_atomic', 'boost_filesystem', 'boost_system', 'boost_type_erasure', 'boost_log_setup', 'boost_math_c99', 'boost_math_c99f', 'boost_math_c99l', 'boost_math_tr1', 'boost_math_tr1f', 'boost_math_tr1l', 'boost_nowide', 'boost_stacktrace_addr2line', 'boost_stacktrace_backtrace', 'boost_stacktrace_basic', 'boost_stacktrace_noop', 'boost_unit_test_framework']
boost/1.73.0: Package folder: /home/ms/.conan/data/boost/1.73.0/_/_/package/5055c0c4fc0c2164e2d11dde7ef188260ed3ce3a
libevent/2.1.11: Already installed!
thrift/0.13.0: Already installed!
thrift/0.13.0: Appending PATH env var with : /home/ms/.conan/data/thrift/0.13.0/_/_/package/cc79aaa29cb36348c899a8f538ff485dbf9c2481/bin
arrow/1.0.0: Copying sources to build folder
arrow/1.0.0: Building your package in /home/ms/.conan/data/arrow/1.0.0/_/_/build/c26df1c75dece9af94f65101d5889aff3f16bc48
arrow/1.0.0: Generator cmake_find_package created Findthrift.cmake
arrow/1.0.0: Generator cmake_find_package created FindBoost.cmake
arrow/1.0.0: Generator cmake_find_package created FindLibevent.cmake
arrow/1.0.0: Generator cmake_find_package created FindZLIB.cmake
arrow/1.0.0: Generator cmake_find_package created FindBZip2.cmake
arrow/1.0.0: Generator cmake_find_package created FindOpenSSL.cmake
arrow/1.0.0: Generator cmake created conanbuildinfo.cmake
arrow/1.0.0: Calling build()
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan: Adjusting fPIC flag (ON)
-- Conan: Compiler GCC>=5, checking major version 8
-- Conan: Checking correct version: 8
-- Conan: C++ stdlib: libstdc++11
-- Building using CMake version: 3.17.2
-- Arrow version: 1.0.0 (full: '1.0.0')
-- Arrow SO version: 100 (full: 100.0.0)
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- clang-tidy not found
-- clang-format not found
-- Could NOT find ClangTools (missing: CLANG_FORMAT_BIN CLANG_TIDY_BIN)
-- infer not found
fatal: not a git repository (or any parent up to mount point /home/ms)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
-- Found Python3: /usr/bin/python3.6 (found version "3.6.9") found components: Interpreter
-- Using ccache: /usr/local/bin/ccache
-- Found cpplint executable at CPPLINT_BIN-NOTFOUND
-- System processor: x86_64
-- Performing Test CXX_SUPPORTS_SSE4_2
-- Performing Test CXX_SUPPORTS_SSE4_2 - Success
-- Performing Test CXX_SUPPORTS_AVX2
-- Performing Test CXX_SUPPORTS_AVX2 - Success
-- Performing Test CXX_SUPPORTS_AVX512
-- Performing Test CXX_SUPPORTS_AVX512 - Success
-- Arrow build warning level: CHECKIN
Using ld linker
Configured for DEBUG build (set with cmake -DCMAKE_BUILD_TYPE={release,debug,...})
-- Build Type: DEBUG
-- Using SYSTEM approach to find dependencies
-- ARROW_ABSL_BUILD_VERSION: 2eba343b51e0923cd3fb919a6abd6120590fc059
-- ARROW_AWSSDK_BUILD_VERSION: 1.7.160
-- ARROW_BOOST_BUILD_VERSION: 1.71.0
-- ARROW_BROTLI_BUILD_VERSION: v1.0.7
-- ARROW_BZIP2_BUILD_VERSION: 1.0.8
-- ARROW_CARES_BUILD_VERSION: 1.16.1
-- ARROW_GBENCHMARK_BUILD_VERSION: v1.5.1
-- ARROW_GFLAGS_BUILD_VERSION: v2.2.2
-- ARROW_GLOG_BUILD_VERSION: v0.4.0
-- ARROW_GRPC_BUILD_VERSION: v1.29.1
-- ARROW_GTEST_BUILD_VERSION: 1.8.1
-- ARROW_JEMALLOC_BUILD_VERSION: 5.2.1
-- ARROW_LZ4_BUILD_VERSION: v1.9.2
-- ARROW_MIMALLOC_BUILD_VERSION: v1.6.3
-- ARROW_ORC_BUILD_VERSION: 1.6.2
-- ARROW_PROTOBUF_BUILD_VERSION: v3.12.1
-- ARROW_RAPIDJSON_BUILD_VERSION: 1a803826f1197b5e30703afe4b9c0e7dd48074f5
-- ARROW_RE2_BUILD_VERSION: 2019-08-01
-- ARROW_SNAPPY_BUILD_VERSION: 1.1.8
-- ARROW_THRIFT_BUILD_VERSION: 0.12.0
-- ARROW_THRIFT_BUILD_MD5_CHECKSUM: 3deebbb4d1ca77dd9c9e009a1ea02183
-- ARROW_UTF8PROC_BUILD_VERSION: v2.5.0
-- ARROW_ZLIB_BUILD_VERSION: 1.2.11
-- ARROW_ZSTD_BUILD_VERSION: v1.4.5
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Building without OpenSSL support. Minimum OpenSSL version 1.0.2 required.
-- Checking for module 'thrift'
--   No package 'thrift' found
CMake Error at /usr/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find Thrift (missing: THRIFT_STATIC_LIB) (found suitable version
  "0.13.0", minimum required is "0.11.0")
Call Stack (most recent call first):
  /usr/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  source_subfolder/cpp/cmake_modules/FindThrift.cmake:87 (find_package_handle_standard_args)
  source_subfolder/cpp/cmake_modules/ThirdpartyToolchain.cmake:178 (find_package)
  source_subfolder/cpp/cmake_modules/ThirdpartyToolchain.cmake:1242 (resolve_dependency_with_version)
  source_subfolder/cpp/CMakeLists.txt:484 (include)


-- Configuring incomplete, errors occurred!
See also "/home/ms/.conan/data/arrow/1.0.0/_/_/build/c26df1c75dece9af94f65101d5889aff3f16bc48/CMakeFiles/CMakeOutput.log".
See also "/home/ms/.conan/data/arrow/1.0.0/_/_/build/c26df1c75dece9af94f65101d5889aff3f16bc48/CMakeFiles/CMakeError.log".
arrow/1.0.0:
arrow/1.0.0: WARN: Package is corrupted, removing folder: /home/ms/.conan/data/arrow/1.0.0/_/_/package/c26df1c75dece9af94f65101d5889aff3f16bc48
arrow/1.0.0: WARN: Build folder is dirty, removing it: /home/ms/.conan/data/arrow/1.0.0/_/_/build/c26df1c75dece9af94f65101d5889aff3f16bc48
arrow/1.0.0: ERROR: Package 'c26df1c75dece9af94f65101d5889aff3f16bc48' build failed
arrow/1.0.0: WARN: Build folder /home/ms/.conan/data/arrow/1.0.0/_/_/build/c26df1c75dece9af94f65101d5889aff3f16bc48
ERROR: arrow/1.0.0: Error in build() method, line 351
	cmake = self._configure_cmake()
while calling '_configure_cmake', line 338
	self._cmake.configure()
	ConanException: Error 1 while executing cd '/home/ms/.conan/data/arrow/1.0.0/_/_/build/c26df1c75dece9af94f65101d5889aff3f16bc48' && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Debug" -DCONAN_IN_LOCAL_CACHE="ON" -DCONAN_COMPILER="gcc" -DCONAN_COMPILER_VERSION="8" -DCONAN_CXX_FLAGS="-m64" -DCONAN_SHARED_LINKER_FLAGS="-m64" -DCONAN_C_FLAGS="-m64" -DCONAN_LIBCXX="libstdc++11" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_INSTALL_PREFIX="/home/ms/.conan/data/arrow/1.0.0/_/_/package/c26df1c75dece9af94f65101d5889aff3f16bc48" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCONAN_CMAKE_POSITION_INDEPENDENT_CODE="ON" -DCMAKE_MODULE_PATH="/home/ms/.conan/data/arrow/1.0.0/_/_/build/c26df1c75dece9af94f65101d5889aff3f16bc48" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -DARROW_DEPENDENCY_SOURCE="SYSTEM" -DARROW_GANDIVA="False" -DARROW_PARQUET="True" -DARROW_PLASMA="False" -DARROW_DATASET="False" -DARROW_FILESYSTEM="False" -DPARQUET_REQUIRE_ENCRYPTION="False" -DARROW_HDFS="False" -DARROW_VERBOSE_THIRDPARTY_BUILD="True" -DARROW_BUILD_SHARED="False" -DARROW_BUILD_STATIC="True" -DARROW_NO_DEPRECATED_API="False" -DARROW_FLIGHT="False" -DARROW_HIVESERVER2="False" -DARROW_COMPUTE="False" -DARROW_CSV="False" -DARROW_CUDA="False" -DARROW_JEMALLOC="False" -DARROW_JSON="False" -DBOOST_SOURCE="SYSTEM" -DProtobuf_SOURCE="SYSTEM" -DgRPC_SOURCE="SYSTEM" -DARROW_USE_GLOG="False" -DGLOG_SOURCE="SYSTEM" -DARROW_WITH_BACKTRACE="False" -DARROW_WITH_BROTLI="False" -DBrotli_SOURCE="SYSTEM" -DARROW_BROTLI_USE_SHARED="False" -Dgflags_SOURCE="SYSTEM" -DARROW_WITH_BZ2="False" -DBZip2_SOURCE="SYSTEM" -DARROW_WITH_LZ4="False" -DLz4_SOURCE="SYSTEM" -DARROW_WITH_SNAPPY="False" -DSnappy_SOURCE="SYSTEM" -DARROW_WITH_ZLIB="False" -DRE2_SOURCE="SYSTEM" -DZLIB_SOURCE="SYSTEM" -DARROW_WITH_ZSTD="False" -DZSTD_SOURCE="SYSTEM" -DORC_SOURCE="SYSTEM" -DARROW_WITH_THRIFT="True" -DThrift_SOURCE="SYSTEM" -DTHRIFT_VERSION="1.0" -DARROW_USE_OPENSSL="False" -DARROW_S3="False" -DAWSSDK_SOURCE="SYSTEM" -DARROW_BUILD_UTILITIES="False" -DARROW_BUILD_INTEGRATION="False" -DARROW_INSTALL_NAME_RPATH="False" -DARROW_BUILD_EXAMPLES="False" -DARROW_BUILD_TESTS="False" -DARROW_ENABLE_TIMING_TESTS="False" -DARROW_BUILD_BENCHMARKS="False" -DLLVM_SOURCE="SYSTEM" -DARROW_WITH_UTF8PROC="False" -Dutf8proc_SOURCE="SYSTEM" -Wno-dev '/home/ms/.conan/data/arrow/1.0.0/_/_/build/c26df1c75dece9af94f65101d5889aff3f16bc48'
CMake Error at build/conan.cmake:402 (message):
  Conan install failed='1'
Call Stack (most recent call first):
  build/conan.cmake:497 (conan_cmake_install)
  CMakeLists.txt:79 (conan_cmake_run)


-- Configuring incomplete, errors occurred!
See also "/home/ms/dev/test_project/build/CMakeFiles/CMakeOutput.log".
See also "/home/ms/dev/test_project/build/CMakeFiles/CMakeError.log".

```

</details>



Discussion:
@madebr have you come across something like this?
No, I am able to build the 3 modules (arrow, parquet and plasma), but not gandiva (because of missing llvm).
Maybe try updating your conan dependencies?
It turned out that I had some garbage in cmake, after removing CMakeCache.txt it works.
Thanks!
Unfortunately I reproduced again the bug. Now I know what is the root cause, when I build in release it's OK, but with `cmake -DCMAKE_BUILD_TYPE=Debug ..` above errors occur.
It looks like thrift has no correct components set.
I'm looking into it.

Resolving patch:
diff --git a/recipes/thrift/all/conanfile.py b/recipes/thrift/all/conanfile.py
--- a/recipes/thrift/all/conanfile.py
+++ b/recipes/thrift/all/conanfile.py
@@ -1,5 +1,6 @@
-import os
 from conans import tools, CMake, ConanFile
+from conans.errors import ConanInvalidConfiguration
+import os
 
 
 class ConanFileDefault(ConanFile):
@@ -28,6 +29,7 @@ class ConanFileDefault(ConanFile):
         "with_cpp": [True, False],
         "with_java": [True, False],
         "with_python": [True, False],
+        "with_qt": [True, False],
         "with_haskell": [True, False],
         "with_plugin": [True, False]
     }
@@ -46,16 +48,28 @@ class ConanFileDefault(ConanFile):
         "with_cpp": True,
         "with_java": False,
         "with_python": False,
+        "with_qt": False,
         "with_haskell": False,
         "with_plugin": False
     }
-    _source_subfolder = "source_subfolder"
-    _build_subfolder = "build_subfolder"
+    short_paths = True
 
     _cmake = None
 
+    @property
+    def _source_subfolder(self):
+        return "source_subfolder"
+
+    @property
+    def _build_subfolder(self):
+        return "build_subfolder"
+
     def config_options(self):
-        if self.settings.os == 'Windows':
+        if self.settings.os == "Windows":
+            del self.options.fPIC
+
+    def configure(self):
+        if self.options.shared:
             del self.options.fPIC
 
     def source(self):
@@ -63,15 +77,6 @@ def source(self):
         extracted_dir = "thrift-" + self.version
         os.rename(extracted_dir, self._source_subfolder)
 
-    def build(self):
-        for p in self.conan_data["patches"][self.version]:
-            tools.patch(**p)
-        for f in ["Findflex.cmake", "Findbison.cmake"]:
-            if os.path.isfile(f):
-                os.unlink(f)
-        cmake = self._configure_cmake()
-        cmake.build()
-
     def build_requirements(self):
         if tools.os_info.is_windows:
             self.build_requires("winflexbison/2.5.22")
@@ -80,10 +85,14 @@ def build_requirements(self):
             self.build_requires("bison/3.5.3")
 
     def requirements(self):
-        self.requires("boost/1.73.0")
+        self.requires("boost/1.74.0")
+
+        if self.options.with_qt:
+            # FIXME: missing qt recipe
+            raise ConanInvalidConfiguration("qt is not (yet) available on cci")
 
         if self.options.with_openssl:
-            self.requires("openssl/1.1.1g")
+            self.requires("openssl/1.1.1h")
         if self.options.with_zlib:
             self.requires("zlib/1.2.11")
         if self.options.with_libevent:
@@ -101,24 +110,36 @@ def _configure_cmake(self):
         self._cmake.definitions["USE_BOOST_THREAD"] = self.options.with_boostthreads
         self._cmake.definitions["WITH_SHARED_LIB"] = self.options.shared
         self._cmake.definitions["WITH_STATIC_LIB"] = not self.options.shared
-        self._cmake.definitions["BOOST_ROOT"] = self.deps_cpp_info['boost'].rootpath
+        self._cmake.definitions["BOOST_ROOT"] = self.deps_cpp_info["boost"].rootpath
         self._cmake.definitions["BUILD_TESTING"] = False
         self._cmake.definitions["BUILD_COMPILER"] = True
         self._cmake.definitions["BUILD_LIBRARIES"] = True
         self._cmake.definitions["BUILD_EXAMPLES"] = False
         self._cmake.definitions["BUILD_TUTORIALS"] = False
 
+        if self.settings.compiler == "Visual Studio":
+            self._cmake.definitions["WITH_MT"] = "MT" in str(self.settings.compiler.runtime)
+
         # Make optional libs "findable"
         if self.options.with_openssl:
-            self._cmake.definitions["OPENSSL_ROOT_DIR"] = self.deps_cpp_info['openssl'].rootpath
+            self._cmake.definitions["OPENSSL_ROOT_DIR"] = self.deps_cpp_info["openssl"].rootpath
         if self.options.with_zlib:
-            self._cmake.definitions["ZLIB_ROOT"] = self.deps_cpp_info['zlib'].rootpath
+            self._cmake.definitions["ZLIB_ROOT"] = self.deps_cpp_info["zlib"].rootpath
         if self.options.with_libevent:
-            self._cmake.definitions["LIBEVENT_ROOT"] = self.deps_cpp_info['libevent'].rootpath
+            self._cmake.definitions["LIBEVENT_ROOT"] = self.deps_cpp_info["libevent"].rootpath
 
         self._cmake.configure(build_folder=self._build_subfolder)
         return self._cmake
 
+    def build(self):
+        for p in self.conan_data["patches"][self.version]:
+            tools.patch(**p)
+        for f in ["Findflex.cmake", "Findbison.cmake"]:
+            if os.path.isfile(f):
+                os.unlink(f)
+        cmake = self._configure_cmake()
+        cmake.build()
+
     def package(self):
         self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
         cmake = self._configure_cmake()
@@ -130,17 +151,52 @@ def package(self):
         tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
 
     def package_info(self):
-        self.cpp_info.libs = tools.collect_libs(self)
-        # Make sure libs are link in correct order. Important thing is that libthrift/thrift is last
-        # (a little naive to sort, but libthrift/thrift should end up last since rest of the libs extend it with an abbrevation: 'thriftnb', 'thriftz')
-        # The library that needs symbols must be first, then the library that resolves the symbols should come after.
-        self.cpp_info.libs.sort(reverse = True)
-
+        libsuffix = "{}{}".format(
+            str(self.settings.compiler.runtime).lower()[:2] if self.settings.compiler == "Visual Studio" else "",
+            "d" if self.settings.build_type == "Debug" else ""
+        )
+
+        self.cpp_info.filenames["cmake_find_package"] = "Thrift"
+        self.cpp_info.filenames["cmake_find_package_multi"] = "Thrift"
+        self.cpp_info.names["cmake_find_package"] = "thrift"
+        self.cpp_info.names["cmake_find_package_multi"] = "thrift"
+
+        self.cpp_info.components["libthrift"].libs = ["thrift" + libsuffix]
+        self.cpp_info.components["libthrift"].names["cmake_find_package"] = "thrift"
+        self.cpp_info.components["libthrift"].names["cmake_find_package_multi"] = "thrift"
+        self.cpp_info.components["libthrift"].names["pkg_config"] = "thrift"
         if self.settings.os == "Windows":
-            # To avoid error C2589: '(' : illegal token on right side of '::'
-            self.cpp_info.defines.append("NOMINMAX")
+            self.cpp_info.components["libthrift"].defines.append("NOMINMAX")
         elif self.settings.os == "Linux":
-            self.cpp_info.system_libs.extend(["m", "pthread"])
+            self.cpp_info.components["libthrift"].system_libs.extend(["m", "pthread"])
+        self.cpp_info.components["libthrift"].requires.append("boost::boost")
+        if self.options.with_openssl:
+            self.cpp_info.components["libthrift"].requires.append("openssl::openssl")
+        if self.options.with_libevent:
+            self.cpp_info.components["libthrift"].requires.append("libevent::libevent")
+
+        # FIXME: this generates thrift::thriftz, but should be thriftz::thriftz
+        if self.options.with_zlib:
+            self.cpp_info.components["libthrift_z"].libs = ["thriftz" + libsuffix]
+            self.cpp_info.components["libthrift_z"].requires = ["libthrift", "zlib::zlib"]
+            self.cpp_info.components["libthrift_z"].names["cmake_find_package"] = "thriftz"
+            self.cpp_info.components["libthrift_z"].names["cmake_find_package_multi"] = "thriftz"
+            self.cpp_info.components["libthrift_z"].names["pkg_config"] = "thrift-z"
+
+        # FIXME: this generates thrift::thriftnb, but should be thriftnb::thriftnb
+        self.cpp_info.components["libthrift_nb"].libs = ["thriftnb" + libsuffix]
+        self.cpp_info.components["libthrift_nb"].requires = ["libthrift"]
+        self.cpp_info.components["libthrift_nb"].names["cmake_find_package"] = "thriftnb"
+        self.cpp_info.components["libthrift_nb"].names["cmake_find_package_multi"] = "thriftnb"
+        self.cpp_info.components["libthrift_nb"].names["pkg_config"] = "thrift-nb"
+
+        # FIXME: this generates thrift::thriftqt5, but should be thriftqt5::thriftqt5
+        if self.options.with_qt:
+            self.cpp_info.components["libthrift_qt5"].libs = ["thriftqt5" + libsuffix]
+            self.cpp_info.components["libthrift_qt5"].requires = ["libthrift", "qt::core"]
+            self.cpp_info.components["libthrift_qt5"].names["cmake_find_package"] = "thriftqt5"
+            self.cpp_info.components["libthrift_qt5"].names["cmake_find_package_multi"] = "thriftqt5"
+            self.cpp_info.components["libthrift_qt5"].names["pkg_config"] = "thrift-qt5"
 
         bin_path = os.path.join(self.package_folder, "bin")
         self.output.info("Appending PATH env var with : {}".format(bin_path))


Test patch:
diff --git a/recipes/thrift/all/test_package/CMakeLists.txt b/recipes/thrift/all/test_package/CMakeLists.txt
--- a/recipes/thrift/all/test_package/CMakeLists.txt
+++ b/recipes/thrift/all/test_package/CMakeLists.txt
@@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 3.1)
 project(test_package)
 
 include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
-conan_basic_setup()
+conan_basic_setup(TARGETS)
+
+find_package(Thrift CONFIG REQUIRED)
 
 set(HEADER_FILES    calculator_constants.h
                     calculator_types.h
@@ -14,5 +16,5 @@ set(SOURCE_FILES    calculator_constants.cpp
                     test_package.cpp)
 
 add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})
-target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
+target_link_libraries(${PROJECT_NAME} thrift::thriftnb)  # FIXME: shoulbe be thriftnb::thriftnb
 set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11)
diff --git a/recipes/thrift/all/test_package/conanfile.py b/recipes/thrift/all/test_package/conanfile.py
--- a/recipes/thrift/all/test_package/conanfile.py
+++ b/recipes/thrift/all/test_package/conanfile.py
@@ -4,7 +4,7 @@
 
 class TestPackageConan(ConanFile):
     settings = "os", "compiler", "build_type", "arch"
-    generators = "cmake"
+    generators = "cmake", "cmake_find_package_multi"
 
     def build(self):
         cmake = CMake(self)