Coder Social home page Coder Social logo

guesswordx's Introduction

QtCMake

This is an example of running Qt project using CMake file. You can either use IDEs (CLion, Visual Studio 2017) to open this project, or compile directly through command line tool.

CLion

Add the following line

QTDIR:PATH="*YOUR_QT_INSTALL_LOCATION*"

to

"*CLion Build Directory*"/cmake-build-debug/CMakeCache.txt
or
"*CLion Build Directory*"/cmake-build-release/CMakeCache.txt

based on your configuration type. You can add this line at anywhere, CLion will automatically configure it for you.

Visual Studio 2017

Visual Studio 2017 comes with CMake support. You can take advantage of the features of Visual Studio to open and compile CMake projects.

Open the project by File->Open->Folder... or simply Right Click in the folder space. Find menu CMake->Change CMake Settings-> YOUR_CMAKE_FILE in VS2017 to open CMakeSettings.json for editing. Add the following variable

"variables": [ { "name": "QTDIR", "value": "*YOUR_QT_INSTALL_LOCATION*" } ]

to CMakeSettings.json.

An example of CMakeSettings.json will look like this:

{
  "configurations": [ {
      "name": "x64-Release",
      "generator": "Visual Studio 15 2017 Win64",
      "configurationType": "Release",
      "inheritEnvironments": [ "msvc_x64" ],
      "buildRoot": "${workspaceRoot}/${name}",
      "variables": [ {
          "name": "QTDIR",
          "value": "C:/Qt/Qt5.9.0/5.9/msvc2017_64/"
        } ]
    } ]
}

where the Qt location is C:/Qt/Qt5.9.0/5.9/msvc2017_64/.

Command Line

To run CMake directly in command line, add the following CMake option to your command line.

-DQTDIR="*YOUR_QT_INSTALL_LOCATION*"

guesswordx's People

Contributors

heymind avatar shenyaoke avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.