|
From: <ai...@us...> - 2013-11-08 07:52:16
|
Revision: 12670
http://sourceforge.net/p/plplot/code/12670
Author: airwin
Date: 2013-11-08 07:52:13 +0000 (Fri, 08 Nov 2013)
Log Message:
-----------
I got completely fed up with the broken autoconf-based build system
for iwidgets4.0.1 and the inflexible and limited binary distribution
approach that was used for iwidgets4.1.0. So I implemented a
CMake-based build system for iwidgets4.0/4.1, deleted the iwidgets4.0
directory that contained the separate autoconf-based build of
iwidgets4.0.1, and configured CMake-based builds of both iwidgets4.0
and iwidgets (version 4.1.0 generated from iwidgets4.0 with a patch)
in the one remaining iwidgets directory.
Tested by Alan W. Irwin <ai...@us...> using the
-DBUILD_THE_BUILDTOOLS=ON build_projects cmake option and the
build_iwidgets and build_iwidgets4.0 targets. The builds (which
included all the relevant Tcl/Tk8.6 builds and both the version 3 and
version 4 builds of itcl/itk and the version 4.0 and version 4.1
builds of iwidgets) proceeded to conclusion without issues.
Some simple testing under wish suceeded with such commands as "package
require Iwidgets" (which loaded itcl/itk version 4 and iwidgets
version 4.1.0) and "package require -exact Iwidgets 4.0.1) which
loaded itcl/itk version 3 and iwidgets version 4.0.1. I also
tested the calendar and watch iwidgets demos under both Iwidgets 4.0.1
and Iwidgets 4.1.0 with no issues.
Additional testing with PLplot should follow.
Modified Paths:
--------------
trunk/cmake/build_projects/CMakeLists.txt
trunk/cmake/build_projects/iwidgets/bp.cmake
Added Paths:
-----------
trunk/cmake/build_projects/iwidgets/CMakeLists.txt
trunk/cmake/build_projects/iwidgets/iwidgets4_case.patch
Removed Paths:
-------------
trunk/cmake/build_projects/iwidgets4.0/
Modified: trunk/cmake/build_projects/CMakeLists.txt
===================================================================
--- trunk/cmake/build_projects/CMakeLists.txt 2013-11-08 07:27:59 UTC (rev 12669)
+++ trunk/cmake/build_projects/CMakeLists.txt 2013-11-08 07:52:13 UTC (rev 12670)
@@ -292,14 +292,13 @@
# itcl version 4 is integrated into tcl
# itk version 4 is not integrated into tk (or tcl).
itk
- # iwidgets version 4.1 is not integrated into itcl
- iwidgets
# itcl version 3 is an independent project
itcl3
# itk version 3 is an independent project
itk3
- # iwidgets version 4.0 is an independent project
- iwidgets4.0
+ # iwidgets subdirectory contains build configurations for both
+ # iwidgets (version 4.1) and iwidgets4.0 (version 4.0).
+ iwidgets
)
else(BUILD_THE_BUILDTOOLS)
# List of all configurations. Order doesn't matter because multiple
Added: trunk/cmake/build_projects/iwidgets/CMakeLists.txt
===================================================================
--- trunk/cmake/build_projects/iwidgets/CMakeLists.txt (rev 0)
+++ trunk/cmake/build_projects/iwidgets/CMakeLists.txt 2013-11-08 07:52:13 UTC (rev 12670)
@@ -0,0 +1,149 @@
+# Top-level CMakeLists.txt for the CMake-based build and test system
+# of the iwidgets software.
+
+# Copyright (C) 2013 Alan W. Irwin
+
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Library General Public License as published
+# by the Free Software Foundation; version 2 of the License.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this file; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# The traditional autoconf build of iwidgets that was created in 2002
+# or earlier is completely broken and difficult to understand because
+# lots of the install is done in a low-level way.
+# Therefore, this is an attempt to replace that build system with a
+# rational CMake-based build system that actually works.
+
+# N.B. This "build" system only installs files so
+# no compiler is required for this project
+project(iwidgets NONE)
+
+message(STATUS "CMake version = ${CMAKE_VERSION}")
+message(STATUS "CMAKE_SYSTEM = ${CMAKE_SYSTEM}")
+message(STATUS "CMAKE_GENERATOR = ${CMAKE_GENERATOR}")
+message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
+
+cmake_minimum_required(VERSION 2.8.11.2 FATAL_ERROR)
+
+option(BUILD_IWIDGETS_4.1 "Build iwidgets 4.1" OFF)
+
+if(BUILD_IWIDGETS_4.1)
+ # install iwidgets 4.1 that is associated with version 4 of itcl and itk.
+ # Note the only difference between iwidgets 4.1 and 4.0 source code
+ # is a small patch. We assume that patch has been applied for this case.
+ set(ITCL_VERSION 4.0)
+ set(VERSION 4.1.0)
+else(BUILD_IWIDGETS_4.1)
+ # install iwidgets 4.0 that is associated with version 3 of itcl and itk.
+ set(ITCL_VERSION 3.2)
+ set(VERSION 4.0.1)
+endif(BUILD_IWIDGETS_4.1)
+
+set(PACKAGE iwidgets${VERSION})
+
+# Set up install locations.
+set(
+ CMAKE_INSTALL_SCRIPTS_DIR
+ ${CMAKE_INSTALL_PREFIX}/lib/${PACKAGE}
+ CACHE PATH "install location for iwidgets scripts."
+ )
+
+set(
+ CMAKE_INSTALL_DOC_DIR
+ ${CMAKE_INSTALL_PREFIX}/share/doc/${PACKAGE}
+ CACHE PATH "install location for iwidgets scripts."
+ )
+
+set(
+ CMAKE_INSTALL_MAN_DIR
+ ${CMAKE_INSTALL_PREFIX}/share/man
+ CACHE PATH "install location for man documentation"
+ )
+
+# Install configured iwidgets.tcl and pkgIndex.tcl.
+configure_file(iwidgets.tcl.in iwidgets.tcl @ONLY)
+configure_file(pkgIndex.tcl.in pkgIndex.tcl @ONLY)
+install(
+ FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/iwidgets.tcl
+ ${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl
+ DESTINATION ${CMAKE_INSTALL_SCRIPTS_DIR}
+ )
+
+# Install selected files from the generic subdirectory.
+
+file(GLOB generic_FILE_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} generic/*.itk generic/*.itcl generic/tclIndex generic/*.gif)
+install(
+ FILES
+ ${generic_FILE_LIST}
+ DESTINATION ${CMAKE_INSTALL_SCRIPTS_DIR}/scripts
+ )
+
+# Install some individual files to the documentation directory.
+install(
+ FILES
+ CHANGES ChangeLog README license.terms
+ DESTINATION ${CMAKE_INSTALL_DOC_DIR}
+ )
+
+
+# Install demos, demos/images, and demos/html.
+
+file(GLOB demos_FILE_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} demos/*)
+list(REMOVE_ITEM demos_FILE_LIST demos/images demos/html)
+install(
+ FILES
+ ${demos_FILE_LIST}
+ DESTINATION ${CMAKE_INSTALL_DOC_DIR}/demos
+ )
+
+file(GLOB demos_images_FILE_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} demos/images/*)
+install(
+ FILES
+ ${demos_images_FILE_LIST}
+ DESTINATION ${CMAKE_INSTALL_DOC_DIR}/demos/images
+ )
+file(GLOB demos_html_FILE_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} demos/html/*)
+install(
+ FILES
+ ${demos_html_FILE_LIST}
+ DESTINATION ${CMAKE_INSTALL_DOC_DIR}/demos/html
+ )
+
+# Install transformed man pages using "iwidgets_" filename suffix.
+# (All these changes copied exactly from the traditional build system
+# except that I use default 644 permissions [which is consistent
+# with the permissions of Debian man pages].)
+
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc)
+
+find_program(SED_EXECUTABLE sed)
+if(NOT SED_EXECUTABLE)
+ message(FATAL_ERROR "sed required for build but not found")
+endif(NOT SED_EXECUTABLE)
+
+file(GLOB man_FILE_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} doc/*.n)
+foreach(manpage ${man_FILE_LIST})
+ string(REGEX REPLACE "^doc/" "doc/iwidgets_" processed_manpage ${manpage})
+ execute_process(
+ COMMAND
+ ${SED_EXECUTABLE} -e "/man\\.macros/r ${CMAKE_CURRENT_SOURCE_DIR}/doc/man.macros" -e "/man\\.macros/d"
+ INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${manpage}
+ OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${processed_manpage}
+ )
+endforeach(manpage ${man_FILE_LIST})
+
+file(GLOB man_FILE_LIST ${CMAKE_CURRENT_BINARY_DIR}/doc/*.n)
+install(
+ FILES
+ ${man_FILE_LIST}
+ DESTINATION ${CMAKE_INSTALL_MAN_DIR}/mann
+ )
Property changes on: trunk/cmake/build_projects/iwidgets/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/cmake/build_projects/iwidgets/bp.cmake
===================================================================
--- trunk/cmake/build_projects/iwidgets/bp.cmake 2013-11-08 07:27:59 UTC (rev 12669)
+++ trunk/cmake/build_projects/iwidgets/bp.cmake 2013-11-08 07:52:13 UTC (rev 12670)
@@ -1,5 +1,5 @@
# iwidgets/bp.cmake
-# CMakeLists.txt file to configure the build of iwidgets.
+# CMakeLists.txt file to configure the build of iwidgets4.0 and iwidgets
# Copyright (C) 2013 Alan W. Irwin
@@ -23,9 +23,6 @@
# used below that configure how the External_Project functions
# operate.
-# These build configuration details for iwidgets adapted from
-# <http://www.mail-archive.com/fin...@li.../msg113511.html>
-
# Protect against configuring a build twice in one CMake call
if(iwidgets_configured)
return()
@@ -36,57 +33,111 @@
# ignored.
set(BP_ignored_dependencies_LIST ${extra_ignored_dependencies_list})
-set(iwidgets_dependencies_LIST tk tcl itk)
-# Remove dependencies that should be ignored.
-if(iwidgets_dependencies_LIST)
- list(REMOVE_ITEM iwidgets_dependencies_LIST ${BP_ignored_dependencies_LIST})
-endif(iwidgets_dependencies_LIST)
+set(iwidgets4.0_dependencies_LIST itk3 itcl3 tk tcl)
+set(iwidgets_dependencies_LIST itk tk tcl)
-set(iwidgets_dependencies_targets)
-foreach(build_configuration ${iwidgets_dependencies_LIST})
- if(EXISTS ${CMAKE_SOURCE_DIR}/${build_configuration}/bp.cmake)
- include(${build_configuration}/bp.cmake)
- list(APPEND iwidgets_dependencies_targets build_${build_configuration})
- else(EXISTS ${CMAKE_SOURCE_DIR}/${build_configuration}/bp.cmake)
- message(STATUS "Warning: A build_configuration for ${build_configuration} does not exist so it is assumed this dependency of iwidgets has been installed another way.")
- endif(EXISTS ${CMAKE_SOURCE_DIR}/${build_configuration}/bp.cmake)
-endforeach(build_configuration ${iwidgets_dependences_LIST})
+set(tags "4.0" "")
+foreach(tag IN LISTS tags)
+ # Remove dependencies that should be ignored.
+ if(iwidgets${tag}_dependencies_LIST)
+ list(REMOVE_ITEM iwidgets${tag}_dependencies_LIST ${BP_ignored_dependencies_LIST})
+ endif(iwidgets${tag}_dependencies_LIST)
+ set(iwidgets${tag}_dependencies_targets)
+ foreach(build_configuration ${iwidgets${tag}_dependencies_LIST})
+ if(EXISTS ${CMAKE_SOURCE_DIR}/${build_configuration}/bp.cmake)
+ include(${build_configuration}/bp.cmake)
+ list(APPEND iwidgets${tag}_dependencies_targets build_${build_configuration})
+ else(EXISTS ${CMAKE_SOURCE_DIR}/${build_configuration}/bp.cmake)
+ message(STATUS "Warning: A build_configuration for ${build_configuration} does not exist so it is assumed this dependency of iwidgets${tag} has been installed another way.")
+ endif(EXISTS ${CMAKE_SOURCE_DIR}/${build_configuration}/bp.cmake)
+ endforeach(build_configuration ${iwidgets${tag}_dependences_LIST})
+endforeach(tag IN LISTS tags)
+
# This can be safely done only after above includes.
set(BP_PACKAGE iwidgets)
-# Data that is related to downloads.
-set(IWIDGETS_VERSION 41)
-set(IWIDGETS_LIBVERSION 4.1)
-set(${BP_PACKAGE}_URL http://downloads.sourceforge.net/project/kbskit/itk/iwidgets${IWIDGETS_VERSION}.tgz)
-set(${BP_PACKAGE}_DOWNLOAD_HASH_TYPE MD5)
-set(${BP_PACKAGE}_DOWNLOAD_HASH 5a60ec284bd8095c665287215ff2a69f)
+set(${BP_PACKAGE}4.0_VERSION 4.0.1)
+set(${BP_PACKAGE}4.0_LIBVERSION 4.0)
+set(${BP_PACKAGE}4.0_ITCL_VERSION 3.2)
+set(${BP_PACKAGE}4.0_CMAKE_OPTION -DBUILD_IWIDGETS_4.1=OFF)
-# Data that is related to the PATH that must be used.
-if(MSYS_PLATFORM)
- #set(BP_PATH_NODLL "${BP_PATH}")
- #set(BP_PATH "${EP_BASE}/Build/build_${BP_PACKAGE}/dll;${BP_PATH_NODLL}")
- determine_msys_path(BP_PATH "${BP_PATH}")
- # Must have all elements of env command in MSYS platform form
- determine_msys_path(source_PATH "${EP_BASE}/Source/build_${BP_PACKAGE}")
- set(${BP_PACKAGE}_SET_CFLAGS "CFLAGS=$ENV{CFLAGS}")
-else(MSYS_PLATFORM)
- set(source_PATH "${EP_BASE}/Source/build_${BP_PACKAGE}")
- set(${BP_PACKAGE}_SET_CFLAGS "CFLAGS=$ENV{CFLAGS}")
-endif(MSYS_PLATFORM)
-#message(STATUS "modified BP_PATH for ${BP_PACKAGE} = ${BP_PATH}")
+set(${BP_PACKAGE}_VERSION 4.1.0)
+set(${BP_PACKAGE}_LIBVERSION 4.1)
+set(${BP_PACKAGE}_ITCL_VERSION 4.0)
+set(${BP_PACKAGE}_CMAKE_OPTION -DBUILD_IWIDGETS_4.1=ON)
-ExternalProject_Add(
- build_${BP_PACKAGE}
- DEPENDS ${${BP_PACKAGE}_dependencies_targets}
- URL ${${BP_PACKAGE}_URL}
- URL_HASH ${${BP_PACKAGE}_DOWNLOAD_HASH_TYPE}=${${BP_PACKAGE}_DOWNLOAD_HASH}
- CONFIGURE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${EP_BASE}/Source/build_${BP_PACKAGE} ${BP_CMAKE_INSTALL_PREFIX}/lib/iwidgets${IWIDGETS_LIBVERSION}
- )
+foreach(tag IN LISTS tags)
+ # Data that is related to downloads.
+ set(${BP_PACKAGE}${tag}_URL http://downloads.sourceforge.net/project/incrtcl/%5bIncr%20Widgets%5d/${${BP_PACKAGE}4.0_VERSION}/iwidgets${${BP_PACKAGE}4.0_VERSION}.tar.gz)
+ set(${BP_PACKAGE}${tag}_DOWNLOAD_HASH_TYPE MD5)
+ set(${BP_PACKAGE}${tag}_DOWNLOAD_HASH 0e9c140e81ea6015b56130127c7deb03)
-list(APPEND build_target_LIST build_${BP_PACKAGE})
-# Restore BP_PATH to original state.
-set(BP_PATH "${BP_ORIGINAL_NATIVE_PATH}")
-#message(STATUS "${BP_PACKAGE} restored original BP_PATH = ${BP_PATH}")
+ # Data that is related to the PATH that must be used.
+ if(MSYS_PLATFORM)
+ #set(BP_PATH_NODLL "${BP_PATH}")
+ #set(BP_PATH "${EP_BASE}/Build/build_${BP_PACKAGE}${tag}/dll;${BP_PATH_NODLL}")
+ determine_msys_path(BP_PATH "${BP_PATH}")
+ # Must have all elements of env command in MSYS platform form
+ determine_msys_path(source_PATH "${EP_BASE}/Source/build_${BP_PACKAGE}${tag}")
+ else(MSYS_PLATFORM)
+ set(source_PATH "${EP_BASE}/Source/build_${BP_PACKAGE}${tag}")
+ endif(MSYS_PLATFORM)
+ #message(STATUS "modified BP_PATH for ${BP_PACKAGE}${tag} = ${BP_PATH}")
+
+
+ ExternalProject_Add(
+ build_${BP_PACKAGE}${tag}
+ DEPENDS ${${BP_PACKAGE}${tag}_dependencies_targets}
+ URL ${${BP_PACKAGE}${tag}_URL}
+ URL_HASH ${${BP_PACKAGE}${tag}_DOWNLOAD_HASH_TYPE}=${${BP_PACKAGE}${tag}_DOWNLOAD_HASH}
+ PATCH_COMMAND ""
+ CONFIGURE_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_CMAKE_COMMAND} ${${BP_PACKAGE}${tag}_CMAKE_OPTION} ${EP_BASE}/Source/build_${BP_PACKAGE}${tag}
+ BUILD_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_BUILD_COMMAND}
+ INSTALL_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_BUILD_COMMAND} install
+ )
+ if(NOT "${tag}")
+ # Note this logic block executed for iwidget4.1 which has an empty
+ # tag. For this (4.1) case we do not use the
+ # http://downloads.sourceforge.net/project/kbskit/itk/iwidgets41.tar.gz
+ # tarball because there are some problems (incorrect install
+ # locations and only a subset of what is normally installed) for
+ # that binary distribution of iwidgets4.1. Instead, we build 4.1
+ # similarly to 4.0 except we apply the following patch which was
+ # derived as follows:
+ #
+ # diff -Naur iwidgets4.0.1/README iwidgets4.1/README >iwidgets4.1.patch
+ # diff -Naur iwidgets4.0.1/license.terms iwidgets4.1/license.terms >>iwidgets4.1.patch
+ # diff -Naur --exclude=pkgIndex.tcl iwidgets4.0.1/generic iwidgets4.1/library >> iwidgets4.1.patch
+ # diff -Naur iwidgets4.0.1/tests iwidgets4.1/tests >> iwidgets4.1.patch
+ #
+ # N.B. this patch is somewhat larger than
+ # iwidgets4.1/iwidgets.patch because that latter patch is only
+ # concerned with generic subdirectory differences and it also
+ # appears to be taken against iwidgets-4.0.2 (which I cannot find
+ # anywhere on the net) rather than iwidgets-4.0.1.
+ add_custom_command(
+ OUTPUT
+ ${EP_BASE}/Stamp/build_${BP_PACKAGE}${tag}/build_${BP_PACKAGE}${tag}-patch
+ COMMAND echo "Apply iwidgets4.1 source code patch"
+ COMMAND ${PATCH_EXECUTABLE} --directory=${EP_BASE}/Source/build_${BP_PACKAGE}${tag} -p1 < ${CMAKE_SOURCE_DIR}/${BP_PACKAGE}/${BP_PACKAGE}4.1.patch
+ COMMAND echo "Apply patch to support both iwidgets and Iwidgets package names"
+ COMMAND ${PATCH_EXECUTABLE} --directory=${EP_BASE}/Source/build_${BP_PACKAGE}${tag} -p1 < ${CMAKE_SOURCE_DIR}/${BP_PACKAGE}/${BP_PACKAGE}4_case.patch
+ APPEND
+ )
+ endif(NOT "${tag}")
+
+ add_custom_command(
+ OUTPUT
+ ${EP_BASE}/Stamp/build_${BP_PACKAGE}${tag}/build_${BP_PACKAGE}${tag}-patch
+ COMMAND echo "Add CMake-based build system"
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_SOURCE_DIR}/${BP_PACKAGE}/CMakeLists.txt
+ ${EP_BASE}/Source/build_${BP_PACKAGE}${tag}/CMakeLists.txt
+ APPEND
+ )
+ list(APPEND build_target_LIST build_${BP_PACKAGE}${tag})
+ # Restore BP_PATH to original state.
+ set(BP_PATH "${BP_ORIGINAL_NATIVE_PATH}")
+ #message(STATUS "${BP_PACKAGE}${tag} restored original BP_PATH = ${BP_PATH}")
+endforeach(tag IN LISTS tags)
Added: trunk/cmake/build_projects/iwidgets/iwidgets4_case.patch
===================================================================
--- trunk/cmake/build_projects/iwidgets/iwidgets4_case.patch (rev 0)
+++ trunk/cmake/build_projects/iwidgets/iwidgets4_case.patch 2013-11-08 07:52:13 UTC (rev 12670)
@@ -0,0 +1,17 @@
+diff -Naur iwidgets4.0.1_orig/iwidgets.tcl.in iwidgets4.0.1/iwidgets.tcl.in
+--- iwidgets4.0.1_orig/iwidgets.tcl.in 2001-08-07 12:56:47.000000000 -0700
++++ iwidgets4.0.1/iwidgets.tcl.in 2013-11-07 18:57:47.610530341 -0800
+@@ -28,4 +28,5 @@
+ lappend auto_path $iwidgets::library \
+ [file join $iwidgets::library generic] \
+ [file join $iwidgets::library scripts]
++package provide iwidgets $iwidgets::version
+ package provide Iwidgets $iwidgets::version
+diff -Naur iwidgets4.0.1_orig/pkgIndex.tcl.in iwidgets4.0.1/pkgIndex.tcl.in
+--- iwidgets4.0.1_orig/pkgIndex.tcl.in 1999-09-13 17:01:24.000000000 -0700
++++ iwidgets4.0.1/pkgIndex.tcl.in 2013-11-07 18:59:00.941136073 -0800
+@@ -1,3 +1,4 @@
+ # Tcl package index file, version 1.0
+
++package ifneeded iwidgets @VERSION@ [list source [file join $dir iwidgets.tcl]]
+ package ifneeded Iwidgets @VERSION@ [list source [file join $dir iwidgets.tcl]]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|