CMake and QTCreator designer



  • Hey,

    Recently I've started using CMake and I've been configuring it for a while. After I was done I noticed that QTCreator can't see any of the changes I've done to the .UI files and I have to rebuild the project to see ui_HeaderFile.hh. Plus I also can't use the Right click -> Go to slot freely

    I've kept things as simple as possible. Note that I'm still learning the ropes with CMake so I've probably missed plenty of things

    Files here:

    Top level:

    cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
    
    project(Mumbli)
    
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
    set(CMAKE_AUTOMOC ON)
    
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
    
    find_package(Qt5Widgets REQUIRED)
    find_package(QT5Core REQUIRED)
    find_package(QT5Gui REQUIRED)
    add_definitions(${Qt5Widgets_DEFINITIONS})
    
    add_subdirectory(Source)
    

    Within Source folder

    set(mumbli_src 
    	main.cc
    	Gui/mumbli.cc
    )
    
    set(mumbli_headers
    	Gui/mumbli.hh
    )
    
    set(mumbli_uis
    	Gui/mumbli.ui
    )
    
    qt5_wrap_ui(gen_uis ${mumbli_uis})
    
    INCLUDE_DIRECTORIES(
        Gui
    )
    add_executable(mumbli ${mumbli_src} ${mumbli_headers} ${gen_uis} )
    
    target_link_libraries(mumbli Qt5::Widgets)
    

    If this is the intended behavior, please let me know.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.