Skip to content

Commit

Permalink
Merge branch 'commontk:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
txdy077345 authored Nov 15, 2023
2 parents 7cd2533 + f53820a commit 0650865
Show file tree
Hide file tree
Showing 305 changed files with 1,254 additions and 2,350 deletions.
58 changes: 0 additions & 58 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,5 @@
version: 2
jobs:
build-qt4:
working_directory: /usr/src/CTK
docker:
- image: slicer/buildenv-qt4-centos5:latest
steps:
- checkout
- run:
name: Configure and build
command: |
mkdir /usr/src/CTK-build
cd /usr/src/CTK-build
cmake \
-DCTK_QT_VERSION:STRING=4 \
-DCTK_ENABLE_Widgets:BOOL=ON \
../CTK
make -j4
- save_cache:
key: ctk-src-{{ .Revision }}
paths: /usr/src/CTK
- save_cache:
key: ctk-build-qt4-{{ .Revision }}
paths: /usr/src/CTK-build
- save_cache:
key: ctk-qt4-libraries-{{ .Revision }}
paths: /usr/src/qt-install

# test-qt4:
# docker:
# - image: thewtex/opengl:debian
# steps:
# - restore_cache:
# keys:
# - ctk-src-{{ .Revision }}
# - restore_cache:
# keys:
# - ctk-build-qt4-{{ .Revision }}
# - restore_cache:
# keys:
# - ctk-qt4-libraries-{{ .Revision }}
# - run:
# name: Workaround the difference between cmake install path in 'slicer/buildenv-*' and 'thewtex/opengl:debian' images
# command: |
# mkdir -p /usr/src/cmake-3.11.0/bin
# ln -s $(which cmake) /usr/src/cmake-3.11.0/bin/cmake
# ln -s $(which cpack) /usr/src/cmake-3.11.0/bin/cpack
# ln -s $(which ctest) /usr/src/cmake-3.11.0/bin/ctest
# - run:
# command: |
# export APP="sudo chown -R user.user /usr/src/CTK-build && cd /usr/src/CTK-build/CTK-build && ctest -VV"
# /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
# [ "$(cat /tmp/graphical-app.return_code)" = 0 ]
# environment:
# QT_X11_NO_MITSHM: "1"
# XDG_RUNTIME_DIR: "/tmp/runtime-user"

build-qt5:
working_directory: /usr/src/CTK
Expand Down Expand Up @@ -114,10 +60,6 @@ workflows:
version: 2
build-test:
jobs:
- build-qt4
# - test-qt4:
# requires:
# - build-qt4
- build-qt5
# - test-qt5:
# requires:
Expand Down
6 changes: 1 addition & 5 deletions Applications/Testing/Cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ if(CTK_APP_ctkDICOMQuery AND CTK_APP_ctkDICOMRetrieve)
# Add Tests
#
ctk_add_executable_utf8(ctkDICOMApplicationTest1 ctkDICOMApplicationTest1.cpp)
if(CTK_QT_VERSION VERSION_LESS "5")
target_link_libraries(ctkDICOMApplicationTest1 ${QT_LIBRARIES})
else()
target_link_libraries(ctkDICOMApplicationTest1 Qt5::Core)
endif()
target_link_libraries(ctkDICOMApplicationTest1 Qt${CTK_QT_VERSION}::Core)

