I recently stated observing extremely annoying thing when I use QtCreator with projects that also happen to use vcpkg as my package manager. Namely, after initial, successful CMake configuration, any call to CMake configure causes infinite 'configuration loop'. This happens when QtCreator detects new changes in CMakeLists.txt or even if I just call it manually.

This looks like this:

** logs -> **

Running /usr/bin/cmake -S /home/izowiuz/Git/concordia -B /home/izowiuz/Git/concordia/build in /home/izowiuz/Git/concordia/build.
-- Running vcpkg install
Detecting compiler hash for triplet x64-linux...
All requested packages are currently installed.

Total elapsed time: 2.04 us

The package openssl is compatible with built-in CMake targets:

    find_package(OpenSSL REQUIRED)
    target_link_libraries(main PRIVATE OpenSSL::SSL OpenSSL::Crypto)

The package libpq provides CMake integration:

    find_package(PostgreSQL REQUIRED)
    target_link_libraries(main PRIVATE PostgreSQL::PostgreSQL)

The package libpqxx:x64-linux provides CMake targets:

    find_package(libpqxx CONFIG REQUIRED)
    target_link_libraries(main PRIVATE libpqxx::pqxx)

The package nlohmann-json:x64-linux provides CMake targets:

    find_package(nlohmann_json CONFIG REQUIRED)
    target_link_libraries(main PRIVATE nlohmann_json 
nlohmann_json::nlohmann_json)

The package spdlog:x64-linux provides CMake targets:

    find_package(spdlog CONFIG REQUIRED)
    target_link_libraries(main PRIVATE spdlog::spdlog 
spdlog::spdlog_header_only)

-- Running vcpkg install - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/izowiuz/Git/concordia/build
Elapsed time: 00:02.

Running /usr/bin/cmake -S /home/izowiuz/Git/concordia -B /home/izowiuz/Git/concordia/build in /home/izowiuz/Git/concordia/build.
-- Running vcpkg install
Detecting compiler hash for triplet x64-linux...
All requested packages are currently installed.

Total elapsed time: 1.68 us ...

[ ... gazilion more configuration steps skipped ... ]

** logs <- **

I somewhat suspecting this being a fault of a vcpkg because I believe QtC 4.15.2 worked fine earlier in that configuration. This is with pretty mundane CMakeLists.txt without any esoteric stuff done in it. I'm attaching a complete CMakeLists.txt where I see this at the end of my message.

I see this with QtCreator 4.15.2, 5.0 RC / Beta and 5.0 release.
I'm using Kubuntu 21.04 x86_64 and vcpkg on version 2021-08-12-unknownhash

Any help here would be greatly appreciated. I much prefer QtC to the vscode on 
Linux :]

** CMakeLists.txt -> **

# minimum required CMake version
cmake_minimum_required(VERSION 3.15)

# force verbose makefiles
set(CMAKE_VERBOSE_MAKEFILE ON)

# vcpkg's toolchain_file
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
    set(VCPKG_ROOT $ENV{VCPKG_ROOT})
set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
endif()

set(VCPKG_FEATURE_FLAGS ${VCPKG_FEATURE_FLAGS} "registries" CACHE STRING "")

project("concordia")

find_package(OpenSSL REQUIRED)
find_package(spdlog CONFIG REQUIRED)
find_package(PostgreSQL REQUIRED)
find_package(libpqxx CONFIG REQUIRED)
find_package(nlohmann_json CONFIG REQUIRED)

set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED)

add_executable(
    concordia
    ""
)

target_compile_features(
    concordia
PRIVATE
    cxx_std_17
)

target_sources(
    concordia
PRIVATE
    "src/Concordia.cpp"
    "src/Listener.cpp"
    "src/Listener.h"
    "src/Service.cpp"
    "src/Service.h"
    "src/Connection.cpp"
    "src/Connection.h"
    "src/DatabaseConnection.cpp"
    "src/DatabaseConnection.h"
    "src/RequestProcessor.cpp"
    "src/RequestProcessor.h"
    "src/Endpoint.cpp"
    "src/Endpoint.h"
)

target_include_directories(
    concordia
PRIVATE
    ${Boost_INCLUDE_DIR}
)

target_link_libraries(
    concordia
PRIVATE
    libpqxx::pqxx
    PostgreSQL::PostgreSQL
    OpenSSL::SSL
    OpenSSL::Crypto
    spdlog::spdlog
    nlohmann_json::nlohmann_json
)


** CMakeLists.txt <- **

--
Best regards / Pozdrawiam serdecznie
Narolewski Jakub
Software Developer
_______________________________________________
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator

Reply via email to