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. How to configure kit (toolchain) for clang with cmake project?
Forum Updated to NodeBB v4.3 + New Features

How to configure kit (toolchain) for clang with cmake project?

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 3 Posters 5.7k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    ahoro
    wrote on last edited by
    #1

    I have recently added clang 3.1 to my Ubuntu installation.
    However I am having trouble with making it compile via kits.
    in Build & Run -> compilers
    both gcc and clang are detected (in both 64 and 32 bit versions)

    However, when I create kit based on clang and I run cmake again
    Projects -> Build Settings -> Reconfigure project: Run cmake

    it fails to switch to clang - e.g. compilation is always done via default gcc

    p.s. when I manually test cmake in fresh build directory, clang works e.g.:
    cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../source

    Does kits / compiler selection work only with qmake?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      Switching kits does indeed not work fully with cmake: There are standard flags that cmake usually uses to set the compiler. A CMakeLists.txt file is free to do something else though. If that happens, then you will need to manually configure that.

      Sorry, cmake is just not made to integrate with an IDE:(

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mpusz
        wrote on last edited by
        #3

        I just checked and it seems that setting kits for cmake is still not supported in qtcreator 2.8. Could you please consider providing those compiler specific settings for cmake? It would make swtiching kits in qtcreator really easy for most cases. If the user will override those variables in his CMakefileList.txt file it is his fault :-P

        1 Reply Last reply
        0

        • Login

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