Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

CMake CUDA QTCreator



  • OK so i setup a cmake project in QTCreator and my cuda program compiles correctly.
    But I get a warning: This file is not part of any project. The code model might have issues parsing this file properly.

    also qt creator goes not give any include headers in the auto complete.

    cmake tells me this is enough but i d like to get atlest come kind of code completion. can i fix this in any way?
    link text

    this is the contents of my cmake file

    cmake_minimum_required(VERSION 3.17)
    
    project(cutest LANGUAGES CUDA)
    add_executable(cutest main.cu)
    
    set_target_properties(
        cutest
        PROPERTIES
        CUDA_SEPARABLE_COMPILATION ON)
    
    


  • ok late reply. found an easy fix for this. go to
    Tools -> Options -> Environment -> MIME Types

    type .cu in the Filter tab. (just to search for the right type)
    click on text/vnd.nvidia.cuda.csrc and clear the*.cu in the patterns tab.

    now type c++ in the Filter tab.
    click on text/x-c++src and add*.cu;*.cuh in the patters tab. dont clear whats alredy here.