Skip to content

Commit a98459d

Browse files
committed
ENH: Addition of ctk_cli
ctk_cli [1] is a command line parsing python package that parses arguments the same way SlicerExecutionModel does. Using ctk_cli allows in Python scripts allows to have the same user interface in Python or in C++. [1] https://github.com/commontk/ctk-cli
1 parent ac5c629 commit a98459d

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

SuperBuild.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ if(Slicer_USE_SimpleITK)
100100
endif()
101101

102102
if(Slicer_BUILD_CLI_SUPPORT)
103-
list(APPEND Slicer_DEPENDENCIES SlicerExecutionModel)
103+
list(APPEND Slicer_DEPENDENCIES SlicerExecutionModel python-ctk_cli)
104104
endif()
105105

106106
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
set(proj python-ctk_cli)
2+
3+
# Set dependency list
4+
set(${proj}_DEPENDENCIES python python-setuptools)
5+
6+
# Include dependent projects if any
7+
ExternalProject_Include_Dependencies(${proj} PROJECT_VAR proj DEPENDS_VAR ${proj}_DEPENDENCIES)
8+
9+
if(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
10+
# XXX - Add a test checking if <proj> is available
11+
endif()
12+
13+
if(NOT DEFINED ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
14+
set(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj} ${${CMAKE_PROJECT_NAME}_USE_SYSTEM_python})
15+
endif()
16+
17+
set(ctk_cli_REPOSITORY ${git_protocol}://github.com/commontk/ctk-cli.git)
18+
set(ctk_cli_GIT_TAG 4346a22618b299c8eff84c6a179067ca68db43b9)
19+
20+
if(NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
21+
22+
ExternalProject_Add(${proj}
23+
${${proj}_EP_ARGS}
24+
GIT_REPOSITORY ${ctk_cli_REPOSITORY}
25+
GIT_TAG ${ctk_cli_GIT_TAG}
26+
SOURCE_DIR ${proj}
27+
BUILD_IN_SOURCE 1
28+
CONFIGURE_COMMAND ""
29+
BUILD_COMMAND ""
30+
INSTALL_COMMAND ${PYTHON_EXECUTABLE} setup.py install
31+
DEPENDS
32+
${${proj}_DEPENDENCIES}
33+
)
34+
else()
35+
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
36+
endif()

0 commit comments

Comments
 (0)