2024-04-30 06:19 PM - last edited on 2024-09-16 02:51 PM by Doreena Deng
Hello everyone,
I'm reaching out to you because I'm encountering some difficulties in configuring the dependencies of my project using CMake, and I would like to ask for your help in resolving them.
Problem Description: I'm currently working on a project that utilizes several external libraries, including Boost, Catch2, fakeit, gsl-lite, magic_enum, spdlog, archicad_adk, and range-v3. These libraries are necessary for the development of my project, but I'm facing challenges in properly configuring the dependencies using CMake.
I've followed the instructions to correctly import these libraries into my project using find_package; however, during compilation, I'm receiving errors indicating that dependency header files cannot be found.
For example, I'm getting the error "Cannot open include file: 'Archicad/ACAPinc.h': No such file or directory" while compiling my ArchicadApi.cpp file, which depends on the archicad_adk library.
I've checked the presence of header files, and it seems that everything is configured correctly in CMake, but I'm unable to understand why the compilation is failing.
What I've Tried So Far:
It's worth mentioning that the problem likely arises from the interaction between Conan 2.2.2 and CMake. Specifically, the issue seems to be related to the integration of libraries obtained from Conan configuration files into a generic library named Common. Despite the fact that the include directories should theoretically be automatically propagated to Common using the INTERFACE qualifier, it appears that this automatic propagation might not be occurring as expected.
My Approach: In an attempt to address this issue, I've manually tried to force the inclusion of these directories by directly using the targets provided by Conan. Although this workaround involves a more manual process, I hoped it would ensure that the necessary include directories are properly added to the Common library. However, despite these efforts, the problem persists (it can't find the include paths even if they are in the project --- check the first image).
Question: Could you kindly provide me with some suggestions on what I could do to resolve these dependency configuration issues with CMake? I'm open to any advice or guidance that could help me overcome this challenge.
Thank you in advance for your assistance!
The three files involved in the building process have been attached (CMakeLists.txt, cmake/Archicad.cmake and conanfile.py).
Best regards,
Manuel
2024-05-01 05:38 PM
Just a basic question - does CMake have the means for find_package to locate archicad_adk in your dev environment?
2024-05-20 01:29 PM
Yes it does, it has access to the configurations file generated from Conan.