frankosterfeld / qtkeychain

Platform-independent Qt API for storing passwords securely.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error compiling qtkeychain

Dhouha-ma opened this issue · comments

hi,
i'm trying to compile qtkeychain on ubuntu 14.04 and this is what i got

CMake Error at /lib/cmake/Qt5Core/Qt5CoreConfig.cmake:27 (message):
The imported target "Qt5::Core" references the file

 "//bin/qmake"

but this file does not exist. Possible reasons include:

i need help plz

That looks weird, usually it would be /usr/bin/qmake. Is there any qmake in your PATH? Did you install the Qt development packages?

i now have this :

The imported target "Qt5::Core" references the file

 "//include/QtCore"

but this file does not exist. Possible reasons include:

what's wrong !

Looks like some prefix cannot be detected by CMake. Please make sure you can compile and run a basic Qt application on that system before continuing with qtkeychain.

yes i do, i can compile Qt application

Ok, which exact line did you use when running cmake?

sudo cmake .

Try without sudo (one should never have to build as root anyway) and from a separate build directory, like

mkdir build
cd build
cmake ..

Not sure if that helps though. For more remote debugging I'd probably need cmake logs.

without sudo : CMake Error: : System Error: Permission denied
cmake in "build" gives me the same error

/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:

if (CMAKE_VERSION VERSION_LESS 2.8.3)
message(FATAL_ERROR "Qt 5 requires at least CMake version 2.8.3")
endif()

get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)

Use original install prefix when loaded through a

cross-prefix symbolic link such as /lib -> /usr/lib.

get_filename_component(_realCurr "${_IMPORT_PREFIX}" REALPATH)
get_filename_component(_realOrig "/usr/lib/cmake/Qt5Core" REALPATH)
if(_realCurr STREQUAL _realOrig)
get_filename_component(_qt5Core_install_prefix "/usr/lib/../" ABSOLUTE)
else()
get_filename_component(_qt5Core_install_prefix "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
endif()
unset(_realOrig)
unset(_realCurr)
unset(_IMPORT_PREFIX)

For backwards compatibility only. Use Qt5Core_VERSION instead.

set(Qt5Core_VERSION_STRING 5.4.2)

set(Qt5Core_LIBRARIES Qt5::Core)

macro(_qt5_Core_check_file_exists file)
if(NOT EXISTS "${file}" )
message(FATAL_ERROR "The imported target "Qt5::Core" references the file
"${file}"
but this file does not exist. Possible reasons include:

  • The file was deleted, renamed, or moved to another location.
  • An install or uninstall procedure did not complete successfully.
  • The installation package was faulty and contained
    "${CMAKE_CURRENT_LIST_FILE}"
    but not all the files it references.
    ")
    endif()
    endmacro()

macro(_populate_Core_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION)
set_property(TARGET Qt5::Core APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})

set(imported_location "${_qt5Core_install_prefix}/lib/${LIB_LOCATION}")
_qt5_Core_check_file_exists(${imported_location})
set_target_properties(Qt5::Core PROPERTIES
    "INTERFACE_LINK_LIBRARIES" "${_Qt5Core_LIB_DEPENDENCIES}"
    "IMPORTED_LOCATION_${Configuration}" ${imported_location}
    "IMPORTED_SONAME_${Configuration}" "libQt5Core.so.5"
    # For backward compatibility with CMake < 2.8.12
    "IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}" "${_Qt5Core_LIB_DEPENDENCIES}"
)

endmacro()

if (NOT TARGET Qt5::Core)

set(_Qt5Core_OWN_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/" "${_qt5Core_install_prefix}/include/QtCore")
set(Qt5Core_PRIVATE_INCLUDE_DIRS
    "${_qt5Core_install_prefix}/include/QtCore/5.4.2"
    "${_qt5Core_install_prefix}/include/QtCore/5.4.2/QtCore"
)

foreach(_dir ${_Qt5Core_OWN_INCLUDE_DIRS})
    _qt5_Core_check_file_exists(${_dir})
endforeach()

# Only check existence of private includes if the Private component is
# specified.
list(FIND Qt5Core_FIND_COMPONENTS Private _check_private)
if (NOT _check_private STREQUAL -1)
    foreach(_dir ${Qt5Core_PRIVATE_INCLUDE_DIRS})
        _qt5_Core_check_file_exists(${_dir})
    endforeach()
endif()

set(Qt5Core_INCLUDE_DIRS ${_Qt5Core_OWN_INCLUDE_DIRS})

set(Qt5Core_DEFINITIONS -DQT_CORE_LIB)
set(Qt5Core_COMPILE_DEFINITIONS QT_CORE_LIB)

set(_Qt5Core_MODULE_DEPENDENCIES "")

set(_Qt5Core_FIND_DEPENDENCIES_REQUIRED)
if (Qt5Core_FIND_REQUIRED)
    set(_Qt5Core_FIND_DEPENDENCIES_REQUIRED REQUIRED)
endif()
set(_Qt5Core_FIND_DEPENDENCIES_QUIET)
if (Qt5Core_FIND_QUIETLY)
    set(_Qt5Core_DEPENDENCIES_FIND_QUIET QUIET)
endif()
set(_Qt5Core_FIND_VERSION_EXACT)
if (Qt5Core_FIND_VERSION_EXACT)
    set(_Qt5Core_FIND_VERSION_EXACT EXACT)
endif()

set(Qt5Core_EXECUTABLE_COMPILE_FLAGS "")

foreach(_module_dep ${_Qt5Core_MODULE_DEPENDENCIES})
    if (NOT Qt5${_module_dep}_FOUND)
        find_package(Qt5${_module_dep}
            5.4.2 ${_Qt5Core_FIND_VERSION_EXACT}
            ${_Qt5Core_DEPENDENCIES_FIND_QUIET}
            ${_Qt5Core_FIND_DEPENDENCIES_REQUIRED}
            PATHS "${CMAKE_CURRENT_LIST_DIR}/.." NO_DEFAULT_PATH
        )
    endif()

    if (NOT Qt5${_module_dep}_FOUND)
        set(Qt5Core_FOUND False)
        return()
    endif()

    list(APPEND Qt5Core_INCLUDE_DIRS "${Qt5${_module_dep}_INCLUDE_DIRS}")
    list(APPEND Qt5Core_PRIVATE_INCLUDE_DIRS "${Qt5${_module_dep}_PRIVATE_INCLUDE_DIRS}")
    list(APPEND Qt5Core_DEFINITIONS ${Qt5${_module_dep}_DEFINITIONS})
    list(APPEND Qt5Core_COMPILE_DEFINITIONS ${Qt5${_module_dep}_COMPILE_DEFINITIONS})
    list(APPEND Qt5Core_EXECUTABLE_COMPILE_FLAGS ${Qt5${_module_dep}_EXECUTABLE_COMPILE_FLAGS})
endforeach()
list(REMOVE_DUPLICATES Qt5Core_INCLUDE_DIRS)
list(REMOVE_DUPLICATES Qt5Core_PRIVATE_INCLUDE_DIRS)
list(REMOVE_DUPLICATES Qt5Core_DEFINITIONS)
list(REMOVE_DUPLICATES Qt5Core_COMPILE_DEFINITIONS)
list(REMOVE_DUPLICATES Qt5Core_EXECUTABLE_COMPILE_FLAGS)

set(_Qt5Core_LIB_DEPENDENCIES "")

add_library(Qt5::Core SHARED IMPORTED)

set_property(TARGET Qt5::Core PROPERTY
  INTERFACE_INCLUDE_DIRECTORIES ${_Qt5Core_OWN_INCLUDE_DIRS})
set_property(TARGET Qt5::Core PROPERTY
  INTERFACE_COMPILE_DEFINITIONS QT_CORE_LIB)

_populate_Core_target_properties(RELEASE "libQt5Core.so.5.4.2" "" )




file(GLOB pluginTargets "${CMAKE_CURRENT_LIST_DIR}/Qt5Core_*Plugin.cmake")

macro(_populate_Core_plugin_properties Plugin Configuration PLUGIN_LOCATION)
    set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})

    set(imported_location "${_qt5Core_install_prefix}/lib/Qt/plugins/${PLUGIN_LOCATION}")
    _qt5_Core_check_file_exists(${imported_location})
    set_target_properties(Qt5::${Plugin} PROPERTIES
        "IMPORTED_LOCATION_${Configuration}" ${imported_location}
    )
