Partage
  • Partager sur Facebook
  • Partager sur Twitter

CMake: CMake Error at CMakeLists.txt:3 (project):

    14 juin 2023 à 22:30:44

    Bonjour,

    je suis sur Linux et j'essaye de build un programme simple en C++ utilisant Qt avec CMake mais j'ai l'erreur suivante:

    CMake Error: Could not find cmake module file: CMakeDetermine1.0.0Compiler.cmake
    CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
    Missing variable is:
    CMAKE_1.0.0_COMPILER_ENV_VAR
    CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
    Missing variable is:
    CMAKE_1.0.0_COMPILER
    CMake Error: Could not find cmake module file: /home/nomdutilisateur/Documents/monprojet/build/CMakeFiles/3.26.4/CMake1.0.0Compiler.cmake
    -- The CXX compiler identification is GNU 13.1.1
    CMake Error at CMakeLists.txt:3 (project):
      No CMAKE_1.0.0_COMPILER could be found.
    
      Tell CMake where to find the compiler by setting the CMake cache entry
      CMAKE_1.0.0_COMPILER to the full path to the compiler, or to the compiler
      name if it is in the PATH.
    
    
    CMake Error: Could not find cmake module file: CMake1.0.0Information.cmake
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/c++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    CMake Error: CMAKE_1.0.0_COMPILER not set, after EnableLanguage
    -- Configuring incomplete, errors occurred!
    

    Pourtant, mon compilateur (gcc) est bel et bien installé.

    Voilà le contenu du fichier CMakeLists.txt au cas où:

    cmake_minimum_required(VERSION 3.1.0)
    
    project(helloworld 1.0.0 LANGUAGES CXX)
    
    set(CMAKE_CXX_STANDARD 11)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTORCC ON)
    set(CMAKE_AUTOUIC ON)
    
    if(CMAKE_VERSION VERSION_LESS "3.7.0")
        set(CMAKE_INCLUDE_CURRENT_DIR ON)
    endif()
    
    find_package(Qt5 COMPONENTS Widgets REQUIRED)
    
    if(Qt5Widgets_FOUND)
        message("Qt5 not found")
    endif()
    
    add_executable(helloworld
        ui/mainwindow.ui
        src/mainwindow.cpp
        main.cpp
    )
    
    target_link_libraries(helloworld Qt5::Widgets)
    

    Merci d'avance pour votre réponse.


    • Partager sur Facebook
    • Partager sur Twitter

    CMake: CMake Error at CMakeLists.txt:3 (project):

    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
    • Editeur
    • Markdown