admin管理员组

文章数量:1344328

we have a CMake superbuild project, like this:

cmake_minimum_required(VERSION 3.20)
project(...-solution)

if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0)
    message(FATAL_ERROR "Clang version must be at least 14.0!")
endif()

set(TESSER_CLANG_TIDY "clang-tidy-15")
set(TESSER_CLANG_FORMAT "clang-format-15")

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_FIND_DEBUG_MODE ON)
set(CMAKE_VERBOSE_MAKEFILE ON)

# Handle superbuild first
option (USE_SUPERBUILD "Whether or not a superbuild should be invoked" ON)

if (USE_SUPERBUILD)
    include(thirdparty.cmake)
else()
    include(product.cmake)
endif()

Where the thirdparty.cmake looks like this:

include(ExternalProject)

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
    set(ENABLE_LTO OFF)
    set(BOOST_LTO "")
    set(BOOST_VARIANT debug)
else()
    set(ENABLE_LTO ON)
    set(BOOST_LTO "--lto=on")
    set(BOOST_VARIANT release)
endif()

set(THIRDPARTY_CMAKE_CACHE_ARGS
    -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
    -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
    -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
    -DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD}
    -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=${ENABLE_LTO}
    )

set(THIRDPARTY_INSTALL_DIR ${CMAKE_BINARY_DIR}/../artifacts/thirdparty/${CMAKE_BUILD_TYPE})

ExternalProject_Add(
    mongo_c_driver
    GIT_REPOSITORY .git
    GIT_TAG 1.30.2
    SOURCE_DIR "${CMAKE_BINARY_DIR}/mongo-c-driver"
    BINARY_DIR "${CMAKE_BINARY_DIR}/mongo-c-driver/build"
    BUILD_ALWAYS 1
    UPDATE_COMMAND ""
    CMAKE_CACHE_ARGS
        ${THIRDPARTY_CMAKE_CACHE_ARGS}
        -DENABLE_AUTOMATIC_INIT_AND_CLEANUP:BOOL=OFF
        -DCMAKE_INSTALL_PREFIX:PATH=${THIRDPARTY_INSTALL_DIR}/mongo-c-driver
    )

Now, we are using using cmake 4.0.0.

The problem is if I want to build, it seems, that the install step never finishes. The last log line is:

-- Installing: <...>-Release/../artifacts/thirdparty/mongo-c-driver/share/mongo-c-driver/THIRD_PARTY_NOTICES

I guess, the doc files are installed last.

Can anybody help me?

本文标签: mongodbBuilding mongocdriver via CMake ExternalProjectAdd hangs on installStack Overflow