2011-09-27 11:55:44 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
|
** Contact: http://www.qt.io/licensing
|
2011-09-27 11:55:44 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator
|
2011-09-27 11:55:44 +02:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Free Documentation License
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Free
|
|
|
|
|
** Documentation License version 1.3 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file included in the packaging of this
|
|
|
|
|
** file.
|
|
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
// **********************************************************************
|
|
|
|
|
// NOTE: the sections are not ordered by their logical order to avoid
|
|
|
|
|
// reshuffling the file each time the index order changes (i.e., often).
|
|
|
|
|
// Run the fixnavi.pl script to adjust the links to the index order.
|
|
|
|
|
// **********************************************************************
|
|
|
|
|
|
|
|
|
|
/*!
|
2014-03-17 12:18:12 +01:00
|
|
|
\contentspage {Qt Creator Manual}
|
2011-11-29 14:19:28 +01:00
|
|
|
\previouspage creator-projects-autotools.html
|
2011-09-27 11:55:44 +02:00
|
|
|
\page creator-project-generic.html
|
2011-12-13 11:52:47 +01:00
|
|
|
\nextpage creator-cli.html
|
2011-09-27 11:55:44 +02:00
|
|
|
|
|
|
|
|
\title Setting Up a Generic Project
|
|
|
|
|
|
|
|
|
|
Generic project support allows you to use \QC as a code editor. You
|
|
|
|
|
can change the way your project is built by modifying the \c make command
|
2014-12-11 15:43:19 +01:00
|
|
|
in the \uicontrol{Projects} mode under \uicontrol{Build Settings}.
|
2011-09-27 11:55:44 +02:00
|
|
|
|
|
|
|
|
When you import a project, \QC creates the following files that
|
|
|
|
|
allow you to specify which files belong to your project and which include
|
|
|
|
|
directories or defines you want to pass to your compiler:
|
|
|
|
|
\tt{.files}, \tt{.includes}, and \tt{.config}.
|
|
|
|
|
|
|
|
|
|
\section1 Importing a Generic Project
|
|
|
|
|
|
|
|
|
|
To import an existing generic project:
|
|
|
|
|
|
|
|
|
|
\list 1
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li Select \uicontrol File > \uicontrol{New File or Project} > \uicontrol{Import Project}
|
|
|
|
|
> \uicontrol{Import Existing Project}.
|
2011-09-27 11:55:44 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li In \uicontrol{Import Existing Project}, enter the project name
|
2011-09-27 11:55:44 +02:00
|
|
|
and select the location of the project file you want to import.
|
|
|
|
|
|
|
|
|
|
\QC automatically generates the following files in the
|
|
|
|
|
project directory:
|
|
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li \l{Specifying Files}{.files}
|
2011-09-27 11:55:44 +02:00
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li \l{Specifying Include Paths}{.includes}
|
2011-09-27 11:55:44 +02:00
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li \l{Specifying Defines}{.config}
|
2011-09-27 11:55:44 +02:00
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li .creator
|
2011-09-27 11:55:44 +02:00
|
|
|
|
|
|
|
|
\endlist
|
|
|
|
|
|
|
|
|
|
\endlist
|
|
|
|
|
|
|
|
|
|
When the project is successfully imported, \QC creates the project
|
|
|
|
|
tree in the sidebar.
|
|
|
|
|
|
|
|
|
|
After importing a generic project into \QC, open it by selecting the
|
|
|
|
|
\tt{.creator} file.
|
|
|
|
|
|
|
|
|
|
\section1 Working with Generic Project Files
|
|
|
|
|
|
|
|
|
|
For a generic project, you have to manually specify which files belong to
|
|
|
|
|
your project and which include directories or defines you want to pass to
|
|
|
|
|
your compiler.
|
|
|
|
|
|
|
|
|
|
\section1 Specifying Files
|
|
|
|
|
|
|
|
|
|
The list of files for a generic project is specified in the \tt{.files}
|
|
|
|
|
file. When you first create a generic project, \QC adds any files it
|
|
|
|
|
recognizes to your project.
|
|
|
|
|
|
|
|
|
|
To add or remove files, edit the \tt{.files} file in \QC.
|
|
|
|
|
\QC recreates your project tree when you save the \tt{.files} file.
|
|
|
|
|
Alternatively, you can add and remove files using the context menu in the
|
|
|
|
|
project tree.
|
|
|
|
|
|
|
|
|
|
If you frequently need to update the \tt{.files} file, you can do so
|
|
|
|
|
efficiently by using a script that updates the file for you. If the file
|
|
|
|
|
is modified externally, you have to restart \QC for the changes to
|
|
|
|
|
take effect.
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
To update the \tt{.files} on the \uicontrol Git repository use the following
|
2011-09-27 11:55:44 +02:00
|
|
|
script:
|
|
|
|
|
|
|
|
|
|
\code
|
|
|
|
|
git ls-files "*.cpp" "*.h" > MyProject.files
|
|
|
|
|
\endcode
|
|
|
|
|
|
|
|
|
|
\section1 Specifying Include Paths
|
|
|
|
|
|
|
|
|
|
The include paths are specified in the \tt{.includes} file, one include
|
|
|
|
|
path per line. The paths can be either absolute or relative to the
|
|
|
|
|
\tt{.includes} file.
|
|
|
|
|
|
|
|
|
|
\section1 Specifying Defines
|
|
|
|
|
|
|
|
|
|
The defines are specified in the \tt{.config} file. The \tt{.config} file is
|
|
|
|
|
a regular C++ file, prepended to all your source files when they are parsed.
|
|
|
|
|
Only use the \tt{.config} file to add lines as in the example below:
|
|
|
|
|
|
|
|
|
|
\code
|
|
|
|
|
#define NAME value
|
|
|
|
|
\endcode
|
|
|
|
|
|
|
|
|
|
\section1 Creating a Run Configuration
|
|
|
|
|
|
|
|
|
|
\QC cannot automatically determine which executable to run.
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
In the \uicontrol{Projects} mode under \uicontrol{Run Settings}, define the executable
|
2011-09-27 11:55:44 +02:00
|
|
|
file to run:
|
|
|
|
|
|
|
|
|
|
\list 1
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li Click \uicontrol Add and select \uicontrol{Custom Executable}.
|
2011-09-27 11:55:44 +02:00
|
|
|
|
2013-02-06 08:50:23 +01:00
|
|
|
\li Define the configuration name, the location of the executable, any
|
2011-09-27 11:55:44 +02:00
|
|
|
additional arguments and the working directory.
|
|
|
|
|
|
|
|
|
|
\endlist
|
|
|
|
|
|
|
|
|
|
*/
|