|
From: <arj...@us...> - 2009-02-11 05:22:00
|
Revision: 9504
http://plplot.svn.sourceforge.net/plplot/?rev=9504&view=rev
Author: arjenmarkus
Date: 2009-02-11 05:21:56 +0000 (Wed, 11 Feb 2009)
Log Message:
-----------
Changed detection of Itcl: leave finding the right (compatible) version to
Tcl itself. This does not yet guarantee that the Itcl bindings can be turned
on: for that we still need the header file and the library.
Turning ENABLE_itcl on by default
Modified Paths:
--------------
trunk/cmake/modules/tcl-related.cmake
Added Paths:
-----------
trunk/cmake/modules/GetITCL_Version.tcl
Added: trunk/cmake/modules/GetITCL_Version.tcl
===================================================================
--- trunk/cmake/modules/GetITCL_Version.tcl (rev 0)
+++ trunk/cmake/modules/GetITCL_Version.tcl 2009-02-11 05:21:56 UTC (rev 9504)
@@ -0,0 +1,2 @@
+# Extract the version of Itcl
+puts -nonewline [package require Itcl]; exit
Property changes on: trunk/cmake/modules/GetITCL_Version.tcl
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/cmake/modules/tcl-related.cmake
===================================================================
--- trunk/cmake/modules/tcl-related.cmake 2009-02-11 03:26:39 UTC (rev 9503)
+++ trunk/cmake/modules/tcl-related.cmake 2009-02-11 05:21:56 UTC (rev 9504)
@@ -27,7 +27,7 @@
option(ENABLE_itk "Enable incr TK interface code" OFF)
else(DEFAULT_NO_BINDINGS)
option(ENABLE_tcl "Enable Tcl bindings" ON)
- option(ENABLE_itcl "Enable incr Tcl interface code" OFF)
+ option(ENABLE_itcl "Enable incr Tcl interface code" ON)
option(ENABLE_tk "Enable Tk interface code" OFF)
option(ENABLE_itk "Enable incr TK interface code" OFF)
endif(DEFAULT_NO_BINDINGS)
@@ -88,31 +88,45 @@
message(STATUS "TCL_INCLUDE_PATH = ${TCL_INCLUDE_PATH}")
message(STATUS "TCL_LIBRARY = ${TCL_LIBRARY}")
if(ENABLE_itcl)
- message(STATUS "Looking for itcl.h")
- find_path(ITCL_INCLUDE_PATH itcl.h ${TCL_INCLUDE_PATH})
- if(ITCL_INCLUDE_PATH)
- message(STATUS "Looking for itcl.h - found")
- message(STATUS "Looking for itcl library")
+ execute_process(
+ COMMAND ${TCL_TCLSH} CheckITCL_Available.tcl
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/modules
+ OUTPUT_VARIABLE AVAILABLE_ITCL)
+ if(AVAILABLE_ITCL)
+ execute_process(
+ COMMAND ${TCL_TCLSH} GetITCL_Version.tcl
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/modules
+ OUTPUT_VARIABLE itcl_library_versions)
+ message(STATUS "Looking for itcl.h")
+ find_path(ITCL_INCLUDE_PATH itcl.h ${TCL_INCLUDE_PATH})
+ if(ITCL_INCLUDE_PATH)
+ message(STATUS "Looking for itcl.h - found")
+ message(STATUS "Looking for itcl library")
get_filename_component(TCL_LIBRARY_PATH ${TCL_LIBRARY} PATH)
- set(itcl_library_versions 3.4 3.3 3.2 3.1 3.0 2.1 2.0)
- foreach(version ${itcl_library_versions})
- find_library(ITCL_LIBRARY itcl${version} PATHS ${TCL_LIBRARY_PATH}
- PATH_SUFFIXES itcl${version})
- endforeach(version ${itcl_library_versions})
- if(ITCL_LIBRARY)
- message(STATUS "Looking for itcl library - found")
- set(HAVE_ITCL ON)
- find_path(HAVE_ITCLDECLS_H itclDecls.h ${TCL_INCLUDE_PATH})
- else(ITCL_LIBRARY)
- message(STATUS "Looking for itcl library - not found")
+ set(itcl_library_versions 3.4 3.3 3.2 3.1 3.0 2.1 2.0)
+ foreach(version ${itcl_library_versions})
+ find_library(ITCL_LIBRARY itcl${version} PATHS ${TCL_LIBRARY_PATH}
+ PATH_SUFFIXES itcl${version})
+ endforeach(version ${itcl_library_versions})
+ if(ITCL_LIBRARY)
+ message(STATUS "Looking for itcl library - found")
+ set(HAVE_ITCL ON)
+ find_path(HAVE_ITCLDECLS_H itclDecls.h ${TCL_INCLUDE_PATH})
+ else(ITCL_LIBRARY)
+ message(STATUS "Looking for itcl library - not found")
+ message(STATUS "WARNING: Disabling incr Tcl interface code")
+ set(ENABLE_itcl OFF CACHE BOOL "Enable incr Tcl interface code" FORCE)
+ endif(ITCL_LIBRARY)
+ else(ITCL_INCLUDE_PATH)
+ message(STATUS "Looking for itcl.h - not found")
message(STATUS "WARNING: Disabling incr Tcl interface code")
set(ENABLE_itcl OFF CACHE BOOL "Enable incr Tcl interface code" FORCE)
- endif(ITCL_LIBRARY)
- else(ITCL_INCLUDE_PATH)
- message(STATUS "Looking for itcl.h - not found")
- message(STATUS "WARNING: Disabling incr Tcl interface code")
+ endif(ITCL_INCLUDE_PATH)
+ else(AVAILABLE_ITCL)
+ message(STATUS "Itcl not available or not compatible with current Tcl shell")
+ set(HAVE_ITCL OFF)
set(ENABLE_itcl OFF CACHE BOOL "Enable incr Tcl interface code" FORCE)
- endif(ITCL_INCLUDE_PATH)
+ endif(AVAILABLE_ITCL)
endif(ENABLE_itcl)
if(ENABLE_itcl)
message(STATUS "ITCL_INCLUDE_PATH = ${ITCL_INCLUDE_PATH}")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|