Commit b38e75ef authored by pieper's avatar pieper
Browse files

COMP: enable the Tkinter package for python

git-svn-id: http://svn.slicer.org/Slicer4/trunk@14530 3bd1e089-480b-0410-8dfb-8563597acbee
parent c6e132c4
......@@ -188,7 +188,8 @@ endif()
#
#
# Note:
# Tcl, Tk, blt, incrTcl and iwidgets are build only if Slicer3_USE_KWWIDGETS is ON
# Tcl, Tk, and incrTcl are built in all cases
# blt and iwidgets are build only if Slicer3_USE_KWWIDGETS is ON
# Python is build if either Slicer3_USE_PYTHON or Slicer3_USE_PYTHONQT are ON
#
......@@ -357,10 +358,10 @@ set(slicer_DEPENDENCIES VTK Insight BatchMake OpenIGTLink teem cmcurl)
# Conditionnaly include ExternalProject Target
#------------------------------------------------------------------------------
include(External_Tcl)
include(External_Tk)
include(External_incrTcl)
if(Slicer3_USE_KWWIDGETS)
include(External_Tcl)
include(External_Tk)
include(External_incrTcl)
include(External_iwidgets)
include(External_blt)
endif()
......
......@@ -16,17 +16,15 @@ if(WIN32)
# point the tkinter build file to the slicer tcl-build
set(python_PATCH_COMMAND)
if(Slicer3_USE_KWWIDGETS)
set(python_tkinter ${python_base}/pyproject.vsprops)
string(REPLACE "/" "\\" python_tkinter ${python_tkinter})
set(python_tkinter ${python_base}/pyproject.vsprops)
string(REPLACE "/" "\\" python_tkinter ${python_tkinter})
set(script ${CMAKE_CURRENT_SOURCE_DIR}/../CMake/StringFindReplace.cmake)
set(out ${python_tkinter})
set(in ${python_tkinter})
set(script ${CMAKE_CURRENT_SOURCE_DIR}/../CMake/StringFindReplace.cmake)
set(out ${python_tkinter})
set(in ${python_tkinter})
set(python_PATCH_COMMAND
${CMAKE_COMMAND} -Din=${in} -Dout=${out} -Dfind=tcltk\" -Dreplace=tcl-build\" -P ${script})
endif()
set(python_PATCH_COMMAND
${CMAKE_COMMAND} -Din=${in} -Dout=${out} -Dfind=tcltk\" -Dreplace=tcl-build\" -P ${script})
ExternalProject_Add(${proj}
#SVN_REPOSITORY ${python_SVN_REPOSITORY}
......@@ -44,14 +42,12 @@ if(WIN32)
${python_DEPENDENCIES}
)
if(Slicer3_USE_KWWIDGETS)
# this must match the version of tcl we are building for slicer.
ExternalProject_Add_Step(${proj} Patch_tcltk_version
COMMAND ${CMAKE_COMMAND} -Din=${in} -Dout=${out} -Dfind=85 -Dreplace=84 -P ${script}
DEPENDEES configure
DEPENDERS build
)
endif()
# this must match the version of tcl we are building for slicer.
ExternalProject_Add_Step(${proj} Patch_tcltk_version
COMMAND ${CMAKE_COMMAND} -Din=${in} -Dout=${out} -Dfind=85 -Dreplace=84 -P ${script}
DEPENDEES configure
DEPENDERS build
)
# Convenient helper function
function(build_python_target target depend)
......@@ -68,12 +64,8 @@ if(WIN32)
build_python_target(pythoncore Build_w9xpopen)
build_python_target(_socket Build_pythoncore)
if(Slicer3_USE_KWWIDGETS)
build_python_target(_tkinter Build__socket)
build_python_target(_testcapi Build__tkinter)
else()
build_python_target(_testcapi Build_pythoncore)
endif()
build_python_target(_tkinter Build__socket)
build_python_target(_testcapi Build__tkinter)
build_python_target(_msi Build__testcapi)
build_python_target(_elementtree Build__msi)
......
......@@ -3,13 +3,11 @@ if(UNIX)
set(ENV{LD_LIBRARY_PATH} "@CMAKE_CURRENT_BINARY_DIR@/tcl-build/lib:@CMAKE_CURRENT_BINARY_DIR@/python-build/lib")
set(ENV{CXX} "@CMAKE_CXX_COMPILER@")
if(Slicer3_USE_KWWIDGETS)
set(ENV{LDFLAGS} "-L@CMAKE_CURRENT_BINARY_DIR@/tcl-build/lib")
set(ENV{CPPFLAGS} "-I@CMAKE_CURRENT_BINARY_DIR@/tcl-build/include")
endif()
set(ENV{LDFLAGS} "-L@CMAKE_CURRENT_BINARY_DIR@/tcl-build/lib")
set(ENV{CPPFLAGS} "-I@CMAKE_CURRENT_BINARY_DIR@/tcl-build/include")
EXECUTE_PROCESS(
COMMAND sh configure --prefix=@CMAKE_CURRENT_BINARY_DIR@/python-build --enable-shared
COMMAND sh configure --prefix=@CMAKE_CURRENT_BINARY_DIR@/python-build --with-tcl=@CMAKE_CURRENT_BINARY_DIR@/tcl-build --enable-unicode=ucs2 --enable-shared
WORKING_DIRECTORY "@python_base@"
RESULT_VARIABLE rv
)
......
......@@ -4,4 +4,9 @@ if(UNIX)
COMMAND make install
WORKING_DIRECTORY "@python_base@"
)
EXECUTE_PROCESS(
COMMAND @CMAKE_CURRENT_BINARY_DIR@/python-build/bin/python setup.py install
WORKING_DIRECTORY "@python_base@"
RESULT_VARIABLE rv
)
endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment