Commit e2be0b5d authored by Sebastien Barre's avatar Sebastien Barre
Browse files

ENH: add win32 resource file to vtk.exe, so that we do not use the Tk one...

ENH: add win32 resource file to vtk.exe, so that we do not use the Tk one (wrong copyright and so on). new logo will come later.
parent cc170e7d
......@@ -8,8 +8,30 @@ IF (NOT TCL_LIBRARY)
MESSAGE("VTK_WRAP_TCL is ON, but the Tcl library was not found. Please set TCL_LIBRARY." "Error")
ENDIF (NOT TCL_LIBRARY)
IF (WIN32)
VTK_GET_TCL_TK_VERSION ("TCL_TK_MAJOR_VERSION" "TCL_TK_MINOR_VERSION")
IF (TCL_TK_MAJOR_VERSION AND TCL_TK_MINOR_VERSION)
FIND_FILE(TK_RESOURCE_FILE
tk.rc
"${VTK_SOURCE_DIR}/Utilities/TclTk/resources/tk${TCL_TK_MAJOR_VERSION}.${TCL_TK_MINOR_VERSION}/win/rc"
DOC "The resource file required to add the proper resources to a static Tk build")
MARK_AS_ADVANCED(TK_RESOURCE_FILE)
ENDIF (TCL_TK_MAJOR_VERSION AND TCL_TK_MINOR_VERSION)
IF (TK_RESOURCE_FILE)
GET_FILENAME_COMPONENT(TK_RESOURCE_PATH ${TK_RESOURCE_FILE} PATH)
INCLUDE_DIRECTORIES(${TK_RESOURCE_PATH})
CONFIGURE_FILE(
${VTK_SOURCE_DIR}/Wrapping/Tcl/resources/vtk.rc.in
${VTK_BINARY_DIR}/Wrapping/Tcl/resources/vtk.rc
)
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/resources")
SET(VTK_EXE_RESOURCE_FILES
"${VTK_BINARY_DIR}/Wrapping/Tcl/resources/vtk.rc")
ENDIF (TK_RESOURCE_FILE)
ENDIF (WIN32)
# Create the vtk Tcl wrapper executable.
ADD_EXECUTABLE(vtk vtkTkAppInit.cxx ${TK_RESOURCE_FILE})
ADD_EXECUTABLE(vtk vtkTkAppInit.cxx ${VTK_EXE_RESOURCE_FILES})
TARGET_LINK_LIBRARIES (vtk
vtkCommonTCL
vtkFilteringTCL
......@@ -48,7 +70,7 @@ INSTALL_TARGETS(/bin vtk)
# Create the pvtk Tcl wrapper executable with MPI support.
IF (VTK_USE_PARALLEL)
IF (VTK_USE_MPI)
ADD_EXECUTABLE(pvtk vtkParaTkAppInit.cxx ${TK_RESOURCE_FILE})
ADD_EXECUTABLE(pvtk vtkParaTkAppInit.cxx ${VTK_EXE_RESOURCE_FILES})
IF(VTK_USE_CARBON)
FIND_PROGRAM(VTK_APPLE_RESOURCE Rez /Developer/Tools)
IF(VTK_APPLE_RESOURCE)
......
#include "vtkrc.h"
// The icon whose name or resource ID is lexigraphically first, is used
// as the application's icon.
// Tk was defining app.
//IDI_APPLICATION ICON DISCARDABLE "vtkicon32.ico"
//IDI_VTKICO ICON DISCARDABLE "vtkicon32.ico"
//IDI_VTKICOSMALL ICON DISCARDABLE "vtkicon16.ico"
#include <windows.h>
#include "vtkToolkits.h"
#ifdef VTK_TCL_TK_STATIC
#include "tk_base.rc"
#endif
VS_VERSION_INFO VERSIONINFO
FILEVERSION @VTK_MAJOR_VERSION@,@VTK_MINOR_VERSION@
PRODUCTVERSION @VTK_MAJOR_VERSION@,@VTK_MINOR_VERSION@
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "VTK\0"
VALUE "OriginalFilename", "vtk.exe\0"
VALUE "CompanyName", "Kitware Inc.\0"
VALUE "FileVersion", "@VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@\0"
VALUE "LegalCopyright", "Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\0"
VALUE "ProductName", "VTK @VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@ for Windows\0"
VALUE "ProductVersion", "@VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/*=========================================================================
Program: Visualization Toolkit
Module: vtkrc.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#define IDI_VTKICO 107
#define IDI_VTKICOSMALL 108
......@@ -34,7 +34,9 @@ PURPOSE. See the above copyright notice for more information.
#include "vtkToolkits.h"
#include "Wrapping/Tcl/vtkTkAppInitConfigure.h"
#ifdef VTK_TCL_TK_COPY_SUPPORT_LIBRARY
#include <sys/stat.h>
#endif
#if defined(CMAKE_INTDIR)
# define VTK_TCL_PACKAGE_DIR VTK_TCL_PACKAGE_DIR_BUILD "/" CMAKE_INTDIR
......@@ -196,6 +198,7 @@ void help()
{
}
#ifdef VTK_TCL_TK_COPY_SUPPORT_LIBRARY
int vtkTkAppInitFileExists(const char *filename)
{
struct stat fs;
......@@ -276,6 +279,7 @@ const char* vtkTkAppInitConvertToUnixSlashes(const char* path, char *unix_path)
return unix_path;
}
#endif
int Tcl_AppInit(Tcl_Interp *interp)
{
......@@ -298,11 +302,11 @@ int Tcl_AppInit(Tcl_Interp *interp)
The above code will also make Tcl/Tk search inside VTK's build/install
directory, more precisely inside a TclTk/lib sub dir.
ex: [path to vtk.exe]/TclTk/lib/tcl8.4, [path to vtk.exe]/TclTk/lib/tk8.4
If we provide support files in the future, or if they are provided
by turn-key apps (ParaView or VolView), this is where they are going to
be copied.
Support files are copied to that location when
VTK_TCL_TK_COPY_SUPPORT_LIBRARY is ON.
*/
#ifdef VTK_TCL_TK_COPY_SUPPORT_LIBRARY
int has_tcllibpath_env = getenv("TCL_LIBRARY") ? 1 : 0;
int has_tklibpath_env = getenv("TK_LIBRARY") ? 1 : 0;
if (!has_tcllibpath_env || !has_tklibpath_env)
......@@ -343,6 +347,7 @@ int Tcl_AppInit(Tcl_Interp *interp)
}
}
}
#endif
if (Tcl_Init(interp) == TCL_ERROR)
{
......
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