ADD_TEST( NAME ctkDICOMApplicationTest1
COMMAND
Expand Down
5 changes: 0 additions & 5 deletions Applications/ctkCommandLineModuleExplorer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ set(KIT_resources
resources/ctkCmdLineModuleExplorer.qrc
)

if(CTK_QT_VERSION VERSION_LESS "5")
set(QT_USE_QTUITOOLS 1)
include(${QT_USE_FILE})
endif()

# Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
# The following macro will read the target libraries from the file 'target_libraries.cmake'
ctkFunctionGetTargetLibraries(KIT_target_libraries)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@
#include <ctkSettingsDialog.h>

#include <QtConcurrentMap>
#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
#include <QDesktopServices>
#else
#include <QStandardPaths>
#endif
#include <QMessageBox>
#include <QFutureSynchronizer>
#include <QCloseEvent>
Expand All @@ -61,11 +57,7 @@ ctkCLModuleExplorerMainWindow::ctkCLModuleExplorerMainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::ctkCmdLineModuleExplorerMainWindow),
defaultModuleFrontendFactory(NULL),
#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
moduleManager(ctkCmdLineModuleManager::WEAK_VALIDATION, QDesktopServices::storageLocation(QDesktopServices::CacheLocation)),
#else
moduleManager(ctkCmdLineModuleManager::WEAK_VALIDATION, QStandardPaths::writableLocation(QStandardPaths::CacheLocation)),
#endif
directoryWatcher(&moduleManager),
settingsDialog(NULL)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ int main(int argc, char** argv)
else if (args.contains("string"))
{
QByteArray byteArray;
byteArray.append(args["string"].toString());
byteArray.append(args["string"].toString().toUtf8());
QBuffer buffer(&byteArray);
buffer.open(QIODevice::ReadOnly);

Expand Down
2 changes: 1 addition & 1 deletion Applications/ctkDICOM/Testing/Cpp/ctkDICOMTest1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int ctkDICOMTest1(int argc, char * argv [])
}
QString command = app.arguments().at(1);
QProcess process;
process.start(command);
process.start(command, /* arguments= */ QStringList());
bool res = process.waitForStarted();
if (!res)
{
Expand Down
2 changes: 1 addition & 1 deletion Applications/ctkDICOM2/Testing/Cpp/ctkDICOM2Test1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int ctkDICOM2Test1(int argc, char * argv [])
}
QString command = app.arguments().at(1);
QProcess process;
process.start(command);
process.start(command, /* arguments= */ QStringList());
bool res = process.waitForStarted();
if (!res)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int ctkDICOMHostTest1(int argc, char * argv [])
QCoreApplication app(argc, argv);
QString command = QString("ctkDICOMHost");
QProcess process;
process.start(command);
process.start(command, /* arguments= */ QStringList());
bool res = process.waitForStarted();
if (!res)
{
Expand Down
4 changes: 1 addition & 3 deletions Applications/ctkExampleHost/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ set(KIT_resources
# The following macro will read the target libraries from the file 'target_libraries.cmake'
ctkFunctionGetTargetLibraries(KIT_target_libraries)

if(CTK_QT_VERSION VERSION_GREATER "4")
list(APPEND KIT_target_libraries Qt5::Widgets)
endif()
list(APPEND KIT_target_libraries Qt${CTK_QT_VERSION}::Widgets)

ctkMacroBuildApp(
NAME ${PROJECT_NAME}
Expand Down
4 changes: 1 addition & 3 deletions Applications/ctkPluginBrowser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ set(KIT_resources
# The following macro will read the target libraries from the file 'target_libraries.cmake'
ctkFunctionGetTargetLibraries(KIT_target_libraries)

if(CTK_QT_VERSION VERSION_GREATER "4")
list(APPEND KIT_target_libraries Qt5::Widgets)
endif()
list(APPEND KIT_target_libraries Qt${CTK_QT_VERSION}::Widgets)

ctkMacroBuildApp(
NAME ${PROJECT_NAME}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ QVariant ctkPluginResourcesTreeModel::data(const QModelIndex &index, int role) c
Qt::ItemFlags ctkPluginResourcesTreeModel::flags(const QModelIndex &index) const
{
if (!index.isValid())
return 0;
{
return Qt::ItemFlags();
}

return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}
Expand Down
2 changes: 1 addition & 1 deletion Applications/ctkPluginBrowser/ctkQtResourcesTreeModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ QVariant ctkQtResourcesTreeModel::data(const QModelIndex &index, int role) const
Qt::ItemFlags ctkQtResourcesTreeModel::flags(const QModelIndex &index) const
{
if (!index.isValid())
return 0;
return Qt::ItemFlags();

return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}
Expand Down
110 changes: 0 additions & 110 deletions CMake/CMakeFindDependencyMacro.cmake

This file was deleted.

17 changes: 9 additions & 8 deletions CMake/CTKConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# This file is configured by CTK and used by the UseCTK.cmake module
# to load CTK's settings for an external project.

if(CMAKE_VERSION VERSION_LESS 3.0.0)
message(FATAL_ERROR "CTK requires at least CMake version 3.0.0")
endif()

@PACKAGE_INIT@

Expand Down Expand Up @@ -60,23 +63,21 @@ include("${CTK_CMAKE_DIR}/ctkMacroTargetLibraries.cmake") # Import multiple macr
include("${CTK_CMAKE_DIR}/ctkFunctionExtractOptionNameAndValue.cmake")
include("${CTK_CMAKE_DIR}/ctkMacroValidateBuildOptions.cmake")
include("${CTK_CMAKE_DIR}/ctkFunctionGenerateDGraphInput.cmake")
include("${CTK_CMAKE_DIR}/ctkFunctionGetIncludeDirs.cmake")
include("${CTK_CMAKE_DIR}/ctkFunctionGetLibraryDirs.cmake")
include("${CTK_CMAKE_DIR}/ctkMacroGenerateMocs.cmake")

# PluginFramework
include("${CTK_CMAKE_DIR}/ctkFunctionGeneratePluginManifest.cmake")
include("${CTK_CMAKE_DIR}/ctkFunctionGeneratePluginUseFile.cmake")
include("${CTK_CMAKE_DIR}/ctkMacroGeneratePluginResourceFile.cmake")
include("${CTK_CMAKE_DIR}/ctkFunctionGetIncludeDirs.cmake")
include("${CTK_CMAKE_DIR}/ctkFunctionGetLibraryDirs.cmake")
include("${CTK_CMAKE_DIR}/ctkFunctionExtractPluginTargets.cmake")
include("${CTK_CMAKE_DIR}/ctkFunctionGetAllPluginTargets.cmake")
include("${CTK_CMAKE_DIR}/ctkFunctionGetTargetDependencies.cmake")
include("${CTK_CMAKE_DIR}/ctkFunctionGetPluginDependencies.cmake")
include("${CTK_CMAKE_DIR}/ctkMacroSetupPlugins.cmake")
include("${CTK_CMAKE_DIR}/ctkMacroGenerateMocs.cmake")

if(CMAKE_VERSION VERSION_LESS 3)
include("${CTK_CMAKE_DIR}/CMakeFindDependencyMacro.cmake")
else()
include(CMakeFindDependencyMacro)
endif()
include(CMakeFindDependencyMacro)

# List all libraries
SET(CTK_LIBRARIES @CTK_LIBRARIES@)
Expand Down
Loading

0 comments on commit 0650865

Please sign in to comment.