3

New to QT I added PCL using vcpkg (.\vcpkg.exe install pcl), on x86-windows, but PCL cannot find boost, If I do a simple find_package(Boost REQUIRED) boost is found, but if I add the other components system and filesystem as the following with my CMakeList.txt:

...
set(Boost_USE_STATIC_LIBS ON)
set(Boost_DEBUG ON)
set(Boost_NO_WARN_NEW_VERSIONS 1)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets LinguistTools)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets LinguistTools)

set(Boost_INCLUDE_DIR C:/Users/maxim/OneDrive/Bureau/vcpkg-master/installed/x86-windows/include)
find_package(Boost REQUIRED COMPONENTS system filesystem REQUIRED)

find_package(PCL REQUIRED) 
target_link_libraries(main PRIVATE ${PCL_LIBRARIES})
...

My previous error which was:

erreur : common is required but boost was not found C:/Users/maxim/OneDrive/Bureau/vcpkg-master/installed/x86-windows/share/pcl/PCLConfig.cmake:350 (pcl_report_not_found) C:/Users/maxim/OneDrive/Bureau/vcpkg-master/installed/x86-windows/share/pcl/PCLConfig.cmake:517 (find_external_library) CMakeLists.txt:26 (find_package)

On the find package PCL, is now on the find boost : Could NOT find Boost (missing: system filesystem) (found version "1.78.0")

On Qt Creator if I do the same on Projects -> Build -> Re-Configure with Initial Parameters, I have the same error

In my configuration I have added the vcpkg.make:
Build initial configuration qt creator

I have been stuck on it the whole day, I have looked other post without success but I found this post linking to this github Boost_install, from what I understand have a cmake I could use, but I can't find a way to ask my CMakeList to load/use-it? Any help would be great.

-- EDIT : Following comments, my CMake version was maybe not the correct one for my Boost version -> as shared

So, I have to specify that I want to use boost 1.77, I added a vckpg.json at the root of my project for Qt creator to call vcpkg on it. Qt couldn't access vcpkg.exe, so I added the env path to my folder containing my vcpkg.exe But vcpkg need Ninja to use vcpkg.json (you need to add the path to ninja to your environement).

--- EDIT : OK, I didn't clone the vcpkg repo, so it wasn't a .git repo, and for my vcpkg.json to work, you need to specify the git baseline :

{
  "name": "showcase",
  "version": "6.3.0",
  "dependencies": [
    "boost-system",
    {
      "name": "boost",
      "version>=": "1.77.0"
    }
  ],
  "builtin-baseline":"2ac61f87f69f0484b8044f95ab274038fbaf7bdd"
}

(I cloned it, installed pcl, updated my path), and I followed the comments suggestion, now I can just have find_package(PCL REQUIRED)

The new problem is python3 .../python3/x64-mingw-static-rel/... files not found, I followed the link in the error log and as sugested try to define in vcpkg.json python3 version as 3.9.6 without success.

I think the problem come from python trying to be in mingw (I'm on windows 10) because when I do a vcpkg.exe install python3 i have x86-windows instead, and if I do a vcpkg.exe install python3 --triplet=x64-mingw-static I got a :

ninja: error: loading 'build.ninja'

and if I search in the log :

No CMAKE_C_COMPILER could be found

build env variables

-- EDIT 3 : I'm stuck I added path to Msbuil, added path to cmake (and installed it), it's failing during compilation, now Its msbuild who fail with python

\Microsoft.CppBuild.targets(439,5): error MSB8020: Les outils de génération pour external (ensemble d'outils de plateforme = 'external') sont introuvables. Pour générer à l'aide des outils de génération external, installez les outils de génération external. Vous avez également la possibilité de mettre à niveau les outils Visual Studio actuels en sélectionnant le menu Projet ou en cliquant avec le bouton droit sur la solution, puis en sélectionnant "Recibler la solution". [H:\vcpkg\buildtrees\python3\x64-mingw-static-rel\v3.10.2-c601936d22.clean\PCbuild\pythoncore.vcxproj]

I don't find a way to resolve it

Samael
  • 61
  • 1
  • 9
  • 1
    What's your CMake version? Unless it is 3.22.2, your brand new Boost might not be supported, see https://stackoverflow.com/a/42124857/2799037. This is probably not the problem, but just to be sure. – usr1234567 Apr 23 '22 at 18:17
  • On top of my CMakeLists.txt i have `cmake_minimum_required(VERSION 3.5)` an in my logs i found : `Qt/Tools/CMake_64/share/cmake-3.21` i'll check this – Samael Apr 23 '22 at 18:29
  • 1
    `Boost_INCLUDE_DIR ` is an output variable, you should never set it. If you want to give hints to the find module you should set `BOOST_INCLUDEDIR`. Although, I would recommend using the [`CONFIG` version](https://cmake.org/cmake/help/latest/command/find_package.html#search-modes) and set `Boost_DIR` instead. – ixSci Apr 23 '22 at 19:06
  • 1
    Just keep this line `find_package(PCL CONFIG REQUIRED)` and remove everything related to boost from your `CMakeLists.txt` (unless you actually need boost, then keep only`find_package(Boost REQUIRED COMPONENTS system filesystem)`. Delete cmake cache and reconfigure. – Osyotr Apr 24 '22 at 01:28
  • 1
    I have similar problems using Boost 1.77.0, MinGW shipped with Qt6 and CMake 3.23. – jlee7 Jun 08 '22 at 21:07
  • @jlee7 sorry mate, i couldn't find any way to resolve, but i didn't try the open source Qt, maybe it could help, i dont know – Samael Jun 10 '22 at 19:50

0 Answers0