endmacro()

if (pluginTargets)
    foreach(pluginTarget ${pluginTargets})
        include(${pluginTarget})
    endforeach()
endif()


include("${CMAKE_CURRENT_LIST_DIR}/Qt5CoreConfigExtras.cmake")

include("${CMAKE_CURRENT_LIST_DIR}/Qt5CoreMacros.cmake")

_qt5_Core_check_file_exists("${CMAKE_CURRENT_LIST_DIR}/Qt5CoreConfigVersion.cmake")

endif()

make sure the source directory is owned by your normal user, and not root.

yes it's owned by another user

Do a clone with the same user who is then running cmake afterwards.

@frankosterfeld is it possible to compile qtkeychain on openwrt ?

because i'm trying to compile owncloud client on openwrt and i got this have you any idea plz ?

-- Build of crashreporter disabled.
-- Found Qt5 core, checking for further dependencies...
-- Using Qt 5!
-- GIT_SHA1 80bd86a305f594c3846822c780f28edd3c860ba2
CMake Error at /home/dhouha/openwrt/staging_dir/host/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
Could NOT find Qt5Keychain (missing: QTKEYCHAIN_LIBRARY)
Call Stack (most recent call first):
/home/dhouha/openwrt/staging_dir/host/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
cmake/modules/FindQt5Keychain.cmake:35 (find_package_handle_standard_args)
CMakeLists.txt:151 (find_package)

-- Configuring incomplete, errors occurred!

If Qt builds, qtkeychain should, too (although it won't do much unless you have kwallet or gnome keyring installed as well).. The error is expected if you build owncloud client without having qtkeychain compiled and installed before.

@frankosterfeld how to compile qtkeychain on openwrt?

I don't know, I never compiled for openwrt. I assume it works like any other CMake-based project. Are you cross-compiling or building natively?

i'm cross-compiling, i think i should create a qtkeychain package for openwrt with a Makefile and compile it
thank you for answering me :)

sorry for bothering you @frankosterfeld

can you help me with this ?
/lib/i386-linux-gnu/libQt5DBus.so.5.4.2: could not read symbols: File in wrong format
collect2: ld returned 1 exit status

What's the context? What are you building? Is this actually the right lib (looks like a system path, not a location for cross-compiled code). Did you build Qt for openwrt with dbus support? I can't help you debugging generic cross-compilation issues with openwrt, for that it would probably be better to check for OpenWRT mailing lists or IRC channels.

Closing, please reopen if there's an issue remaining with current qtkeychain