Commit cac6610d authored by David Gobbi's avatar David Gobbi

ENH: Move wrapper tools into Wrapper/Tools subdirectory.

This is the first commit in a two-stage process of creating a new
module for the wrapping tools. This commit moves the files into
Wrapper/Tools and renames the library to libvtkWrappingTools.
The next commit will make WrappingTools into a VTK module.

Change-Id: Ifeecdf51538718718750c028968a142ac52e0855
parent 53ad1435
......@@ -16,8 +16,8 @@ function(vtk_add_tcl_wrapping module_name module_srcs module_hdrs)
endif()
# Need to add the Wrapping directory to the include directory
set(_tcl_include_dirs
${VTK_SOURCE_DIR}/Wrapping
${VTK_BINARY_DIR}/Wrapping
${VTK_SOURCE_DIR}/Wrapping/Tcl
${VTK_BINARY_DIR}/Wrapping/Tcl
${TCL_INCLUDE_PATH})
if(NOT CMAKE_HAS_TARGET_INCLUDES)
......@@ -34,7 +34,7 @@ function(vtk_add_tcl_wrapping module_name module_srcs module_hdrs)
# FIXME: Terrible temporary hack - add in the extra source file for CommonCore
if(${module_name} STREQUAL "vtkCommonCore")
set(extra_srcs ${VTK_SOURCE_DIR}/Wrapping/vtkTclUtil.cxx)
set(extra_srcs ${VTK_SOURCE_DIR}/Wrapping/Tcl/vtkTclUtil.cxx)
set(extra_links vtksys)
else()
unset(extra_srcs)
......
......@@ -271,7 +271,14 @@ option(VTK_WRAP_JAVA "Should VTK Java wrapping be built?" OFF)
# FIXME: This variable should not be necessary once we are done
set(VTK_IGNORE_BTX ON CACHE INTERNAL "VTK modular always ignores BTX")
find_file(VTK_WRAP_HINTS hints ${VTK_SOURCE_DIR}/Wrapping
# Force reset of hints file location in cache if it was moved
if(VTK_WRAP_HINTS)
if(NOT EXISTS ${VTK_WRAP_HINTS})
set(VTK_WRAP_HINTS "VTK_WRAP_HINTS-NOTFOUND")
endif()
endif()
find_file(VTK_WRAP_HINTS hints ${VTK_SOURCE_DIR}/Wrapping/Tools
NO_CMAKE_FIND_ROOT_PATH)
mark_as_advanced(VTK_WRAP_HINTS)
......@@ -335,7 +342,12 @@ include(vtkModuleTop)
# The wrapping must come after all other modules are processed.
if(VTK_WRAP_PYTHON OR VTK_WRAP_TCL OR VTK_WRAP_JAVA OR VTK_GENERATE_WRAPTOOLS)
add_subdirectory(Wrapping)
add_subdirectory(Wrapping/Tools)
endif()
# Wrapping/Tcl is not a module yet
if(VTK_WRAP_TCL)
add_subdirectory(Wrapping/Tcl)
endif()
if(BUILD_TESTING)
......
# this file is used directly from VTK/CMakeLists.txt, not from VTK/Wrapping/CMakeLists.txt
# this file is used directly from VTK/CMakeLists.txt
# Defined local options to add to VTK Tcl interpreter
#
......@@ -90,6 +90,10 @@ find_package(TCL)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${VTK_BINARY_DIR}/Common/Core
${VTK_SOURCE_DIR}/Common/Core
${VTK_BINARY_DIR}/Utilities/KWSys
${TCL_INCLUDE_PATH}
)
......
......@@ -116,4 +116,3 @@ void vtkTclApplicationInitTclTk(Tcl_Interp* interp,
const char* const relative_dirs[]);
#endif
......@@ -3,11 +3,11 @@
include(${VTK_SOURCE_DIR}/Wrapping/LocalUserOptions.cmake OPTIONAL)
# vtkParse.tab.c has #line markers that break #include with double quotes.
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/Python
${VTK_SOURCE_DIR}/Common/Core
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${VTK_BINARY_DIR}/Common/Core
${VTK_BINARY_DIR}/Wrapping
${VTK_SOURCE_DIR}/Common/Core
${VTK_BINARY_DIR}/Utilities/KWSys)
set(VTK_PARSE_SOURCES
......@@ -32,7 +32,7 @@ set_source_files_properties(
)
# Wrapper tools must be statically linked
vtk_add_library(vtkWrappingCore STATIC ${VTK_PARSE_SOURCES})
vtk_add_library(vtkWrappingTools STATIC ${VTK_PARSE_SOURCES})
# Get our lists of modules to be wrapped, create a list of uniques that need to
# have wrap hierarchy run on them too.
......@@ -45,27 +45,21 @@ set_property(SOURCE vtkParseMain.c PROPERTY COMPILE_DEFINITIONS
if(NOT CMAKE_CROSSCOMPILING)
if(VTK_WRAP_TCL OR VTK_WRAP_PYTHON OR VTK_WRAP_JAVA OR VTK_GENERATE_WRAPTOOLS)
add_executable(vtkWrapHierarchy vtkWrapHierarchy.c)
target_link_libraries(vtkWrapHierarchy vtkWrappingCore)
target_link_libraries(vtkWrapHierarchy vtkWrappingTools)
vtk_compile_tools_target(vtkWrapHierarchy)
endif()
if(VTK_WRAP_TCL)
add_executable(vtkWrapTcl vtkWrapTcl.c)
target_link_libraries(vtkWrapTcl vtkWrappingCore)
target_link_libraries(vtkWrapTcl vtkWrappingTools)
add_executable(vtkWrapTclInit vtkWrapTclInit.c)
vtk_compile_tools_target(vtkWrapTcl)
vtk_compile_tools_target(vtkWrapTclInit)
endif()
if(VTK_WRAP_PYTHON)
set(VTK_WRAP_PYTHON_FIND_LIBS ON)
include(vtkWrapPython)
include_directories("${PYTHON_INCLUDE_PATH}"
"${CMAKE_CURRENT_SOURCE_DIR}/Python"
"${CMAKE_CURRENT_BINARY_DIR}/Python")
add_executable(vtkWrapPython vtkWrapPython.c)
target_link_libraries(vtkWrapPython vtkWrappingCore)
target_link_libraries(vtkWrapPython vtkWrappingTools)
add_executable(vtkWrapPythonInit vtkWrapPythonInit.c)
vtk_compile_tools_target(vtkWrapPython)
vtk_compile_tools_target(vtkWrapPythonInit)
......@@ -73,15 +67,11 @@ if(NOT CMAKE_CROSSCOMPILING)
if(VTK_WRAP_JAVA)
add_executable(vtkParseJava vtkParseJava.c)
target_link_libraries(vtkParseJava vtkWrappingCore)
target_link_libraries(vtkParseJava vtkWrappingTools)
add_executable(vtkWrapJava vtkWrapJava.c)
target_link_libraries(vtkWrapJava vtkWrappingCore)
target_link_libraries(vtkWrapJava vtkWrappingTools)
vtk_compile_tools_target(vtkParseJava)
vtk_compile_tools_target(vtkWrapJava)
endif()
endif()
if(VTK_WRAP_TCL)
add_subdirectory(Tcl)
endif()
......@@ -34,4 +34,3 @@ Important Note on YACC:
platforms. Use a recent byacc instead. Byacc is the Berkeley LALR
parser generator. Red Hat Linux apparently installs byacc by
default.
......@@ -11,7 +11,7 @@ void vtkParseOutput(FILE *fp, FileInfo *data)
fprintf(fp,"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n");
fprintf(fp,"<!-- manual pages generated by vtkHTML -->\n\n");
fprintf(fp,"<HTML><HEADER>\n<TITLE>Documentation for %s</TITLE></HEADER>\n",
data->ClassName);
data->ClassName);
fprintf(fp,"<body bgcolor=\"#FFFFFF\">\n");
......@@ -31,12 +31,12 @@ void vtkParseOutput(FILE *fp, FileInfo *data)
if (data->NumberOfSuperClasses > 0)
{
fprintf(fp,"<p>Super Class: <A HREF=\"%s.html\">%s</a></p>\n",
data->SuperClasses[0], data->SuperClasses[0]);
data->SuperClasses[0], data->SuperClasses[0]);
}
fprintf(fp,"<p>Description:</p>\n\n<blockquote>\n");
fprintf(fp," <p>%s</p>\n</blockquote>\n\n",
data->Description ? data->Description : "None provided.");
data->Description ? data->Description : "None provided.");
if (data->Caveats)
{
......@@ -82,8 +82,8 @@ void vtkParseOutput(FILE *fp, FileInfo *data)
if (data->Functions[i].Comment)
{
fprintf(fp," <li><a href=\"#method%i\">%s</a></li>", i,
data->Functions[i].Signature);
}
data->Functions[i].Signature);
}
else
{
fprintf(fp," <li>%s</li>", data->Functions[i].Signature);
......@@ -107,8 +107,8 @@ void vtkParseOutput(FILE *fp, FileInfo *data)
if (data->Functions[i].Comment)
{
fprintf(fp," <li><a href=\"#method%i\">%s</a></li>", i,
data->Functions[i].Signature);
}
data->Functions[i].Signature);
}
else
{
fprintf(fp," <li>%s</li>", data->Functions[i].Signature);
......@@ -127,14 +127,14 @@ void vtkParseOutput(FILE *fp, FileInfo *data)
for (i = 0; i < data->NumberOfFunctions; i++)
{
if (data->Functions[i].Name && !(data->Functions[i].IsProtected ||
data->Functions[i].IsPublic))
data->Functions[i].IsPublic))
{
no_methods = 0;
if (data->Functions[i].Comment)
{
fprintf(fp," <li><a href=\"#method%i\">%s</a></li>", i,
data->Functions[i].Signature);
}
data->Functions[i].Signature);
}
else
{
fprintf(fp," <li>%s</li>", data->Functions[i].Signature);
......@@ -162,32 +162,31 @@ void vtkParseOutput(FILE *fp, FileInfo *data)
closed = 0;
}
fprintf(fp," <li><a name=\"method%i\">%s%s</a></li>\n", i,
data->Functions[i].Signature,
((data->Functions[i].IsPublic) ? "" :
(data->Functions[i].IsProtected) ? " [protected]" :
" [private]"));
data->Functions[i].Signature,
((data->Functions[i].IsPublic) ? "" :
(data->Functions[i].IsProtected) ? " [protected]" :
" [private]"));
/* if we have a comment */
if (data->Functions[i].Comment)
{
/* and this is the last method */
if (i == (data->NumberOfFunctions - 1) ||
/* or it isn't the last */
(i < (data->NumberOfFunctions - 1) &&
/* and the next comment either doesn't exist */
(!data->Functions[i+1].Comment ||
/* or it does exist but is different */
(data->Functions[i+1].Comment &&
strcmp(data->Functions[i].Comment,
data->Functions[i+1].Comment)))))
{
closed = 1;
fprintf(fp,"<blockquote>");
fprintf(fp," <p>%s</p>\n</blockquote></ul><hr>\n\n",
data->Functions[i].Comment);
}
}
{
/* and this is the last method */
if (i == (data->NumberOfFunctions - 1) ||
/* or it isn't the last */
(i < (data->NumberOfFunctions - 1) &&
/* and the next comment either doesn't exist */
(!data->Functions[i+1].Comment ||
/* or it does exist but is different */
(data->Functions[i+1].Comment &&
strcmp(data->Functions[i].Comment,
data->Functions[i+1].Comment)))))
{
closed = 1;
fprintf(fp,"<blockquote>");
fprintf(fp," <p>%s</p>\n</blockquote></ul><hr>\n\n",
data->Functions[i].Comment);
}
}
}
}
fprintf(fp,"<p>&nbsp;</p>\n</body>\n</html>\n");
}
......@@ -954,4 +954,3 @@ int main(int argc, char *argv[])
return 0;
}
......@@ -752,4 +752,3 @@ if (!data->NumberOfSuperClasses)
}
fprintf(fp,"}\n");
}
......@@ -23,30 +23,30 @@ void vtkParseOutput(FILE *fp, FileInfo *data)
for (i = 0; i < data->NumberOfFunctions; i++)
{
fprintf(fp," Function Name: %s\n",data->Functions[i].Name ?
data->Functions[i].Name : "None");
data->Functions[i].Name : "None");
fprintf(fp," Function Signature: %s\n",data->Functions[i].Signature ?
data->Functions[i].Signature : "None");
data->Functions[i].Signature : "None");
fprintf(fp," Number Of Arguments: %i\n",
data->Functions[i].NumberOfArguments);
data->Functions[i].NumberOfArguments);
fprintf(fp," Array Failure: %s\n",
data->Functions[i].ArrayFailure ? "Yes" : "No");
data->Functions[i].ArrayFailure ? "Yes" : "No");
fprintf(fp," Pure Virtual: %s\n",
data->Functions[i].IsPureVirtual ? "Yes" : "No");
data->Functions[i].IsPureVirtual ? "Yes" : "No");
fprintf(fp," Public: %s\n",
data->Functions[i].IsPublic ? "Yes" : "No");
data->Functions[i].IsPublic ? "Yes" : "No");
fprintf(fp," Operator: %s\n",
data->Functions[i].IsOperator ? "Yes" : "No");
data->Functions[i].IsOperator ? "Yes" : "No");
fprintf(fp," Have Hint: %s\n",
data->Functions[i].HaveHint ? "Yes" : "No");
data->Functions[i].HaveHint ? "Yes" : "No");
fprintf(fp," Hint Size: %i\n",
data->Functions[i].HintSize);
data->Functions[i].HintSize);
fprintf(fp," Return Type: %i\n",
data->Functions[i].ReturnType);
data->Functions[i].ReturnType);
fprintf(fp," ReturnClass: %s\n",
data->Functions[i].ReturnClass ?
data->Functions[i].ReturnClass : "None");
data->Functions[i].ReturnClass ?
data->Functions[i].ReturnClass : "None");
fprintf(fp," Comment: %s\n",
data->Functions[i].Comment ?
data->Functions[i].Comment : "None");
data->Functions[i].Comment ?
data->Functions[i].Comment : "None");
}
}
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