Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
ExtensionBuilder.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
35
83
84 Q_OBJECT
85
86public:
97 Q_ENUM(ExtensionBuilderStage) // This macro makes the enum available to the meta-object system
98
99
102 ExtensionBuilder(const QString& camitkFilePath, QObject* parent = nullptr);
104
107 void setStages(QList<ExtensionBuilderStage> stagesToPerform);
108
110 void start();
111
113 bool success() const;
114
116 QString getCurrentStage() const;
117
119 QStringList getStages() const;
120
122 QString getStageName(ExtensionBuilderStage value) const;
123
124signals:
126 void stageStarted(const QString& stage);
127
132 void stageFinished(const QString& stage, bool success, const QString& output);
133
135 void allStagesFinished(bool status);
136
137private slots:
139 void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
140
141private:
143 QString camitkFilePath;
144
146 CamiTKExtensionModel camitkExtensionModel;
147
149 QProcess* currentProcess;
150
152 bool status;
153
155 QDir sourceDir;
156
158 QDir buildDir;
159
161 QDir camitkBinDir;
162
164 bool isDebug;
165
168
170 int currentStageIndex;
171
173 void executeNextStage();
174
176 bool isPython();
177
180 void checkSystem();
181 void generateSourceFiles();
182 void configureCMake();
183 void buildProject();
184 void runCamiTKConfig();
185 void checkIntegration();
186 void cleanup();
188
189
190};
191
192#endif // __CMAKE_PROJECT_MANAGER__
#define CAMITKEXTENSIONGENERATOR_EXPORT
Definition CamiTKExtensionGeneratorAPI.h:33
This class manages a CamiTK Extension model (stored as a VariantDataModel).
Definition CamiTKExtensionModel.h:67
Build an extension from the given CamiTK file.
Definition ExtensionBuilder.h:82
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)
void allStagesFinished(bool status)
sent when all the stage are finished (with the given overall status)
ExtensionBuilderStage
Known stages that can be set in the stage configuration.
Definition ExtensionBuilder.h:88
@ Generate_Source_Files
calls camitk-extensiongenerator (fist phase with destination dir equals to the CamiTK file path)
Definition ExtensionBuilder.h:90
@ Build_Project
cmake build (only for C++ extension)
Definition ExtensionBuilder.h:92
@ Configure_CMake
cmake configure (only for C++ extension)
Definition ExtensionBuilder.h:91
@ Check_System
check that camitk-extensiongenerator can be found and usable (for C++/python extensions) and that cma...
Definition ExtensionBuilder.h:89
@ Run_CamiTK_Config
check camitk-config –config (output can be check for new Standard extension) (only for C++ extension)
Definition ExtensionBuilder.h:93
@ Check_Integration
(for C++ Standard extension) check what is build action extensions defined in the CamiTK file were bu...
Definition ExtensionBuilder.h:94
Definition PersistenceManager.h:30