[Dart] Sweeping Dart changes

Brad King brad.king at kitware.com
Tue, 22 Jan 2002 17:44:36 -0500 (EST)


>   This is true.  One thought that Jim and I had was to supply a
> autoconf style configuration for Dart, that would look up path's and
> such to configure Dart.  Do you have any suggestions for non-CMake
> projects?  One possibility was to use tcl to find these things, as it
> would be relatively cross platform, but then we end up duplicating
> much of what CMake has done.
I have been running a dashboard for Boost, which is not built with
CMake.  My DartConfiguration.tcl file includes Tcl code to search the
system path to find most of the programs.  The result is that the
user-written input file looks like this:

-----------------------------------------------------------
# DartClientConfig.tcl
set DART_ROOT [list /home/kingb/Programs/Nightly/Dart]

set BOOST_ROOT [list /home/kingb/Programs/Nightly/boost]
set ALL_LOCATE_TARGET [list /home/kingb/Programs/Nightly/boost-nightly]
set JAM_COMPILER [list -sTOOLS=gcc]

set SITE [list kitware.com]
set BUILDNAME [list Linux-2.2.18-i686-gcc-2.95.3]
set MOTD ""

source [file join $BOOST_ROOT status DartClientUtility.tcl]
-----------------------------------------------------------

Then the DartClientUtility.tcl sets up everything else.  This will not
work for the non-sourced config file, of course.  However, I'm working on
support for Dart in Boost's build system (Jam).  I plan to have Jam find
everything and write the config file, just like CMake does.

I would suggest writing a configuration script in Tcl that can be used by
projects that want to use it.  It isn't that much work that will be
duplicated.  The procedure below appears in my DartClientUtility.tcl file:

# Procedure to search the path for an executable that may have one of
# several names.
proc FindProgram {names} {
  global tcl_platform
  if {$tcl_platform(platform) == "unix"} { set splitChar ":" } \
  else { set splitChar ";" }   
  set PATH [split $::env(PATH) $splitChar]
  foreach d $PATH {
    foreach n $names {
      set f [file join $d $n]
      if {[file executable $f]} { return $f }
    }
  }
  return "";
}

This lets the later configuration steps find programs like this example of
finding the compression command:

FindProgram {gzip compress zip}

-Brad