Skip to content
Snippets Groups Projects
Commit 5a85d99f authored by Riccardo Maria Bianchi's avatar Riccardo Maria Bianchi :sunny:
Browse files

let users disable HepMC3 support if not needed

parent 88e0ccf0
No related branches found
No related tags found
2 merge requests!170Merging latest CMake fixes from master into the branch to test the new CI single-build jobs,!168Fix FullSimLight and FSL builds for distribution kits, and make HepMC3 dependency optional
.DS_Store
......@@ -33,9 +33,20 @@ else()
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Support for the HepMC3 exchange format
# This is ON by default, but it can be disabled by the user if not used/needed,
# or if HepMC3 is not installed
option(GEOMODEL_USE_HEPMC3 "Enable the build of all GeoModel sub-packages" ON)
if(GEOMODEL_USE_HEPMC3)
find_package(HepMC3 REQUIRED)
endif()
if(HepMC3_FOUND)
target_compile_definitions(fullSimLight PRIVATE USE_HEPMC3)
endif()
# Find the dependencies of the project.
find_package( Qt5 COMPONENTS Core Gui Widgets Sql PrintSupport OpenGL REQUIRED )
......
......
......@@ -191,6 +191,13 @@ FSLMainWindow::FSLMainWindow(QWidget *parent)
connect(&fullSimLight_process,SIGNAL(started()),this,SLOT(fsml_process_started()));
connect(&fullSimLight_process,SIGNAL(finished(int , QProcess::ExitStatus )),this,SLOT(fsml_process_finished()));
// Disable options if the underlying packages/tools are not installed/found
// (e.g., HepMC3, Pythia, ...)
// TODO: add check for Pythia, external plugins, and anything is not embedded in FullSimLight by default
#ifndef USE_HEPMC3
ui->cB_gen_options->setItemData(2, false, Qt::UserRole -1);
ui->groupBox_hepmc3->setEnabled(false);
#endif
}
......@@ -935,10 +942,11 @@ void FSLMainWindow::configure_generator()
ui->sB_NOT->setValue(1);
ui->sB_NOT->setEnabled(false);
#ifdef USE_HEPMC3
ui->pB_hepmc3_browse_files->setEnabled(true);
ui->cB_hepmc3_type_of_eve->setEnabled(true);
ui->lE_HEPMC3->setEnabled(true);
#endif
ui->cB_particle->setEnabled(false);
ui->lE_px->setEnabled(false);
......@@ -1152,6 +1160,7 @@ void FSLMainWindow::run_configuration()
QStringList args; //Contains arguments of the command
//Needs to be fixed. Should not be a hard coded path.
//TODO: add check if exe is found. If not, throw an error message
Command = "fullSimLight";
args<<"-c"<< QString::fromUtf8(tmpConf.c_str());
......@@ -1173,6 +1182,7 @@ void FSLMainWindow::run_gmex()
QStringList args; //Contains arguments of the command
//Needs to be fixed. Should not be a hard coded path.
//TODO: add check if exe is found. If not, throw an error message
Command = "gmex";
args << QString::fromUtf8(geom_file_address.c_str());
......@@ -1194,6 +1204,7 @@ void FSLMainWindow::run_gmclash()
QStringList args; //Contains arguments of the command
//Needs to be fixed. Should not be a hard coded path.
//TODO: add check if exe is found. If not, throw an error message
Command = "gmclash";
args << QString("-g") << QString::fromUtf8(geom_file_address.c_str());
......@@ -1404,18 +1415,18 @@ void FSLMainWindow::load_configuration()
{
ui->sB_NOT->setValue(1);
ui->sB_NOT->setEnabled(false);
#ifdef USE_HEPMC3
ui->cB_gen_options->setCurrentIndex(2);
ui->pB_hepmc3_browse_files->setEnabled(true);
ui->cB_hepmc3_type_of_eve->setEnabled(true);
ui->lE_HEPMC3->setEnabled(true);
hepmc3_type_of_file = j_load["HepMC3 type of file"];
hepmc3_input_file = j_load["HepMC3 file"];
ui->cB_hepmc3_type_of_eve->setCurrentText(QString::fromUtf8(hepmc3_type_of_file.c_str()));
ui->lE_HEPMC3->setText(QString::fromUtf8(hepmc3_input_file.c_str()));
#endif
ui->lE_px->clear();
......@@ -1880,6 +1891,7 @@ void FSLMainWindow::load_configuration_CL(std::string config_file_path)
ui->sB_NOT->setValue(1);
ui->sB_NOT->setEnabled(false);
#ifdef USE_HEPMC3
ui->cB_gen_options->setCurrentIndex(2);
ui->pB_hepmc3_browse_files->setEnabled(true);
ui->cB_hepmc3_type_of_eve->setEnabled(true);
......@@ -1891,7 +1903,7 @@ void FSLMainWindow::load_configuration_CL(std::string config_file_path)
ui->cB_hepmc3_type_of_eve->setCurrentText(QString::fromUtf8(hepmc3_type_of_file.c_str()));
ui->lE_HEPMC3->setText(QString::fromUtf8(hepmc3_input_file.c_str()));
#endif
ui->lE_px->clear();
ui->lE_py->clear();
......
......
......@@ -29,7 +29,7 @@
</font>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="main">
<attribute name="title">
......@@ -595,7 +595,7 @@
</spacer>
</item>
<item row="2" column="4">
<widget class="QGroupBox" name="groupBox_5">
<widget class="QGroupBox" name="groupBox_pythia">
<property name="font">
<font>
<pointsize>15</pointsize>
......@@ -667,7 +667,7 @@
</widget>
</item>
<item row="3" column="4">
<widget class="QGroupBox" name="groupBox_10">
<widget class="QGroupBox" name="groupBox_hepmc3">
<property name="font">
<font>
<pointsize>15</pointsize>
......@@ -742,7 +742,7 @@
</spacer>
</item>
<item row="4" column="4">
<widget class="QGroupBox" name="groupBox_12">
<widget class="QGroupBox" name="groupBox_plugin">
<property name="font">
<font>
<pointsize>15</pointsize>
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment