Skip to content

Commit

Permalink
BUG: Fix lookup of DCMTK binaries in ctkDICOMTester for multi-config …
Browse files Browse the repository at this point in the history
…build tree

In commit 2583a4e ("Remove empty build command and set install command
empty.", 2014-11-04), the systematic installation of DCMTK during CTK
superbuild was disabled. To support looking up binaries in the build tree,
commit 0f5da46 ("ENH: Update ctkDICOMTester to lookup DCMTK executables in
build tree", 2024-01-12), the directory for searching DCMTK binaries was
changed from an install tree to a build tree. While this change was effective
for single config builds, it failed in the case of multi-config builds where
the exectuables are generated in sub-directories like "Release", "RelWithDebInfo",
"MinSizeRel", or "Debug".

Following commit c1d55a1 ("ENH: Streamline test execution setting launch
environment (#1168)," 2024-01-13), tests began executing with an updated
PATH environment variable. To address the issue, we now expect DCMTK binaries
to be automatically located in the PATH.
  • Loading branch information
jcfr committed Jan 13, 2024
1 parent c1d55a1 commit 6da0cf5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Libs/DICOM/Core/ctkDICOMTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ QString ctkDICOMTesterPrivate::findFile(const QStringList& nameFilters, const QS
//------------------------------------------------------------------------------
QString ctkDICOMTesterPrivate::findDCMQRSCPExecutable()const
{
return this->findFile(QStringList("dcmqrscp*"), "../DCMTK-build/bin");
QString executable = this->findFile(QStringList("dcmqrscp*"), "../DCMTK-build/bin");
// If not found, assume the executable is in the PATH
return executable.isEmpty() ? "dcmqrscp" : executable;
}

//------------------------------------------------------------------------------
Expand All @@ -146,13 +148,17 @@ QString ctkDICOMTesterPrivate::findDCMQRSCPConfigFile()const
//------------------------------------------------------------------------------
QString ctkDICOMTesterPrivate::findStoreSCUExecutable()const
{
return this->findFile(QStringList("storescu*"), "../DCMTK-build/bin");
QString executable = this->findFile(QStringList("storescu*"), "../DCMTK-build/bin");
// If not found, assume the executable is in the PATH
return executable.isEmpty() ? "storescu" : executable;
}

//------------------------------------------------------------------------------
QString ctkDICOMTesterPrivate::findStoreSCPExecutable()const
{
return this->findFile(QStringList("storescp*"), "../DCMTK-build/bin");
QString executable = this->findFile(QStringList("storescp*"), "../DCMTK-build/bin");
// If not found, assume the executable is in the PATH
return executable.isEmpty() ? "storescp" : executable;
}

//------------------------------------------------------------------------------
Expand Down

0 comments on commit 6da0cf5

Please sign in to comment.