poco icon indicating copy to clipboard operation
poco copied to clipboard

CMake error when trying to use Poco::Util from poco-1.12.5

Open nkbolg opened this issue 2 years ago • 4 comments

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.

nkbolg avatar Oct 27 '23 07:10 nkbolg

Same thing. Brew package manager, macOS Sonoma 14.0

Alvov1 avatar Nov 07 '23 20:11 Alvov1

Same issue here when using poco 1.12.5p2 in Yocto/openembedded.

Arctize avatar Dec 05 '23 20:12 Arctize

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?

insi-eb avatar Dec 08 '23 15:12 insi-eb

This is fixed in the current release. Or at least the issue does not arise.

themightyoarfish avatar Sep 05 '24 12:09 themightyoarfish