代码之家  ›  专栏  ›  技术社区  ›  X.Strange

在windows上编译qml材料时出错

  •  1
  • X.Strange  · 技术社区  · 9 年前

    如何编译和安装 qml-material 在windows7机器上?

    首先,我克隆并编译额外的cmake模块,如下所示:

    git clone git://anongit.kde.org/extra-cmake-modules
    cd extra-cmake-modules
    mkdir build
    cd build
    cmake -G "MinGW Makefiles" ..
    

    之后,我运行 Make 命令,但没有输出!(无错误,无更改!)

    为了编译 qml材料 我使用以下说明:

    mkdir build
    cd build
    cmake -G "MinGW Makefiles" ..
    

    但我明白 错误 :

     -- The C compiler identification is GNU 4.9.2
     -- The CXX compiler identification is GNU 4.9.2
     -- Check for working C compiler: C:/bin/cxx/Qt/Qt5.5.1/Tools/mingw492_32/bin/gcc.exe
     -- Check for working C compiler: C:/bin/cxx/Qt/Qt5.5.1/Tools/mingw492_32/bin/gcc.exe -- works
     -- Detecting C compiler ABI info
     -- Detecting C compiler ABI info - done
     -- Detecting C compile features
     -- Detecting C compile features - done
     -- Check for working CXX compiler: C:/bin/cxx/Qt/Qt5.5.1/Tools/mingw492_32/bin/g++.exe
     -- Check for working CXX compiler: C:/bin/cxx/Qt/Qt5.5.1/Tools/mingw492_32/bin/g++.exe -- works
     -- Detecting CXX compiler ABI info
     -- Detecting CXX compiler ABI info - done
     -- Detecting CXX compile features
     -- Detecting CXX compile features - done
    CMake Error at C:/Users/me/Documents/Github/ecm/ECMConfig.cmake:35 (include):  
     include could not find load file:
    
        C:/Users/me/share/ECM/modules//ECMUseFindModules.cmake
    Call Stack (most recent call first):
           CMakeLists.txt:13 (find_package)
    
    CMake Error at CMakeLists.txt:16 (include):
     include could not find load file:
    
        KDEInstallDirs
    
    CMake Error at CMakeLists.txt:17 (include):
     include could not find load file:
    
        KDECMakeSettings
    
     CMake Error at CMakeLists.txt:18 (include):
      include could not find load file:
    
        KDECompilerSettings
    
     CMake Error at tests/CMakeLists.txt:1 (include):
      include could not find load file:
    
        ECMMarkAsTest
    
     CMake Error at tests/CMakeLists.txt:13 (ecm_mark_as_test):
      Unknown CMake command "ecm_mark_as_test".
    
    
     -- Configuring incomplete, errors occurred!
    

    我尝试使用QtCreator来编译ECM,之后还编译了qml材料,ECM编译和构建良好,没有任何错误,但qml材料也显示了上述错误!!!

    谢谢

    1 回复  |  直到 9 年前
        1
  •  2
  •   sk2212    9 年前

    我将提供我的评论作为更好的概述的答案:

    要使用 qml-material 实际上没有必要用cmake“构建”项目,因为项目本身只包含纯qml文件。 我不知道为什么这些家伙从qmake系统切换到cmake系统。

    然而,您只需将文件结构复制到本地文件系统:

    • 使用签出项目 git clone https://github.com/papyros/qml-material.git

    • 复制的内容 qml-material/modules/Material Qt5.5.1/5.5/mingw/qml/Material qml-material/modules/QtQuick/Controls/Styles/Material Qt5.5.1/5.5/mingw/qml/QtQuick/Controls/Styles/Material 哪里 mingw 代表您的Qt平台。也可能是 gcc4.9 或者类似的东西。

    仅此而已。