Meson not detecting Poco

96 Views Asked by At

I'm attempting to use the Poco library in my C++ project. However, I get the error 'Dependency "Poco" not found, tried cmake' similar to this issue .

Based on the meson documentation for cmake, cmake attempts to find Find<NAME>.cmake files. However I have a PocoConfig.cmake in my /usr/lib/cmake/Poco directory instead. Thus I believe I need to make meson use the cmake find_package command in config mode to solve this issue, but it's not clear how to do this from the documentation.

System Parameters

  • meson --version 0.53.2
  • ninja --version 1.10.0
  • OS is Ubuntu 20.04.6 LTS (Windows subsystem for linux 2)

meson.build file

project('test', 'cpp',
  version : '0.1',
  default_options : ['warning_level=3', 'cpp_std=c++17'])


cmake = import('cmake')
thread_dep = dependency('threads')

poco = dependency(
  'Poco',
  method: 'cmake',
  modules: ['Poco::Foundation',  'Poco::JSON', 'Poco::Net', 'Poco::Util'],
  components: ['Foundation', 'JSON', 'Net', 'Util']
)


subdir('src')

Part of meson-log.txt after running meson build

C++ compiler for the host machine: c++ (gcc 9.4.0 "c++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0")
C++ linker for the host machine: c++ ld.bfd 2.34
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Run-time dependency threads found: YES
meson.build:9: WARNING: Passed invalid keyword argument "components".
WARNING: This will become a hard error in the future.
CMake binary for MachineChoice.HOST is not cached
CMake binary missing from cross or native file, or env var undefined.
Trying a default CMake fallback at cmake
Trying CMake binary cmake for machine MachineChoice.HOST at ['/usr/bin/cmake']
Found CMake: /usr/bin/cmake (3.16.3)
Extracting basic cmake information
Try CMake generator: auto
No CFLAGS in the environment, not changing global flags.
No LDFLAGS in the environment, not changing global flags.
No CPPFLAGS in the environment, not changing global flags.
Failed to find a fortran compiler for CMake. This might cause CMake to fail.
Called `/usr/bin/cmake --trace-expand .` in /home/testUser/Projects/testProject/build/meson-private/cmake_Poco -> 0
  -- Module search paths:    ['/', '/opt', '/usr', '/usr/local']
  -- CMake root:             /usr/share/cmake-3.16
  -- CMake architectures:    ['x86_64-linux-gnu']
  -- CMake lib search paths: ['lib', 'lib32', 'lib64', 'libx32', 'share', 'lib/x86_64-linux-gnu']

Determining dependency 'Poco' with CMake executable '/usr/bin/cmake'
Try CMake generator: auto
No CFLAGS in the environment, not changing global flags.
No LDFLAGS in the environment, not changing global flags.
No CPPFLAGS in the environment, not changing global flags.
Failed to find a fortran compiler for CMake. This might cause CMake to fail.
Called `/usr/bin/cmake --trace-expand -DNAME=Poco -DARCHS=x86_64-linux-gnu .` in /home/testUser/Projects/testProject/build/meson-private/cmake_Poco -> 0
Run-time dependency poco found: NO (tried cmake)

meson.build:9:0: ERROR: Dependency "Poco" not found, tried cmake
0

There are 0 best solutions below