conan-io / cmake-conan

CMake wrapper for conan C and C++ package manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

find_package(Boost REQUIRED COMPONENTS ..) doesn't work with conan_provider.cmake

temap opened this issue · comments

Add the following changes to the example:

diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
index dd1fedb..5eab55d 100644
--- a/example/CMakeLists.txt
+++ b/example/CMakeLists.txt
@@ -5,6 +5,7 @@ project(FormatOutput LANGUAGES CXX)
 set(CMAKE_CXX_STANDARD 14)
 
 find_package(fmt REQUIRED)
+find_package(Boost REQUIRED COMPONENTS regex)
 
 add_executable(main main.cpp)
-target_link_libraries(main PRIVATE fmt::fmt)                    
\ No newline at end of file
+target_link_libraries(main PRIVATE fmt::fmt)                    
diff --git a/example/conanfile.txt b/example/conanfile.txt
index e83f3c8..f1905c3 100644
--- a/example/conanfile.txt
+++ b/example/conanfile.txt
@@ -1,5 +1,6 @@
 [requires]
+boost/1.82.0
 fmt/9.1.0
 [layout]
-cmake_layout
\ No newline at end of file
+cmake_layout

Output from cmake -S . -B build:

-- The CXX compiler identification is GNU 12.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Boost (missing: Boost_INCLUDE_DIR regex)
Call Stack (most recent call first):
  /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.25/Modules/FindBoost.cmake:2376 (find_package_handle_standard_args)
  CMakeLists.txt:8 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/panfilov/cmake-conan/example/build/CMakeFiles/CMakeOutput.log".

Hi @temap

Thanks very much for your report, and the details to reproduce, it really helped.
We have submitted a fix in #553, it has already been merged, could you please update and try again? Thanks!

Everything working now? Can we close the issue? Please let us know