Open curlybeast opened 1 year ago
You have forgotten CMakeToolchain generator (or to manually set CMAKE_MODULE_PATH or CMAKE_PREFIX_PATH if you know what you are doing), but it's not a bug in xerces-c recipe.
You have forgotten CMakeToolchain generator (or to manually set CMAKE_MODULE_PATH or CMAKE_PREFIX_PATH if you know what you are doing), but it's not a bug in xerces-c recipe.
Hi, thanks for the quick reply.
So I have 2 projects, 1 is the simple example/project I sent here and the other is my comprehensive project with a lot of other Conan packages being imported.
I noticed in my comprehensive project, it works if I use:
find_package(XercesC CONFIG REQUIRED)
The keyword here being CONFIG
. I wondered if it was related to the use of:
self.cpp_info.set_property("cmake_find_mode", "both")
in the original recipe? which seems to be the main difference when I compare it to other recipes.
But you're also right. In my simple project (that I posed here), adding this fixed it:
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
I should file a bug with the https://github.com/conan-io/cmake-conan project, but I'm actually wondering how this fails still because they do add to the CMAKE_PREFIX_PATH
already:
if (CONAN_GENERATORS_FOLDER)
list(PREPEND CMAKE_PREFIX_PATH "${CONAN_GENERATORS_FOLDER}")
endif()
and other packages (e.g. Boost, etc.) are being found before this failure with XercesC?
Also, the generator used is out of my control because this is handled automatically by the cmake-conan
project's .cmake
files for me.
Any ideas?
cmake-conan is not compatible with conan v2 client yet. I know conan team plans to bring this compatibility in the future, but I don't know more.
@uilianries @prince-chrismc I guess this issue should be moved to https://github.com/conan-io/cmake-conan or https://github.com/conan-io/conan?
I moved the issue, since this is using the experimental feature, it might be tied to here
find_package(XercesC)
I know in other issue https://github.com/conan-io/cmake-conan/issues/478#issuecomment-1473647189 how the config files worked changed behavior
Description
I'm tring to use xerces-c with with Conan 2.0 within CMake using conan-io/cmake-conan (https://github.com/conan-io/cmake-conan/tree/develop2).
This is working for a bunch of other libraries, but when I try to use xerces-c, I get:
Looking at the generated CMake files, it looks like there is a mismatch where the
pkg-config-name
is being used instead of thecmake-target-name
for the variables:Package and Environment Details
Conan profile
[settings] arch=x86_64 build_type=Debug compiler=gcc compiler.cppstd=gnu17 compiler.libcxx=libstdc++11 compiler.version=8 os=Linux
Steps to reproduce
This is easily reproducible using the following:
Then create a
CMakeLists.txt
like this:Simply running this command produces the error:
Logs
Click to expand log
I see the following error: ``` -- CMake-conan: find_package(XercesC) found, 'conan install' aready ran -- Failed to find XercesC (missing: XercesC_LIBRARY XercesC_INCLUDE_DIR XercesC_VERSION) ```