Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-87718

FTBFS Qt 6

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 6.0.0 Beta1
    • Fix Version/s: None
    • Component/s: Build System: CMake
    • Labels:

      Description

      I am trying to build Qt 6 by using all dependencies coming from conan packages. I manage to have a minimal configuration which (starts to) build successfully, but as soon as I use the conan generated FindZLIB.cmake, I get the following errors:

      Qt is now configured for building. Just run 'cmake --build . --parallel'
      
      Once everything is built, you must run 'cmake --install .'
      Qt will be installed into '/home/eric/.conan/data/qt/6.0.0-beta1/bincrafters/testing/package/7ad18fcf7c5dd7a35dbe53fcb711be159ef55c5d'
      
      To configure and build other Qt modules, you can use the following convenience script:
              /bin/qt-cmake-private
      
      If reconfiguration fails for some reason, try to remove 'CMakeCache.txt' from the build directory
      
      -- Configuring done
      CMake Error at qtbase/cmake/QtPriHelpers.cmake:74 (file):
        Error evaluating generator expression:
      
          $<TARGET_PROPERTY:TYPE>
      
        $<TARGET_PROPERTY:prop> may only be used with binary targets.  It may not
        be used with add_custom_command or add_custom_target.  Specify the target
        to read a property from using the $<TARGET_PROPERTY:tgt,prop> signature
        instead.
      Call Stack (most recent call first):
        qtbase/cmake/QtPriHelpers.cmake:682 (qt_generate_qmake_libraries_pri_content)
        qtbase/cmake/QtBaseGlobalTargets.cmake:106 (qt_generate_global_module_pri_file)
        qtbase/CMakeLists.txt:74 (include)
      
      
      CMake Error at qtbase/cmake/QtPriHelpers.cmake:74 (file):
        Error evaluating generator expression:
      
          $<TARGET_PROPERTY:TYPE>
      
        $<TARGET_PROPERTY:prop> may only be used with binary targets.  It may not
        be used with add_custom_command or add_custom_target.  Specify the target
        to read a property from using the $<TARGET_PROPERTY:tgt,prop> signature
        instead.
      Call Stack (most recent call first):
        qtbase/cmake/QtPriHelpers.cmake:682 (qt_generate_qmake_libraries_pri_content)
        qtbase/cmake/QtBaseGlobalTargets.cmake:106 (qt_generate_global_module_pri_file)
        qtbase/CMakeLists.txt:74 (include)
      
      
      CMake Error at qtbase/cmake/QtPriHelpers.cmake:74 (file):
        Error evaluating generator expression:
      
          $<TARGET_PROPERTY:TYPE>
      
        $<TARGET_PROPERTY:prop> may only be used with binary targets.  It may not
        be used with add_custom_command or add_custom_target.  Specify the target
        to read a property from using the $<TARGET_PROPERTY:tgt,prop> signature
        instead.
      Call Stack (most recent call first):
        qtbase/cmake/QtPriHelpers.cmake:682 (qt_generate_qmake_libraries_pri_content)
        qtbase/cmake/QtBaseGlobalTargets.cmake:106 (qt_generate_global_module_pri_file)
        qtbase/CMakeLists.txt:74 (include)
      
      
      -- Generating done
      CMake Warning:
        Manually-specified variables were not used by the project:
      
          CMAKE_EXPORT_NO_PACKAGE_REGISTRY
          CMAKE_INSTALL_BINDIR
          CMAKE_INSTALL_DATAROOTDIR
          CMAKE_INSTALL_INCLUDEDIR
          CMAKE_INSTALL_LIBDIR
          CMAKE_INSTALL_LIBEXECDIR
          CMAKE_INSTALL_OLDINCLUDEDIR
          CMAKE_INSTALL_SBINDIR
          CONAN_COMPILER
          CONAN_COMPILER_VERSION
          CONAN_CXX_FLAGS
          CONAN_C_FLAGS
          CONAN_EXPORTED
          CONAN_IN_LOCAL_CACHE
          CONAN_LIBCXX
          CONAN_SHARED_LINKER_FLAGS
          FEATURE_libjpeg
          FEATURE_libpng
          FEATURE_sqlite
          FEATURE_system_fontconfig
          FEATURE_system_glib
          FEATURE_system_icu
          FEATURE_system_libjpeg
          FEATURE_system_libpng
      
      
      CMake Generate step failed.  Build files cannot be regenerated correctly.

      The FindZLIB.cmake file which triggers the error is:

      
      function(conan_message MESSAGE_OUTPUT)
          if(NOT CONAN_CMAKE_SILENT_OUTPUT)
              message(${ARGV${0}})
          endif()
      endfunction()
      
      
      macro(conan_find_apple_frameworks FRAMEWORKS_FOUND FRAMEWORKS FRAMEWORKS_DIRS)
          if(APPLE)
              foreach(_FRAMEWORK ${FRAMEWORKS})
                  # https://cmake.org/pipermail/cmake-developers/2017-August/030199.html
                  find_library(CONAN_FRAMEWORK_${_FRAMEWORK}_FOUND NAME ${_FRAMEWORK} PATHS ${FRAMEWORKS_DIRS} CMAKE_FIND_ROOT_PATH_BOTH)
                  if(CONAN_FRAMEWORK_${_FRAMEWORK}_FOUND)
                      list(APPEND ${FRAMEWORKS_FOUND} ${CONAN_FRAMEWORK_${_FRAMEWORK}_FOUND})
                  else()
                      message(FATAL_ERROR "Framework library ${_FRAMEWORK} not found in paths: ${FRAMEWORKS_DIRS}")
                  endif()
              endforeach()
          endif()
      endmacro()
      
      
      function(conan_package_library_targets libraries package_libdir deps out_libraries out_libraries_target build_type package_name)
          unset(_CONAN_ACTUAL_TARGETS CACHE)
          unset(_CONAN_FOUND_SYSTEM_LIBS CACHE)
          foreach(_LIBRARY_NAME ${libraries})
              find_library(CONAN_FOUND_LIBRARY NAME ${_LIBRARY_NAME} PATHS ${package_libdir}
                           NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
              if(CONAN_FOUND_LIBRARY)
                  conan_message(STATUS "Library ${_LIBRARY_NAME} found ${CONAN_FOUND_LIBRARY}")
                  list(APPEND _out_libraries ${CONAN_FOUND_LIBRARY})
                  if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
                      # Create a micro-target for each lib/a found
                      set(_LIB_NAME CONAN_LIB::${package_name}_${_LIBRARY_NAME}${build_type})
                      if(NOT TARGET ${_LIB_NAME})
                          # Create a micro-target for each lib/a found
                          add_library(${_LIB_NAME} UNKNOWN IMPORTED)
                          set_target_properties(${_LIB_NAME} PROPERTIES IMPORTED_LOCATION ${CONAN_FOUND_LIBRARY})
                          set(_CONAN_ACTUAL_TARGETS ${_CONAN_ACTUAL_TARGETS} ${_LIB_NAME})
                      else()
                          conan_message(STATUS "Skipping already existing target: ${_LIB_NAME}")
                      endif()
                      list(APPEND _out_libraries_target ${_LIB_NAME})
                  endif()
                  conan_message(STATUS "Found: ${CONAN_FOUND_LIBRARY}")
              else()
                  conan_message(STATUS "Library ${_LIBRARY_NAME} not found in package, might be system one")
                  list(APPEND _out_libraries_target ${_LIBRARY_NAME})
                  list(APPEND _out_libraries ${_LIBRARY_NAME})
                  set(_CONAN_FOUND_SYSTEM_LIBS "${_CONAN_FOUND_SYSTEM_LIBS};${_LIBRARY_NAME}")
              endif()
              unset(CONAN_FOUND_LIBRARY CACHE)
          endforeach()
      
          if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
              # Add all dependencies to all targets
              string(REPLACE " " ";" deps_list "${deps}")
              foreach(_CONAN_ACTUAL_TARGET ${_CONAN_ACTUAL_TARGETS})
                  set_property(TARGET ${_CONAN_ACTUAL_TARGET} PROPERTY INTERFACE_LINK_LIBRARIES "${_CONAN_FOUND_SYSTEM_LIBS};${deps_list}")
              endforeach()
          endif()
      
          set(${out_libraries} ${_out_libraries} PARENT_SCOPE)
          set(${out_libraries_target} ${_out_libraries_target} PARENT_SCOPE)
      endfunction()
      
      
      include(FindPackageHandleStandardArgs)
      
      conan_message(STATUS "Conan: Using autogenerated FindZLIB.cmake")
      # Global approach
      set(ZLIB_FOUND 1)
      set(ZLIB_VERSION "1.2.11")
      
      find_package_handle_standard_args(ZLIB REQUIRED_VARS
                                        ZLIB_VERSION VERSION_VAR ZLIB_VERSION)
      mark_as_advanced(ZLIB_FOUND ZLIB_VERSION)
      
      
      set(ZLIB_INCLUDE_DIRS "/home/eric/.conan/data/zlib/1.2.11/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/include")
      set(ZLIB_INCLUDE_DIR "/home/eric/.conan/data/zlib/1.2.11/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/include")
      set(ZLIB_INCLUDES "/home/eric/.conan/data/zlib/1.2.11/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/include")
      set(ZLIB_RES_DIRS )
      set(ZLIB_DEFINITIONS )
      set(ZLIB_LINKER_FLAGS_LIST
              "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
              "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
              "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
      )
      set(ZLIB_COMPILE_DEFINITIONS )
      set(ZLIB_COMPILE_OPTIONS_LIST "" "")
      set(ZLIB_COMPILE_OPTIONS_C "")
      set(ZLIB_COMPILE_OPTIONS_CXX "")
      set(ZLIB_LIBRARIES_TARGETS "") # Will be filled later, if CMake 3
      set(ZLIB_LIBRARIES "") # Will be filled later
      set(ZLIB_LIBS "") # Same as ZLIB_LIBRARIES
      set(ZLIB_SYSTEM_LIBS )
      set(ZLIB_FRAMEWORK_DIRS )
      set(ZLIB_FRAMEWORKS )
      set(ZLIB_FRAMEWORKS_FOUND "") # Will be filled later
      set(ZLIB_BUILD_MODULES_PATHS )
      
      conan_find_apple_frameworks(ZLIB_FRAMEWORKS_FOUND "${ZLIB_FRAMEWORKS}" "${ZLIB_FRAMEWORK_DIRS}")
      
      mark_as_advanced(ZLIB_INCLUDE_DIRS
                       ZLIB_INCLUDE_DIR
                       ZLIB_INCLUDES
                       ZLIB_DEFINITIONS
                       ZLIB_LINKER_FLAGS_LIST
                       ZLIB_COMPILE_DEFINITIONS
                       ZLIB_COMPILE_OPTIONS_LIST
                       ZLIB_LIBRARIES
                       ZLIB_LIBS
                       ZLIB_LIBRARIES_TARGETS)
      
      # Find the real .lib/.a and add them to ZLIB_LIBS and ZLIB_LIBRARY_LIST
      set(ZLIB_LIBRARY_LIST z)
      set(ZLIB_LIB_DIRS "/home/eric/.conan/data/zlib/1.2.11/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/lib")
      
      # Gather all the libraries that should be linked to the targets (do not touch existing variables):
      set(_ZLIB_DEPENDENCIES "${ZLIB_FRAMEWORKS_FOUND} ${ZLIB_SYSTEM_LIBS} ")
      
      conan_package_library_targets("${ZLIB_LIBRARY_LIST}"  # libraries
                                    "${ZLIB_LIB_DIRS}"      # package_libdir
                                    "${_ZLIB_DEPENDENCIES}"  # deps
                                    ZLIB_LIBRARIES            # out_libraries
                                    ZLIB_LIBRARIES_TARGETS    # out_libraries_targets
                                    ""                          # build_type
                                    "ZLIB")                                      # package_name
      
      set(ZLIB_LIBS ${ZLIB_LIBRARIES})
      
      foreach(_FRAMEWORK ${ZLIB_FRAMEWORKS_FOUND})
          list(APPEND ZLIB_LIBRARIES_TARGETS ${_FRAMEWORK})
          list(APPEND ZLIB_LIBRARIES ${_FRAMEWORK})
      endforeach()
      
      foreach(_SYSTEM_LIB ${ZLIB_SYSTEM_LIBS})
          list(APPEND ZLIB_LIBRARIES_TARGETS ${_SYSTEM_LIB})
          list(APPEND ZLIB_LIBRARIES ${_SYSTEM_LIB})
      endforeach()
      
      # We need to add our requirements too
      set(ZLIB_LIBRARIES_TARGETS "${ZLIB_LIBRARIES_TARGETS};")
      set(ZLIB_LIBRARIES "${ZLIB_LIBRARIES};")
      
      set(CMAKE_MODULE_PATH "/home/eric/.conan/data/zlib/1.2.11/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/" ${CMAKE_MODULE_PATH})
      set(CMAKE_PREFIX_PATH "/home/eric/.conan/data/zlib/1.2.11/_/_/package/6af9cc7cb931c5ad942174fd7838eb655717c709/" ${CMAKE_PREFIX_PATH})
      
      foreach(_BUILD_MODULE_PATH ${ZLIB_BUILD_MODULES_PATHS})
          include(${_BUILD_MODULE_PATH})
      endforeach()
      
      if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
          # Target approach
          if(NOT TARGET ZLIB::ZLIB)
              add_library(ZLIB::ZLIB INTERFACE IMPORTED)
              if(ZLIB_INCLUDE_DIRS)
                  set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
                                        "${ZLIB_INCLUDE_DIRS}")
              endif()
              set_property(TARGET ZLIB::ZLIB PROPERTY INTERFACE_LINK_LIBRARIES
                           "${ZLIB_LIBRARIES_TARGETS};${ZLIB_LINKER_FLAGS_LIST}")
              set_property(TARGET ZLIB::ZLIB PROPERTY INTERFACE_COMPILE_DEFINITIONS
                           ${ZLIB_COMPILE_DEFINITIONS})
              set_property(TARGET ZLIB::ZLIB PROPERTY INTERFACE_COMPILE_OPTIONS
                           "${ZLIB_COMPILE_OPTIONS_LIST}")
              
          endif()
      endif()
      

      the full log is attached

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-87718
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              qtbuildsystem Qt Build System Team
              Reporter:
              ericlemanissier Eric Lemanissier
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There is 1 open Gerrit change