Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator plugin CMakeLists.txt is corrupted upon project creation

Qt Creator plugin CMakeLists.txt is corrupted upon project creation

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
plugincmake
3 Posts 2 Posters 479 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    remisa
    wrote on 23 Aug 2024, 13:15 last edited by
    #1

    I have created a library -> Qt creator plugin. After filling information in wizard my project was ready and this the log I found:

    [cmake] Running /home/me/Qt/Tools/CMake/bin/cmake -S /data/Code/Qt/Notepad--/plugins/CppSyntaxHighlighterPlugin -B /data/Code/Qt/Notepad--/plugins/CppSyntaxHighlighterPlugin/build/Desktop-Debug -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang -DCMAKE_PREFIX_PATH:PATH=/usr -DCMAKE_GENERATOR:STRING=Ninja -DQT_QMAKE_EXECUTABLE:FILEPATH=/usr/bin/qmake6 -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/x86_64-pc-linux-gnu-g++ -DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG -DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=/data/Code/Qt/Notepad--/plugins/CppSyntaxHighlighterPlugin/build/Desktop-Debug/.qtc/package-manager/auto-setup.cmake in /data/Code/Qt/Notepad--/plugins/CppSyntaxHighlighterPlugin/build/Desktop-Debug.
    [cmake] -- The C compiler identification is Clang 18.1.8
    [cmake] -- The CXX compiler identification is GNU 14.2.1
    [cmake] -- Detecting C compiler ABI info
    [cmake] -- Detecting C compiler ABI info - done
    [cmake] -- Check for working C compiler: /usr/bin/clang - skipped
    [cmake] -- Detecting C compile features
    [cmake] -- Detecting C compile features - done
    [cmake] -- Detecting CXX compiler ABI info
    [cmake] -- Detecting CXX compiler ABI info - done
    [cmake] -- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++ - skipped
    [cmake] -- Detecting CXX compile features
    [cmake] -- Detecting CXX compile features - done
    [cmake] CMake Error at CMakeLists.txt:15 (find_package):
    [cmake]   By not providing "FindQtCreator.cmake" in CMAKE_MODULE_PATH this project
    [cmake]   has asked CMake to find a package configuration file provided by
    [cmake]   "QtCreator", but CMake did not find one.
    [cmake] 
    [cmake]   Could not find a package configuration file provided by "QtCreator" with
    [cmake]   any of the following names:
    [cmake] 
    [cmake]     QtCreatorConfig.cmake
    [cmake]     qtcreator-config.cmake
    [cmake] 
    [cmake]   Add the installation prefix of "QtCreator" to CMAKE_PREFIX_PATH or set
    [cmake]   "QtCreator_DIR" to a directory containing one of the above files.  If
    [cmake]   "QtCreator" provides a separate development package or SDK, be sure it has
    [cmake]   been installed.
    [cmake] 
    [cmake] 
    [cmake] -- Configuring incomplete, errors occurred!
    [cmake] 
    [cmake] The command "/home/me/Qt/Tools/CMake/bin/cmake -S /data/Code/Qt/Notepad--/plugins/CppSyntaxHighlighterPlugin -B /data/Code/Qt/Notepad--/plugins/CppSyntaxHighlighterPlugin/build/Desktop-Debug -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang -DCMAKE_PREFIX_PATH:PATH=/usr -DCMAKE_GENERATOR:STRING=Ninja -DQT_QMAKE_EXECUTABLE:FILEPATH=/usr/bin/qmake6 -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/x86_64-pc-linux-gnu-g++ -DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG -DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=/data/Code/Qt/Notepad--/plugins/CppSyntaxHighlighterPlugin/build/Desktop-Debug/.qtc/package-manager/auto-setup.cmake" terminated with exit code 1.
    [cmake] 
    [cmake] Elapsed time: 00:01.
    

    This is CMakeLists.txt:

    cmake_minimum_required(VERSION 3.16)
    
    # Remove when sharing with others.
    list(APPEND CMAKE_PREFIX_PATH "/data/Code/Qt/Notepad--/plugins/build")
    
    project(CppSyntaxHighlighterPlugin)
    
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTORCC ON)
    set(CMAKE_AUTOUIC ON)
    set(CMAKE_CXX_STANDARD 20)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    set(CMAKE_CXX_EXTENSIONS OFF)
    
    find_package(QtCreator REQUIRED COMPONENTS Core)
    find_package(Qt6 COMPONENTS Widgets REQUIRED)
    
    # Add a CMake option that enables building your plugin with tests.
    # You don't want your released plugin binaries to contain tests,
    # so make that default to 'NO'.
    # Enable tests by passing -DWITH_TESTS=ON to CMake.
    option(WITH_TESTS "Builds with tests" NO)
    
    if(WITH_TESTS)
      # Look for QtTest
      find_package(Qt6 REQUIRED COMPONENTS Test)
    
      # Tell CMake functions like add_qtc_plugin about the QtTest component.
      set(IMPLICIT_DEPENDS Qt::Test)
    
      # Enable ctest for auto tests.
      enable_testing()
    endif()
    
    add_qtc_plugin(CppSyntaxHighlighterPlugin
      PLUGIN_DEPENDS
        QtCreator::Core
      DEPENDS
        Qt::Widgets
        QtCreator::ExtensionSystem
        QtCreator::Utils
      SOURCES
        .github/workflows/build_cmake.yml
        .github/workflows/README.md
        README.md
        cppsyntaxhighlighterplugin.cpp
        cppsyntaxhighlighterpluginconstants.h
        cppsyntaxhighlighterplugintr.h
    )
    

    since I have Arch Linux I have installed qtcreator package. Any Idea?

    1 Reply Last reply
    0
    • C Christian Ehrlicher moved this topic from General and Desktop on 23 Aug 2024, 14:12
    • C Offline
      C Offline
      cristian-adam
      wrote on 23 Aug 2024, 14:18 last edited by
      #2

      You need to have the Qt Creator -dev package that has the file QtCreatorConfig.cmake.

      I am unsure if Arch Linux actually packages this.

      If you install Qt Creator from https://download.qt.io/official_releases/qtcreator/ and select the "Development" package, you will be able to create Qt Creator plugins.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cristian-adam
        wrote on 23 Aug 2024, 14:20 last edited by
        #3

        Arch does package qtcreator-devel. See https://archlinux.org/packages/extra/x86_64/qtcreator-devel/

        1 Reply Last reply
        0

        2/3

        23 Aug 2024, 14:18

        • Login

        • Login or register to search.
        2 out of 3
        • First post
          2/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved