CMake error when trying to use Poco::Util from poco-1.12.5
Error msg:
CMake Error at /tmp/poco-poco-1.12.5-release/build/poco_install/lib/cmake/Poco/PocoConfig.cmake:29 (find_package):
Found package configuration file:
/tmp/poco-poco-1.12.5-release/build/poco_install/lib/cmake/Poco/PocoUtilConfig.cmake
but it set PocoUtil_FOUND to FALSE so package "PocoUtil" is considered to
be NOT FOUND. Reason given by package:
The following imported targets are referenced, but are missing: Poco::XML
Poco::JSON
Call Stack (most recent call first):
CMakeLists.txt:7 (find_package)
Minimal CMakeLists.txt to reproduce:
cmake_minimum_required(VERSION 3.16)
project(name VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_PREFIX_PATH "../poco_install")
find_package(Poco REQUIRED COMPONENTS Util)
add_executable(main main.cpp)
target_link_libraries(main Poco::Util)
The problem seems to be introduced here: https://github.com/pocoproject/poco/blob/bd06526ee07e5b09165b141fc7ec0b5b705e7cee/Util/cmake/PocoUtilConfig.cmake#L3
When I'm removing these if-statements, it starts to work normally.
Same thing. Brew package manager, macOS Sonoma 14.0
Same issue here when using poco 1.12.5p2 in Yocto/openembedded.
shouldn't the statement in PocoUtilConfig.cmake be if(@ENABLE_XML@) instead of if(ENABLED_XML), as proposed in https://github.com/pocoproject/poco/issues/3815?
This is fixed in the current release. Or at least the issue does not arise.