Computer Assisted Medical Intervention Tool Kit  version 6.0
Loading...
Searching...
No Matches
CMakeProjectManager.h
Go to the documentation of this file.
1/*****************************************************************************
2 * $CAMITK_LICENCE_BEGIN$
3 *
4 * CamiTK - Computer Assisted Medical Intervention ToolKit
5 * (c) 2001-2025 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, TIMC, 38000 Grenoble, France
6 *
7 * Visit http://camitk.imag.fr for more information
8 *
9 * This file is part of CamiTK.
10 *
11 * CamiTK is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * CamiTK is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22 *
23 * $CAMITK_LICENCE_END$
24 ****************************************************************************/
25
26#ifndef __CMAKE_PROJECT_MANAGER__
27#define __CMAKE_PROJECT_MANAGER__
28
29#include <QObject>
30#include <QProcess>
31#include <QDir>
32
34
79
80 Q_OBJECT
81
82public:
93 Q_ENUM(CMakeProjectManagerStage) // This macro makes the enum available to the meta-object system
94
95
98 CMakeProjectManager(const QString& camitkFilePath, QObject* parent = nullptr);
100
103 void setStages(QList<CMakeProjectManagerStage> stagesToPerform);
104
106 void start();
107
109 bool success() const;
110
112 QString getCurrentStage() const;
113
115 QStringList getStages() const;
116
118 QString getStageName(CMakeProjectManagerStage value) const;
119
120signals:
122 void stageStarted(const QString& stage);
123
128 void stageFinished(const QString& stage, bool success, const QString& output);
129
131 void allStagesFinished(bool status);
132
133private slots:
135 void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
136
137private:
139 QString camitkFilePath;
140
142 QProcess* currentProcess;
143
145 bool status;
146
148 QDir sourceDir;
149
151 QDir buildDir;
152
154 QDir camitkBinDir;
155
157 bool isDebug;
158
161
163 int currentStageIndex;
164
166 void executeNextStage();
167
170 void checkSystem();
171 void generateSourceFiles();
172 void configureCMake();
173 void buildProject();
174 void runCamiTKConfig();
175 void checkIntegration();
176 void cleanup();
178
179
180};
181
182#endif // __CMAKE_PROJECT_MANAGER__
#define CAMITKEXTENSIONGENERATOR_EXPORT
Definition CamiTKExtensionGeneratorAPI.h:33
Definition CMakeProjectManager.h:78
CMakeProjectManagerStage
Known stages that can be set in the stage configuration.
Definition CMakeProjectManager.h:84
@ Configure_CMake
cmake configure
Definition CMakeProjectManager.h:87
@ Generate_Source_Files
calls camitk-extensiongenerator (fist phase with destination dir equals to the CamiTK file path)
Definition CMakeProjectManager.h:86
@ Run_CamiTK_Config
check camitk-config –config (output can be check for new Standard extension)
Definition CMakeProjectManager.h:89
@ Build_Project
cmake build
Definition CMakeProjectManager.h:88
@ Check_Integration
(for Standard extension) check what is build action extensions defined in the CamiTK file were build ...
Definition CMakeProjectManager.h:90
@ Cleanup
remove temporary directory used during the previous stages
Definition CMakeProjectManager.h:91
@ Check_System
check that cmake, camitk-extensiongenerator and camitk-config are found and usable
Definition CMakeProjectManager.h:85
CMakeProjectManager(const QString &camitkFilePath, QObject *parent=nullptr)
constructor
Definition CMakeProjectManager.cpp:38
bool success() const
current value of the process
Definition CMakeProjectManager.cpp:93
void allStagesFinished(bool status)
sent when all the stage are finished (with the given overall status)
void stageStarted(const QString &stage)
sent when the given stage is starting
void stageFinished(const QString &stage, bool success, const QString &output)
sent when the given stage is finished (with the given status and output)
Definition PersistenceManager.h:30