|
From: <ai...@us...> - 2013-12-29 02:13:56
|
Revision: 12913
http://sourceforge.net/p/plplot/code/12913
Author: airwin
Date: 2013-12-29 02:13:54 +0000 (Sun, 29 Dec 2013)
Log Message:
-----------
Check Tcl/Tk version consistency by implementing the following:
* Determine Tcl version from tclsh
* Determine Tcl version from library name (if that is possible) and
WARN if it is not consistent with Tcl version from tclsh.
* Determine Tk version from wish and confirm it is the same
as the Tcl version from tclsh or else disable Tk.
* Determine Tcl version from wish and confirm it is the
same as the Tcl version from tclsh or else disable Tk.
* Determine Tk version from tclsh and confirm it is the
same as the Tk version from wish or else disable Tk.
* Determine Tk version from library name (if that is possible) and
confirm consistent with Tcl version from tclsh or else disable Tk.
Tested by: Alan W. Irwin <ai...@us...> using various
runs of cmake with wrong results locally imposed to test all the WARNING
logic.
Modified Paths:
--------------
trunk/cmake/modules/tcl-related.cmake
Modified: trunk/cmake/modules/tcl-related.cmake
===================================================================
--- trunk/cmake/modules/tcl-related.cmake 2013-12-22 22:35:13 UTC (rev 12912)
+++ trunk/cmake/modules/tcl-related.cmake 2013-12-29 02:13:54 UTC (rev 12913)
@@ -71,7 +71,7 @@
message(STATUS "Start determining consistent system data for Tcl and friends")
find_package(TclStub QUIET)
if(TCL_FOUND)
- message(STATUS "Looking for include paths and libraries for Tcl - found")
+ message(STATUS "Looking for Tcl - found")
message(STATUS "TCL_INCLUDE_PATH = ${TCL_INCLUDE_PATH}")
message(STATUS "TCL_LIBRARY = ${TCL_LIBRARY}")
message(STATUS "TCL_STUB_LIBRARY = ${TCL_STUB_LIBRARY}")
@@ -85,66 +85,117 @@
if(TCL_TCLSH)
message(STATUS "Looking for tclsh - found")
message(STATUS "TCL_TCLSH = ${TCL_TCLSH}")
+ if(NOT PLPLOT_TCL_VERSION)
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckTCL_VERSION.tcl "puts -nonewline [package require Tcl]; exit")
+ # Find Tcl version via tclsh or fail.
+ execute_process(
+ COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/CheckTCL_VERSION.tcl
+ RESULT_VARIABLE TCL_RC
+ OUTPUT_VARIABLE _plplot_tcl_version
+ )
+ if(NOT TCL_RC)
+ message(STATUS "Looking for Tcl version with tclsh - found")
+ # Store result in cached variable so it will be remembered
+ # when cmake is re-run, but use type of STRING rather than
+ # INTERNAL to allow users to specify the value with a
+ # -DPLPLOT_TCL_VERSION:STRING=<whatever> on the command
+ # line for those rare cases when "package require Tcl"
+ # would error out due to some tclsh issue.
+ set(PLPLOT_TCL_VERSION ${_plplot_tcl_version}
+ CACHE STRING "Tcl version that is available"
+ )
+ else(NOT TCL_RC)
+ message(STATUS "Looking for Tcl version with tclsh - not found")
+ message(STATUS "WARNING: setting ENABLE_tcl to OFF")
+ set(ENABLE_tcl OFF CACHE BOOL "Enable Tcl bindings" FORCE)
+ endif(NOT TCL_RC)
+ endif(NOT PLPLOT_TCL_VERSION)
else(TCL_TCLSH)
message(STATUS "Looking for tclsh - not found")
+ message(STATUS "WARNING: setting ENABLE_tcl to OFF")
+ set(ENABLE_tcl OFF CACHE BOOL "Enable Tcl bindings" FORCE)
endif(TCL_TCLSH)
else(TCL_FOUND)
- message(STATUS "Looking for include paths and libraries for Tcl - not found")
+ message(STATUS "Looking for Tcl - not found")
+ message(STATUS "WARNING: setting ENABLE_tcl to OFF")
+ set(ENABLE_tcl OFF CACHE BOOL "Enable Tcl bindings" FORCE)
endif(TCL_FOUND)
+endif(ENABLE_tcl)
- # Initially mark various quantities as as unfound in case that turns out to be the case.
+if(ENABLE_tcl)
+ message(STATUS "PLPLOT_TCL_VERSION = ${PLPLOT_TCL_VERSION}")
+
+ # Sanity checking of Tcl version consistency _if_ a Tcl version string
+ # can be extracted from the Tcl library name.
+ string(REGEX MATCH "[0-9]+[.]?[0-9]+" library_version ${TCL_LIBRARY})
+ if(library_version)
+ # If no decimal point in version insert as the second character.
+ if(NOT library_version MATCHES "[.]")
+ string(REGEX REPLACE "^([0-9])([0-9]+)$" "\\1.\\2" library_version ${library_version})
+ endif(NOT library_version MATCHES "[.]")
+ #message(STATUS "library_version = ${library_version}")
+ string(LENGTH ${library_version} length_library_version)
+ string(SUBSTRING ${PLPLOT_TCL_VERSION} 0 ${length_library_version} truncated_version)
+ #message(STATUS "truncated_version = ${truncated_version}")
+ if(NOT truncated_version STREQUAL library_version)
+ message(STATUS "WARNING: Tcl library version = ${library_version} that is extracted from the
+ library name is not consistent with PLPLOT_TCL_VERSION = ${PLPLOT_TCL_VERSION}")
+ endif(NOT truncated_version STREQUAL library_version)
+ endif(library_version)
+
+ # Initially mark various quantities as unfound in case that turns out to be true.
set(HAVE_ITCL OFF)
set(HAVE_ITK OFF)
- if(TCL_FOUND AND TCL_TCLSH)
- if(ENABLE_itcl)
- if(USE_INCRTCL_VERSION_4)
- set(SUGGESTED_ITCL_VERSION 4)
- else(USE_INCRTCL_VERSION_4)
- set(SUGGESTED_ITCL_VERSION 3)
- endif(USE_INCRTCL_VERSION_4)
- if(NOT PLPLOT_ITCL_VERSION)
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_Available.tcl "puts -nonewline [package require Itcl ${SUGGESTED_ITCL_VERSION}]; exit")
- # Refine SUGGESTED_ITCL_VERSION to exact value or fail.
- execute_process(
- COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_Available.tcl
- RESULT_VARIABLE ITCL_RC
- OUTPUT_VARIABLE _plplot_itcl_version
+ if(ENABLE_itcl)
+ if(USE_INCRTCL_VERSION_4)
+ set(SUGGESTED_ITCL_VERSION 4)
+ else(USE_INCRTCL_VERSION_4)
+ set(SUGGESTED_ITCL_VERSION 3)
+ endif(USE_INCRTCL_VERSION_4)
+ if(NOT PLPLOT_ITCL_VERSION)
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_Available.tcl "puts -nonewline [package require Itcl ${SUGGESTED_ITCL_VERSION}]; exit")
+ # Refine SUGGESTED_ITCL_VERSION to exact value or fail.
+ execute_process(
+ COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_Available.tcl
+ RESULT_VARIABLE ITCL_RC
+ OUTPUT_VARIABLE _plplot_itcl_version
+ )
+ if(NOT ITCL_RC)
+ # Store result in cached variable so it will be remembered
+ # when cmake is re-run, but use type of STRING rather than
+ # INTERNAL to allow users to specify the value with a
+ # -DPLPLOT_ITCL_VERSION:STRING=<whatever> on the command
+ # line for those rare cases when "package require Itcl"
+ # would error out due to some tclsh issue.
+ set(PLPLOT_ITCL_VERSION ${_plplot_itcl_version}
+ CACHE STRING "Itcl version that will be used"
)
- if(NOT ITCL_RC)
- # Store result in cached variable so it will be remembered
- # when cmake is re-run, but use type of STRING rather than
- # INTERNAL to allow users to specify the value with a
- # -DPLPLOT_ITCL_VERSION:STRING=<whatever> on the command
- # line for those rare cases when "package require Itcl"
- # would error out due to some tclsh issue.
- set(PLPLOT_ITCL_VERSION ${_plplot_itcl_version}
- CACHE STRING "Itcl version that will be used"
- )
- endif(NOT ITCL_RC)
- else(NOT PLPLOT_ITCL_VERSION)
- set(ITCL_RC 0)
- endif(NOT PLPLOT_ITCL_VERSION)
- if(NOT ITCL_RC)
- message(STATUS "Looking for itcl.h")
- if(NOT USE_INCRTCL_VERSION_4)
- # Search first for epa_build install location.
- find_path(ITCL_INCLUDE_PATH itcl.h HINTS ${TCL_INCLUDE_PATH}/itcl${PLPLOT_ITCL_VERSION})
- endif(NOT USE_INCRTCL_VERSION_4)
- find_path(ITCL_INCLUDE_PATH itcl.h HINTS ${TCL_INCLUDE_PATH})
+ endif(NOT ITCL_RC)
+ else(NOT PLPLOT_ITCL_VERSION)
+ set(ITCL_RC 0)
+ endif(NOT PLPLOT_ITCL_VERSION)
- if(ITCL_INCLUDE_PATH)
- message(STATUS "Looking for itcl.h - found")
- message(STATUS "ITCL_INCLUDE_PATH = ${ITCL_INCLUDE_PATH}")
- message(STATUS "PLPLOT_ITCL_VERSION = ${PLPLOT_ITCL_VERSION}")
+ if(NOT ITCL_RC)
+ message(STATUS "Looking for itcl.h")
+ if(NOT USE_INCRTCL_VERSION_4)
+ # Search first for epa_build install location.
+ find_path(ITCL_INCLUDE_PATH itcl.h HINTS ${TCL_INCLUDE_PATH}/itcl${PLPLOT_ITCL_VERSION})
+ endif(NOT USE_INCRTCL_VERSION_4)
+ find_path(ITCL_INCLUDE_PATH itcl.h HINTS ${TCL_INCLUDE_PATH})
- message(STATUS "Checking for Itcl header version consistency")
- string(REGEX REPLACE "^([0-9]*)\\.[0-9]*.*$" "\\1" ITCL_MAJOR_VERSION "${PLPLOT_ITCL_VERSION}")
- string(REGEX REPLACE "^[0-9]*\\.([0-9]*).*$" "\\1" ITCL_MINOR_VERSION "${PLPLOT_ITCL_VERSION}")
- message(STATUS "ITCL_MAJOR_VERSION = ${ITCL_MAJOR_VERSION}")
- message(STATUS "ITCL_MINOR_VERSION = ${ITCL_MINOR_VERSION}")
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_VERSION.c
- "// #define RC_INVOKED to avoid sucking in lots of additional includes for
+ if(ITCL_INCLUDE_PATH)
+ message(STATUS "Looking for itcl.h - found")
+ message(STATUS "ITCL_INCLUDE_PATH = ${ITCL_INCLUDE_PATH}")
+ message(STATUS "PLPLOT_ITCL_VERSION = ${PLPLOT_ITCL_VERSION}")
+
+ message(STATUS "Checking for Itcl header version consistency")
+ string(REGEX REPLACE "^([0-9]*)\\.[0-9]*.*$" "\\1" ITCL_MAJOR_VERSION "${PLPLOT_ITCL_VERSION}")
+ string(REGEX REPLACE "^[0-9]*\\.([0-9]*).*$" "\\1" ITCL_MINOR_VERSION "${PLPLOT_ITCL_VERSION}")
+ message(STATUS "ITCL_MAJOR_VERSION = ${ITCL_MAJOR_VERSION}")
+ message(STATUS "ITCL_MINOR_VERSION = ${ITCL_MINOR_VERSION}")
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_VERSION.c
+ "// #define RC_INVOKED to avoid sucking in lots of additional includes for
// efficiency and simplicity.
#define RC_INVOKED 1
#include <itcl.h>
@@ -153,133 +204,238 @@
#endif
void main(void){}
"
- )
- try_compile(CONSISTENT_HEADER_ITCL_VERSION ${CMAKE_BINARY_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_VERSION.c
- CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${ITCL_INCLUDE_PATH};${TCL_INCLUDE_PATH}"
- )
- if(CONSISTENT_HEADER_ITCL_VERSION)
- message(STATUS "Checking for Itcl header version consistency - true")
- else(CONSISTENT_HEADER_ITCL_VERSION)
- message(STATUS "Checking for Itcl header version consistency - false")
- message(STATUS "WARNING: Disabling Itcl interface code")
- set(ENABLE_itcl OFF CACHE BOOL "Enable Itcl interface code" FORCE)
- endif(CONSISTENT_HEADER_ITCL_VERSION)
- else(ITCL_INCLUDE_PATH)
- message(STATUS "Looking for itcl.h - not found")
+ )
+ try_compile(CONSISTENT_HEADER_ITCL_VERSION ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_VERSION.c
+ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${ITCL_INCLUDE_PATH};${TCL_INCLUDE_PATH}"
+ )
+ if(CONSISTENT_HEADER_ITCL_VERSION)
+ message(STATUS "Checking for Itcl header version consistency - true")
+ else(CONSISTENT_HEADER_ITCL_VERSION)
+ message(STATUS "Checking for Itcl header version consistency - false")
message(STATUS "WARNING: Disabling Itcl interface code")
- set(ENABLE_itcl OFF CACHE BOOL "Enable Itcl interface code" FORCE)
- endif(ITCL_INCLUDE_PATH)
-
- if(ENABLE_itcl)
- message(STATUS "Looking for itcl library")
- # Search first for epa_build install location.
- find_library(ITCL_LIBRARY itcl${PLPLOT_ITCL_VERSION} HINTS ${TCL_LIBRARY_PATH}/itcl${PLPLOT_ITCL_VERSION})
- find_library(ITCL_LIBRARY itcl${PLPLOT_ITCL_VERSION} HINTS ${TCL_LIBRARY_PATH})
- if(ITCL_LIBRARY)
- message(STATUS "Looking for itcl library - found")
- message(STATUS "ITCL_LIBRARY = ${ITCL_LIBRARY}")
- get_filename_component(ITCL_LIBRARY_PATH ${ITCL_LIBRARY} PATH)
- list(APPEND TCL_TK_ITCL_ITK_RPATH ${ITCL_LIBRARY_PATH})
- set(HAVE_ITCL ON)
- find_path(HAVE_ITCLDECLS_H itclDecls.h HINTS ${ITCL_INCLUDE_PATH})
- else(ITCL_LIBRARY)
- message(STATUS "Looking for itcl library - not found")
- message(STATUS "WARNING: Disabling Itcl interface code")
- set(ENABLE_itcl OFF CACHE BOOL "Enable Itcl interface code" FORCE)
- endif(ITCL_LIBRARY)
- endif(ENABLE_itcl)
- else(NOT ITCL_RC)
- message(STATUS "Itcl not available or not compatible with current Tcl shell")
+ set(ENABLE_itcl OFF CACHE BOOL "Enable Itcl interface code" FORCE)
+ endif(CONSISTENT_HEADER_ITCL_VERSION)
+ else(ITCL_INCLUDE_PATH)
+ message(STATUS "Looking for itcl.h - not found")
message(STATUS "WARNING: Disabling Itcl interface code")
set(ENABLE_itcl OFF CACHE BOOL "Enable Itcl interface code" FORCE)
- endif(NOT ITCL_RC)
- endif(ENABLE_itcl)
+ endif(ITCL_INCLUDE_PATH)
- if(ENABLE_tk AND NOT TK_FOUND)
- message(STATUS "WARNING: Tk not found so disabling Tk interface code")
- set(ENABLE_tk OFF CACHE BOOL "Enable Tk interface code" FORCE)
- endif(ENABLE_tk AND NOT TK_FOUND)
+ if(ENABLE_itcl)
+ message(STATUS "Looking for itcl library")
+ # Search first for epa_build install location.
+ find_library(ITCL_LIBRARY itcl${PLPLOT_ITCL_VERSION} HINTS ${TCL_LIBRARY_PATH}/itcl${PLPLOT_ITCL_VERSION})
+ find_library(ITCL_LIBRARY itcl${PLPLOT_ITCL_VERSION} HINTS ${TCL_LIBRARY_PATH})
+ if(ITCL_LIBRARY)
+ message(STATUS "Looking for itcl library - found")
+ message(STATUS "ITCL_LIBRARY = ${ITCL_LIBRARY}")
+ get_filename_component(ITCL_LIBRARY_PATH ${ITCL_LIBRARY} PATH)
+ list(APPEND TCL_TK_ITCL_ITK_RPATH ${ITCL_LIBRARY_PATH})
+ set(HAVE_ITCL ON)
+ find_path(HAVE_ITCLDECLS_H itclDecls.h HINTS ${ITCL_INCLUDE_PATH})
+ else(ITCL_LIBRARY)
+ message(STATUS "Looking for itcl library - not found")
+ message(STATUS "WARNING: Disabling Itcl interface code")
+ set(ENABLE_itcl OFF CACHE BOOL "Enable Itcl interface code" FORCE)
+ endif(ITCL_LIBRARY)
+ endif(ENABLE_itcl)
+ else(NOT ITCL_RC)
+ message(STATUS "Itcl not available or not compatible with current Tcl shell")
+ message(STATUS "WARNING: Disabling Itcl interface code")
+ set(ENABLE_itcl OFF CACHE BOOL "Enable Itcl interface code" FORCE)
+ endif(NOT ITCL_RC)
+ endif(ENABLE_itcl)
- if(ENABLE_tk AND NOT X11_FOUND)
- if(WIN32 AND NOT CYGWIN)
- message(STATUS "WARNING: X11 not found, turning off Tk devices that depend on it")
- set(PLD_tk OFF CACHE BOOL "Enable Tk device" FORCE)
- set(PLD_tkwin OFF CACHE BOOL "Enable Tk device" FORCE)
- else(WIN32 AND NOT CYGWIN)
- message(STATUS "WARNING: X11 not found so disabling Tk interface code")
- set(ENABLE_tk OFF CACHE BOOL "Enable Tk interface code" FORCE)
- endif(WIN32 AND NOT CYGWIN)
- endif(ENABLE_tk AND NOT X11_FOUND)
+ if(ENABLE_tk AND TK_FOUND)
+ message(STATUS "Looking for Tk - found")
+ if(X11_FOUND)
+ list(APPEND TK_INCLUDE_PATH ${X11_INCLUDE_DIR})
+ endif(X11_FOUND)
+ message(STATUS "TK_INCLUDE_PATH = ${TK_INCLUDE_PATH}")
+ message(STATUS "TK_LIBRARY = ${TK_LIBRARY}")
+ message(STATUS "TK_STUB_LIBRARY = ${TK_STUB_LIBRARY}")
- if(ENABLE_tk)
- message(STATUS "Looking for include paths and libraries for Tk - found")
- set(TK_INCLUDE_PATH ${TK_INCLUDE_PATH} ${X11_INCLUDE_DIR})
- message(STATUS "TK_INCLUDE_PATH = ${TK_INCLUDE_PATH}")
- message(STATUS "TK_LIBRARY = ${TK_LIBRARY}")
- message(STATUS "TK_STUB_LIBRARY = ${TK_STUB_LIBRARY}")
+ get_filename_component(TK_LIBRARY_PATH ${TK_LIBRARY} PATH)
+ list(APPEND TCL_TK_RPATH ${TK_LIBRARY_PATH})
+ list(APPEND TCL_TK_ITCL_ITK_RPATH ${TK_LIBRARY_PATH})
- get_filename_component(TK_LIBRARY_PATH ${TK_LIBRARY} PATH)
- message(STATUS "TK_LIBRARY_PATH = ${TK_LIBRARY_PATH}")
- if(NOT ${TK_LIBRARY_PATH} STREQUAL ${TCL_LIBRARY_PATH})
- message(STATUS "WARNING: the Tcl and Tk library locations are inconsistent so those libraries are likely not compatible")
- endif(NOT ${TK_LIBRARY_PATH} STREQUAL ${TCL_LIBRARY_PATH})
- list(APPEND TCL_TK_RPATH ${TK_LIBRARY_PATH})
- list(APPEND TCL_TK_ITCL_ITK_RPATH ${TK_LIBRARY_PATH})
- else(ENABLE_tk)
- message(STATUS "WARNING: Because Tk is disabled must disable Itk as well")
- set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
- endif(ENABLE_tk)
+ message(STATUS "TK_LIBRARY_PATH = ${TK_LIBRARY_PATH}")
+ if(NOT ${TK_LIBRARY_PATH} STREQUAL ${TCL_LIBRARY_PATH})
+ message(STATUS "WARNING: the Tcl and Tk library locations are inconsistent so those libraries are likely not compatible")
+ endif(NOT ${TK_LIBRARY_PATH} STREQUAL ${TCL_LIBRARY_PATH})
- if(ENABLE_itk)
- if(USE_INCRTCL_VERSION_4)
- set(SUGGESTED_ITK_VERSION 4)
- else(USE_INCRTCL_VERSION_4)
- set(SUGGESTED_ITK_VERSION 3)
- endif(USE_INCRTCL_VERSION_4)
- if(NOT PLPLOT_ITK_VERSION)
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_Available.tcl "puts -nonewline [package require Itk ${SUGGESTED_ITK_VERSION}]; exit")
- # Refine SUGGESTED_ITK_VERSION to exact value or fail.
+ if(TK_WISH)
+ message(STATUS "Looking for wish - found")
+ message(STATUS "TK_WISH = ${TK_WISH}")
+ if(NOT PLPLOT_TK_VERSION)
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckTK_VERSION.tcl "puts -nonewline [package require Tk]; exit")
+ # Find Tk version via wish or fail.
execute_process(
- COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_Available.tcl
- RESULT_VARIABLE ITK_RC
- OUTPUT_VARIABLE _plplot_itk_version
+ COMMAND ${TK_WISH} ${CMAKE_CURRENT_BINARY_DIR}/CheckTK_VERSION.tcl
+ RESULT_VARIABLE TK_RC
+ OUTPUT_VARIABLE _plplot_tk_version
)
- if(NOT ITK_RC)
+ if(NOT TK_RC)
+ message(STATUS "Looking for Tk version with wish - found")
# Store result in cached variable so it will be remembered
# when cmake is re-run, but use type of STRING rather than
# INTERNAL to allow users to specify the value with a
- # -DPLPLOT_ITK_VERSION:STRING=<whatever> on the command line
- # for those rare cases (e.g., autobuild environment without X)
- # when "package require Itk" would error out due to the lack
- # of X or some tclsh issue.
- set(PLPLOT_ITK_VERSION ${_plplot_itk_version}
- CACHE STRING "Itk version that will be used"
+ # -DPLPLOT_TK_VERSION:STRING=<whatever> on the command
+ # line for those rare cases when "package require Tk"
+ # would error out due to some wish issue.
+ set(PLPLOT_TK_VERSION ${_plplot_tk_version}
+ CACHE STRING "Tk version found by wish"
)
- endif(NOT ITK_RC)
- else(NOT PLPLOT_ITK_VERSION)
- set(ITCL_RC 0)
- endif(NOT PLPLOT_ITK_VERSION)
+
+ if(PLPLOT_TCL_VERSION STREQUAL PLPLOT_TK_VERSION)
+ # Cross check that wish finds the same Tcl version as tclsh.
+ execute_process(
+ COMMAND ${TK_WISH} ${CMAKE_CURRENT_BINARY_DIR}/CheckTCL_VERSION.tcl
+ RESULT_VARIABLE TCL_RC
+ OUTPUT_VARIABLE _plplot_tcl_version
+ )
+
+ if(NOT TCL_RC AND _plplot_tcl_version STREQUAL PLPLOT_TCL_VERSION)
+ # Cross check that tclsh finds the same Tk version as wish.
+ execute_process(
+ COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/CheckTK_VERSION.tcl
+ RESULT_VARIABLE TK_RC
+ OUTPUT_VARIABLE _plplot_tk_version
+ )
+ if(NOT TK_RC AND _plplot_tk_version STREQUAL PLPLOT_TK_VERSION)
+ message(STATUS "Tcl and Tk versions found by both tclsh and wish are identical")
+ # Sanity checking of Tk version consistency _if_ a Tk
+ # version string can be extracted from the Tk library
+ # name.
+ string(REGEX MATCH "[0-9]+[.]?[0-9]+" library_version ${TK_LIBRARY})
+ if(library_version)
+ # If no decimal point in version insert as the second character.
+ if(NOT library_version MATCHES "[.]")
+ string(REGEX REPLACE "^([0-9])([0-9]+)$" "\\1.\\2" library_version ${library_version})
+ endif(NOT library_version MATCHES "[.]")
+ #message(STATUS "library_version = ${library_version}")
+ string(LENGTH ${library_version} length_library_version)
+ string(SUBSTRING ${PLPLOT_TK_VERSION} 0 ${length_library_version} truncated_version)
+ #message(STATUS "truncated_version = ${truncated_version}")
+ if(NOT truncated_version STREQUAL library_version)
+ message(STATUS "WARNING: Tk library version = ${library_version} that is extracted from the
+ library name is not consistent with PLPLOT_TK_VERSION = ${PLPLOT_TK_VERSION}")
+ endif(NOT truncated_version STREQUAL library_version)
+ endif(library_version)
+ elseif(TK_RC)
+ message(STATUS "Looking for Tk version with tclsh - not found")
+ message(STATUS "WARNING: setting ENABLE_tk to OFF")
+ set(ENABLE_tk OFF CACHE BOOL "Enable Tk bindings" FORCE)
+ else(NOT TK_RC AND _plplot_tk_version STREQUAL PLPLOT_TK_VERSION)
+ message(STATUS "Tk version = ${_plplot_tk_version} found by tclsh is not consistent with
+ Tk version = ${PLPLOT_TK_VERSION} found by wish"
+ )
+ message(STATUS "WARNING: setting ENABLE_tk to OFF")
+ set(ENABLE_tk OFF CACHE BOOL "Enable Tk bindings" FORCE)
+ endif(NOT TK_RC AND _plplot_tk_version STREQUAL PLPLOT_TK_VERSION)
+ elseif(TCL_RC)
+ message(STATUS "Looking for Tcl version with wish - not found")
+ message(STATUS "WARNING: setting ENABLE_tk to OFF")
+ set(ENABLE_tk OFF CACHE BOOL "Enable Tk bindings" FORCE)
+ else(NOT TCL_RC AND _plplot_tcl_version STREQUAL PLPLOT_TCL_VERSION)
+ message(STATUS "Tcl version = ${_plplot_tcl_version} found by wish is not consistent with
+ Tcl version = ${PLPLOT_TCL_VERSION} found by tclsh"
+ )
+ message(STATUS "WARNING: setting ENABLE_tk to OFF")
+ set(ENABLE_tk OFF CACHE BOOL "Enable Tk bindings" FORCE)
+ endif(NOT TCL_RC AND _plplot_tcl_version STREQUAL PLPLOT_TCL_VERSION)
+ else(PLPLOT_TCL_VERSION STREQUAL PLPLOT_TK_VERSION)
+ message(STATUS "Tk version = ${PLPLOT_TK_VERSION} found by wish is not consistent with
+ Tcl version = ${PLPLOT_TCL_VERSION} found by tclsh"
+ )
+ message(STATUS "WARNING: setting ENABLE_tk to OFF")
+ set(ENABLE_tk OFF CACHE BOOL "Enable Tk bindings" FORCE)
+ endif(PLPLOT_TCL_VERSION STREQUAL PLPLOT_TK_VERSION)
+ else(NOT TK_RC)
+ message(STATUS "Looking for Tk version with wish - not found")
+ message(STATUS "WARNING: setting ENABLE_tk to OFF")
+ set(ENABLE_tk OFF CACHE BOOL "Enable Tk bindings" FORCE)
+ endif(NOT TK_RC)
+ else(NOT PLPLOT_TK_VERSION)
+ set(TK_RC 0)
+ endif(NOT PLPLOT_TK_VERSION)
+ else(TK_WISH)
+ message(STATUS "Looking for wish - not found")
+ message(STATUS "WARNING: setting ENABLE_tk to OFF")
+ set(ENABLE_tk OFF CACHE BOOL "Enable Tk bindings" FORCE)
+ endif(TK_WISH)
+ elseif(ENABLE_tk AND NOT TK_FOUND)
+ message(STATUS "Looking for Tk - not found")
+ message(STATUS "WARNING: setting ENABLE_tk to OFF")
+ set(ENABLE_tk OFF CACHE BOOL "Enable Tk bindings" FORCE)
+ endif(ENABLE_tk AND TK_FOUND)
+
+ if(ENABLE_tk AND NOT X11_FOUND)
+ if(WIN32 AND NOT CYGWIN)
+ message(STATUS "WARNING: X11 not found, turning off Tk devices that depend on it")
+ set(PLD_tk OFF CACHE BOOL "Enable Tk device" FORCE)
+ set(PLD_tkwin OFF CACHE BOOL "Enable Tk device" FORCE)
+ else(WIN32 AND NOT CYGWIN)
+ message(STATUS "WARNING: X11 not found so disabling Tk interface code")
+ set(ENABLE_tk OFF CACHE BOOL "Enable Tk interface code" FORCE)
+ endif(WIN32 AND NOT CYGWIN)
+ endif(ENABLE_tk AND NOT X11_FOUND)
+
+ if(NOT ENABLE_tk)
+ message(STATUS "WARNING: Because Tk is disabled must disable Itk as well")
+ set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
+ endif(NOT ENABLE_tk)
+
+ if(ENABLE_itk)
+ if(USE_INCRTCL_VERSION_4)
+ set(SUGGESTED_ITK_VERSION 4)
+ else(USE_INCRTCL_VERSION_4)
+ set(SUGGESTED_ITK_VERSION 3)
+ endif(USE_INCRTCL_VERSION_4)
+ if(NOT PLPLOT_ITK_VERSION)
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_Available.tcl "puts -nonewline [package require Itk ${SUGGESTED_ITK_VERSION}]; exit")
+ # Refine SUGGESTED_ITK_VERSION to exact value or fail.
+ execute_process(
+ COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_Available.tcl
+ RESULT_VARIABLE ITK_RC
+ OUTPUT_VARIABLE _plplot_itk_version
+ )
if(NOT ITK_RC)
- message(STATUS "Looking for itk.h")
- if(NOT USE_INCRTCL_VERSION_4)
- # Search first for epa_build install location.
- find_path(ITK_INCLUDE_PATH itk.h HINTS ${TCL_INCLUDE_PATH}/itcl${PLPLOT_ITCL_VERSION})
- endif(NOT USE_INCRTCL_VERSION_4)
- find_path(ITK_INCLUDE_PATH itk.h HINTS ${TCL_INCLUDE_PATH})
+ # Store result in cached variable so it will be remembered
+ # when cmake is re-run, but use type of STRING rather than
+ # INTERNAL to allow users to specify the value with a
+ # -DPLPLOT_ITK_VERSION:STRING=<whatever> on the command line
+ # for those rare cases (e.g., autobuild environment without X)
+ # when "package require Itk" would error out due to the lack
+ # of X or some tclsh issue.
+ set(PLPLOT_ITK_VERSION ${_plplot_itk_version}
+ CACHE STRING "Itk version that will be used"
+ )
+ endif(NOT ITK_RC)
+ else(NOT PLPLOT_ITK_VERSION)
+ set(ITCL_RC 0)
+ endif(NOT PLPLOT_ITK_VERSION)
+ if(NOT ITK_RC)
+ message(STATUS "Looking for itk.h")
+ if(NOT USE_INCRTCL_VERSION_4)
+ # Search first for epa_build install location.
+ find_path(ITK_INCLUDE_PATH itk.h HINTS ${TCL_INCLUDE_PATH}/itcl${PLPLOT_ITCL_VERSION})
+ endif(NOT USE_INCRTCL_VERSION_4)
+ find_path(ITK_INCLUDE_PATH itk.h HINTS ${TCL_INCLUDE_PATH})
- if(ITK_INCLUDE_PATH)
- message(STATUS "Looking for itk.h - found")
- message(STATUS "ITK_INCLUDE_PATH = ${ITK_INCLUDE_PATH}")
- message(STATUS "PLPLOT_ITK_VERSION = ${PLPLOT_ITK_VERSION}")
+ if(ITK_INCLUDE_PATH)
+ message(STATUS "Looking for itk.h - found")
+ message(STATUS "ITK_INCLUDE_PATH = ${ITK_INCLUDE_PATH}")
+ message(STATUS "PLPLOT_ITK_VERSION = ${PLPLOT_ITK_VERSION}")
- message(STATUS "Checking for Itk header version consistency")
- string(REGEX REPLACE "^([0-9]*)\\.[0-9]*.*$" "\\1" ITK_MAJOR_VERSION "${PLPLOT_ITK_VERSION}")
- string(REGEX REPLACE "^[0-9]*\\.([0-9]*).*$" "\\1" ITK_MINOR_VERSION "${PLPLOT_ITK_VERSION}")
- message(STATUS "ITK_MAJOR_VERSION = ${ITK_MAJOR_VERSION}")
- message(STATUS "ITK_MINOR_VERSION = ${ITK_MINOR_VERSION}")
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_VERSION.c
- "// #define RC_INVOKED to avoid sucking in lots of additional includes for
+ message(STATUS "Checking for Itk header version consistency")
+ string(REGEX REPLACE "^([0-9]*)\\.[0-9]*.*$" "\\1" ITK_MAJOR_VERSION "${PLPLOT_ITK_VERSION}")
+ string(REGEX REPLACE "^[0-9]*\\.([0-9]*).*$" "\\1" ITK_MINOR_VERSION "${PLPLOT_ITK_VERSION}")
+ message(STATUS "ITK_MAJOR_VERSION = ${ITK_MAJOR_VERSION}")
+ message(STATUS "ITK_MINOR_VERSION = ${ITK_MINOR_VERSION}")
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_VERSION.c
+ "// #define RC_INVOKED to avoid sucking in lots of additional includes for
// efficiency and simplicity and also to avoid the header file disaster that has long
// been a problem for version 3.3 of itk.h
#define RC_INVOKED 1
@@ -289,143 +445,134 @@
#endif
void main(void){}
"
- )
- try_compile(CONSISTENT_HEADER_ITK_VERSION ${CMAKE_BINARY_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_VERSION.c
- CMAKE_FLAGS -DINCLUDE_DIRECTORIES:PATH=${ITK_INCLUDE_PATH}
- )
- if(CONSISTENT_HEADER_ITK_VERSION)
- message(STATUS "Checking for Itk header version consistency - true")
- else(CONSISTENT_HEADER_ITK_VERSION)
- message(STATUS "Checking for Itk header version consistency - false")
- message(STATUS "WARNING: Disabling Itk interface code")
- set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
- endif(CONSISTENT_HEADER_ITK_VERSION)
- else(ITK_INCLUDE_PATH)
- message(STATUS "Looking for itk.h - not found")
+ )
+ try_compile(CONSISTENT_HEADER_ITK_VERSION ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_VERSION.c
+ CMAKE_FLAGS -DINCLUDE_DIRECTORIES:PATH=${ITK_INCLUDE_PATH}
+ )
+ if(CONSISTENT_HEADER_ITK_VERSION)
+ message(STATUS "Checking for Itk header version consistency - true")
+ else(CONSISTENT_HEADER_ITK_VERSION)
+ message(STATUS "Checking for Itk header version consistency - false")
message(STATUS "WARNING: Disabling Itk interface code")
- set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
- endif(ITK_INCLUDE_PATH)
+ set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
+ endif(CONSISTENT_HEADER_ITK_VERSION)
+ else(ITK_INCLUDE_PATH)
+ message(STATUS "Looking for itk.h - not found")
+ message(STATUS "WARNING: Disabling Itk interface code")
+ set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
+ endif(ITK_INCLUDE_PATH)
- if(ENABLE_itk)
- message(STATUS "Looking for itk library")
- # Search first for epa_build install location.
- find_library(ITK_LIBRARY itk${PLPLOT_ITK_VERSION} HINTS ${TCL_LIBRARY_PATH}/itk${PLPLOT_ITK_VERSION})
- find_library(ITK_LIBRARY itk${PLPLOT_ITK_VERSION} HINTS ${TCL_LIBRARY_PATH})
- if(ITK_LIBRARY)
- message(STATUS "Looking for itk library - found")
- message(STATUS "ITK_LIBRARY = ${ITK_LIBRARY}")
- set(HAVE_ITK ON)
- get_filename_component(ITK_LIBRARY_PATH ${ITK_LIBRARY} PATH)
- list(APPEND TCL_TK_ITCL_ITK_RPATH ${ITK_LIBRARY_PATH})
+ if(ENABLE_itk)
+ message(STATUS "Looking for itk library")
+ # Search first for epa_build install location.
+ find_library(ITK_LIBRARY itk${PLPLOT_ITK_VERSION} HINTS ${TCL_LIBRARY_PATH}/itk${PLPLOT_ITK_VERSION})
+ find_library(ITK_LIBRARY itk${PLPLOT_ITK_VERSION} HINTS ${TCL_LIBRARY_PATH})
+ if(ITK_LIBRARY)
+ message(STATUS "Looking for itk library - found")
+ message(STATUS "ITK_LIBRARY = ${ITK_LIBRARY}")
+ set(HAVE_ITK ON)
+ get_filename_component(ITK_LIBRARY_PATH ${ITK_LIBRARY} PATH)
+ list(APPEND TCL_TK_ITCL_ITK_RPATH ${ITK_LIBRARY_PATH})
- # Test version consistency between iwidgets, itk, and itcl.
- if(NOT IWIDGETS_VERSIONS_LIST)
- if(USE_INCRTCL_VERSION_4)
- set(SUGGESTED_IWIDGETS_VERSION 4.1)
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl "puts -nonewline \"[package require Iwidgets ${SUGGESTED_IWIDGETS_VERSION}];[package require Itk];[package require Itcl]\";exit")
+ # Test version consistency between iwidgets, itk, and itcl.
+ if(NOT IWIDGETS_VERSIONS_LIST)
+ if(USE_INCRTCL_VERSION_4)
+ set(SUGGESTED_IWIDGETS_VERSION 4.1)
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl "puts -nonewline \"[package require Iwidgets ${SUGGESTED_IWIDGETS_VERSION}];[package require Itk];[package require Itcl]\";exit")
+ execute_process(
+ COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl
+ RESULT_VARIABLE IWIDGETS_RC
+ OUTPUT_VARIABLE _iwidgets_versions_list
+ )
+ else(USE_INCRTCL_VERSION_4)
+ # Find maximum 4.0 version of iwidgets that is
+ # available. 4.0.1 (released in 2002) is the largest
+ # version of iwidgets4.0 (as opposed to the recently
+ # developed iwidgets4.1) I have found on the web in
+ # tarball form, but I have seen one reference to 4.0.2
+ # which may have been publicly released somewhere
+ # inaccessible to my google searches or privately made
+ # available before all development of iwidgets4.0
+ # stopped. So add 4.0.2 to the list just in case.
+ foreach(SUGGESTED_IWIDGETS_VERSION 4.0.2 4.0.1 4.0.0)
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl "puts -nonewline \"[package require -exact Iwidgets ${SUGGESTED_IWIDGETS_VERSION}];[package require Itk];[package require Itcl]\";exit")
execute_process(
COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl
RESULT_VARIABLE IWIDGETS_RC
OUTPUT_VARIABLE _iwidgets_versions_list
+ ERROR_QUIET
)
- else(USE_INCRTCL_VERSION_4)
- # Find maximum 4.0 version of iwidgets that is
- # available. 4.0.1 (released in 2002) is the largest
- # version of iwidgets4.0 (as opposed to the recently
- # developed iwidgets4.1) I have found on the web in
- # tarball form, but I have seen one reference to 4.0.2
- # which may have been publicly released somewhere
- # inaccessible to my google searches or privately made
- # available before all development of iwidgets4.0
- # stopped. So add 4.0.2 to the list just in case.
- foreach(SUGGESTED_IWIDGETS_VERSION 4.0.2 4.0.1 4.0.0)
- file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl "puts -nonewline \"[package require -exact Iwidgets ${SUGGESTED_IWIDGETS_VERSION}];[package require Itk];[package require Itcl]\";exit")
- execute_process(
- COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl
- RESULT_VARIABLE IWIDGETS_RC
- OUTPUT_VARIABLE _iwidgets_versions_list
- ERROR_QUIET
- )
- if(NOT IWIDGETS_RC)
- break()
- endif(NOT IWIDGETS_RC)
- endforeach(SUGGESTED_IWIDGETS_VERSION 4.0.2 4.0.1 4.0.0)
- endif(USE_INCRTCL_VERSION_4)
- if(NOT IWIDGETS_RC)
- # Store result in cached variable so it will be
- # remembered when cmake is re-run, but use type of
- # STRING rather than INTERNAL to allow users to
- # specify the value with a
- # -DIWIDGETS_VERSIONS_LIST:STRING=<whatever> on the
- # command line for those rare cases (e.g., autobuild
- # environment without X) when "package require Itk (or
- # Itcl or IWidgets)" would error out due to the lack of
- # X or some tclsh issue
- set(IWIDGETS_VERSIONS_LIST ${_iwidgets_versions_list}
- CACHE STRING "list of Iwidgets; Itk, and Itcl versions (in that order) that will be used"
- )
- endif(NOT IWIDGETS_RC)
- else(NOT IWIDGETS_VERSIONS_LIST)
- set(IWIDGETS_RC 0)
- endif(NOT IWIDGETS_VERSIONS_LIST)
+ if(NOT IWIDGETS_RC)
+ break()
+ endif(NOT IWIDGETS_RC)
+ endforeach(SUGGESTED_IWIDGETS_VERSION 4.0.2 4.0.1 4.0.0)
+ endif(USE_INCRTCL_VERSION_4)
if(NOT IWIDGETS_RC)
- message(STATUS "IWIDGETS_VERSIONS_LIST = ${IWIDGETS_VERSIONS_LIST}")
- list(GET IWIDGETS_VERSIONS_LIST 0 PLPLOT_IWIDGETS_VERSION)
- list(GET IWIDGETS_VERSIONS_LIST 1 CONSISTENT_ITK_VERSION)
- list(GET IWIDGETS_VERSIONS_LIST 2 CONSISTENT_ITCL_VERSION)
+ # Store result in cached variable so it will be
+ # remembered when cmake is re-run, but use type of
+ # STRING rather than INTERNAL to allow users to
+ # specify the value with a
+ # -DIWIDGETS_VERSIONS_LIST:STRING=<whatever> on the
+ # command line for those rare cases (e.g., autobuild
+ # environment without X) when "package require Itk (or
+ # Itcl or IWidgets)" would error out due to the lack of
+ # X or some tclsh issue
+ set(IWIDGETS_VERSIONS_LIST ${_iwidgets_versions_list}
+ CACHE STRING "list of Iwidgets; Itk, and Itcl versions (in that order) that will be used"
+ )
+ endif(NOT IWIDGETS_RC)
+ else(NOT IWIDGETS_VERSIONS_LIST)
+ set(IWIDGETS_RC 0)
+ endif(NOT IWIDGETS_VERSIONS_LIST)
+ if(NOT IWIDGETS_RC)
+ message(STATUS "IWIDGETS_VERSIONS_LIST = ${IWIDGETS_VERSIONS_LIST}")
+ list(GET IWIDGETS_VERSIONS_LIST 0 PLPLOT_IWIDGETS_VERSION)
+ list(GET IWIDGETS_VERSIONS_LIST 1 CONSISTENT_ITK_VERSION)
+ list(GET IWIDGETS_VERSIONS_LIST 2 CONSISTENT_ITCL_VERSION)
- message(STATUS "PLPLOT_IWIDGETS_VERSION = ${PLPLOT_IWIDGETS_VERSION}")
- message(STATUS "Checking that the Iwidgets, Itk, and Itcl packages are consistent")
- if(CONSISTENT_ITCL_VERSION STREQUAL PLPLOT_ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL PLPLOT_ITK_VERSION)
- message(STATUS "Checking that the Iwidgets, Itk, and Itcl packages are consistent - true")
- else(CONSISTENT_ITCL_VERSION STREQUAL PLPLOT_ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL PLPLOT_ITK_VERSION)
- message(STATUS "PLPLOT_ITK_VERSION = ${PLPLOT_ITK_VERSION}")
- message(STATUS "CONSISTENT_ITK_VERSION = ${CONSISTENT_ITK_VERSION}")
- message(STATUS "PLPLOT_ITCL_VERSION = ${PLPLOT_ITCL_VERSION}")
- message(STATUS "CONSISTENT_ITCL_VERSION = ${CONSISTENT_ITCL_VERSION}")
- message(STATUS "Checking that the Iwidgets, Itk, and Itcl packages are consistent - false")
- message(STATUS "WARNING: Consistent combination of Iwidgets, Itk, and Itcl not found so disabling Itcl and Itk")
- set(ENABLE_itcl OFF CACHE BOOL "Enable Itcl interface code" FORCE)
- set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
- endif(CONSISTENT_ITCL_VERSION STREQUAL PLPLOT_ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL PLPLOT_ITK_VERSION)
- else(NOT IWIDGETS_RC)
- message(STATUS "WARNING: Iwidgets could not be found so disabling Itcl and Itk")
+ message(STATUS "PLPLOT_IWIDGETS_VERSION = ${PLPLOT_IWIDGETS_VERSION}")
+ message(STATUS "Checking that the Iwidgets, Itk, and Itcl packages are consistent")
+ if(CONSISTENT_ITCL_VERSION STREQUAL PLPLOT_ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL PLPLOT_ITK_VERSION)
+ message(STATUS "Checking that the Iwidgets, Itk, and Itcl packages are consistent - true")
+ else(CONSISTENT_ITCL_VERSION STREQUAL PLPLOT_ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL PLPLOT_ITK_VERSION)
+ message(STATUS "PLPLOT_ITK_VERSION = ${PLPLOT_ITK_VERSION}")
+ message(STATUS "CONSISTENT_ITK_VERSION = ${CONSISTENT_ITK_VERSION}")
+ message(STATUS "PLPLOT_ITCL_VERSION = ${PLPLOT_ITCL_VERSION}")
+ message(STATUS "CONSISTENT_ITCL_VERSION = ${CONSISTENT_ITCL_VERSION}")
+ message(STATUS "Checking that the Iwidgets, Itk, and Itcl packages are consistent - false")
+ message(STATUS "WARNING: Consistent combination of Iwidgets, Itk, and Itcl not found so disabling Itcl and Itk")
set(ENABLE_itcl OFF CACHE BOOL "Enable Itcl interface code" FORCE)
set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
- endif(NOT IWIDGETS_RC)
- else(ITK_LIBRARY)
- message(STATUS "Looking for itk library - not found")
- message(STATUS "WARNING: Disabling Itk interface code")
- set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
- endif(ITK_LIBRARY)
- endif(ENABLE_itk)
- else(NOT ITK_RC)
- message(STATUS "Itk not available or not compatible with current Tcl shell")
- message(STATUS "WARNING: Disabling Itk interface code")
- set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
- endif(NOT ITK_RC)
- endif(ENABLE_itk)
+ endif(CONSISTENT_ITCL_VERSION STREQUAL PLPLOT_ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL PLPLOT_ITK_VERSION)
+ else(NOT IWIDGETS_RC)
+ message(STATUS "WARNING: Iwidgets could not be found so disabling Itcl and Itk")
+ set(ENABLE_itcl OFF CACHE BOOL "Enable Itcl interface code" FORCE)
+ set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
+ endif(NOT IWIDGETS_RC)
+ else(ITK_LIBRARY)
+ message(STATUS "Looking for itk library - not found")
+ message(STATUS "WARNING: Disabling Itk interface code")
+ set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
+ endif(ITK_LIBRARY)
+ endif(ENABLE_itk)
+ else(NOT ITK_RC)
+ message(STATUS "Itk not available or not compatible with current Tcl shell")
+ message(STATUS "WARNING: Disabling Itk interface code")
+ set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
+ endif(NOT ITK_RC)
+ endif(ENABLE_itk)
- # ------------------------------------------------------------------------
- # figure out how to build tclIndex
- # ------------------------------------------------------------------------
- set(MKTCLINDEX ${CMAKE_SOURCE_DIR}/scripts/mktclIndex)
- if(ENABLE_itcl)
- set(MKTCLINDEX_ARGS "-itcl")
- else(ENABLE_itcl)
- set(MKTCLINDEX_ARGS "-tcl")
- endif(ENABLE_itcl)
+ # ------------------------------------------------------------------------
+ # figure out how to build tclIndex
+ # ------------------------------------------------------------------------
+ set(MKTCLINDEX ${CMAKE_SOURCE_DIR}/scripts/mktclIndex)
+ if(ENABLE_itcl)
+ set(MKTCLINDEX_ARGS "-itcl")
+ else(ENABLE_itcl)
+ set(MKTCLINDEX_ARGS "-tcl")
+ endif(ENABLE_itcl)
- else(TCL_FOUND AND TCL_TCLSH)
- message(STATUS "Tcl not found OR tclsh not found")
- message(STATUS "WARNING: Disabling everything that is Tcl/Tk related")
- set(ENABLE_tcl OFF CACHE BOOL "Enable Tcl bindings" FORCE)
- set(ENABLE_itcl OFF CACHE BOOL "Enable Itcl interface code" FORCE)
- set(ENABLE_tk OFF CACHE BOOL "Enable Tk interface code" FORCE)
- set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
- endif(TCL_FOUND AND TCL_TCLSH)
-
filter_rpath(TCL_RPATH)
if(TCL_RPATH)
message(STATUS "TCL_RPATH = ${TCL_RPATH}")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|