Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

CMake with different Qt compilations of different configurations: Release, Debug and RelWithDebInfo



  • Hello,

    I'm using conan to deliver Qt. I'm creating a package with different compilation configuration: debug, release and release with pdb (relwithdebinfo).

    At the end conan installs these configuration in different directory and create (with the help of generator) a file:

    conanbuildinfo_multi.cmake which includes:

    • list itemconanbuildinfo_debug.cmake
    • list itemconanbuildinfo_release.cmake
    • list itemconanbuildinfo_relwithdebinfo.cmake

    I get set different variable like for each of this release like: ${CONAN_QT_ROOT_RELEASE} ${CONAN_QT_ROOT_DEBUG}, ...

    Question is: how could I use find package to support in this multi-configuration different QT_ROOT?

    I have an alternative. I compile Qt debug and release (by using the -debug-and-release) which could find correctly the different libraries (find_package over the root). In this vaiant I'm stuck with 2 problems: how to support the release with debug info and (but not part of this forum) how I could create multi configuration conan package which accept in requirement the multi configuration for external libraries like OpenSSl.

    Another alternative I'm using the wrap function with all the parameters and without find_package() but I could not more AUTOMOC?

    I know the situation is a little bit tricky. I know about some communities are using Qt conan package (bincrafters, urcad, osechet) but I don't find any help.

    If someone could give me some way to search I will grandly appreciate :)

    br,
    Alexandre Desboeufs

    Current settings used inside my project is:

    cmake_policy(SET CMP0071 OLD) # not scan the Generated Files

    set_property(GLOBAL PROPERTY AUTOGEN_SOURCE_GROUP "Generated Files")

    set (CMAKE_INCLUDE_CURRENT_DIR ON)

    set (Qt5_NO_LINK_QTMAIN ON)

    if (CONAN_QT_ROOT)
    set (Qt5_DIR ${CONAN_QT_ROOT}/lib/cmake/Qt5) # to work in both multi and single build
    else ()
    set (Qt5_DIR ${CONAN_QT_ROOT_RELEASE}/lib/cmake/Qt5) # to work in both multi and single build
    endif ()

    find_package(Qt5
    COMPONENTS
    Core Gui Widgets Network Xml Test Designer Svg PrintSupport
    AxContainer AxBase OpenGL WinExtras Concurrent REQUIRED)


Log in to reply