Index: include/CMakeLists.txt
===================================================================
--- include/CMakeLists.txt	(revision 54114)
+++ include/CMakeLists.txt	(working copy)
@@ -104,11 +104,11 @@
 	install(FILES ${brlcadinclude_wanted} DESTINATION include/brlcad)
 endif(NOT BRLCAD_BUILD_BENCHMARK_ONLY AND NOT BRLCAD_BUILD_RTSERVER_ONLY)
 
-CMAKEFILES(${brlcadinclude_required})
-CMAKEFILES(${brlcadinclude_wanted})
-CMAKEFILES(${brlcadnoinst_HEADERS})
-CMAKEFILES(${brlcadinclude_misc})
-CMAKEFILES(Makefile.am)
+cmakefiles(${brlcadinclude_required})
+cmakefiles(${brlcadinclude_wanted})
+cmakefiles(${brlcadnoinst_HEADERS})
+cmakefiles(${brlcadinclude_misc})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: db/CMakeLists.txt
===================================================================
--- db/CMakeLists.txt	(revision 54114)
+++ db/CMakeLists.txt	(working copy)
@@ -70,14 +70,14 @@
   endif(BRLCAD_INSTALL_EXAMPLE_GEOMETRY)
   set(BUILT_MODELS "${BUILT_MODELS};${output_file}")
 endforeach(g_model ${G_SAMPLE_MODELS})
-CMAKEFILES(${G_SAMPLE_MODELS})
+cmakefiles(${G_SAMPLE_MODELS})
 
-SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${BUILT_MODELS}")
+set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${BUILT_MODELS}")
 
 if(BRLCAD_INSTALL_EXAMPLE_GEOMETRY)
-   BRLCAD_ADDDATA(terra.dsp db)
+   brlcad_adddata(terra.dsp db)
 endif(BRLCAD_INSTALL_EXAMPLE_GEOMETRY)
-CMAKEFILES(Makefile.am cornell.rt db.php include)
+cmakefiles(Makefile.am cornell.rt db.php include)
 
 # Local Variables:
 # tab-width: 8
Index: src/libfft/CMakeLists.txt
===================================================================
--- src/libfft/CMakeLists.txt	(revision 54114)
+++ src/libfft/CMakeLists.txt	(working copy)
@@ -7,7 +7,7 @@
 # local directories
 set(FFT_LOCAL_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
 
-BRLCAD_LIB_INCLUDE_DIRS(fft FFT_INCLUDE_DIRS FFT_LOCAL_INCLUDE_DIRS)
+brlcad_lib_include_dirs(fft FFT_INCLUDE_DIRS FFT_LOCAL_INCLUDE_DIRS)
 
 add_executable(fftc fftc.c splitditc.c)
 target_link_libraries(fftc ${M_LIBRARY})
@@ -43,13 +43,13 @@
   ${FFT_GEN_SRCS}
   )
 
-BRLCAD_ADDLIB(libfft "${LIBFFT_SRCS}" "${M_LIBRARY}")
-SET_TARGET_PROPERTIES(libfft PROPERTIES LINKER_LANGUAGE C)
-SET_TARGET_PROPERTIES(libfft PROPERTIES VERSION 20.0.1 SOVERSION 20)
+brlcad_addlib(libfft "${LIBFFT_SRCS}" "${M_LIBRARY}")
+set_target_properties(libfft PROPERTIES LINKER_LANGUAGE C)
+set_target_properties(libfft PROPERTIES VERSION 20.0.1 SOVERSION 20)
 
 add_executable(fftest fftest.c)
 target_link_libraries(fftest libfft ${M_LIBRARY})
-CMAKEFILES(Makefile.am)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/tab/CMakeLists.txt
===================================================================
--- src/tab/CMakeLists.txt	(revision 54114)
+++ src/tab/CMakeLists.txt	(working copy)
@@ -5,24 +5,24 @@
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_BINARY_DIR}
   )
-LIST(REMOVE_DUPLICATES HALFTONE_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES HALFTONE_INCLUDE_DIRS)
 include_directories(${HALFTONE_INCLUDE_DIRS})
 
 if(LEX_EXECUTABLE)
-  LEX_TARGET(SS_Scanner script.l
+  lex_target(SS_Scanner script.l
     ${CMAKE_CURRENT_BINARY_DIR}/script.c COMPILE_FLAGS "-l")
-  BRLCAD_ADDEXEC(scriptsort "scriptsort.c;${LEX_SS_Scanner_OUTPUTS}" librt)
-  SET_TARGET_PROPERTIES(scriptsort PROPERTIES COMPILE_FLAGS "-Wno-error")
+  brlcad_addexec(scriptsort "scriptsort.c;${LEX_SS_Scanner_OUTPUTS}" librt)
+  set_target_properties(scriptsort PROPERTIES COMPILE_FLAGS "-Wno-error")
 else(LEX_EXECUTABLE)
-  CMAKEFILES(scriptsort.c)
+  cmakefiles(scriptsort.c)
 endif(LEX_EXECUTABLE)
 
-BRLCAD_ADDEXEC(script-tab script-tab.c "librt;libbn;libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(tabinterp tabinterp.c "librt;libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(tabsub tabsub.c "libbn;libbu;${M_LIBRARY}")
+brlcad_addexec(script-tab script-tab.c "librt;libbn;libbu;${M_LIBRARY}")
+brlcad_addexec(tabinterp tabinterp.c "librt;libbu;${M_LIBRARY}")
+brlcad_addexec(tabsub tabsub.c "libbn;libbu;${M_LIBRARY}")
 
-CMAKEFILES(script.l tokens.h)
-CMAKEFILES(Makefile.am)
+cmakefiles(script.l tokens.h)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/nirt/CMakeLists.txt
===================================================================
--- src/nirt/CMakeLists.txt	(revision 54114)
+++ src/nirt/CMakeLists.txt	(working copy)
@@ -2,7 +2,7 @@
   ${FB_INCLUDE_DIRS}
   ${RT_INCLUDE_DIRS}
   )
-LIST(REMOVE_DUPLICATES NIRT_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES NIRT_INCLUDE_DIRS)
 include_directories(${NIRT_INCLUDE_DIRS})
 
 set(NIRT_SRCS
@@ -17,10 +17,10 @@
   parse_fmt.c
   )
 
-BRLCAD_ADDEXEC(nirt "${NIRT_SRCS}" "librt;libfb;${M_LIBRARY}")
-SET_PROPERTY(TARGET nirt APPEND PROPERTY COMPILE_DEFINITIONS "DFLT_SHELL=\"/bin/sh\"")
+brlcad_addexec(nirt "${NIRT_SRCS}" "librt;libfb;${M_LIBRARY}")
+set_property(TARGET nirt APPEND PROPERTY COMPILE_DEFINITIONS "DFLT_SHELL=\"/bin/sh\"")
 
-BRLCAD_ADDEXEC(showshot showshot.c libbn)
+brlcad_addexec(showshot showshot.c libbn)
 
 set(nirt_sfiles
   sfiles/csv.nrt
@@ -30,14 +30,14 @@
   sfiles/gap1.nrt
   sfiles/gap2.nrt
   )
-BRLCAD_ADDDATA(nirt_sfiles nirt)
+brlcad_adddata(nirt_sfiles nirt)
 
 set(nirt_ignore_files
   nirt.h
   usrfmt.h
   )
-CMAKEFILES(${nirt_ignore_files})
-CMAKEFILES(Makefile.am sfiles/Makefile.am)
+cmakefiles(${nirt_ignore_files})
+cmakefiles(Makefile.am sfiles/Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/bwish/CMakeLists.txt
===================================================================
--- src/bwish/CMakeLists.txt	(revision 54114)
+++ src/bwish/CMakeLists.txt	(working copy)
@@ -28,10 +28,10 @@
   set(btclsh_libs libtclcad libbu libtermio ${ITCL_LIBRARY})
 endif(WIN32)
 # Regardless of OS , make sure all the tclsh files are marked for CMake
-CMAKEFILES(cmd.c input.c main.c tcl.c cadAppInit.c consoleMain.c)
+cmakefiles(cmd.c input.c main.c tcl.c cadAppInit.c consoleMain.c)
 
 # Now, define the btclsh target
-BRLCAD_ADDEXEC(btclsh "${btclsh_srcs}" "${btclsh_libs}")
+brlcad_addexec(btclsh "${btclsh_srcs}" "${btclsh_libs}")
 
 # If we have Tk enabled, we want bwish too
 if(BRLCAD_ENABLE_TK)
@@ -44,12 +44,12 @@
   else(WIN32)
     # If we're not on Windows, bwish is just btclsh with more libraries and
     # an extra compilation definition
-    BRLCAD_ADDEXEC(bwish "${btclsh_srcs}" "libtclcad;libdm;libtermio;${X11_LIBRARIES};${X11_Xi_LIB};libdm;${ITCL_LIBRARY};${ITK_LIBRARY}")
+    brlcad_addexec(bwish "${btclsh_srcs}" "libtclcad;libdm;libtermio;${X11_LIBRARIES};${X11_Xi_LIB};libdm;${ITCL_LIBRARY};${ITK_LIBRARY}")
   endif(WIN32)
   # Both platform cases get the compilation flag
   set_target_properties(bwish PROPERTIES COMPILE_DEFINITIONS "BWISH=1")
 endif(BRLCAD_ENABLE_TK)
-CMAKEFILES(unixMain.c winMain.c cmd.c input.c main.c tcl.c)
+cmakefiles(unixMain.c winMain.c cmd.c input.c main.c tcl.c)
 
 if(ITCL_LIBRARY MATCHES "^itcl$")
   add_dependencies(btclsh itcl)
@@ -59,7 +59,7 @@
   add_dependencies(bwish itcl itk)
 endif(ITK_LIBRARY MATCHES "^itk$" AND BRLCAD_ENABLE_TK)
 
-CMAKEFILES(Makefile.am)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/util/CMakeLists.txt
===================================================================
--- src/util/CMakeLists.txt	(revision 54114)
+++ src/util/CMakeLists.txt	(working copy)
@@ -17,7 +17,7 @@
   )
 
 set(UTIL_ALL_INCLUDE_DIRS ${UTIL_INCLUDE_DIRS} ${UTIL_LOCAL_INCLUDE_DIRS})
-BRLCAD_SORT_INCLUDE_DIRS(UTIL_ALL_INCLUDE_DIRS)
+brlcad_sort_include_dirs(UTIL_ALL_INCLUDE_DIRS)
 include_directories(${UTIL_ALL_INCLUDE_DIRS})
 
 if(MSVC)
@@ -29,155 +29,155 @@
 
 
 if(BRLCAD_ENABLE_X11)
-  BRLCAD_ADDEXEC(pl-X pl-X.c "libdm;libbu")
+  brlcad_addexec(pl-X pl-X.c "libdm;libbu")
   if(BRLCAD_ENABLE_TK)
-    BRLCAD_ADDEXEC(pl-dm pl-dm.c "libdm;libbu;${M_LIBRARY}")
-    BRLCAD_ADDEXEC(bombardier bombardier.c "libtclcad;libbu")
+    brlcad_addexec(pl-dm pl-dm.c "libdm;libbu;${M_LIBRARY}")
+    brlcad_addexec(bombardier bombardier.c "libtclcad;libbu")
   endif(BRLCAD_ENABLE_TK)
 endif(BRLCAD_ENABLE_X11)
 
-BRLCAD_ADDDATA(pl-dm.c sample_applications)
+brlcad_adddata(pl-dm.c sample_applications)
 
 if(LIBPC_DIR)
-  BRLCAD_ADDEXEC(pc_test pc_test.c "libwdb;libpc" NO_INSTALL)
+  brlcad_addexec(pc_test pc_test.c "libwdb;libpc" NO_INSTALL)
 else(LIBPC_DIR)
-  CMAKEFILES(pc_test.c)
+  cmakefiles(pc_test.c)
 endif(LIBPC_DIR)
 
-BRLCAD_ADDEXEC(alias-pix alias-pix.c libbu)
-BRLCAD_ADDEXEC(ap-pix ap-pix.c libbu)
-BRLCAD_ADDEXEC(asc-pl asc-pl.c "libbn;libbu")
-BRLCAD_ADDEXEC(azel azel.c "libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(bary bary.c libbu)
-BRLCAD_ADDEXEC(buffer buffer.c libbu)
-BRLCAD_ADDEXEC(bw-a bw-a.c "libfb;libbu")
-BRLCAD_ADDEXEC(bw-imp bw-imp.c libbu)
-BRLCAD_ADDEXEC(bw-pix bw-pix.c libbu)
-BRLCAD_ADDEXEC(bw-png bw-png.c "libfb;libbu;${PNG_LIBRARY}")
-BRLCAD_ADDEXEC(bw-ps bw-ps.c libbu)
-BRLCAD_ADDEXEC(bw-rle "bw-rle.c;rle_args.c" "libbu;libsysv;${UTAHRLE_LIBRARY}")
-BRLCAD_ADDEXEC(bw3-pix bw3-pix.c libbu)
-BRLCAD_ADDEXEC(bwcrop bwcrop.c libbu)
-BRLCAD_ADDEXEC(bwdiff bwdiff.c libbu)
-BRLCAD_ADDEXEC(bwfilter bwfilter.c libbu)
-BRLCAD_ADDEXEC(bwhist bwhist.c libfb)
-BRLCAD_ADDEXEC(bwhisteq bwhisteq.c libbu)
-BRLCAD_ADDEXEC(bwmod bwmod.c "libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(bwrect bwrect.c libbu)
-BRLCAD_ADDEXEC(bwrot bwrot.c "libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(bwscale bwscale.c libbu)
-BRLCAD_ADDEXEC(bwshrink bwshrink.c libbu)
-BRLCAD_ADDEXEC(bwstat bwstat.c "libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(bwthresh bwthresh.c libbu)
-BRLCAD_ADDEXEC(cv cv.c libbu)
+brlcad_addexec(alias-pix alias-pix.c libbu)
+brlcad_addexec(ap-pix ap-pix.c libbu)
+brlcad_addexec(asc-pl asc-pl.c "libbn;libbu")
+brlcad_addexec(azel azel.c "libbu;${M_LIBRARY}")
+brlcad_addexec(bary bary.c libbu)
+brlcad_addexec(buffer buffer.c libbu)
+brlcad_addexec(bw-a bw-a.c "libfb;libbu")
+brlcad_addexec(bw-imp bw-imp.c libbu)
+brlcad_addexec(bw-pix bw-pix.c libbu)
+brlcad_addexec(bw-png bw-png.c "libfb;libbu;${PNG_LIBRARY}")
+brlcad_addexec(bw-ps bw-ps.c libbu)
+brlcad_addexec(bw-rle "bw-rle.c;rle_args.c" "libbu;libsysv;${UTAHRLE_LIBRARY}")
+brlcad_addexec(bw3-pix bw3-pix.c libbu)
+brlcad_addexec(bwcrop bwcrop.c libbu)
+brlcad_addexec(bwdiff bwdiff.c libbu)
+brlcad_addexec(bwfilter bwfilter.c libbu)
+brlcad_addexec(bwhist bwhist.c libfb)
+brlcad_addexec(bwhisteq bwhisteq.c libbu)
+brlcad_addexec(bwmod bwmod.c "libbu;${M_LIBRARY}")
+brlcad_addexec(bwrect bwrect.c libbu)
+brlcad_addexec(bwrot bwrot.c "libbu;${M_LIBRARY}")
+brlcad_addexec(bwscale bwscale.c libbu)
+brlcad_addexec(bwshrink bwshrink.c libbu)
+brlcad_addexec(bwstat bwstat.c "libbu;${M_LIBRARY}")
+brlcad_addexec(bwthresh bwthresh.c libbu)
+brlcad_addexec(cv cv.c libbu)
 # FIXME dbcp is a "copy program for UNIX" - will need some porting
 # work for Windows
 if(NOT WIN32)
-  BRLCAD_ADDEXEC(dbcp dbcp.c libbu)
+  brlcad_addexec(dbcp dbcp.c libbu)
 endif(NOT WIN32)
-BRLCAD_ADDEXEC(decimate decimate.c libbu)
-BRLCAD_ADDEXEC(double-asc double-asc.c "libfb;libbu")
-BRLCAD_ADDEXEC(dpix-pix dpix-pix.c libbu)
-BRLCAD_ADDEXEC(dsp_add dsp_add.c libbu)
+brlcad_addexec(decimate decimate.c libbu)
+brlcad_addexec(double-asc double-asc.c "libfb;libbu")
+brlcad_addexec(dpix-pix dpix-pix.c libbu)
+brlcad_addexec(dsp_add dsp_add.c libbu)
 # Not fixing these for Windows - they're on their way out (deprecated)
 if(NOT WIN32)
-  BRLCAD_ADDEXEC(dunncolor "dunncolor.c;dunncomm.c" libbu)
-  BRLCAD_ADDEXEC(dunnsnap "dunnsnap.c;dunncomm.c" "libfb;libbu")
+  brlcad_addexec(dunncolor "dunncolor.c;dunncomm.c" libbu)
+  brlcad_addexec(dunnsnap "dunnsnap.c;dunncomm.c" "libfb;libbu")
 endif(NOT WIN32)
-BRLCAD_ADDEXEC(fix_polysolids fix_polysolids.c "librt;libbu")
-BRLCAD_ADDEXEC(gencolor gencolor.c libbu)
-BRLCAD_ADDEXEC(hex hex.c libbu)
-BRLCAD_ADDEXEC(imgdims imgdims.c "libfb;libbu")
-BRLCAD_ADDEXEC(loop loop.c libbu)
-BRLCAD_ADDEXEC(lowp lowp.c libbu)
-BRLCAD_ADDEXEC(mac-pix mac-pix.c libbu)
-BRLCAD_ADDEXEC(random random.c "libbn;libbu")
-BRLCAD_ADDEXEC(orle-pix orle-pix.c "libfb;liborle;libbu")
-BRLCAD_ADDEXEC(pix-alias pix-alias.c libbu)
-BRLCAD_ADDEXEC(pix-bw pix-bw.c libbu)
-BRLCAD_ADDEXEC(pix-bw3 pix-bw3.c libbu)
-BRLCAD_ADDEXEC(pix-orle pix-orle.c "libfb;liborle;libbu")
-BRLCAD_ADDEXEC(pix-png pix-png.c "libfb;libbu;${PNG_LIBRARY}")
-BRLCAD_ADDEXEC(pix-ppm pix-ppm.c "libfb;libbu")
-BRLCAD_ADDEXEC(pix-ps pix-ps.c libbu)
-BRLCAD_ADDEXEC(pix-rle "pix-rle.c;rle_args.c" "libbu;libsysv;${UTAHRLE_LIBRARY}")
-BRLCAD_ADDEXEC(pix-spm pix-spm.c libbn)
-BRLCAD_ADDEXEC(pix-sun pix-sun.c libbu)
-BRLCAD_ADDEXEC(pix-yuv pix-yuv.c "libfb;libbn;libbu")
-BRLCAD_ADDEXEC(pix3filter pix3filter.c libbu)
-BRLCAD_ADDEXEC(pixbackgnd pixbackgnd.c libbu)
-BRLCAD_ADDEXEC(pixbgstrip pixbgstrip.c "libfb;libbu")
-BRLCAD_ADDEXEC(pixblend pixblend.c libbu)
-BRLCAD_ADDEXEC(pixborder pixborder.c "libfb;libbn;libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(pixbustup pixbustup.c libbu)
-BRLCAD_ADDEXEC(pixclump pixclump.c "libbn;libbu")
-BRLCAD_ADDEXEC(pixcolors pixcolors.c libbu)
-BRLCAD_ADDEXEC(pixcount pixcount.c libbu)
-BRLCAD_ADDEXEC(pixcut pixcut.c "libfb;libbu")
-BRLCAD_ADDEXEC(pixdiff pixdiff.c libbu)
-BRLCAD_ADDEXEC(pixdsplit pixdsplit.c libbu)
-BRLCAD_ADDEXEC(pixelswap pixelswap.c libbu)
-BRLCAD_ADDEXEC(pixembed pixembed.c libbu)
-BRLCAD_ADDEXEC(pixfade pixfade.c "libbn;libbu")
-BRLCAD_ADDEXEC(pixfields pixfields.c libbu)
-BRLCAD_ADDEXEC(pixfieldsep pixfieldsep.c libbu)
-BRLCAD_ADDEXEC(pixfilter pixfilter.c libbu)
-BRLCAD_ADDEXEC(pixhalve pixhalve.c "libfb;libbu")
-BRLCAD_ADDEXEC(pixhist pixhist.c "libfb;libbu")
-BRLCAD_ADDEXEC(pixhist3d pixhist3d.c "libfb;libbu")
-BRLCAD_ADDEXEC(pixhist3d-pl pixhist3d-pl.c "libbn;libbu")
-BRLCAD_ADDEXEC(pixinterp2x pixinterp2x.c libbu)
-BRLCAD_ADDEXEC(pixmatte pixmatte.c libbu)
-BRLCAD_ADDEXEC(pixmerge pixmerge.c libbu)
-BRLCAD_ADDEXEC(pixmorph pixmorph.c "libfb;libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(pixpaste pixpaste.c "libfb;libbu")
-BRLCAD_ADDEXEC(pixrect pixrect.c libbu)
-BRLCAD_ADDEXEC(pixrot pixrot.c libbu)
-BRLCAD_ADDEXEC(pixsaturate pixsaturate.c libbu)
-BRLCAD_ADDEXEC(pixscale pixscale.c libbu)
-BRLCAD_ADDEXEC(pixshrink pixshrink.c libbu)
-BRLCAD_ADDEXEC(pixstat pixstat.c "libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(pixsubst pixsubst.c libbu)
-BRLCAD_ADDEXEC(pixtile pixtile.c libbu)
-BRLCAD_ADDEXEC(pixuntile pixuntile.c libbu)
-BRLCAD_ADDEXEC(pl-asc pl-asc.c libbu)
-BRLCAD_ADDEXEC(pl-hpgl pl-hpgl.c libbu)
-BRLCAD_ADDEXEC(pl-pl pl-pl.c libbu)
-BRLCAD_ADDEXEC(pl-ps pl-ps.c libbu)
-BRLCAD_ADDEXEC(pl-tek pl-tek.c libbu)
-BRLCAD_ADDEXEC(plcolor plcolor.c libbn)
-BRLCAD_ADDEXEC(pldebug pldebug.c libbu)
-SET_TARGET_PROPERTIES(pldebug PROPERTIES LINKER_LANGUAGE C)
-BRLCAD_ADDEXEC(plgetframe plgetframe.c libbu)
-BRLCAD_ADDEXEC(plline2 plline2.c "libbn;libbu")
-BRLCAD_ADDEXEC(plrot plrot.c "libbn;libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(plstat plstat.c libbu)
-BRLCAD_ADDEXEC(png-bw png-bw.c "libbn;libbu;${PNG_LIBRARY}")
-BRLCAD_ADDEXEC(png-pix png-pix.c "libbn;libbu;${PNG_LIBRARY}")
-BRLCAD_ADDEXEC(png_info png_info.c "libbn;libbu;${PNG_LIBRARY}")
-BRLCAD_ADDEXEC(rle-pix rle-pix.c "libbu;libsysv;${UTAHRLE_LIBRARY}")
+brlcad_addexec(fix_polysolids fix_polysolids.c "librt;libbu")
+brlcad_addexec(gencolor gencolor.c libbu)
+brlcad_addexec(hex hex.c libbu)
+brlcad_addexec(imgdims imgdims.c "libfb;libbu")
+brlcad_addexec(loop loop.c libbu)
+brlcad_addexec(lowp lowp.c libbu)
+brlcad_addexec(mac-pix mac-pix.c libbu)
+brlcad_addexec(random random.c "libbn;libbu")
+brlcad_addexec(orle-pix orle-pix.c "libfb;liborle;libbu")
+brlcad_addexec(pix-alias pix-alias.c libbu)
+brlcad_addexec(pix-bw pix-bw.c libbu)
+brlcad_addexec(pix-bw3 pix-bw3.c libbu)
+brlcad_addexec(pix-orle pix-orle.c "libfb;liborle;libbu")
+brlcad_addexec(pix-png pix-png.c "libfb;libbu;${PNG_LIBRARY}")
+brlcad_addexec(pix-ppm pix-ppm.c "libfb;libbu")
+brlcad_addexec(pix-ps pix-ps.c libbu)
+brlcad_addexec(pix-rle "pix-rle.c;rle_args.c" "libbu;libsysv;${UTAHRLE_LIBRARY}")
+brlcad_addexec(pix-spm pix-spm.c libbn)
+brlcad_addexec(pix-sun pix-sun.c libbu)
+brlcad_addexec(pix-yuv pix-yuv.c "libfb;libbn;libbu")
+brlcad_addexec(pix3filter pix3filter.c libbu)
+brlcad_addexec(pixbackgnd pixbackgnd.c libbu)
+brlcad_addexec(pixbgstrip pixbgstrip.c "libfb;libbu")
+brlcad_addexec(pixblend pixblend.c libbu)
+brlcad_addexec(pixborder pixborder.c "libfb;libbn;libbu;${M_LIBRARY}")
+brlcad_addexec(pixbustup pixbustup.c libbu)
+brlcad_addexec(pixclump pixclump.c "libbn;libbu")
+brlcad_addexec(pixcolors pixcolors.c libbu)
+brlcad_addexec(pixcount pixcount.c libbu)
+brlcad_addexec(pixcut pixcut.c "libfb;libbu")
+brlcad_addexec(pixdiff pixdiff.c libbu)
+brlcad_addexec(pixdsplit pixdsplit.c libbu)
+brlcad_addexec(pixelswap pixelswap.c libbu)
+brlcad_addexec(pixembed pixembed.c libbu)
+brlcad_addexec(pixfade pixfade.c "libbn;libbu")
+brlcad_addexec(pixfields pixfields.c libbu)
+brlcad_addexec(pixfieldsep pixfieldsep.c libbu)
+brlcad_addexec(pixfilter pixfilter.c libbu)
+brlcad_addexec(pixhalve pixhalve.c "libfb;libbu")
+brlcad_addexec(pixhist pixhist.c "libfb;libbu")
+brlcad_addexec(pixhist3d pixhist3d.c "libfb;libbu")
+brlcad_addexec(pixhist3d-pl pixhist3d-pl.c "libbn;libbu")
+brlcad_addexec(pixinterp2x pixinterp2x.c libbu)
+brlcad_addexec(pixmatte pixmatte.c libbu)
+brlcad_addexec(pixmerge pixmerge.c libbu)
+brlcad_addexec(pixmorph pixmorph.c "libfb;libbu;${M_LIBRARY}")
+brlcad_addexec(pixpaste pixpaste.c "libfb;libbu")
+brlcad_addexec(pixrect pixrect.c libbu)
+brlcad_addexec(pixrot pixrot.c libbu)
+brlcad_addexec(pixsaturate pixsaturate.c libbu)
+brlcad_addexec(pixscale pixscale.c libbu)
+brlcad_addexec(pixshrink pixshrink.c libbu)
+brlcad_addexec(pixstat pixstat.c "libbu;${M_LIBRARY}")
+brlcad_addexec(pixsubst pixsubst.c libbu)
+brlcad_addexec(pixtile pixtile.c libbu)
+brlcad_addexec(pixuntile pixuntile.c libbu)
+brlcad_addexec(pl-asc pl-asc.c libbu)
+brlcad_addexec(pl-hpgl pl-hpgl.c libbu)
+brlcad_addexec(pl-pl pl-pl.c libbu)
+brlcad_addexec(pl-ps pl-ps.c libbu)
+brlcad_addexec(pl-tek pl-tek.c libbu)
+brlcad_addexec(plcolor plcolor.c libbn)
+brlcad_addexec(pldebug pldebug.c libbu)
+set_target_properties(pldebug PROPERTIES LINKER_LANGUAGE C)
+brlcad_addexec(plgetframe plgetframe.c libbu)
+brlcad_addexec(plline2 plline2.c "libbn;libbu")
+brlcad_addexec(plrot plrot.c "libbn;libbu;${M_LIBRARY}")
+brlcad_addexec(plstat plstat.c libbu)
+brlcad_addexec(png-bw png-bw.c "libbn;libbu;${PNG_LIBRARY}")
+brlcad_addexec(png-pix png-pix.c "libbn;libbu;${PNG_LIBRARY}")
+brlcad_addexec(png_info png_info.c "libbn;libbu;${PNG_LIBRARY}")
+brlcad_addexec(rle-pix rle-pix.c "libbu;libsysv;${UTAHRLE_LIBRARY}")
 if(CPP_DLL_DEFINES)
-  SET_PROPERTY(TARGET rle-pix APPEND PROPERTY COMPILE_DEFINITIONS "RLE_DLL_IMPORTS")
+  set_property(TARGET rle-pix APPEND PROPERTY COMPILE_DEFINITIONS "RLE_DLL_IMPORTS")
 endif(CPP_DLL_DEFINES)
-BRLCAD_ADDEXEC(sun-pix sun-pix.c libbu)
-BRLCAD_ADDEXEC(terrain terrain.c "libbn;libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(texturescale texturescale.c "libfb;libbn;libbu;${M_LIBRARY}")
+brlcad_addexec(sun-pix sun-pix.c libbu)
+brlcad_addexec(terrain terrain.c "libbn;libbu;${M_LIBRARY}")
+brlcad_addexec(texturescale texturescale.c "libfb;libbn;libbu;${M_LIBRARY}")
 #FIXME - Need to look at pcattcp port to Windows - ttcp should be
 #maintained and ported
 if(NOT WIN32)
-  BRLCAD_ADDEXEC(ttcp ttcp.c "${SOCKET_LIBRARY};${NSL_LIBRARY};${NETWORK_LIBRARY}")
+  brlcad_addexec(ttcp ttcp.c "${SOCKET_LIBRARY};${NSL_LIBRARY};${NETWORK_LIBRARY}")
 endif(NOT WIN32)
-BRLCAD_ADDEXEC(wavelet wavelet.c "libfb;libbn;libbu")
-BRLCAD_ADDEXEC(xyz-pl xyz-pl.c "libbn;libbu")
-BRLCAD_ADDEXEC(yuv-pix yuv-pix.c "libfb;libbn;libbu")
+brlcad_addexec(wavelet wavelet.c "libfb;libbn;libbu")
+brlcad_addexec(xyz-pl xyz-pl.c "libbn;libbu")
+brlcad_addexec(yuv-pix yuv-pix.c "libfb;libbn;libbu")
 
 install(PROGRAMS morphedit.tcl DESTINATION bin)
 
-BRLCAD_ADDEXEC(roots_example roots_example.c "libbu;librt" NO_INSTALL)
-BRLCAD_ADDDATA(roots_example.c sample_applications)
+brlcad_addexec(roots_example roots_example.c "libbu;librt" NO_INSTALL)
+brlcad_adddata(roots_example.c sample_applications)
 
-CMAKEFILES(bombardier.h rle_args.h morphedit.tcl pldebug.c)
-CMAKEFILES(Makefile.am)
+cmakefiles(bombardier.h rle_args.h morphedit.tcl pldebug.c)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/libfb/CMakeLists.txt
===================================================================
--- src/libfb/CMakeLists.txt	(revision 54114)
+++ src/libfb/CMakeLists.txt	(working copy)
@@ -9,7 +9,7 @@
   ${TCL_INCLUDE_DIRS}
   ${TK_INCLUDE_PATH}
   )
-BRLCAD_LIB_INCLUDE_DIRS(fb FB_INCLUDE_DIRS "")
+brlcad_lib_include_dirs(fb FB_INCLUDE_DIRS "")
 
 set(LINKLIBS "")
 if(BRLCAD_ENABLE_X11 AND X11_FOUND)
@@ -59,7 +59,7 @@
 # Unfortunately, on Mac OS X the OpenGL headers are not C90
 # compliant - anything pulling them in needs the C99 flag
 get_property(libfb_C_FLAGS GLOBAL PROPERTY libfb_C_FLAGS)
-LIST(APPEND libfb_C_FLAGS "${C99_FLAG}")
+list(APPEND libfb_C_FLAGS "${C99_FLAG}")
 set_property(GLOBAL PROPERTY libfb_C_FLAGS "${libfb_C_FLAGS}")
 
 add_definitions(
@@ -70,10 +70,10 @@
   ${XOPEN_DEFINE}
   )
 
-BRLCAD_ADDLIB(libfb "${LIBFB_SOURCES}" "libbu;libpkg;${LINKLIBS}")
-SET_TARGET_PROPERTIES(libfb PROPERTIES VERSION 20.0.1 SOVERSION 20)
+brlcad_addlib(libfb "${LIBFB_SOURCES}" "libbu;libpkg;${LINKLIBS}")
+set_target_properties(libfb PROPERTIES VERSION 20.0.1 SOVERSION 20)
 if(BRLCAD_BUILD_LOCAL_TK AND BRLCAD_ENABLE_TK)
-  ADD_DEPENDENCIES(libfb tk)
+  add_dependencies(libfb tk)
 endif(BRLCAD_BUILD_LOCAL_TK AND BRLCAD_ENABLE_TK)
 
 set(libfb_ignore_files
@@ -87,8 +87,8 @@
   if_wgl.c
   if_tk.c
   )
-CMAKEFILES(${libfb_ignore_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${libfb_ignore_files})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/libmultispectral/CMakeLists.txt
===================================================================
--- src/libmultispectral/CMakeLists.txt	(revision 54114)
+++ src/libmultispectral/CMakeLists.txt	(working copy)
@@ -19,15 +19,15 @@
   ${RT_INCLUDE_DIRS}
   ${OPTICAL_INCLUDE_DIRS}
   )
-BRLCAD_LIB_INCLUDE_DIRS(multispectral MULTISPECTRAL_INCLUDE_DIRS "")
+brlcad_lib_include_dirs(multispectral MULTISPECTRAL_INCLUDE_DIRS "")
 
 add_definitions(
   -DRT_MULTISPECTRAL
   )
 
-BRLCAD_ADDLIB(libmultispectral "${LIBMULTISPECTRAL_SRCS}" "librt;libbn;libbu")
-SET_TARGET_PROPERTIES(libmultispectral PROPERTIES VERSION 20.0.1 SOVERSION 20)
-CMAKEFILES(Makefile.am)
+brlcad_addlib(libmultispectral "${LIBMULTISPECTRAL_SRCS}" "librt;libbn;libbu")
+set_target_properties(libmultispectral PROPERTIES VERSION 20.0.1 SOVERSION 20)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/libnurbs/CMakeLists.txt
===================================================================
--- src/libnurbs/CMakeLists.txt	(revision 54114)
+++ src/libnurbs/CMakeLists.txt	(working copy)
@@ -16,7 +16,7 @@
   ${BRLCAD_SOURCE_DIR}/src/other/Eigen
   )
 
-BRLCAD_LIB_INCLUDE_DIRS(nurbs NURBS_INCLUDE_DIRS NURBS_LOCAL_INCLUDE_DIRS)
+brlcad_lib_include_dirs(nurbs NURBS_INCLUDE_DIRS NURBS_LOCAL_INCLUDE_DIRS)
 
 set(LIBNURBS_SOURCES
   opennurbs_ext.cpp
@@ -29,8 +29,8 @@
   opennurbs_fit.cpp
   PullbackCurve.h
   )
-CMAKEFILES(${libnurbs_ignored_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${libnurbs_ignored_files})
+cmakefiles(Makefile.am)
 
 # Initialize libnurbs_DEFINES in case of reconfiguration
 set(libnurbs_DEFINES "")
@@ -43,7 +43,7 @@
 endif(CPP_DLL_DEFINES)
 set_property(GLOBAL PROPERTY libnurbs_DEFINES "${libnurbs_DEFINES}")
 
-BRLCAD_ADDLIB(libnurbs "${LIBNURBS_SOURCES}" "libbn;libbu;${OPENNURBS_LIBRARY};${ZLIB_LIBRARY};${WINSOCK_LIB};${RPCRT_LIB};${STDCXX_LIBRARIES}" NOSTRICTCXX)
+brlcad_addlib(libnurbs "${LIBNURBS_SOURCES}" "libbn;libbu;${OPENNURBS_LIBRARY};${ZLIB_LIBRARY};${WINSOCK_LIB};${RPCRT_LIB};${STDCXX_LIBRARIES}" NOSTRICTCXX)
 
 if(BUILD_STATIC_LIBS)
   set_property(TARGET libnurbs-static APPEND PROPERTY COMPILE_DEFINITIONS "OBJ_BREP=1")
@@ -52,7 +52,7 @@
 set_target_properties(libnurbs PROPERTIES VERSION 20.0.1 SOVERSION 20)
 if(CPP_DLL_DEFINES)
   if(BRLCAD_BUILD_STATIC_LIBS AND BRLCAD_ENABLE_BRLCAD_LIBRARY)
-    SET_PROPERTY(TARGET libnurbs-static APPEND PROPERTY COMPILE_DEFINITIONS "ON_DLL_IMPORTS")
+    set_property(TARGET libnurbs-static APPEND PROPERTY COMPILE_DEFINITIONS "ON_DLL_IMPORTS")
   endif(BRLCAD_BUILD_STATIC_LIBS AND BRLCAD_ENABLE_BRLCAD_LIBRARY)
 endif(CPP_DLL_DEFINES)
 
Index: src/libtclcad/CMakeLists.txt
===================================================================
--- src/libtclcad/CMakeLists.txt	(revision 54114)
+++ src/libtclcad/CMakeLists.txt	(working copy)
@@ -15,7 +15,7 @@
   ${PNG_INCLUDE_DIR}
   )
 
-BRLCAD_LIB_INCLUDE_DIRS(tclcad TCLCAD_INCLUDE_DIRS TCLCAD_LOCAL_INCLUDE_DIRS)
+brlcad_lib_include_dirs(tclcad TCLCAD_INCLUDE_DIRS TCLCAD_LOCAL_INCLUDE_DIRS)
 
 add_definitions(
   ${C99_FLAG}
@@ -30,11 +30,11 @@
   tkImgFmtPIX.c
   cmdhist_obj.c
   )
-BRLCAD_ADDLIB(libtclcad "${LIBTCLCAD_SRCS}" "libged;libdm;${TCLCAD_XLIBS};${X11_Xi_LIB}")
-SET_TARGET_PROPERTIES(libtclcad PROPERTIES VERSION 20.0.1 SOVERSION 20)
+brlcad_addlib(libtclcad "${LIBTCLCAD_SRCS}" "libged;libdm;${TCLCAD_XLIBS};${X11_Xi_LIB}")
+set_target_properties(libtclcad PROPERTIES VERSION 20.0.1 SOVERSION 20)
 set(tclcad_ignore_files tclcad_private.h)
-CMAKEFILES(${tclcad_ignore_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${tclcad_ignore_files})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/sig/CMakeLists.txt
===================================================================
--- src/sig/CMakeLists.txt	(revision 54114)
+++ src/sig/CMakeLists.txt	(working copy)
@@ -2,46 +2,46 @@
   ${BU_INCLUDE_DIRS}
   ${FFT_INCLUDE_DIRS}
   )
-LIST(REMOVE_DUPLICATES SIG_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES SIG_INCLUDE_DIRS)
 include_directories(${SIG_INCLUDE_DIRS})
 
-BRLCAD_ADDEXEC(a-d a-d.c libbu)
-BRLCAD_ADDEXEC(bw-d bw-d.c libbu)
-BRLCAD_ADDEXEC(c-d c-d.c "libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(d-a d-a.c libbu)
-BRLCAD_ADDEXEC(d-bw d-bw.c libbu)
-BRLCAD_ADDEXEC(d-f d-f.c libbu)
-BRLCAD_ADDEXEC(d-i d-i.c libbu)
-BRLCAD_ADDEXEC(d-u d-u.c libbu)
-BRLCAD_ADDEXEC(d2-c d2-c.c libbu)
-BRLCAD_ADDEXEC(damdf damdf.c libbu)
-BRLCAD_ADDEXEC(dauto dauto.c libbu)
-BRLCAD_ADDEXEC(dauto2 dauto2.c libbu)
-BRLCAD_ADDEXEC(dconv dconv.c "libbu;libfft")
-BRLCAD_ADDEXEC(ddisp ddisp.c libfb)
-BRLCAD_ADDEXEC(dfft "dfft.c;interp.c;butter.c" "libbu;libfft")
-BRLCAD_ADDEXEC(dmod dmod.c "libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(dpeak dpeak.c libbu)
-BRLCAD_ADDEXEC(dsel dsel.c libbu)
-BRLCAD_ADDEXEC(dstats dstats.c "libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(dwin "dwin.c;coswin.c;hamwin.c" "libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(f-d f-d.c libbu)
-BRLCAD_ADDEXEC(f-i f-i.c libbu)
-BRLCAD_ADDEXEC(fhor fhor.c libfb)
-BRLCAD_ADDEXEC(i-a i-a.c libbu)
-BRLCAD_ADDEXEC(i-d i-d.c libbu)
-BRLCAD_ADDEXEC(i-f i-f.c libbu)
-BRLCAD_ADDEXEC(ihist ihist.c libbu)
-BRLCAD_ADDEXEC(imod imod.c "libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(istats istats.c "libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(smod smod.c "libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(u-a u-a.c libbu)
-BRLCAD_ADDEXEC(u-bw u-bw.c libbu)
-BRLCAD_ADDEXEC(u-d u-d.c libbu)
-BRLCAD_ADDEXEC(u-f u-f.c libbu)
-BRLCAD_ADDEXEC(umod umod.c "libbu;${M_LIBRARY}")
-BRLCAD_ADDEXEC(ustats ustats.c "libbu;${M_LIBRARY}")
-CMAKEFILES(Makefile.am)
+brlcad_addexec(a-d a-d.c libbu)
+brlcad_addexec(bw-d bw-d.c libbu)
+brlcad_addexec(c-d c-d.c "libbu;${M_LIBRARY}")
+brlcad_addexec(d-a d-a.c libbu)
+brlcad_addexec(d-bw d-bw.c libbu)
+brlcad_addexec(d-f d-f.c libbu)
+brlcad_addexec(d-i d-i.c libbu)
+brlcad_addexec(d-u d-u.c libbu)
+brlcad_addexec(d2-c d2-c.c libbu)
+brlcad_addexec(damdf damdf.c libbu)
+brlcad_addexec(dauto dauto.c libbu)
+brlcad_addexec(dauto2 dauto2.c libbu)
+brlcad_addexec(dconv dconv.c "libbu;libfft")
+brlcad_addexec(ddisp ddisp.c libfb)
+brlcad_addexec(dfft "dfft.c;interp.c;butter.c" "libbu;libfft")
+brlcad_addexec(dmod dmod.c "libbu;${M_LIBRARY}")
+brlcad_addexec(dpeak dpeak.c libbu)
+brlcad_addexec(dsel dsel.c libbu)
+brlcad_addexec(dstats dstats.c "libbu;${M_LIBRARY}")
+brlcad_addexec(dwin "dwin.c;coswin.c;hamwin.c" "libbu;${M_LIBRARY}")
+brlcad_addexec(f-d f-d.c libbu)
+brlcad_addexec(f-i f-i.c libbu)
+brlcad_addexec(fhor fhor.c libfb)
+brlcad_addexec(i-a i-a.c libbu)
+brlcad_addexec(i-d i-d.c libbu)
+brlcad_addexec(i-f i-f.c libbu)
+brlcad_addexec(ihist ihist.c libbu)
+brlcad_addexec(imod imod.c "libbu;${M_LIBRARY}")
+brlcad_addexec(istats istats.c "libbu;${M_LIBRARY}")
+brlcad_addexec(smod smod.c "libbu;${M_LIBRARY}")
+brlcad_addexec(u-a u-a.c libbu)
+brlcad_addexec(u-bw u-bw.c libbu)
+brlcad_addexec(u-d u-d.c libbu)
+brlcad_addexec(u-f u-f.c libbu)
+brlcad_addexec(umod umod.c "libbu;${M_LIBRARY}")
+brlcad_addexec(ustats ustats.c "libbu;${M_LIBRARY}")
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/libged/CMakeLists.txt
===================================================================
--- src/libged/CMakeLists.txt	(revision 54114)
+++ src/libged/CMakeLists.txt	(working copy)
@@ -317,14 +317,14 @@
   ${LIBGED_CMD_INCLUDE_DIRS}
   )
 
-BRLCAD_LIB_INCLUDE_DIRS(ged GED_INCLUDE_DIRS GED_LOCAL_INCLUDE_DIRS)
+brlcad_lib_include_dirs(ged GED_INCLUDE_DIRS GED_LOCAL_INCLUDE_DIRS)
 
 if(CPP_DLL_DEFINES)
   add_definitions(-DCLIPPER_DLL_IMPORTS)
 endif(CPP_DLL_DEFINES)
 
-BRLCAD_ADDLIB(libged "${LIBGED_SOURCES}" "libwdb;librt;libfb;libbu;libicv;libanalyze;${LIBGED_CMD_LIBS_LIST};${REGEX_LIBRARY};${WINSOCK_LIB};${CLIPPER_LIBRARY};${M_LIBRARY}" ${NOSTRICTCXX_SETTING})
-SET_TARGET_PROPERTIES(libged PROPERTIES VERSION 20.0.1 SOVERSION 20)
+brlcad_addlib(libged "${LIBGED_SOURCES}" "libwdb;librt;libfb;libbu;libicv;libanalyze;${LIBGED_CMD_LIBS_LIST};${REGEX_LIBRARY};${WINSOCK_LIB};${CLIPPER_LIBRARY};${M_LIBRARY}" ${NOSTRICTCXX_SETTING})
+set_target_properties(libged PROPERTIES VERSION 20.0.1 SOVERSION 20)
 
 set(ged_ignore_files
   ged_private.h
@@ -336,8 +336,8 @@
   simulate/simulate.h
   simulate/simutils.h
   )
-CMAKEFILES(${ged_ignore_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${ged_ignore_files})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/libbn/tests/CMakeLists.txt
===================================================================
--- src/libbn/tests/CMakeLists.txt	(revision 54114)
+++ src/libbn/tests/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-BRLCAD_ADDEXEC(tester_bn_coplanar_tri_tri_isect bn_coplanar_tri_tri_isect.c "libbu;libbn" NO_INSTALL LOCAL)
-BRLCAD_ADDEXEC(tester_bn_tri_tri_isect bn_tri_tri_isect.c "libbu;libbn" NO_INSTALL LOCAL)
-BRLCAD_ADDEXEC(tester_bn_list bn_list.c "libbu;libbn" NO_INSTALL LOCAL)
+brlcad_addexec(tester_bn_coplanar_tri_tri_isect bn_coplanar_tri_tri_isect.c "libbu;libbn" NO_INSTALL LOCAL)
+brlcad_addexec(tester_bn_tri_tri_isect bn_tri_tri_isect.c "libbu;libbn" NO_INSTALL LOCAL)
+brlcad_addexec(tester_bn_list bn_list.c "libbu;libbn" NO_INSTALL LOCAL)
 
 # For tester_bn_coplanar_tri_tri_isect, the input format is as follows:
 #
Index: src/libbn/CMakeLists.txt
===================================================================
--- src/libbn/CMakeLists.txt	(revision 54114)
+++ src/libbn/CMakeLists.txt	(working copy)
@@ -4,7 +4,7 @@
   ${BRLCAD_SOURCE_DIR}/include
   ${BU_INCLUDE_DIRS}
   )
-BRLCAD_LIB_INCLUDE_DIRS(bn BN_INCLUDE_DIRS "")
+brlcad_lib_include_dirs(bn BN_INCLUDE_DIRS "")
 
 set(LIBBN_SOURCES
   anim.c
@@ -40,14 +40,14 @@
   )
 
 
-BRLCAD_ADDLIB(libbn "${LIBBN_SOURCES}" libbu)
-SET_TARGET_PROPERTIES(libbn PROPERTIES VERSION 20.0.1 SOVERSION 20)
+brlcad_addlib(libbn "${LIBBN_SOURCES}" libbu)
+set_target_properties(libbn PROPERTIES VERSION 20.0.1 SOVERSION 20)
 
-BRLCAD_ADDEXEC(bntester bntester.c "libbu;libbn" NO_INSTALL)
+brlcad_addexec(bntester bntester.c "libbu;libbn" NO_INSTALL)
 
 add_subdirectory(tests)
 
-CMAKEFILES(
+cmakefiles(
   Makefile.am
   README
   bntester.dat
Index: src/lgt/CMakeLists.txt
===================================================================
--- src/lgt/CMakeLists.txt	(revision 54114)
+++ src/lgt/CMakeLists.txt	(working copy)
@@ -6,7 +6,7 @@
   ${CURSOR_INCLUDE_DIRS}
   ${CMAKE_CURRENT_SOURCE_DIR}
   )
-LIST(REMOVE_DUPLICATES LGT_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES LGT_INCLUDE_DIRS)
 include_directories(${LGT_INCLUDE_DIRS})
 
 set(lgt_SOURCES
@@ -30,8 +30,8 @@
   )
 
 if(HAVE_TERMLIB)
-  BRLCAD_ADDEXEC(lgt "${lgt_SOURCES}" "librt;libfb;libtermio;libvfont;libcursor;${M_LIBRARY}")
-  SET_TARGET_PROPERTIES(lgt PROPERTIES COMPILE_DEFINITIONS "BEHIND_ME_TOL=0.05")
+  brlcad_addexec(lgt "${lgt_SOURCES}" "librt;libfb;libtermio;libvfont;libcursor;${M_LIBRARY}")
+  set_target_properties(lgt PROPERTIES COMPILE_DEFINITIONS "BEHIND_ME_TOL=0.05")
 
 endif(HAVE_TERMLIB)
 set(lgt_ignore_files
@@ -45,8 +45,8 @@
   texture.h
   tree.h
   )
-CMAKEFILES(${lgt_ignore_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${lgt_ignore_files})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/fb/tests/CMakeLists.txt
===================================================================
--- src/fb/tests/CMakeLists.txt	(revision 54114)
+++ src/fb/tests/CMakeLists.txt	(working copy)
@@ -1,5 +1,5 @@
 if(BRLCAD_ENABLE_TK)
-    BRLCAD_ADDEXEC(fbthreadtest fbthreadtest.c "libfb;${TCL_TK_LIBRARY}" NO_INSTALL LOCAL)
-  SET_TARGET_PROPERTIES(fbthreadtest PROPERTIES COMPILE_DEFINITIONS "IF_TK")
-  SET_TARGET_PROPERTIES(fbthreadtest PROPERTIES LINKER_LANGUAGE C)
+    brlcad_addexec(fbthreadtest fbthreadtest.c "libfb;${TCL_TK_LIBRARY}" NO_INSTALL LOCAL)
+  set_target_properties(fbthreadtest PROPERTIES COMPILE_DEFINITIONS "IF_TK")
+  set_target_properties(fbthreadtest PROPERTIES LINKER_LANGUAGE C)
 endif(BRLCAD_ENABLE_TK)
Index: src/fb/CMakeLists.txt
===================================================================
--- src/fb/CMakeLists.txt	(revision 54114)
+++ src/fb/CMakeLists.txt	(working copy)
@@ -10,70 +10,70 @@
   ${PNG_INCLUDE_DIR}
   ${ZLIB_INCLUDE_DIR}
   )
-BRLCAD_SORT_INCLUDE_DIRS(FBBIN_INCLUDE_DIRS)
+brlcad_sort_include_dirs(FBBIN_INCLUDE_DIRS)
 include_directories(${FBBIN_INCLUDE_DIRS})
 
 if(MSVC)
   add_definitions(-DIF_WGL)
 endif(MSVC)
-BRLCAD_ADDEXEC(bw-fb bw-fb.c libfb)
-BRLCAD_ADDEXEC(cell-fb cell-fb.c "libfb;libbn")
-BRLCAD_ADDEXEC(cmap-fb cmap-fb.c libfb)
-BRLCAD_ADDEXEC(fb-bw fb-bw.c libfb)
-BRLCAD_ADDEXEC(fb-cmap fb-cmap.c libfb)
-BRLCAD_ADDEXEC(fb-fb fb-fb.c libfb)
-BRLCAD_ADDEXEC(fb-orle "fb-orle.c;cmap-crunch.c" "libfb;liborle")
-BRLCAD_ADDEXEC(fb-pix "fb-pix.c;cmap-crunch.c" libfb)
-BRLCAD_ADDEXEC(fb-png "fb-png.c;cmap-crunch.c" "libfb;${PNG_LIBRARY}")
-BRLCAD_ADDEXEC(fb-rle "fb-rle.c;cmap-crunch.c" "libfb;${UTAHRLE_LIBRARY}")
-BRLCAD_ADDEXEC(fbanim fbanim.c libfb)
-BRLCAD_ADDEXEC(fbcbars fbcbars.c libfb)
-BRLCAD_ADDEXEC(fbclear fbclear.c libfb)
-BRLCAD_ADDEXEC(fbcmap fbcmap.c libfb)
-BRLCAD_ADDEXEC(fbcmrot fbcmrot.c libfb)
+brlcad_addexec(bw-fb bw-fb.c libfb)
+brlcad_addexec(cell-fb cell-fb.c "libfb;libbn")
+brlcad_addexec(cmap-fb cmap-fb.c libfb)
+brlcad_addexec(fb-bw fb-bw.c libfb)
+brlcad_addexec(fb-cmap fb-cmap.c libfb)
+brlcad_addexec(fb-fb fb-fb.c libfb)
+brlcad_addexec(fb-orle "fb-orle.c;cmap-crunch.c" "libfb;liborle")
+brlcad_addexec(fb-pix "fb-pix.c;cmap-crunch.c" libfb)
+brlcad_addexec(fb-png "fb-png.c;cmap-crunch.c" "libfb;${PNG_LIBRARY}")
+brlcad_addexec(fb-rle "fb-rle.c;cmap-crunch.c" "libfb;${UTAHRLE_LIBRARY}")
+brlcad_addexec(fbanim fbanim.c libfb)
+brlcad_addexec(fbcbars fbcbars.c libfb)
+brlcad_addexec(fbclear fbclear.c libfb)
+brlcad_addexec(fbcmap fbcmap.c libfb)
+brlcad_addexec(fbcmrot fbcmrot.c libfb)
 
 if(HAVE_TERMLIB)
-  BRLCAD_ADDEXEC(fbcolor fbcolor.c "libfb;libtermio")
+  brlcad_addexec(fbcolor fbcolor.c "libfb;libtermio")
 endif(HAVE_TERMLIB)
-BRLCAD_ADDEXEC(fbfade "fbfade.c;ioutil.c" libfb)
-BRLCAD_ADDEXEC(fbframe fbframe.c libfb)
-BRLCAD_ADDEXEC(fbfree fbfree.c libfb)
-BRLCAD_ADDEXEC(fbgamma fbgamma.c "libfb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(fbgammamod fbgammamod.c "libfb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(fbgrid fbgrid.c libfb)
-BRLCAD_ADDEXEC(fbhelp fbhelp.c libfb)
-BRLCAD_ADDEXEC(fblabel fblabel.c libfb)
-BRLCAD_ADDEXEC(fbline fbline.c libfb)
+brlcad_addexec(fbfade "fbfade.c;ioutil.c" libfb)
+brlcad_addexec(fbframe fbframe.c libfb)
+brlcad_addexec(fbfree fbfree.c libfb)
+brlcad_addexec(fbgamma fbgamma.c "libfb;${M_LIBRARY}")
+brlcad_addexec(fbgammamod fbgammamod.c "libfb;${M_LIBRARY}")
+brlcad_addexec(fbgrid fbgrid.c libfb)
+brlcad_addexec(fbhelp fbhelp.c libfb)
+brlcad_addexec(fblabel fblabel.c libfb)
+brlcad_addexec(fbline fbline.c libfb)
 if(HAVE_TERMLIB)
-  BRLCAD_ADDEXEC(fbpoint fbpoint.c "libfb;libbu;libtermio;libpkg")
+  brlcad_addexec(fbpoint fbpoint.c "libfb;libbu;libtermio;libpkg")
 endif(HAVE_TERMLIB)
-BRLCAD_ADDEXEC(fbscanplot fbscanplot.c libfb)
-BRLCAD_ADDEXEC(fbstretch "fbstretch.c;ioutil.c" libfb)
+brlcad_addexec(fbscanplot fbscanplot.c libfb)
+brlcad_addexec(fbstretch "fbstretch.c;ioutil.c" libfb)
 if(HAVE_TERMLIB)
-  BRLCAD_ADDEXEC(fbzoom fbzoom.c "libfb;libtermio")
+  brlcad_addexec(fbzoom fbzoom.c "libfb;libtermio")
 endif(HAVE_TERMLIB)
-BRLCAD_ADDEXEC(gif-fb "gif-fb.c;ioutil.c" libfb)
-BRLCAD_ADDEXEC(gif2fb gif2fb.c libfb)
-BRLCAD_ADDEXEC(orle-fb orle-fb.c "libfb;liborle")
-BRLCAD_ADDEXEC(pix-fb pix-fb.c libfb)
-BRLCAD_ADDEXEC(pixautosize pixautosize.c libfb)
-BRLCAD_ADDEXEC(pixflip-fb pixflip-fb.c libfb)
-BRLCAD_ADDEXEC(pl-fb pl-fb.c libfb)
-BRLCAD_ADDEXEC(png-fb png-fb.c "libfb;${PNG_LIBRARY}")
-BRLCAD_ADDEXEC(polar-fb polar-fb.c "libfb;${M_LIBRARY}")
+brlcad_addexec(gif-fb "gif-fb.c;ioutil.c" libfb)
+brlcad_addexec(gif2fb gif2fb.c libfb)
+brlcad_addexec(orle-fb orle-fb.c "libfb;liborle")
+brlcad_addexec(pix-fb pix-fb.c libfb)
+brlcad_addexec(pixautosize pixautosize.c libfb)
+brlcad_addexec(pixflip-fb pixflip-fb.c libfb)
+brlcad_addexec(pl-fb pl-fb.c libfb)
+brlcad_addexec(png-fb png-fb.c "libfb;${PNG_LIBRARY}")
+brlcad_addexec(polar-fb polar-fb.c "libfb;${M_LIBRARY}")
 if(HAVE_TERMLIB)
-  BRLCAD_ADDEXEC(pp-fb pp-fb.c "libfb;libtermio")
+  brlcad_addexec(pp-fb pp-fb.c "libfb;libtermio")
 endif(HAVE_TERMLIB)
-BRLCAD_ADDEXEC(rle-fb rle-fb.c "libfb;${UTAHRLE_LIBRARY}")
+brlcad_addexec(rle-fb rle-fb.c "libfb;${UTAHRLE_LIBRARY}")
 if(CPP_DLL_DEFINES)
-  SET_PROPERTY(TARGET rle-fb APPEND PROPERTY COMPILE_DEFINITIONS "RLE_DLL_IMPORTS")
+  set_property(TARGET rle-fb APPEND PROPERTY COMPILE_DEFINITIONS "RLE_DLL_IMPORTS")
 endif(CPP_DLL_DEFINES)
 
-BRLCAD_ADDEXEC(spm-fb spm-fb.c "libfb;libbn")
+brlcad_addexec(spm-fb spm-fb.c "libfb;libbn")
 
 add_subdirectory(tests)
 
-CMAKEFILES(Makefile.am)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/libdm/CMakeLists.txt
===================================================================
--- src/libdm/CMakeLists.txt	(revision 54114)
+++ src/libdm/CMakeLists.txt	(working copy)
@@ -15,7 +15,7 @@
 # local includes
 set(DM_LOCAL_INCLUDE_DIRS ${PNG_INCLUDE_DIR})
 
-BRLCAD_LIB_INCLUDE_DIRS(dm DM_INCLUDE_DIRS DM_LOCAL_INCLUDE_DIRS)
+brlcad_lib_include_dirs(dm DM_INCLUDE_DIRS DM_LOCAL_INCLUDE_DIRS)
 
 # Initialize libdm_DEFINES in case of reconfiguration
 set(libdm_DEFINES "")
@@ -85,7 +85,7 @@
   vers.c
   )
 
-BRLCAD_ADDLIB(libdm "${LIBDM_SRCS}" "libged;librt;libfb;${X11_LIBRARIES};${X11_Xi_LIB};${DM_TKLIB};${Carbon_LIBRARIES}")
+brlcad_addlib(libdm "${LIBDM_SRCS}" "libged;librt;libfb;${X11_LIBRARIES};${X11_Xi_LIB};${DM_TKLIB};${Carbon_LIBRARIES}")
 set_target_properties(libdm PROPERTIES VERSION 20.0.1 SOVERSION 20)
 
 if(BRLCAD_BUILD_LOCAL_TK AND BRLCAD_ENABLE_TK)
@@ -99,9 +99,9 @@
   dm-tk.c
   TODO
   )
-CMAKEFILES(${libdm_ignore_files})
-CMAKEFILES(dm_util.h)
-CMAKEFILES(Makefile.am)
+cmakefiles(${libdm_ignore_files})
+cmakefiles(dm_util.h)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/liborle/CMakeLists.txt
===================================================================
--- src/liborle/CMakeLists.txt	(revision 54114)
+++ src/liborle/CMakeLists.txt	(working copy)
@@ -6,12 +6,12 @@
 # local includes
 set(ORLE_LOCAL_INCLUDE_DIRS ${UTAHRLE_INCLUDE_DIR})
 
-BRLCAD_LIB_INCLUDE_DIRS(orle ORLE_INCLUDE_DIRS ORLE_LOCAL_INCLUDE_DIRS)
+brlcad_lib_include_dirs(orle ORLE_INCLUDE_DIRS ORLE_LOCAL_INCLUDE_DIRS)
 
-BRLCAD_ADDLIB(liborle rle.c "NONE")
-SET_TARGET_PROPERTIES(liborle PROPERTIES VERSION 20.0.1 SOVERSION 20)
+brlcad_addlib(liborle rle.c "NONE")
+set_target_properties(liborle PROPERTIES VERSION 20.0.1 SOVERSION 20)
 
-CMAKEFILES(Makefile.am)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/libpc/CMakeLists.txt
===================================================================
--- src/libpc/CMakeLists.txt	(revision 54114)
+++ src/libpc/CMakeLists.txt	(working copy)
@@ -24,7 +24,7 @@
 
 set(PC_LOCAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/other/boost)
 
-BRLCAD_LIB_INCLUDE_DIRS(pc PC_INCLUDE_DIRS PC_LOCAL_INCLUDE_DIRS)
+brlcad_lib_include_dirs(pc PC_INCLUDE_DIRS PC_LOCAL_INCLUDE_DIRS)
 
 set(LIBPC_NOINST_HDRS
   pcBasic.h
@@ -59,8 +59,8 @@
   -DOBJ_BREP=1
   )
 
-BRLCAD_ADDLIB(libpc "${LIBPC_SOURCES}" "libbu;${OPENNURBS_LIBRARY};${STDCXX_LIBRARIES}" NOSTRICTCXX)
-SET_TARGET_PROPERTIES(libpc PROPERTIES VERSION 20.0.1 SOVERSION 20)
+brlcad_addlib(libpc "${LIBPC_SOURCES}" "libbu;${OPENNURBS_LIBRARY};${STDCXX_LIBRARIES}" NOSTRICTCXX)
+set_target_properties(libpc PROPERTIES VERSION 20.0.1 SOVERSION 20)
 
 #BRLCAD_ADDEXEC(solver_test solver_test.cpp libpc NO_INSTALL)
 #BRLCAD_ADDEXEC(vm_test vm_test.cpp libpc NO_INSTALL)
@@ -84,8 +84,8 @@
   solver_test.cpp
   vm_test.cpp
   )
-CMAKEFILES(${pc_ignore_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${pc_ignore_files})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/adrt/CMakeLists.txt
===================================================================
--- src/adrt/CMakeLists.txt	(revision 54114)
+++ src/adrt/CMakeLists.txt	(working copy)
@@ -1,7 +1,7 @@
 set(ADRT_INCLUDE_DIRS
   ${GCV_INCLUDE_DIRS}
   )
-LIST(REMOVE_DUPLICATES ADRT_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES ADRT_INCLUDE_DIRS)
 include_directories(${ADRT_INCLUDE_DIRS})
 
 include_directories(
@@ -38,7 +38,7 @@
   librender/texture_perlin.c
   librender/texture_stack.c
   )
-BRLCAD_ADDLIB(librender "${LIBRENDER_SRCS}" libgcv)
+brlcad_addlib(librender "${LIBRENDER_SRCS}" libgcv)
 
 set(tie_HDRS
   adrt.h
@@ -51,10 +51,10 @@
   librender/texture_internal.h
   )
 install(FILES ${tie_HDRS} DESTINATION include/tie)
-CMAKEFILES(${tie_HDRS})
+cmakefiles(${tie_HDRS})
 
 # Tcl/Tk based ISST
-INCLUDE_DIRECTORIES(
+include_directories(
   ${TOGL_INCLUDE_DIRS}
   ${OPENGL_INCLUDE_DIR_GL}
   ${OPENGL_INCLUDE_DIR_GLX}
@@ -74,7 +74,7 @@
     LIBRARY DESTINATION ${LIB_DIR}/
     ARCHIVE DESTINATION ${LIB_DIR}/isst0.1)
   include(${BRLCAD_SOURCE_DIR}/misc/CMake/TCL_PKGINDEX.cmake)
-  TCL_PKGINDEX(issttcltk isst "0.1")
+  tcl_pkgindex(issttcltk isst "0.1")
   # TODO - need to make this configure line into a real target ala
   # BRLCAD_ADDDATA in order for the build dir copy to be updated when it
   # is changed.
@@ -93,7 +93,7 @@
   endif(NOT CMAKE_CONFIGURATION_TYPES)
   install(PROGRAMS ${isst_script} DESTINATION bin)
 endif(TOGL_LIBRARIES AND BRLCAD_ENABLE_OPENGL)
-CMAKEFILES(isst_tcltk.c)
+cmakefiles(isst_tcltk.c)
 
 set(adrt_ignore_files
   isst.h
@@ -104,8 +104,8 @@
   slave
   tienet.h
   )
-CMAKEFILES(${adrt_ignore_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${adrt_ignore_files})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/archer/images/CMakeLists.txt
===================================================================
--- src/tclscripts/archer/images/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/archer/images/CMakeLists.txt	(working copy)
@@ -264,8 +264,8 @@
   wizard.png
   )
 
-BRLCAD_ADDDATA(archer_images tclscripts/archer/images)
-CMAKEFILES(Makefile.am)
+brlcad_adddata(archer_images tclscripts/archer/images)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/archer/CMakeLists.txt
===================================================================
--- src/tclscripts/archer/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/archer/CMakeLists.txt	(working copy)
@@ -40,12 +40,12 @@
   itk_redefines.tcl
   tabwindow.itk
   )
-BRLCAD_ADDDATA(archer_TCLSCRIPTS tclscripts/archer)
-pkgIndex_BUILD(archer tclscripts/archer)
-tclIndex_BUILD(archer tclscripts/archer)
+brlcad_adddata(archer_TCLSCRIPTS tclscripts/archer)
+pkgindex_build(archer tclscripts/archer)
+tclindex_build(archer tclscripts/archer)
 
-CMAKEFILES(pkgIndex.tcl tclIndex)
-CMAKEFILES(Makefile.am)
+cmakefiles(pkgIndex.tcl tclIndex)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/rtwizard/CMakeLists.txt
===================================================================
--- src/tclscripts/rtwizard/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/rtwizard/CMakeLists.txt	(working copy)
@@ -37,16 +37,16 @@
 endif(HAVE_SYMLINK)
 
 install(PROGRAMS rtwizard.tcl DESTINATION ${BIN_DIR} RENAME rtwizard)
-DISTCLEAN(${rtwizard_cmd_outputs})
+distclean(${rtwizard_cmd_outputs})
 
 set(rtwizard_TCLSCRIPTS
   RaytraceWizard.tcl
   rtwizard.tcl
   rtwizard.bat
   )
-BRLCAD_ADDDATA(rtwizard_TCLSCRIPTS tclscripts/rtwizard)
-pkgIndex_BUILD(rtwizard tclscripts/rtwizard)
-tclIndex_BUILD(rtwizard tclscripts/rtwizard)
+brlcad_adddata(rtwizard_TCLSCRIPTS tclscripts/rtwizard)
+pkgindex_build(rtwizard tclscripts/rtwizard)
+tclindex_build(rtwizard tclscripts/rtwizard)
 
 # Examples
 
@@ -57,7 +57,7 @@
   examples/PictureTypeA/title.txt
   examples/PictureTypeA/preview.small.gif
   )
-BRLCAD_ADDDATA(PictureTypeA_DATA tclscripts/rtwizard/examples/PictureTypeA)
+brlcad_adddata(PictureTypeA_DATA tclscripts/rtwizard/examples/PictureTypeA)
 
 set(PictureTypeB_DATA
   examples/PictureTypeB/desc.txt
@@ -66,7 +66,7 @@
   examples/PictureTypeB/title.txt
   examples/PictureTypeB/preview.small.gif
   )
-BRLCAD_ADDDATA(PictureTypeB_DATA tclscripts/rtwizard/examples/PictureTypeB)
+brlcad_adddata(PictureTypeB_DATA tclscripts/rtwizard/examples/PictureTypeB)
 
 set(PictureTypeC_DATA
   examples/PictureTypeC/desc.txt
@@ -75,7 +75,7 @@
   examples/PictureTypeC/title.txt
   examples/PictureTypeC/preview.small.gif
   )
-BRLCAD_ADDDATA(PictureTypeC_DATA tclscripts/rtwizard/examples/PictureTypeC)
+brlcad_adddata(PictureTypeC_DATA tclscripts/rtwizard/examples/PictureTypeC)
 
 set(PictureTypeD_DATA
   examples/PictureTypeD/desc.txt
@@ -84,7 +84,7 @@
   examples/PictureTypeD/title.txt
   examples/PictureTypeD/preview.small.gif
   )
-BRLCAD_ADDDATA(PictureTypeD_DATA tclscripts/rtwizard/examples/PictureTypeD)
+brlcad_adddata(PictureTypeD_DATA tclscripts/rtwizard/examples/PictureTypeD)
 
 set(PictureTypeE_DATA
   examples/PictureTypeE/desc.txt
@@ -93,7 +93,7 @@
   examples/PictureTypeE/title.txt
   examples/PictureTypeE/preview.small.gif
   )
-BRLCAD_ADDDATA(PictureTypeE_DATA tclscripts/rtwizard/examples/PictureTypeE)
+brlcad_adddata(PictureTypeE_DATA tclscripts/rtwizard/examples/PictureTypeE)
 
 set(PictureTypeF_DATA
   examples/PictureTypeF/desc.txt
@@ -102,10 +102,10 @@
   examples/PictureTypeF/title.txt
   examples/PictureTypeF/preview.small.gif
   )
-BRLCAD_ADDDATA(PictureTypeF_DATA tclscripts/rtwizard/examples/PictureTypeF)
+brlcad_adddata(PictureTypeF_DATA tclscripts/rtwizard/examples/PictureTypeF)
 
-CMAKEFILES(examples pkgIndex.tcl tclIndex)
-CMAKEFILES(Makefile.am)
+cmakefiles(examples pkgIndex.tcl tclIndex)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/rtwizard/lib/CMakeLists.txt
===================================================================
--- src/tclscripts/rtwizard/lib/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/rtwizard/lib/CMakeLists.txt	(working copy)
@@ -20,11 +20,11 @@
 	PictureTypeF.itcl
 	Wizard.itk
 	)
-BRLCAD_ADDDATA(rtwizard_lib_TCLSCRIPTS tclscripts/rtwizard/lib)
-pkgIndex_BUILD(rtwizard_lib tclscripts/rtwizard/lib)
-tclIndex_BUILD(rtwizard_lib tclscripts/rtwizard/lib)
+brlcad_adddata(rtwizard_lib_TCLSCRIPTS tclscripts/rtwizard/lib)
+pkgindex_build(rtwizard_lib tclscripts/rtwizard/lib)
+tclindex_build(rtwizard_lib tclscripts/rtwizard/lib)
 
-CMAKEFILES(Makefile.am pkgIndex.tcl tclIndex)
+cmakefiles(Makefile.am pkgIndex.tcl tclIndex)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/igraph/CMakeLists.txt
===================================================================
--- src/tclscripts/igraph/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/igraph/CMakeLists.txt	(working copy)
@@ -2,12 +2,12 @@
   GraphEditor.tcl
   igraph.tcl
   )
-BRLCAD_ADDDATA(igraph_TCLSCRIPTS tclscripts/igraph)
-pkgIndex_BUILD(igraph tclscripts/igraph)
-tclIndex_BUILD(igraph tclscripts/igraph)
+brlcad_adddata(igraph_TCLSCRIPTS tclscripts/igraph)
+pkgindex_build(igraph tclscripts/igraph)
+tclindex_build(igraph tclscripts/igraph)
 
-CMAKEFILES(pkgIndex.tcl tclIndex)
-CMAKEFILES(Makefile.am)
+cmakefiles(pkgIndex.tcl tclIndex)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/mged/CMakeLists.txt
===================================================================
--- src/tclscripts/mged/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/mged/CMakeLists.txt	(working copy)
@@ -84,10 +84,10 @@
   tree.tcl
   xclone.tcl
   )
-BRLCAD_ADDDATA(mged_TCLSCRIPTS tclscripts/mged)
+brlcad_adddata(mged_TCLSCRIPTS tclscripts/mged)
 # no packages in here (so far)
 # pkgIndex_BUILD(mged tclscripts/mged)
-tclIndex_BUILD(mged tclscripts/mged)
+tclindex_build(mged tclscripts/mged)
 
 set(mged_tcl_DATA
   l_i0_v0_s0.gif
@@ -134,10 +134,10 @@
   mike-tux.ppm
   mike-tux.png
   )
-BRLCAD_ADDDATA(mged_tcl_DATA tclscripts/mged)
+brlcad_adddata(mged_tcl_DATA tclscripts/mged)
 
-CMAKEFILES(rrmb.tcl pkgIndex.tcl tclIndex)
-CMAKEFILES(Makefile.am)
+cmakefiles(rrmb.tcl pkgIndex.tcl tclIndex)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/CMakeLists.txt
===================================================================
--- src/tclscripts/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/CMakeLists.txt	(working copy)
@@ -1,7 +1,7 @@
 # Convenience macros for building pkgIndex.tcl and tclIndex files
 
-MACRO(pkgIndex_BUILD name targetdir)
-  BRLCAD_GET_DIR_LIST_CONTENTS(DATA_TARGETS "${CMAKE_CURRENT_BINARY_DIR}" data_target_list)
+macro(pkgIndex_BUILD name targetdir)
+  brlcad_get_dir_list_contents(DATA_TARGETS "${CMAKE_CURRENT_BINARY_DIR}" data_target_list)
   string(REGEX REPLACE "/" "_" targetprefix ${targetdir})
   if(CMAKE_CONFIGURATION_TYPES)
     set(pkgIndex_outdir "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${DATA_DIR}/${targetdir}")
@@ -19,10 +19,10 @@
   set(pkgIndex_target_list ${pkgIndex_target_list} ${name}_pkgIndex.tcl)
   list(REMOVE_DUPLICATES pkgIndex_target_list)
   set(pkgIndex_target_list "${pkgIndex_target_list}" CACHE STRING "pkgIndex target list" FORCE)
-ENDMACRO(pkgIndex_BUILD name targetdir)
+endmacro(pkgIndex_BUILD name targetdir)
 
-MACRO(tclIndex_BUILD name targetdir)
-  BRLCAD_GET_DIR_LIST_CONTENTS(DATA_TARGETS "${CMAKE_CURRENT_BINARY_DIR}" data_target_list)
+macro(tclIndex_BUILD name targetdir)
+  brlcad_get_dir_list_contents(DATA_TARGETS "${CMAKE_CURRENT_BINARY_DIR}" data_target_list)
   string(REGEX REPLACE "/" "_" targetprefix ${targetdir})
   if(CMAKE_CONFIGURATION_TYPES)
     set(tclIndex_outdir "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${DATA_DIR}/${targetdir}")
@@ -40,7 +40,7 @@
   set(tclIndex_target_list ${tclIndex_target_list} ${name}_tclIndex)
   list(REMOVE_DUPLICATES tclIndex_target_list)
   set(tclIndex_target_list "${tclIndex_target_list}" CACHE STRING "tclIndex target list" FORCE)
-ENDMACRO(tclIndex_BUILD name targetdir)
+endmacro(tclIndex_BUILD name targetdir)
 
 mark_as_advanced(pkgIndex_target_list)
 mark_as_advanced(tclIndex_target_list)
@@ -77,11 +77,11 @@
   mouse.tcl
   vmath.tcl
   )
-BRLCAD_ADDDATA(tclscripts_TCLSCRIPTS tclscripts)
-pkgIndex_BUILD(tclscripts tclscripts)
-tclIndex_BUILD(tclscripts tclscripts)
+brlcad_adddata(tclscripts_TCLSCRIPTS tclscripts)
+pkgindex_build(tclscripts tclscripts)
+tclindex_build(tclscripts tclscripts)
 
-CMAKEFILES(README Makefile.am pkgIndex.tcl tclIndex hv3_man_browser_test.tcl)
+cmakefiles(README Makefile.am pkgIndex.tcl tclIndex hv3_man_browser_test.tcl)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/boteditor/CMakeLists.txt
===================================================================
--- src/tclscripts/boteditor/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/boteditor/CMakeLists.txt	(working copy)
@@ -3,8 +3,8 @@
   botPropertyBox.tcl
   botTools.tcl
   )
-BRLCAD_ADDDATA(boteditor_TCLSCRIPTS tclscripts/boteditor)
-CMAKEFILES(Makefile.am)
+brlcad_adddata(boteditor_TCLSCRIPTS tclscripts/boteditor)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/hv3/CMakeLists.txt
===================================================================
--- src/tclscripts/hv3/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/hv3/CMakeLists.txt	(working copy)
@@ -7,9 +7,9 @@
   hv3_util.tcl
   snit.tcl
   )
-BRLCAD_ADDDATA(hv3_TCLSCRIPTS tclscripts/hv3)
-pkgIndex_BUILD(hv3 tclscripts/hv3)
-tclIndex_BUILD(hv3 tclscripts/hv3)
+brlcad_adddata(hv3_TCLSCRIPTS tclscripts/hv3)
+pkgindex_build(hv3 tclscripts/hv3)
+tclindex_build(hv3 tclscripts/hv3)
 install(FILES hv3.man DESTINATION ${DATA_DIR}/doc)
 install(FILES tkhtml.n DESTINATION ${MAN_DIR}/mann)
 set(hv3_ignore_files
@@ -21,8 +21,8 @@
   pkgIndex.tcl
   tclIndex
   )
-CMAKEFILES(${hv3_ignore_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${hv3_ignore_files})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/sdialogs/scripts/CMakeLists.txt
===================================================================
--- src/tclscripts/sdialogs/scripts/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/sdialogs/scripts/CMakeLists.txt	(working copy)
@@ -3,10 +3,10 @@
 	listdialog.itk
 	stddlgs.tcl
 )
-BRLCAD_ADDDATA(sdialogs_scripts_TCLSCRIPTS tclscripts/sdialogs/scripts)
-tclIndex_BUILD(sdialogs_scripts tclscripts/sdialogs/scripts)
+brlcad_adddata(sdialogs_scripts_TCLSCRIPTS tclscripts/sdialogs/scripts)
+tclindex_build(sdialogs_scripts tclscripts/sdialogs/scripts)
 
-CMAKEFILES(Makefile.am tclIndex)
+cmakefiles(Makefile.am tclIndex)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/sdialogs/CMakeLists.txt
===================================================================
--- src/tclscripts/sdialogs/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/sdialogs/CMakeLists.txt	(working copy)
@@ -3,11 +3,11 @@
 set(sdialogs_TCLSCRIPTS
   sdialogs.tcl
   )
-BRLCAD_ADDDATA(sdialogs_TCLSCRIPTS tclscripts/sdialogs)
-pkgIndex_BUILD(sdialogs tclscripts/sdialogs)
-tclIndex_BUILD(sdialogs tclscripts/sdialogs)
+brlcad_adddata(sdialogs_TCLSCRIPTS tclscripts/sdialogs)
+pkgindex_build(sdialogs tclscripts/sdialogs)
+tclindex_build(sdialogs tclscripts/sdialogs)
 
-CMAKEFILES(Makefile.am pkgIndex.tcl tclIndex)
+cmakefiles(Makefile.am pkgIndex.tcl tclIndex)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/lib/CMakeLists.txt
===================================================================
--- src/tclscripts/lib/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/lib/CMakeLists.txt	(working copy)
@@ -25,12 +25,12 @@
 	ViewAxesControl.tcl
 	cursor.tcl
 )
-BRLCAD_ADDDATA(lib_TCLSCRIPTS tclscripts/lib)
-pkgIndex_BUILD(lib tclscripts/lib)
-tclIndex_BUILD(lib tclscripts/lib)
+brlcad_adddata(lib_TCLSCRIPTS tclscripts/lib)
+pkgindex_build(lib tclscripts/lib)
+tclindex_build(lib tclscripts/lib)
 
-CMAKEFILES(pkgIndex.tcl tclIndex)
-CMAKEFILES(Makefile.am)
+cmakefiles(pkgIndex.tcl tclIndex)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/pl-dm/CMakeLists.txt
===================================================================
--- src/tclscripts/pl-dm/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/pl-dm/CMakeLists.txt	(working copy)
@@ -3,12 +3,12 @@
   help.tcl
   menu.tcl
   )
-BRLCAD_ADDDATA(pl-dm_TCLSCRIPTS tclscripts/pl-dm)
-pkgIndex_BUILD(pl-dm tclscripts/pl-dm)
-tclIndex_BUILD(pl-dm tclscripts/pl-dm)
+brlcad_adddata(pl-dm_TCLSCRIPTS tclscripts/pl-dm)
+pkgindex_build(pl-dm tclscripts/pl-dm)
+tclindex_build(pl-dm tclscripts/pl-dm)
 
-CMAKEFILES(pkgIndex.tcl tclIndex)
-CMAKEFILES(Makefile.am)
+cmakefiles(pkgIndex.tcl tclIndex)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/geometree/CMakeLists.txt
===================================================================
--- src/tclscripts/geometree/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/geometree/CMakeLists.txt	(working copy)
@@ -2,12 +2,12 @@
   GeometryBrowser.tcl
   geometree.tcl
   )
-BRLCAD_ADDDATA(geometree_TCLSCRIPTS tclscripts/geometree)
-pkgIndex_BUILD(geometree tclscripts/geometree)
-tclIndex_BUILD(geometree tclscripts/geometree)
+brlcad_adddata(geometree_TCLSCRIPTS tclscripts/geometree)
+pkgindex_build(geometree tclscripts/geometree)
+tclindex_build(geometree tclscripts/geometree)
 
-CMAKEFILES(pkgIndex.tcl tclIndex)
-CMAKEFILES(Makefile.am)
+cmakefiles(pkgIndex.tcl tclIndex)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/util/CMakeLists.txt
===================================================================
--- src/tclscripts/util/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/util/CMakeLists.txt	(working copy)
@@ -3,11 +3,11 @@
   getopt.tcl
   luniq.tcl
   )
-BRLCAD_ADDDATA(util_TCLSCRIPTS tclscripts/util)
-pkgIndex_BUILD(util tclscripts/util)
-tclIndex_BUILD(util tclscripts/util)
+brlcad_adddata(util_TCLSCRIPTS tclscripts/util)
+pkgindex_build(util tclscripts/util)
+tclindex_build(util tclscripts/util)
 
-CMAKEFILES(Makefile.am pkgIndex.tcl tclIndex)
+cmakefiles(Makefile.am pkgIndex.tcl tclIndex)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/swidgets/CMakeLists.txt
===================================================================
--- src/tclscripts/swidgets/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/swidgets/CMakeLists.txt	(working copy)
@@ -4,11 +4,11 @@
 set(swidgets_TCLSCRIPTS
   swidgets.tcl
   )
-BRLCAD_ADDDATA(swidgets_TCLSCRIPTS tclscripts/swidgets)
-pkgIndex_BUILD(swidgets tclscripts/swidgets)
-tclIndex_BUILD(swidgets tclscripts/swidgets)
+brlcad_adddata(swidgets_TCLSCRIPTS tclscripts/swidgets)
+pkgindex_build(swidgets tclscripts/swidgets)
+tclindex_build(swidgets tclscripts/swidgets)
 
-CMAKEFILES(Makefile.am pkgIndex.tcl tclIndex)
+cmakefiles(Makefile.am pkgIndex.tcl tclIndex)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/swidgets/images/CMakeLists.txt
===================================================================
--- src/tclscripts/swidgets/images/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/swidgets/images/CMakeLists.txt	(working copy)
@@ -6,9 +6,9 @@
   plus.xbm
   tip.gif
   )
-BRLCAD_ADDDATA(swidgets_image_DATA tclscripts/swidgets/images)
+brlcad_adddata(swidgets_image_DATA tclscripts/swidgets/images)
 
-CMAKEFILES(Makefile.am)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/tclscripts/swidgets/scripts/CMakeLists.txt
===================================================================
--- src/tclscripts/swidgets/scripts/CMakeLists.txt	(revision 54114)
+++ src/tclscripts/swidgets/scripts/CMakeLists.txt	(working copy)
@@ -5,10 +5,10 @@
   tooltip.itk
   tree.itk
   )
-BRLCAD_ADDDATA(swidgets_scripts_TCLSCRIPTS tclscripts/swidgets/scripts)
-tclIndex_BUILD(swidgets_scripts tclscripts/swidgets/scripts)
+brlcad_adddata(swidgets_scripts_TCLSCRIPTS tclscripts/swidgets/scripts)
+tclindex_build(swidgets_scripts tclscripts/swidgets/scripts)
 
-CMAKEFILES(Makefile.am tclIndex)
+cmakefiles(Makefile.am tclIndex)
 
 # Local Variables:
 # tab-width: 8
Index: src/libsysv/CMakeLists.txt
===================================================================
--- src/libsysv/CMakeLists.txt	(revision 54114)
+++ src/libsysv/CMakeLists.txt	(working copy)
@@ -4,7 +4,7 @@
   ${BRLCAD_SOURCE_DIR}/include
   ${TCL_INCLUDE_DIRS}
   )
-BRLCAD_LIB_INCLUDE_DIRS(sysv SYSV_INCLUDE_DIRS "")
+brlcad_lib_include_dirs(sysv SYSV_INCLUDE_DIRS "")
 
 set(LIBSYSV_SOURCES
   memset.c
@@ -22,10 +22,10 @@
   -DHAVE_STRTOK
   )
 
-BRLCAD_ADDLIB(libsysv "${LIBSYSV_SOURCES}" "${TCL_LIBRARY}")
-SET_TARGET_PROPERTIES(libsysv PROPERTIES VERSION 20.0.1 SOVERSION 20)
+brlcad_addlib(libsysv "${LIBSYSV_SOURCES}" "${TCL_LIBRARY}")
+set_target_properties(libsysv PROPERTIES VERSION 20.0.1 SOVERSION 20)
 
-CMAKEFILES(Makefile.am)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/vfont/CMakeLists.txt
===================================================================
--- src/vfont/CMakeLists.txt	(revision 54114)
+++ src/vfont/CMakeLists.txt	(working copy)
@@ -7,16 +7,16 @@
 
 # local
 set(VFONT_LOCAL_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
-BRLCAD_LIB_INCLUDE_DIRS(vfont VFONT_INCLUDE_DIRS VFONT_LOCAL_INCLUDE_DIRS)
+brlcad_lib_include_dirs(vfont VFONT_INCLUDE_DIRS VFONT_LOCAL_INCLUDE_DIRS)
 
-BRLCAD_ADDLIB(libvfont getfont.c libbu)
-SET_TARGET_PROPERTIES(libvfont PROPERTIES VERSION 20.0.1 SOVERSION 20)
+brlcad_addlib(libvfont getfont.c libbu)
+set_target_properties(libvfont PROPERTIES VERSION 20.0.1 SOVERSION 20)
 
-BRLCAD_ADDDATA(fix.6r vfont)
-BRLCAD_ADDDATA(nonie.r.12 vfont)
+brlcad_adddata(fix.6r vfont)
+brlcad_adddata(nonie.r.12 vfont)
 
-CMAKEFILES(vfont.h)
-CMAKEFILES(Makefile.am)
+cmakefiles(vfont.h)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/libbu/tests/CMakeLists.txt
===================================================================
--- src/libbu/tests/CMakeLists.txt	(revision 54114)
+++ src/libbu/tests/CMakeLists.txt	(working copy)
@@ -1,5 +1,5 @@
-BRLCAD_ADDEXEC(tester_bu_sscanf bu_sscanf.c libbu NO_INSTALL LOCAL)
-BRLCAD_ADDEXEC(tester_bu_gethostname bu_gethostname.c libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_sscanf bu_sscanf.c libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_gethostname bu_gethostname.c libbu NO_INSTALL LOCAL)
 
 #
 #  ************ basename.c tests *************
@@ -8,7 +8,7 @@
 ###############################
 #      bu_basename testing    #
 ###############################
-BRLCAD_ADDEXEC(tester_bu_basename    bu_basename.c    libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_basename    bu_basename.c    libbu NO_INSTALL LOCAL)
 add_test(bu_basename_null                                   tester_bu_basename) # tests NULL
 add_test(bu_basename_empty                                  tester_bu_basename "")
 add_test(bu_basename_sl_usr_sl_dir_sl_file                  tester_bu_basename "/usr/dir/file")
@@ -40,47 +40,47 @@
 ###############################
 #      bu_bitv_and testing    #
 ###############################
-BRLCAD_ADDEXEC(tester_bu_bitv_and    bu_bitv_and.c    libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_bitv_and    bu_bitv_and.c    libbu NO_INSTALL LOCAL)
 add_test(bu_bitv_and_test1 tester_bu_bitv_and "ffffffff" "00000000" "00000000")
 add_test(bu_bitv_and_test2 tester_bu_bitv_and "ab00" "1200" "0200")
 
 ###############################
 #      bu_bitv_or testing     #
 ###############################
-BRLCAD_ADDEXEC(tester_bu_bitv_or     bu_bitv_or.c     libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_bitv_or     bu_bitv_or.c     libbu NO_INSTALL LOCAL)
 add_test(bu_bitv_or_test1 tester_bu_bitv_or "ffffffff" "00000000" "ffffffff")
 add_test(bu_bitv_or_test2 tester_bu_bitv_or "ab00" "1200" "bb00")
 
 ##################################
 #      bu_bitv_shift testing     #
 ##################################
-BRLCAD_ADDEXEC(tester_bu_bitv_shift  bu_bitv_shift.c  libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_bitv_shift  bu_bitv_shift.c  libbu NO_INSTALL LOCAL)
 add_test(bu_bitv_shift tester_bu_bitv_shift)
 
 ##################################
 #      bu_bitv_to_hex testing    #
 ##################################
-BRLCAD_ADDEXEC(tester_bu_bitv_to_hex bu_bitv_to_hex.c libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_bitv_to_hex bu_bitv_to_hex.c libbu NO_INSTALL LOCAL)
 add_test(bu_bitv_to_hex_test1 tester_bu_bitv_to_hex "0123" "33323130" 32)
 add_test(bu_bitv_to_hex_test2 tester_bu_bitv_to_hex "12" "3231" 16)
 
 ################################
 #      bu_bitv_vls testing     #
 ################################
-BRLCAD_ADDEXEC(tester_bu_bitv_vls    bu_bitv_vls.c    libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_bitv_vls    bu_bitv_vls.c    libbu NO_INSTALL LOCAL)
 add_test(bu_bitv_vls_test1 tester_bu_bitv_vls "00000000" "() ")
 add_test(bu_bitv_vls_test2 tester_bu_bitv_vls "f0f0f0f0" "(4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31) ")
 
 ##################################
 #      bu_hex_to_bitv testing    #
 ##################################
-BRLCAD_ADDEXEC(tester_bu_hex_to_bitv bu_hex_to_bitv.c libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_hex_to_bitv bu_hex_to_bitv.c libbu NO_INSTALL LOCAL)
 add_test(bu_hex_to_bitv_test1 tester_bu_hex_to_bitv "33323130" "0123" 0)
 add_test(bu_hex_to_bitv_test2 tester_bu_hex_to_bitv "30" "0" 0)
 add_test(bu_hex_to_bitv_error tester_bu_hex_to_bitv "303" "" 1)
 
 else(ENABLE_BITV_TESTS)
-CMAKEFILES(bu_bitv_and.c bu_bitv_or.c bu_bitv_shift.c bu_bitv_to_hex.c bu_bitv_vls.c bu_hex_to_bitv.c)
+cmakefiles(bu_bitv_and.c bu_bitv_or.c bu_bitv_shift.c bu_bitv_to_hex.c bu_bitv_vls.c bu_hex_to_bitv.c)
 endif(ENABLE_BITV_TESTS)
 
 #
@@ -90,7 +90,7 @@
 #################################
 #      bu_booleanize testing    #
 #################################
-BRLCAD_ADDEXEC(tester_bu_booleanize bu_booleanize.c libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_booleanize bu_booleanize.c libbu NO_INSTALL LOCAL)
 add_test(bu_booleanize_null         tester_bu_booleanize) # tests NULL
 add_test(bu_booleanize_empty        tester_bu_booleanize "")
 add_test(bu_booleanize_n            tester_bu_booleanize "n")
@@ -118,7 +118,7 @@
 ##################################
 # Note - because of the special characters needed in these tests, the strings
 # don't work well when fed in from the command line.
-BRLCAD_ADDEXEC(tester_bu_str_isprint bu_str_isprint.c libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_str_isprint bu_str_isprint.c libbu NO_INSTALL LOCAL)
 add_test(bu_str_isprint_basic                tester_bu_str_isprint 1)
 add_test(bu_str_isprint_eol                  tester_bu_str_isprint 2)
 add_test(bu_str_isprint_double_slash         tester_bu_str_isprint 3)
@@ -134,7 +134,7 @@
 ##############################
 #      bu_dirname testing    #
 ##############################
-BRLCAD_ADDEXEC(tester_bu_dirname bu_dirname.c libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_dirname bu_dirname.c libbu NO_INSTALL LOCAL)
 add_test(bu_dirname__usr_dir_file tester_bu_dirname "/usr/dir/file")
 add_test(bu_dirname__usr_dir_ tester_bu_dirname "/usr/dir/")
 add_test(bu_dirname__usr__bsl__dir tester_bu_dirname "/usr\\\\/dir")
@@ -164,7 +164,7 @@
 # Note - because of the quoting needed in these tests, it is simpler
 # to leave the input strings in the C code.  Individual tests are triggered
 # by number
-BRLCAD_ADDEXEC(tester_bu_escape bu_escape.c libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_escape bu_escape.c libbu NO_INSTALL LOCAL)
 
 ###################################
 #      bu_str_unescape testing    #
@@ -246,7 +246,7 @@
 ###############################
 #      bu_progname testing    #
 ###############################
-BRLCAD_ADDEXEC(tester_bu_progname bu_progname.c libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_progname bu_progname.c libbu NO_INSTALL LOCAL)
 add_test(bu_progname_tests tester_bu_progname)
 
 #
@@ -256,7 +256,7 @@
 # approach - the tests below all test both bu_vls_encode and bu_vls_decode.
 # Like many string functions using escaped characters the input strings are
 # left in C to minimize pass-through errors.
-BRLCAD_ADDEXEC(tester_bu_quote bu_quote.c libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_quote bu_quote.c libbu NO_INSTALL LOCAL)
 add_test(bu_quote_test_1  tester_bu_quote 1)   # NULL
 add_test(bu_quote_test_2  tester_bu_quote 2)   # ""
 add_test(bu_quote_test_3  tester_bu_quote 3)   # " "
@@ -284,19 +284,19 @@
 #
 #  ************ rb_*.c tests *************
 #
-BRLCAD_ADDEXEC(tester_bu_redblack bu_redblack.c libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_redblack bu_redblack.c libbu NO_INSTALL LOCAL)
 add_test(bu_redblack_test tester_bu_redblack)
 
 #
 #  ************ timer.c tests *************
 #
-BRLCAD_ADDEXEC(tester_bu_timer bu_timer.c libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_timer bu_timer.c libbu NO_INSTALL LOCAL)
 add_test(bu_gettime_test tester_bu_timer)
 
 #
 #  ************ vls_vprintf.c tests *************
 #
-BRLCAD_ADDEXEC(tester_bu_vls_vprintf bu_vls_vprintf.c libbu NO_INSTALL LOCAL)
+brlcad_addexec(tester_bu_vls_vprintf bu_vls_vprintf.c libbu NO_INSTALL LOCAL)
 add_test(bu_vls_vprintf_test_1  tester_bu_vls_vprintf 1)
 add_test(bu_vls_vprintf_test_2  tester_bu_vls_vprintf 2)
 add_test(bu_vls_vprintf_test_3  tester_bu_vls_vprintf 3)
Index: src/libbu/CMakeLists.txt
===================================================================
--- src/libbu/CMakeLists.txt	(revision 54114)
+++ src/libbu/CMakeLists.txt	(working copy)
@@ -8,7 +8,7 @@
 # locally used but not needed by users of the library
 set(BU_LOCAL_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
 
-BRLCAD_LIB_INCLUDE_DIRS(bu BU_INCLUDE_DIRS BU_LOCAL_INCLUDE_DIRS)
+brlcad_lib_include_dirs(bu BU_INCLUDE_DIRS BU_LOCAL_INCLUDE_DIRS)
 
 set(LIBBU_SOURCES
   argv.c
@@ -94,7 +94,7 @@
   xdr.c
   )
 
-BRLCAD_ADDLIB(libbu "${LIBBU_SOURCES}" "${CMAKE_THREAD_LIBS_INIT};${TCL_LIBRARY};${WINSOCK_LIB};${PSAPI_LIB};${M_LIBRARY}")
+brlcad_addlib(libbu "${LIBBU_SOURCES}" "${CMAKE_THREAD_LIBS_INIT};${TCL_LIBRARY};${WINSOCK_LIB};${PSAPI_LIB};${M_LIBRARY}")
 set_target_properties(libbu PROPERTIES VERSION 20.0.1 SOVERSION 20)
 get_directory_property(BRLCAD_TCL_BUILD DIRECTORY ${BRLCAD_SOURCE_DIR}/src/other DEFINITION BRLCAD_TCL_BUILD)
 if("${BRLCAD_TCL_BUILD}" STREQUAL "ON")
@@ -108,8 +108,8 @@
   uce-dirent.h
   vls_internals.h
   )
-CMAKEFILES(${bu_ignore_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${bu_ignore_files})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/burst/CMakeLists.txt
===================================================================
--- src/burst/CMakeLists.txt	(revision 54114)
+++ src/burst/CMakeLists.txt	(working copy)
@@ -6,7 +6,7 @@
     ${RT_INCLUDE_DIRS}
     ${CMAKE_CURRENT_SOURCE_DIR}
     )
-  LIST(REMOVE_DUPLICATES BURST_INCLUDE_DIRS)
+  list(REMOVE_DUPLICATES BURST_INCLUDE_DIRS)
   include_directories(${BURST_INCLUDE_DIRS})
 
   set(burst_SOURCES
@@ -28,7 +28,7 @@
     ui.c
     )
 
-  BRLCAD_ADDEXEC(burst "${burst_SOURCES}" "librt;libfb;libtermio;${TERMLIB_LIBRARY};${M_LIBRARY}")
+  brlcad_addexec(burst "${burst_SOURCES}" "librt;libfb;libtermio;${TERMLIB_LIBRARY};${M_LIBRARY}")
 
   set(burst_noinst_HEADERS
     ascii.h
@@ -39,8 +39,8 @@
     Sc.h
     trie.h
     )
-  CMAKEFILES(${burst_noinst_HEADERS} burst.format)
-  CMAKEFILES(Makefile.am)
+  cmakefiles(${burst_noinst_HEADERS} burst.format)
+  cmakefiles(Makefile.am)
 endif(HAVE_TERMLIB)
 
 # Local Variables:
Index: src/halftone/CMakeLists.txt
===================================================================
--- src/halftone/CMakeLists.txt	(revision 54114)
+++ src/halftone/CMakeLists.txt	(working copy)
@@ -2,7 +2,7 @@
   ${FB_INCLUDE_DIRS}
   ${RT_INCLUDE_DIRS}
   )
-LIST(REMOVE_DUPLICATES HALFTONE_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES HALFTONE_INCLUDE_DIRS)
 include_directories(${HALFTONE_INCLUDE_DIRS})
 
 set(halftone_SOURCES
@@ -15,9 +15,9 @@
   tonescale.c
   )
 
-BRLCAD_ADDEXEC(halftone "${halftone_SOURCES}" "librt;libfb")
+brlcad_addexec(halftone "${halftone_SOURCES}" "librt;libfb")
 
-CMAKEFILES(Makefile.am)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/irprep/CMakeLists.txt
===================================================================
--- src/irprep/CMakeLists.txt	(revision 54114)
+++ src/irprep/CMakeLists.txt	(working copy)
@@ -3,23 +3,23 @@
   ${RT_INCLUDE_DIRS}
   ${X11_INCLUDE_DIR}
   )
-LIST(REMOVE_DUPLICATES IRPREP_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES IRPREP_INCLUDE_DIRS)
 include_directories(${IRPREP_INCLUDE_DIRS})
 
 if(BRLCAD_ENABLE_X11)
-  BRLCAD_ADDEXEC(ir-X ir-X.c "libbu;${X11_LIBRARIES}")
-  BRLCAD_ADDEXEC(irdisp irdisp.c "libbu;${X11_LIBRARIES}")
-  BRLCAD_ADDEXEC(pictx pictx.c "${X11_LIBRARIES}")
+  brlcad_addexec(ir-X ir-X.c "libbu;${X11_LIBRARIES}")
+  brlcad_addexec(irdisp irdisp.c "libbu;${X11_LIBRARIES}")
+  brlcad_addexec(pictx pictx.c "${X11_LIBRARIES}")
 endif(BRLCAD_ENABLE_X11)
 
-BRLCAD_ADDEXEC(all_sf all_sf.c "librt;${M_LIBRARY}")
-BRLCAD_ADDEXEC(showtherm showtherm.c "librt;${M_LIBRARY}")
-BRLCAD_ADDEXEC(firpass "firpass.c;subroutines.c" "librt;${M_LIBRARY}")
-BRLCAD_ADDEXEC(secpass "secpass.c;subroutines.c" "librt;${M_LIBRARY}")
-BRLCAD_ADDEXEC(shapefact shapefact.c "librt;${M_LIBRARY}")
+brlcad_addexec(all_sf all_sf.c "librt;${M_LIBRARY}")
+brlcad_addexec(showtherm showtherm.c "librt;${M_LIBRARY}")
+brlcad_addexec(firpass "firpass.c;subroutines.c" "librt;${M_LIBRARY}")
+brlcad_addexec(secpass "secpass.c;subroutines.c" "librt;${M_LIBRARY}")
+brlcad_addexec(shapefact shapefact.c "librt;${M_LIBRARY}")
 
-CMAKEFILES(pictx.c)
-CMAKEFILES(Makefile.am)
+cmakefiles(pictx.c)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/archer/CMakeLists.txt
===================================================================
--- src/archer/CMakeLists.txt	(revision 54114)
+++ src/archer/CMakeLists.txt	(working copy)
@@ -34,7 +34,7 @@
 endif(HAVE_SYMLINK)
 add_custom_target(archer ALL DEPENDS ${archer_cmd_outputs})
 install(PROGRAMS archer DESTINATION bin)
-DISTCLEAN(${archer_cmd_outputs})
+distclean(${archer_cmd_outputs})
 
 # archer depends on the creation/installation of all the
 # tclscripts.
@@ -62,30 +62,30 @@
   endif(BRLCAD_BUILD_TKTABLE)
 endif(BRLCAD_ENABLE_TK)
 
-BRLCAD_ADDDATA(plugins/Core/README plugins/archer/Core)
-BRLCAD_ADDDATA(plugins/Commands/README plugins/archer/Command)
+brlcad_adddata(plugins/Core/README plugins/archer/Core)
+brlcad_adddata(plugins/Commands/README plugins/archer/Command)
 
 set(archer_utility_FILES
   plugins/Utility/botUtilityP.tcl
   plugins/Utility/attrGroupsDisplayUtilityP.tcl
   plugins/Utility/README
   )
-BRLCAD_ADDDATA(archer_utility_FILES plugins/archer/Utility)
+brlcad_adddata(archer_utility_FILES plugins/archer/Utility)
 
-BRLCAD_ADDDATA(plugins/Utility/botUtilityP/BotUtilityP.tcl plugins/archer/Utility/botUtilityP)
-BRLCAD_ADDDATA(plugins/Utility/attrGroupsDisplayUtilityP/AttrGroupsDisplayUtilityP.tcl	plugins/archer/Utility/attrGroupsDisplayUtilityP)
+brlcad_adddata(plugins/Utility/botUtilityP/BotUtilityP.tcl plugins/archer/Utility/botUtilityP)
+brlcad_adddata(plugins/Utility/attrGroupsDisplayUtilityP/AttrGroupsDisplayUtilityP.tcl	plugins/archer/Utility/attrGroupsDisplayUtilityP)
 
 set(archer_wizard_FILES
   plugins/Wizards/humanwizard.tcl
   plugins/Wizards/tankwizard.tcl
   plugins/Wizards/tirewizard.tcl
   )
-BRLCAD_ADDDATA(archer_wizard_FILES plugins/archer/Wizards)
+brlcad_adddata(archer_wizard_FILES plugins/archer/Wizards)
 
-BRLCAD_ADDDATA(plugins/Wizards/humanwizard/HumanWizard.tcl plugins/archer/Wizards/humanwizard)
-BRLCAD_ADDDATA(plugins/Wizards/tankwizard/TankWizard.tcl plugins/archer/Wizards/tankwizard)
-BRLCAD_ADDDATA(plugins/Wizards/tankwizard/images/tank.png plugins/archer/Wizards/tankwizardIA/images)
-BRLCAD_ADDDATA(plugins/Wizards/tirewizard/TireWizard.tcl plugins/archer/Wizards/tirewizard)
+brlcad_adddata(plugins/Wizards/humanwizard/HumanWizard.tcl plugins/archer/Wizards/humanwizard)
+brlcad_adddata(plugins/Wizards/tankwizard/TankWizard.tcl plugins/archer/Wizards/tankwizard)
+brlcad_adddata(plugins/Wizards/tankwizard/images/tank.png plugins/archer/Wizards/tankwizardIA/images)
+brlcad_adddata(plugins/Wizards/tirewizard/TireWizard.tcl plugins/archer/Wizards/tirewizard)
 
 set(archer_ignore_files
   TODO
@@ -99,8 +99,8 @@
   plugins/Wizards/tankwizard
   plugins/Wizards/tirewizard
   )
-CMAKEFILES(${archer_ignore_files})
-CMAKEFILES(Makefile.am plugins/Makefile.am plugins/Utility/Makefile.am plugins/Wizards/Makefile.am)
+cmakefiles(${archer_ignore_files})
+cmakefiles(Makefile.am plugins/Makefile.am plugins/Utility/Makefile.am plugins/Wizards/Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/libcursor/CMakeLists.txt
===================================================================
--- src/libcursor/CMakeLists.txt	(revision 54114)
+++ src/libcursor/CMakeLists.txt	(working copy)
@@ -4,11 +4,11 @@
     ${BRLCAD_SOURCE_DIR}/include
     ${TERMLIB_INCLUDE_DIR}
     )
-  BRLCAD_LIB_INCLUDE_DIRS(termlib TERMLIB_INCLUDE_DIRS "")
+  brlcad_lib_include_dirs(termlib TERMLIB_INCLUDE_DIRS "")
 
-  BRLCAD_ADDLIB(libcursor cursor.c "${TERMLIB_LIBRARY}")
-  SET_TARGET_PROPERTIES(libcursor PROPERTIES VERSION 20.0.1 SOVERSION 20)
-  CMAKEFILES(Makefile.am)
+  brlcad_addlib(libcursor cursor.c "${TERMLIB_LIBRARY}")
+  set_target_properties(libcursor PROPERTIES VERSION 20.0.1 SOVERSION 20)
+  cmakefiles(Makefile.am)
 endif(HAVE_TERMLIB)
 
 # Local Variables:
Index: src/conv/raw/CMakeLists.txt
===================================================================
--- src/conv/raw/CMakeLists.txt	(revision 54114)
+++ src/conv/raw/CMakeLists.txt	(working copy)
@@ -3,7 +3,7 @@
   ${RT_INCLUDE_DIRS}
   ${WDB_INCLUDE_DIRS}
   )
-LIST(REMOVE_DUPLICATES RAW_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES RAW_INCLUDE_DIRS)
 include_directories(${RAW_INCLUDE_DIRS})
 
 if(MSVC)
@@ -17,14 +17,14 @@
   raw-g.cpp
   RegionList.cpp
   )
-BRLCAD_ADDEXEC(raw-g "${rawg_SRCS}" "libwdb;librt;libbu" NOSTRICT)
+brlcad_addexec(raw-g "${rawg_SRCS}" "libwdb;librt;libbu" NOSTRICT)
 
 set(RAW_IGNORE_FILES
   Bot.h
   RegionList.h
   )
-CMAKEFILES(${RAW_IGNORE_FILES})
-CMAKEFILES(Makefile.am)
+cmakefiles(${RAW_IGNORE_FILES})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/conv/vdeck/CMakeLists.txt
===================================================================
--- src/conv/vdeck/CMakeLists.txt	(revision 54114)
+++ src/conv/vdeck/CMakeLists.txt	(working copy)
@@ -3,9 +3,9 @@
   ${CMAKE_CURRENT_SOURCE_DIR}
   )
 
-BRLCAD_ADDEXEC(vdeck "cgarbs.c;match.c;parsarg.c;vdeck.c" "librt;${M_LIBRARY}")
-CMAKEFILES(std.h vextern.h)
-CMAKEFILES(Makefile.am)
+brlcad_addexec(vdeck "cgarbs.c;match.c;parsarg.c;vdeck.c" "librt;${M_LIBRARY}")
+cmakefiles(std.h vextern.h)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/conv/intaval/CMakeLists.txt
===================================================================
--- src/conv/intaval/CMakeLists.txt	(revision 54114)
+++ src/conv/intaval/CMakeLists.txt	(working copy)
@@ -3,7 +3,7 @@
   ${RT_INCLUDE_DIRS}
   ${WDB_INCLUDE_DIRS}
   )
-LIST(REMOVE_DUPLICATES INTAVAL_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES INTAVAL_INCLUDE_DIRS)
 include_directories(${INTAVAL_INCLUDE_DIRS})
 
 if(MSVC)
@@ -18,7 +18,7 @@
   tgf-g.cpp
   write_brl.cpp
   )
-BRLCAD_ADDEXEC(tgf-g "${tgf_SRCS}" "libwdb;librt;libbu")
+brlcad_addexec(tgf-g "${tgf_SRCS}" "libwdb;librt;libbu")
 
 set(intaval_ignore_files
   glob.h
@@ -27,8 +27,8 @@
   regtab.h
   write_brl.h
   )
-CMAKEFILES(${intaval_ignore_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${intaval_ignore_files})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/conv/CMakeLists.txt
===================================================================
--- src/conv/CMakeLists.txt	(revision 54114)
+++ src/conv/CMakeLists.txt	(working copy)
@@ -29,28 +29,28 @@
   ${REGEX_INCLUDE_DIR}
   )
 
-LIST(REMOVE_DUPLICATES CONV_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES CONV_INCLUDE_DIRS)
 include_directories(${CONV_INCLUDE_DIRS})
 
-BRLCAD_ADDEXEC(3dm-g 3dm/3dm-g.cpp "libwdb;${OPENNURBS_LIBRARY}" NOSTRICT)
+brlcad_addexec(3dm-g 3dm/3dm-g.cpp "libwdb;${OPENNURBS_LIBRARY}" NOSTRICT)
 
-BRLCAD_ADDEXEC(asc2dsp asc/asc2dsp.c libbu)
+brlcad_addexec(asc2dsp asc/asc2dsp.c libbu)
 
-BRLCAD_ADDEXEC(asc2g asc/asc2g.c "libtclcad;libged;libwdb;librt;libbu;${WINSOCK_LIB};${M_LIBRARY}")
+brlcad_addexec(asc2g asc/asc2g.c "libtclcad;libged;libwdb;librt;libbu;${WINSOCK_LIB};${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(asc2pix asc/asc2pix.c libbu)
+brlcad_addexec(asc2pix asc/asc2pix.c libbu)
 
-BRLCAD_ADDEXEC(pix2asc asc/pix2asc.c libbu)
+brlcad_addexec(pix2asc asc/pix2asc.c libbu)
 
-BRLCAD_ADDEXEC(asc-nmg nmg/asc-nmg.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(asc-nmg nmg/asc-nmg.c "libwdb;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(g2asc asc/g2asc.c "librt;libbu;${WINSOCK_LIB}")
+brlcad_addexec(g2asc asc/g2asc.c "librt;libbu;${WINSOCK_LIB}")
 
-BRLCAD_ADDEXEC(bot-bldxf dxf/bot-bldxf.c "librt;libbu;${M_LIBRARY}")
+brlcad_addexec(bot-bldxf dxf/bot-bldxf.c "librt;libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(bot_dump bot_dump.c "libged;librt")
+brlcad_addexec(bot_dump bot_dump.c "libged;librt")
 
-BRLCAD_ADDEXEC(bot_shell-vtk bot_shell-vtk.c librt)
+brlcad_addexec(bot_shell-vtk bot_shell-vtk.c librt)
 
 set(comgeom-g_SRCS
   comgeom/cvt.c
@@ -61,63 +61,63 @@
   comgeom/solid.c
   comgeom/tools.c
   )
-BRLCAD_ADDEXEC(comgeom-g "${comgeom-g_SRCS}" "libwdb;libbn;libbu;${M_LIBRARY}")
+brlcad_addexec(comgeom-g "${comgeom-g_SRCS}" "libwdb;libbn;libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(conv-vg2g conv-vg2g.c "libbu;libsysv")
+brlcad_addexec(conv-vg2g conv-vg2g.c "libbu;libsysv")
 
-BRLCAD_ADDEXEC(cy-g cy-g.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(cy-g cy-g.c "libwdb;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(dbupgrade dbupgrade.c "libwdb;librt;libbu")
+brlcad_addexec(dbupgrade dbupgrade.c "libwdb;librt;libbu")
 
-BRLCAD_ADDEXEC(dem-g dem-g.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(dem-g dem-g.c "libwdb;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(dxf-g dxf/dxf-g.c "libwdb;librt;libbn;libbu;${M_LIBRARY}")
+brlcad_addexec(dxf-g dxf/dxf-g.c "libwdb;librt;libbn;libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(enf-g enf-g.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(enf-g enf-g.c "libwdb;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(euclid_format euclid/euclid_format.c librt)
+brlcad_addexec(euclid_format euclid/euclid_format.c librt)
 
-BRLCAD_ADDEXEC(euclid_unformat euclid/euclid_unformat.c "libbn;libbu;libsysv")
+brlcad_addexec(euclid_unformat euclid/euclid_unformat.c "libbn;libbu;libsysv")
 
-BRLCAD_ADDEXEC(euclid-g euclid/euclid-g.c libwdb)
+brlcad_addexec(euclid-g euclid/euclid-g.c libwdb)
 
-BRLCAD_ADDEXEC(g-dot g-dot.c "libged;libbu")
+brlcad_addexec(g-dot g-dot.c "libged;libbu")
 
-BRLCAD_ADDEXEC(g-dxf dxf/g-dxf.c "librt;libgcv;libbu")
+brlcad_addexec(g-dxf dxf/g-dxf.c "librt;libgcv;libbu")
 
-BRLCAD_ADDEXEC(g-egg g-egg.c "libwdb;libgcv")
+brlcad_addexec(g-egg g-egg.c "libwdb;libgcv")
 
-BRLCAD_ADDEXEC(g-euclid euclid/g-euclid.c librt)
+brlcad_addexec(g-euclid euclid/g-euclid.c librt)
 
-BRLCAD_ADDEXEC(g-euclid1 euclid/g-euclid1.c librt)
+brlcad_addexec(g-euclid1 euclid/g-euclid1.c librt)
 
-BRLCAD_ADDEXEC(g-nff g-nff.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(g-nff g-nff.c "libwdb;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(g-nmg nmg/g-nmg.c libwdb)
+brlcad_addexec(g-nmg nmg/g-nmg.c libwdb)
 
-BRLCAD_ADDEXEC(fast4-g fast4-g.c "libwdb;librt;libbu;${M_LIBRARY}")
+brlcad_addexec(fast4-g fast4-g.c "libwdb;librt;libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(jack-g jack/jack-g.c "libwdb;librt;libbu")
+brlcad_addexec(jack-g jack/jack-g.c "libwdb;librt;libbu")
 
-BRLCAD_ADDEXEC(g-jack jack/g-jack.c "librt;libbu")
+brlcad_addexec(g-jack jack/g-jack.c "librt;libbu")
 
-BRLCAD_ADDEXEC(g-off off/g-off.c "librt;libbu")
+brlcad_addexec(g-off off/g-off.c "librt;libbu")
 
-BRLCAD_ADDEXEC(off-g off/off-g.c "libwdb;librt;libbu")
+brlcad_addexec(off-g off/off-g.c "libwdb;librt;libbu")
 
-BRLCAD_ADDEXEC(stl-g stl/stl-g.c "libwdb;librt;libbu;${WINSOCK_LIB}")
+brlcad_addexec(stl-g stl/stl-g.c "libwdb;librt;libbu;${WINSOCK_LIB}")
 
-BRLCAD_ADDEXEC(g-stl stl/g-stl.c "librt;libgcv;libbu;${WINSOCK_LIB}")
+brlcad_addexec(g-stl stl/g-stl.c "librt;libgcv;libbu;${WINSOCK_LIB}")
 
-BRLCAD_ADDEXEC(g4-g5 g4-g5.c "librt;libbu" NO_INSTALL)
+brlcad_addexec(g4-g5 g4-g5.c "librt;libbu" NO_INSTALL)
 
-BRLCAD_ADDEXEC(g5-g4 g5-g4.c "libwdb;librt;libbu" NO_INSTALL)
+brlcad_addexec(g5-g4 g5-g4.c "libwdb;librt;libbu" NO_INSTALL)
 
-BRLCAD_ADDEXEC(g-acad g-acad.c "librt;libbu")
+brlcad_addexec(g-acad g-acad.c "librt;libbu")
 
-BRLCAD_ADDEXEC(g-obj g-obj.c "librt;libbu")
+brlcad_addexec(g-obj g-obj.c "librt;libbu")
 
-BRLCAD_ADDEXEC(g-voxel g-voxel.c "librt;libbu;libwdb;libanalyze;")
+brlcad_addexec(g-voxel g-voxel.c "librt;libbu;libwdb;libanalyze;")
 
 # TODO - Until wfobj functionality is available as a libgcv API,
 # obj-g build logic is living in src/libgcv/wfobj. Once an API
@@ -125,48 +125,48 @@
 # obj-g build logic back here
 #BRLCAD_ADDEXEC(obj-g ${OBJ_G_SRCS} "libbu;libbn;librt;libwdb;libgcv")
 
-BRLCAD_ADDEXEC(patch-g patch/patch-g.c "libwdb;librt;libbu;${M_LIBRARY}")
+brlcad_addexec(patch-g patch/patch-g.c "libwdb;librt;libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rpatch patch/rpatch.c "librt;libbu")
+brlcad_addexec(rpatch patch/rpatch.c "librt;libbu")
 
-BRLCAD_ADDEXEC(g-tankill tankill/g-tankill.c "librt;libbu")
+brlcad_addexec(g-tankill tankill/g-tankill.c "librt;libbu")
 
-BRLCAD_ADDEXEC(tankill-g tankill/tankill-g.c "libwdb;librt;libbu")
+brlcad_addexec(tankill-g tankill/tankill-g.c "libwdb;librt;libbu")
 
-BRLCAD_ADDEXEC(g-var g-var.c "librt;libbu;${M_LIBRARY}")
+brlcad_addexec(g-var g-var.c "librt;libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(g-vrml g-vrml.c "librt;libbu;${M_LIBRARY}")
+brlcad_addexec(g-vrml g-vrml.c "librt;libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(g-x3d g-x3d.c "librt;libbu;${M_LIBRARY}")
+brlcad_addexec(g-x3d g-x3d.c "librt;libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(nastran-g nastran-g.c "libwdb;librt;libbu;${M_LIBRARY}")
+brlcad_addexec(nastran-g nastran-g.c "libwdb;librt;libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(nmg-bot nmg/nmg-bot.c libwdb)
+brlcad_addexec(nmg-bot nmg/nmg-bot.c libwdb)
 
-BRLCAD_ADDEXEC(nmg-rib nmg/nmg-rib.c libwdb)
+brlcad_addexec(nmg-rib nmg/nmg-rib.c libwdb)
 
-BRLCAD_ADDEXEC(nmg-sgp nmg/nmg-sgp.c libwdb)
+brlcad_addexec(nmg-sgp nmg/nmg-sgp.c libwdb)
 
-BRLCAD_ADDEXEC(ply-g ply-g.c "librt;libbu")
+brlcad_addexec(ply-g ply-g.c "librt;libbu")
 
-BRLCAD_ADDEXEC(poly-bot poly-bot.c "libwdb;${WINSOCK_LIB}")
+brlcad_addexec(poly-bot poly-bot.c "libwdb;${WINSOCK_LIB}")
 
-BRLCAD_ADDEXEC(proe-g proe-g.c "libwdb;librt;libbu;${M_LIBRARY}")
+brlcad_addexec(proe-g proe-g.c "libwdb;librt;libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(shp-g "shp/shp-g.c;shp/shapelib/safileio.c;shp/shapelib/shpopen.c" "libwdb;librt;libbu")
+brlcad_addexec(shp-g "shp/shp-g.c;shp/shapelib/safileio.c;shp/shapelib/shpopen.c" "libwdb;librt;libbu")
 
-BRLCAD_ADDEXEC(viewpoint-g viewpoint-g.c "libwdb;librt;libbu")
+brlcad_addexec(viewpoint-g viewpoint-g.c "libwdb;librt;libbu")
 
-BRLCAD_ADDEXEC(g-xxx_facets g-xxx_facets.c "librt;libbu" NO_INSTALL)
+brlcad_addexec(g-xxx_facets g-xxx_facets.c "librt;libbu" NO_INSTALL)
 
-BRLCAD_ADDEXEC(walk_example walk_example.c "libbu;librt" NO_INSTALL)
+brlcad_addexec(walk_example walk_example.c "libbu;librt" NO_INSTALL)
 
-BRLCAD_ADDEXEC(g-shell-rect g-shell-rect.c "libwdb;librt;libbu;${M_LIBRARY}")
+brlcad_addexec(g-shell-rect g-shell-rect.c "libwdb;librt;libbu;${M_LIBRARY}")
 
 install(PROGRAMS intaval-g.py DESTINATION bin)
 
-BRLCAD_ADDDATA(g-xxx.c sample_applications)
-BRLCAD_ADDDATA(g-xxx_facets.c sample_applications)
+brlcad_adddata(g-xxx.c sample_applications)
+brlcad_adddata(g-xxx_facets.c sample_applications)
 
 set(conv_ignore_files
   Formats.csv
@@ -184,8 +184,8 @@
   shp/shapelib/shapefil.h
   shp/README
   )
-CMAKEFILES(${conv_ignore_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${conv_ignore_files})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/conv/iges/CMakeLists.txt
===================================================================
--- src/conv/iges/CMakeLists.txt	(revision 54114)
+++ src/conv/iges/CMakeLists.txt	(working copy)
@@ -4,7 +4,7 @@
   ${RT_INCLUDE_DIRS}
   ${WDB_INCLUDE_DIRS}
   )
-LIST(REMOVE_DUPLICATES IGES_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES IGES_INCLUDE_DIRS)
 include_directories(${IGES_INCLUDE_DIRS})
 
 if(MSVC)
@@ -96,9 +96,9 @@
   usage.c
   wedge.c
   )
-BRLCAD_ADDEXEC(iges-g "${iges-g_SRCS}" "libwdb;librt;libbn;libbu;${M_LIBRARY}")
+brlcad_addexec(iges-g "${iges-g_SRCS}" "libwdb;librt;libbn;libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(g-iges "g-iges.c;iges.c" "librt;libbu;${M_LIBRARY}")
+brlcad_addexec(g-iges "g-iges.c;iges.c" "librt;libbu;${M_LIBRARY}")
 
 set(iges_ignore_files
   BrepHandler.cpp
@@ -124,8 +124,8 @@
   wing128.igs
   woodie.igs
   )
-CMAKEFILES(${iges_ignore_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${iges_ignore_files})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/conv/step/CMakeLists.txt
===================================================================
--- src/conv/step/CMakeLists.txt	(revision 54114)
+++ src/conv/step/CMakeLists.txt	(working copy)
@@ -10,7 +10,7 @@
   ${RT_INCLUDE_DIRS}
   ${WDB_INCLUDE_DIRS}
   )
-LIST(REMOVE_DUPLICATES STEP_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES STEP_INCLUDE_DIRS)
 include_directories(${STEP_INCLUDE_DIRS})
 
 # local includes
@@ -38,7 +38,7 @@
 
 set(SCHEMA_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/${SCHEMA_NAME})
 make_directory(${SCHEMA_OUT_DIR})
-DISTCLEAN(${SCHEMA_OUT_DIR})
+distclean(${SCHEMA_OUT_DIR})
 include_directories(${SCHEMA_OUT_DIR})
 
 set(fedex_srcs
@@ -463,7 +463,7 @@
   VolumeSiUnit.h
   VolumeUnit.h
   )
-CMAKEFILES(${stepg_HDRS})
+cmakefiles(${stepg_HDRS})
 
 set(stepg_LIBS
   libwdb
@@ -478,7 +478,7 @@
   )
 list(APPEND stepg_LIBS ${stepg_LIBS})
 
-BRLCAD_ADDEXEC(step-g "${stepg_SOURCES}" "${stepg_LIBS}" NOSTRICT)
+brlcad_addexec(step-g "${stepg_SOURCES}" "${stepg_LIBS}" NOSTRICT)
 
 if(MSVC)
   set(stepg_IMPORTS
@@ -495,8 +495,8 @@
 			"${stepg_IMPORTS}")
 endif(MSVC)
 
-DISTCLEAN(${SCHEMA_OUT_DIR}/make_schema)
-CMAKEFILES(Makefile.am)
+distclean(${SCHEMA_OUT_DIR}/make_schema)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/libgcv/CMakeLists.txt
===================================================================
--- src/libgcv/CMakeLists.txt	(revision 54114)
+++ src/libgcv/CMakeLists.txt	(working copy)
@@ -9,7 +9,7 @@
   ${BU_INCLUDE_DIRS}
   ${RT_INCLUDE_DIRS}
   )
-BRLCAD_LIB_INCLUDE_DIRS(gcv GCV_INCLUDE_DIRS "")
+brlcad_lib_include_dirs(gcv GCV_INCLUDE_DIRS "")
 
 set(LIBGCV_SOURCES
   bottess.c
@@ -18,19 +18,19 @@
   tri_intersect.c
   )
 
-BRLCAD_ADDLIB(libgcv "${LIBGCV_SOURCES}" "librt;libbu")
-SET_TARGET_PROPERTIES(libgcv PROPERTIES VERSION 20.0.1 SOVERSION 20)
+brlcad_addlib(libgcv "${LIBGCV_SOURCES}" "librt;libbu")
+set_target_properties(libgcv PROPERTIES VERSION 20.0.1 SOVERSION 20)
 
 add_subdirectory(wfobj)
 
-BRLCAD_ADDEXEC(test_bottess test_bottess.c libgcv NO_INSTALL)
+brlcad_addexec(test_bottess test_bottess.c libgcv NO_INSTALL)
 if(CPP_DLL_DEFINES)
-  SET_PROPERTY(TARGET test_bottess APPEND PROPERTY COMPILE_DEFINITIONS "BOTTESS_DLL_IMPORTS")
+  set_property(TARGET test_bottess APPEND PROPERTY COMPILE_DEFINITIONS "BOTTESS_DLL_IMPORTS")
 endif(CPP_DLL_DEFINES)
 
-CMAKEFILES(NOTES Makefile.am soup.h tri_intersect.h)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/wfobj/CTestTestfile.cmake)
+cmakefiles(NOTES Makefile.am soup.h tri_intersect.h)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/wfobj/CTestTestfile.cmake)
 
 # Local Variables:
 # tab-width: 8
Index: src/libgcv/wfobj/CMakeLists.txt
===================================================================
--- src/libgcv/wfobj/CMakeLists.txt	(revision 54114)
+++ src/libgcv/wfobj/CMakeLists.txt	(working copy)
@@ -4,10 +4,10 @@
   ${CMAKE_CURRENT_BINARY_DIR}
 )
 
-PERPLEX_TARGET(OBJ_Scanner obj_rules.l ${CMAKE_CURRENT_BINARY_DIR}/obj_rules.cpp
+perplex_target(OBJ_Scanner obj_rules.l ${CMAKE_CURRENT_BINARY_DIR}/obj_rules.cpp
     ${CMAKE_CURRENT_BINARY_DIR}/obj_scanner.h)
-LEMON_TARGET(OBJ_Parser obj_grammar.yy obj_grammar.cpp obj_grammar.hpp)
-ADD_PERPLEX_LEMON_DEPENDENCY(OBJ_Scanner OBJ_Parser)
+lemon_target(OBJ_Parser obj_grammar.yy obj_grammar.cpp obj_grammar.hpp)
+add_perplex_lemon_dependency(OBJ_Scanner OBJ_Parser)
 
 set(OBJ_G_SRCS
 	${CMAKE_CURRENT_BINARY_DIR}/obj_grammar.cpp
@@ -17,7 +17,7 @@
 	tri_face.c
 )
 
-BRLCAD_ADDEXEC(obj-g "${OBJ_G_SRCS}" "libbu;libbn;librt;libwdb" NOSTRICTCXX)
+brlcad_addexec(obj-g "${OBJ_G_SRCS}" "libbu;libbn;librt;libwdb" NOSTRICTCXX)
 
 set(wfobj_ignore_files
 	obj_grammar_decls.h
@@ -29,7 +29,7 @@
 	obj_token_type.h
 	tri_face.h
 	)
-CMAKEFILES(${wfobj_ignore_files})
+cmakefiles(${wfobj_ignore_files})
 
 # Local Variables:
 # tab-width: 8
Index: src/gtools/CMakeLists.txt
===================================================================
--- src/gtools/CMakeLists.txt	(revision 54114)
+++ src/gtools/CMakeLists.txt	(working copy)
@@ -7,7 +7,7 @@
   ${PKG_INCLUDE_DIRS}
   ${BRLCAD_SOURCE_DIR}/src/gtools/beset
   )
-LIST(REMOVE_DUPLICATES GTOOLS_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES GTOOLS_INCLUDE_DIRS)
 include_directories(${GTOOLS_INCLUDE_DIRS})
 
 set(beset_SRCS
@@ -16,23 +16,23 @@
   beset/population.c
   )
 
-BRLCAD_ADDEXEC(beset "${beset_SRCS}"  "libbu;librt;libwdb" NO_INSTALL)
+brlcad_addexec(beset "${beset_SRCS}"  "libbu;librt;libwdb" NO_INSTALL)
 
-BRLCAD_ADDEXEC(g_diff g_diff.c "libtclcad;librt")
-BRLCAD_ADDEXEC(g_lint g_lint.c "librt;${M_LIBRARY}")
-BRLCAD_ADDEXEC(g_qa g_qa.c "libged;librt")
-BRLCAD_ADDEXEC(remapid remapid.c "librt;libbu")
+brlcad_addexec(g_diff g_diff.c "libtclcad;librt")
+brlcad_addexec(g_lint g_lint.c "librt;${M_LIBRARY}")
+brlcad_addexec(g_qa g_qa.c "libged;librt")
+brlcad_addexec(remapid remapid.c "librt;libbu")
 
-BRLCAD_ADDEXEC(g_transfer g_transfer.c "librt;libpkg" NO_INSTALL)
-BRLCAD_ADDDATA(g_transfer.c sample_applications)
+brlcad_addexec(g_transfer g_transfer.c "librt;libpkg" NO_INSTALL)
+brlcad_adddata(g_transfer.c sample_applications)
 
 set(gtools_ignore_files
   beset/beset.h
   beset/fitness.h
   beset/population.h
   )
-CMAKEFILES(${gtools_ignore_files})
-CMAKEFILES(Makefile.am beset/Makefile.am)
+cmakefiles(${gtools_ignore_files})
+cmakefiles(Makefile.am beset/Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/libicv/CMakeLists.txt
===================================================================
--- src/libicv/CMakeLists.txt	(revision 54114)
+++ src/libicv/CMakeLists.txt	(working copy)
@@ -5,16 +5,16 @@
   ${PNG_INCLUDE_DIR}
   ${ZLIB_INCLUDE_DIR}
   )
-BRLCAD_LIB_INCLUDE_DIRS(icv ICV_INCLUDE_DIRS "")
+brlcad_lib_include_dirs(icv ICV_INCLUDE_DIRS "")
 
 set(LIBICV_SOURCES
   fileformat.c
   rot.c
   )
 
-BRLCAD_ADDLIB(libicv "${LIBICV_SOURCES}" "libbu;${PNG_LIBRARY}")
-SET_TARGET_PROPERTIES(libicv PROPERTIES VERSION 20.0.1 SOVERSION 20)
-CMAKEFILES(Makefile.am)
+brlcad_addlib(libicv "${LIBICV_SOURCES}" "libbu;${PNG_LIBRARY}")
+set_target_properties(libicv PROPERTIES VERSION 20.0.1 SOVERSION 20)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/libpkg/example/CMakeLists.txt
===================================================================
--- src/libpkg/example/CMakeLists.txt	(revision 54114)
+++ src/libpkg/example/CMakeLists.txt	(working copy)
@@ -4,13 +4,13 @@
   ${BU_INCLUDE_DIRS}
   ${PKG_INCLUDE_DIRS}
   )
-LIST(REMOVE_DUPLICATES PKG_EXAMPLE_INCLUDES)
+list(REMOVE_DUPLICATES PKG_EXAMPLE_INCLUDES)
 include_directories(${PKG_EXAMPLE_INCLUDES})
 
-BRLCAD_ADDEXEC(pkg_test_server server.c "libbu;libpkg" NO_INSTALL)
-BRLCAD_ADDEXEC(pkg_test_client client.c "libbu;libpkg" NO_INSTALL)
+brlcad_addexec(pkg_test_server server.c "libbu;libpkg" NO_INSTALL)
+brlcad_addexec(pkg_test_client client.c "libbu;libpkg" NO_INSTALL)
 
-CMAKEFILES(ntp.h)
+cmakefiles(ntp.h)
 
 # Local Variables:
 # tab-width: 8
Index: src/libpkg/CMakeLists.txt
===================================================================
--- src/libpkg/CMakeLists.txt	(revision 54114)
+++ src/libpkg/CMakeLists.txt	(working copy)
@@ -4,7 +4,7 @@
   ${BRLCAD_SOURCE_DIR}/include
   ${BU_INCLUDE_DIRS}
   )
-BRLCAD_LIB_INCLUDE_DIRS(pkg PKG_INCLUDE_DIRS "")
+brlcad_lib_include_dirs(pkg PKG_INCLUDE_DIRS "")
 
 set(LIBPKG_SOURCES
   pkg.c
@@ -12,12 +12,12 @@
   vers.c
   )
 
-BRLCAD_ADDDATA(tpkg.c sample_applications)
-BRLCAD_ADDEXEC(tpkg tpkg.c "libbu;libpkg" NO_INSTALL)
+brlcad_adddata(tpkg.c sample_applications)
+brlcad_addexec(tpkg tpkg.c "libbu;libpkg" NO_INSTALL)
 
-BRLCAD_ADDLIB(libpkg "${LIBPKG_SOURCES}" libbu)
-SET_TARGET_PROPERTIES(libpkg PROPERTIES VERSION 20.0.1 SOVERSION 20)
-CMAKEFILES(Makefile.am)
+brlcad_addlib(libpkg "${LIBPKG_SOURCES}" libbu)
+set_target_properties(libpkg PROPERTIES VERSION 20.0.1 SOVERSION 20)
+cmakefiles(Makefile.am)
 
 add_subdirectory(example)
 
Index: src/brlman/CMakeLists.txt
===================================================================
--- src/brlman/CMakeLists.txt	(revision 54114)
+++ src/brlman/CMakeLists.txt	(working copy)
@@ -18,9 +18,9 @@
       DESTINATION ${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/${BIN_DIR}
       FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
       GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
-    DISTCLEAN(${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/${BIN_DIR}/brlman)
-    DISTCLEAN(${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/${BIN_DIR}/brlman.tcl)
-    DISTCLEAN(${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/${BIN_DIR}/brlman.bat)
+    distclean(${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/${BIN_DIR}/brlman)
+    distclean(${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/${BIN_DIR}/brlman.tcl)
+    distclean(${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/${BIN_DIR}/brlman.bat)
   endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
 else(CMAKE_CONFIGURATION_TYPES)
   set(BTCLSH_BIN_DIR "${CMAKE_BINARY_DIR}/${BIN_DIR}")
@@ -40,9 +40,9 @@
     DESTINATION ${CMAKE_BINARY_DIR}/${BIN_DIR}
     FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
     GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/${BIN_DIR}/brlman)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/${BIN_DIR}/brlman.tcl)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/${BIN_DIR}/brlman.bat)
+  distclean(${CMAKE_BINARY_DIR}/${BIN_DIR}/brlman)
+  distclean(${CMAKE_BINARY_DIR}/${BIN_DIR}/brlman.tcl)
+  distclean(${CMAKE_BINARY_DIR}/${BIN_DIR}/brlman.bat)
 endif(CMAKE_CONFIGURATION_TYPES)
 
 set(BTCLSH_BIN_DIR "${CMAKE_INSTALL_PREFIX}/${BIN_DIR}")
@@ -51,7 +51,7 @@
 configure_file(brlman.tcl.in ${CMAKE_BINARY_DIR}/src/brlman/brlman.tcl @ONLY)
 install(PROGRAMS ${CMAKE_BINARY_DIR}/src/brlman/brlman.tcl DESTINATION ${BIN_DIR})
 
-CMAKEFILES(brlman.tcl.in brlman.sh.in brlman.bat)
+cmakefiles(brlman.tcl.in brlman.sh.in brlman.bat)
 
 # Local Variables:
 # tab-width: 8
Index: src/mged/points/CMakeLists.txt
===================================================================
--- src/mged/points/CMakeLists.txt	(revision 54114)
+++ src/mged/points/CMakeLists.txt	(working copy)
@@ -11,11 +11,11 @@
   ${TCL_INCLUDE_DIRS}
   )
 
-YACC_TARGET(MGEDPointsParser points_parse.y
+yacc_target(MGEDPointsParser points_parse.y
   ${CMAKE_CURRENT_BINARY_DIR}/points_parse.c)
-LEX_TARGET(MGEDPointsScanner points_scan.l
+lex_target(MGEDPointsScanner points_scan.l
   ${CMAKE_CURRENT_BINARY_DIR}/points_scan.c COMPILE_FLAGS "-l")
-ADD_LEX_YACC_DEPENDENCY(MGEDPointsScanner MGEDPointsParser)
+add_lex_yacc_dependency(MGEDPointsScanner MGEDPointsParser)
 
 set(MGED_POINTS_SRCS
   ${CMAKE_CURRENT_BINARY_DIR}/points_parse.c
@@ -25,16 +25,16 @@
   main.c
   )
 
-BRLCAD_ADDLIB(libpoints "${MGED_POINTS_SRCS}" libbu)
-SET_TARGET_PROPERTIES(libpoints PROPERTIES COMPILE_DEFINITIONS "ENABLE_POINTS")
+brlcad_addlib(libpoints "${MGED_POINTS_SRCS}" libbu)
+set_target_properties(libpoints PROPERTIES COMPILE_DEFINITIONS "ENABLE_POINTS")
 set(mged_points_ignore_files
   count.h
   points_parse.y
   points_scan.l
   process.h
   )
-CMAKEFILES(${mged_points_ignore_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${mged_points_ignore_files})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/mged/CMakeLists.txt
===================================================================
--- src/mged/CMakeLists.txt	(revision 54114)
+++ src/mged/CMakeLists.txt	(working copy)
@@ -7,7 +7,7 @@
   ${TERMIO_INCLUDE_DIRS}
   ${CMAKE_CURRENT_SOURCE_DIR}
   )
-LIST(REMOVE_DUPLICATES MGED_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES MGED_INCLUDE_DIRS)
 include_directories(${MGED_INCLUDE_DIRS})
 
 # Until we figure out how to properly use package require,
@@ -23,7 +23,7 @@
   add_subdirectory(points)
   set(MGED_EXTRA_LIBS libpoints)
 else(LEX_EXECUTABLE AND YACC_EXECUTABLE)
-  CMAKEFILES(points)
+  cmakefiles(points)
 endif(LEX_EXECUTABLE AND YACC_EXECUTABLE)
 
 
@@ -116,32 +116,32 @@
   )
 
 if(NOT WIN32)
-  BRLCAD_ADDEXEC(mged "${MGED_SOURCES}" "libtclcad;libged;libwdb;libdm;libtermio;${MGED_EXTRA_LIBS};${ITCL_LIBRARY};${ITK_LIBRARY}")
+  brlcad_addexec(mged "${MGED_SOURCES}" "libtclcad;libged;libwdb;libdm;libtermio;${MGED_EXTRA_LIBS};${ITCL_LIBRARY};${ITK_LIBRARY}")
 else(NOT WIN32)
-  BRLCAD_ADDEXEC(mged "${MGED_SOURCES}" "libtclcad;libged;libwdb;libdm;${ITCL_LIBRARY};${ITK_LIBRARY};ws2_32.lib;opengl32.lib")
+  brlcad_addexec(mged "${MGED_SOURCES}" "libtclcad;libged;libwdb;libdm;${ITCL_LIBRARY};${ITK_LIBRARY};ws2_32.lib;opengl32.lib")
 endif(NOT WIN32)
 if(${ITCL_LIBRARY} MATCHES "itcl")
-  ADD_DEPENDENCIES(mged itcl)
+  add_dependencies(mged itcl)
 endif(${ITCL_LIBRARY} MATCHES "itcl")
 if(${ITK_LIBRARY} MATCHES "itk")
-  ADD_DEPENDENCIES(mged itk)
+  add_dependencies(mged itk)
 endif(${ITK_LIBRARY} MATCHES "itk")
 if(LEX_EXECUTABLE AND YACC_EXECUTABLE)
-  SET_TARGET_PROPERTIES(mged PROPERTIES COMPILE_FLAGS "-DBC_WITH_PARSER")
+  set_target_properties(mged PROPERTIES COMPILE_FLAGS "-DBC_WITH_PARSER")
 endif(LEX_EXECUTABLE AND YACC_EXECUTABLE)
 
 # mged depends on the creation/installation of all the
 # tclscripts.
 foreach(item ${pkgIndex_target_list})
-  ADD_DEPENDENCIES(mged ${item})
+  add_dependencies(mged ${item})
 endforeach(item ${pkgIndex_target_list})
 foreach(item ${tclIndex_target_list})
-  ADD_DEPENDENCIES(mged ${item})
+  add_dependencies(mged ${item})
 endforeach(item ${tclIndex_target_list})
 
-BRLCAD_ADDEXEC(cad_boundp cad_boundp.c "libbu;${M_LIBRARY}")
+brlcad_addexec(cad_boundp cad_boundp.c "libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(cad_parea cad_parea.c libbu)
+brlcad_addexec(cad_parea cad_parea.c libbu)
 
 if(CMAKE_CONFIGURATION_TYPES)
    foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
@@ -176,8 +176,8 @@
   sedit.h
   titles.h
   )
-CMAKEFILES(${mged_ignore_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${mged_ignore_files})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/librt/CMakeLists.txt
===================================================================
--- src/librt/CMakeLists.txt	(revision 54114)
+++ src/librt/CMakeLists.txt	(working copy)
@@ -15,7 +15,7 @@
   ${TNT_INCLUDE_DIR}
   )
 
-BRLCAD_LIB_INCLUDE_DIRS(rt RT_INCLUDE_DIRS RT_LOCAL_INCLUDE_DIRS)
+brlcad_lib_include_dirs(rt RT_INCLUDE_DIRS RT_LOCAL_INCLUDE_DIRS)
 
 set(LIBRT_SOURCES
   attributes.c
@@ -273,10 +273,10 @@
   timerunix.c
   uvpoints.cpp
   )
-CMAKEFILES(${librt_ignored_files})
+cmakefiles(${librt_ignored_files})
 
-BRLCAD_ADDDATA(nurb_example.c sample_applications)
-BRLCAD_ADDDATA(raydebug.tcl sample_applications)
+brlcad_adddata(nurb_example.c sample_applications)
+brlcad_adddata(raydebug.tcl sample_applications)
 
 if(MSVC)
   set(LIBRT_SOURCES ${LIBRT_SOURCES} timer-nt.c)
@@ -284,22 +284,22 @@
   set(LIBRT_SOURCES ${LIBRT_SOURCES} timer42.c)
 endif(MSVC)
 
-BRLCAD_ADDLIB(librt "${LIBRT_SOURCES}" "libbn;libbu;${OPENNURBS_LIBRARY};libnurbs;${REGEX_LIBRARY};${ZLIB_LIBRARY};${WINSOCK_LIB};${RPCRT_LIB};${STDCXX_LIBRARIES}" NOSTRICTCXX)
+brlcad_addlib(librt "${LIBRT_SOURCES}" "libbn;libbu;${OPENNURBS_LIBRARY};libnurbs;${REGEX_LIBRARY};${ZLIB_LIBRARY};${WINSOCK_LIB};${RPCRT_LIB};${STDCXX_LIBRARIES}" NOSTRICTCXX)
 if(BUILD_STATIC_LIBS)
-  SET_PROPERTY(TARGET librt-static APPEND PROPERTY COMPILE_DEFINITIONS "OBJ_BREP=1")
+  set_property(TARGET librt-static APPEND PROPERTY COMPILE_DEFINITIONS "OBJ_BREP=1")
 endif(BUILD_STATIC_LIBS)
 
-SET_TARGET_PROPERTIES(librt PROPERTIES VERSION 20.0.1 SOVERSION 20)
+set_target_properties(librt PROPERTIES VERSION 20.0.1 SOVERSION 20)
 if(CPP_DLL_DEFINES)
-  SET_PROPERTY(TARGET librt APPEND PROPERTY COMPILE_DEFINITIONS "TIE_DLL_EXPORTS")
-  SET_PROPERTY(TARGET librt APPEND PROPERTY COMPILE_DEFINITIONS "DB5_DLL_EXPORTS")
+  set_property(TARGET librt APPEND PROPERTY COMPILE_DEFINITIONS "TIE_DLL_EXPORTS")
+  set_property(TARGET librt APPEND PROPERTY COMPILE_DEFINITIONS "DB5_DLL_EXPORTS")
 
   if(BRLCAD_BUILD_STATIC_LIBS AND BRLCAD_ENABLE_BRLCAD_LIBRARY)
-    SET_PROPERTY(TARGET librt-static APPEND PROPERTY COMPILE_DEFINITIONS "ON_DLL_IMPORTS")
+    set_property(TARGET librt-static APPEND PROPERTY COMPILE_DEFINITIONS "ON_DLL_IMPORTS")
   endif(BRLCAD_BUILD_STATIC_LIBS AND BRLCAD_ENABLE_BRLCAD_LIBRARY)
 endif(CPP_DLL_DEFINES)
 
-CMAKEFILES(Makefile.am)
+cmakefiles(Makefile.am)
 
 include_directories(
   ${CMAKE_SOURCE_DIR}/src/other/Eigen
@@ -310,8 +310,8 @@
 #BRLCAD_ADDEXEC(test_nurbsfit test_nurbsfit.cpp "librt;libwdb;libnurbs;libbu" NOSTRICT NO_INSTALL)
 #BRLCAD_ADDEXEC(test_subdivision test_subdivision.cpp "librt;libwdb;libnurbs;libbu" NOSTRICT NO_INSTALL)
 
-BRLCAD_ADDEXEC(test_dvec test_dvec.cpp "librt" NOSTRICT NO_INSTALL LOCAL)
-ADD_TEST(test_dvec test_dvec)
+brlcad_addexec(test_dvec test_dvec.cpp "librt" NOSTRICT NO_INSTALL LOCAL)
+add_test(test_dvec test_dvec)
 
 # Local Variables:
 # tab-width: 8
Index: src/CMakeLists.txt
===================================================================
--- src/CMakeLists.txt	(revision 54114)
+++ src/CMakeLists.txt	(working copy)
@@ -45,14 +45,14 @@
 if(NOT MSVC)
   set(LIBPC_DIR libpc)
 else(NOT MSVC)
-  CMAKEFILES(libpc)
+  cmakefiles(libpc)
 endif(NOT MSVC)
 
 # Only add librtserver if it's enabled
 if(BRLCAD_ENABLE_RTSERVER)
   set(LIBRTSERVER_DIR librtserver)
 else(BRLCAD_ENABLE_RTSERVER)
-  CMAKEFILES(librtserver)
+  cmakefiles(librtserver)
 endif(BRLCAD_ENABLE_RTSERVER)
 
 set(level_2_dirs
@@ -152,7 +152,7 @@
     if(${current_level} LESS ${BRLCAD_ENABLE_TARGETS} OR ${current_level} EQUAL ${BRLCAD_ENABLE_TARGETS} )
       add_subdirectory(${subdir})
     else(${current_level} LESS ${BRLCAD_ENABLE_TARGETS} OR ${current_level} EQUAL ${BRLCAD_ENABLE_TARGETS} )
-      CMAKEFILES(${subdir})
+      cmakefiles(${subdir})
     endif(${current_level} LESS ${BRLCAD_ENABLE_TARGETS} OR ${current_level} EQUAL ${BRLCAD_ENABLE_TARGETS} )
   endforeach(subdir ${level_${current_level}_dirs})
 endwhile(${current_level} LESS ${HIGHEST_TARGET_LEVEL})
@@ -174,8 +174,8 @@
 #  target_link_libraries(libbrlcad ${OPENNURBS_LIBRARY} ${TCL_LIBRARY})
 #endif(${HIGHEST_TARGET_LEVEL} GREATER 1)
 
-CMAKEFILES(README external)
-CMAKEFILES(Makefile.am)
+cmakefiles(README external)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/other/re2c/CMake/FindLEMON.cmake
===================================================================
--- src/other/re2c/CMake/FindLEMON.cmake	(revision 54114)
+++ src/other/re2c/CMake/FindLEMON.cmake	(working copy)
@@ -88,7 +88,7 @@
   endif(lemon_path)
 endif(LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LEMON DEFAULT_MSG LEMON_EXECUTABLE LEMON_TEMPLATE)
+find_package_handle_standard_args(LEMON DEFAULT_MSG LEMON_EXECUTABLE LEMON_TEMPLATE)
 mark_as_advanced(LEMON_TEMPLATE)
 
 #============================================================
Index: src/other/re2c/CMake/FindYACC.cmake
===================================================================
--- src/other/re2c/CMake/FindYACC.cmake	(revision 54114)
+++ src/other/re2c/CMake/FindYACC.cmake	(working copy)
@@ -65,19 +65,19 @@
 #=============================================================================
 
 
-FIND_PROGRAM(YACC_EXECUTABLE bison DOC "path to the yacc executable")
-IF(NOT YACC_EXECUTABLE)
-   FIND_PROGRAM(YACC_EXECUTABLE yacc DOC "path to the yacc executable")
-ENDIF(NOT YACC_EXECUTABLE)
-MARK_AS_ADVANCED(YACC_EXECUTABLE)
+find_program(YACC_EXECUTABLE bison DOC "path to the yacc executable")
+if(NOT YACC_EXECUTABLE)
+   find_program(YACC_EXECUTABLE yacc DOC "path to the yacc executable")
+endif(NOT YACC_EXECUTABLE)
+mark_as_advanced(YACC_EXECUTABLE)
 
-IF(YACC_EXECUTABLE)
+if(YACC_EXECUTABLE)
   # internal macro
-  MACRO(YACC_TARGET_option_verbose Name YaccOutput filename)
-    LIST(APPEND YACC_TARGET_cmdopt "--verbose")
-    GET_FILENAME_COMPONENT(YACC_TARGET_output_path "${YaccOutput}" PATH)
-    GET_FILENAME_COMPONENT(YACC_TARGET_output_name "${YaccOutput}" NAME_WE)
-    ADD_CUSTOM_COMMAND(OUTPUT ${filename}
+  macro(YACC_TARGET_option_verbose Name YaccOutput filename)
+    list(APPEND YACC_TARGET_cmdopt "--verbose")
+    get_filename_component(YACC_TARGET_output_path "${YaccOutput}" PATH)
+    get_filename_component(YACC_TARGET_output_name "${YaccOutput}" NAME_WE)
+    add_custom_command(OUTPUT ${filename}
       COMMAND ${CMAKE_COMMAND}
       ARGS -E copy
       "${YACC_TARGET_output_path}/${YACC_TARGET_output_name}.output"
@@ -86,58 +86,58 @@
       "${YACC_TARGET_output_path}/${YACC_TARGET_output_name}.output"
       COMMENT "[YACC][${Name}] Copying yacc verbose table to ${filename}"
       WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
-    SET(YACC_${Name}_VERBOSE_FILE ${filename})
-    LIST(APPEND YACC_TARGET_extraoutputs
+    set(YACC_${Name}_VERBOSE_FILE ${filename})
+    list(APPEND YACC_TARGET_extraoutputs
       "${YACC_TARGET_output_path}/${YACC_TARGET_output_name}.output")
-  ENDMACRO(YACC_TARGET_option_verbose)
+  endmacro(YACC_TARGET_option_verbose)
 
   # internal macro
-  MACRO(YACC_TARGET_option_extraopts Options)
-    SET(YACC_TARGET_extraopts "${Options}")
-    SEPARATE_ARGUMENTS(YACC_TARGET_extraopts)
-    LIST(APPEND YACC_TARGET_cmdopt ${YACC_TARGET_extraopts})
-  ENDMACRO(YACC_TARGET_option_extraopts)
+  macro(YACC_TARGET_option_extraopts Options)
+    set(YACC_TARGET_extraopts "${Options}")
+    separate_arguments(YACC_TARGET_extraopts)
+    list(APPEND YACC_TARGET_cmdopt ${YACC_TARGET_extraopts})
+  endmacro(YACC_TARGET_option_extraopts)
 
   #============================================================
   # YACC_TARGET (public macro)
   #============================================================
   #
-  MACRO(YACC_TARGET Name YaccInput YaccOutput)
-    SET(YACC_TARGET_output_header "")
-    SET(YACC_TARGET_command_opt "")
-    SET(YACC_TARGET_outputs "${YaccOutput}")
-    IF(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
-      MESSAGE(SEND_ERROR "Usage")
-    ELSE()
+  macro(YACC_TARGET Name YaccInput YaccOutput)
+    set(YACC_TARGET_output_header "")
+    set(YACC_TARGET_command_opt "")
+    set(YACC_TARGET_outputs "${YaccOutput}")
+    if(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
+      message(SEND_ERROR "Usage")
+    else()
       # Parsing parameters
-      IF(${ARGC} GREATER 5 OR ${ARGC} EQUAL 5)
-        IF("${ARGV3}" STREQUAL "VERBOSE")
-          YACC_TARGET_option_verbose(${Name} ${YaccOutput} "${ARGV4}")
-        ENDIF()
-        IF("${ARGV3}" STREQUAL "COMPILE_FLAGS")
-          YACC_TARGET_option_extraopts("${ARGV4}")
-        ENDIF()
-      ENDIF()
+      if(${ARGC} GREATER 5 OR ${ARGC} EQUAL 5)
+        if("${ARGV3}" STREQUAL "VERBOSE")
+          yacc_target_option_verbose(${Name} ${YaccOutput} "${ARGV4}")
+        endif()
+        if("${ARGV3}" STREQUAL "COMPILE_FLAGS")
+          yacc_target_option_extraopts("${ARGV4}")
+        endif()
+      endif()
 
-      IF(${ARGC} EQUAL 7)
-        IF("${ARGV5}" STREQUAL "VERBOSE")
-          YACC_TARGET_option_verbose(${Name} ${YaccOutput} "${ARGV6}")
-        ENDIF()
+      if(${ARGC} EQUAL 7)
+        if("${ARGV5}" STREQUAL "VERBOSE")
+          yacc_target_option_verbose(${Name} ${YaccOutput} "${ARGV6}")
+        endif()
       
-        IF("${ARGV5}" STREQUAL "COMPILE_FLAGS")
-          YACC_TARGET_option_extraopts("${ARGV6}")
-        ENDIF()
-      ENDIF()
+        if("${ARGV5}" STREQUAL "COMPILE_FLAGS")
+          yacc_target_option_extraopts("${ARGV6}")
+        endif()
+      endif()
 
       # Header's name generated by yacc (see option -d)
-      LIST(APPEND YACC_TARGET_cmdopt "-d")
-      STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${ARGV2}")
-      STRING(REPLACE "c" "h" _fileext ${_fileext})
-      STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}" 
+      list(APPEND YACC_TARGET_cmdopt "-d")
+      string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${ARGV2}")
+      string(REPLACE "c" "h" _fileext ${_fileext})
+      string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}" 
           YACC_${Name}_OUTPUT_HEADER "${ARGV2}")
-      LIST(APPEND YACC_TARGET_outputs "${YACC_${Name}_OUTPUT_HEADER}")
+      list(APPEND YACC_TARGET_outputs "${YACC_${Name}_OUTPUT_HEADER}")
         
-      ADD_CUSTOM_COMMAND(OUTPUT ${YACC_TARGET_outputs}
+      add_custom_command(OUTPUT ${YACC_TARGET_outputs}
         ${YACC_TARGET_extraoutputs}
         COMMAND ${YACC_EXECUTABLE}
         ARGS ${YACC_TARGET_cmdopt} -o ${ARGV2} ${ARGV1}
@@ -146,20 +146,20 @@
         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
     
       # define target variables
-      SET(YACC_${Name}_DEFINED TRUE)
-      SET(YACC_${Name}_INPUT ${ARGV1})
-      SET(YACC_${Name}_OUTPUTS ${YACC_TARGET_outputs})
-      SET(YACC_${Name}_COMPILE_FLAGS ${YACC_TARGET_cmdopt})
-      SET(YACC_${Name}_OUTPUT_SOURCE "${YaccOutput}")
+      set(YACC_${Name}_DEFINED TRUE)
+      set(YACC_${Name}_INPUT ${ARGV1})
+      set(YACC_${Name}_OUTPUTS ${YACC_TARGET_outputs})
+      set(YACC_${Name}_COMPILE_FLAGS ${YACC_TARGET_cmdopt})
+      set(YACC_${Name}_OUTPUT_SOURCE "${YaccOutput}")
 
-    ENDIF(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
-  ENDMACRO(YACC_TARGET)
+    endif(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
+  endmacro(YACC_TARGET)
   #
   #============================================================
 
-ENDIF(YACC_EXECUTABLE)
+endif(YACC_EXECUTABLE)
 
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(YACC DEFAULT_MSG YACC_EXECUTABLE)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(YACC DEFAULT_MSG YACC_EXECUTABLE)
 
 # FindYACC.cmake ends here
Index: src/other/re2c/CMakeLists.txt
===================================================================
--- src/other/re2c/CMakeLists.txt	(revision 54114)
+++ src/other/re2c/CMakeLists.txt	(working copy)
@@ -1,11 +1,11 @@
 # Minimum required version of CMake
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8)
 if(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
+  cmake_policy(SET CMP0003 NEW)
 endif(COMMAND CMAKE_POLICY)
 
 # Set CMake project name
-PROJECT(RE2C)
+project(RE2C)
 
 # Set project information
 set(PACKAGE re2c)
@@ -28,7 +28,7 @@
   include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/LEMON_Util.cmake)
 endif(NOT COMMAND LEMON_TARGET)
 
-LEMON_TARGET(re2cParse parser.yy parser.cc parser_tokens.h)
+lemon_target(re2cParse parser.yy parser.cc parser_tokens.h)
 
 set(re2c_common_SRCS
   code.cc
@@ -59,27 +59,27 @@
 
 set(STDC_HEADERS 1)
 include(CheckIncludeFile)
-CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
-CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
-CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
-CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
-CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
-CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
-CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
+check_include_file(inttypes.h HAVE_INTTYPES_H)
+check_include_file(memory.h HAVE_MEMORY_H)
+check_include_file(stdbool.h HAVE_STDBOOL_H)
+check_include_file(stdint.h HAVE_STDINT_H)
+check_include_file(stdlib.h HAVE_STDLIB_H)
+check_include_file(string.h HAVE_STRING_H)
+check_include_file(strings.h HAVE_STRINGS_H)
+check_include_file(sys/stat.h HAVE_SYS_STAT_H)
+check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+check_include_file(unistd.h HAVE_UNISTD_H)
 include(CheckFunctionExists)
-CHECK_FUNCTION_EXISTS(memset HAVE_MEMSET)
-CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
-CHECK_FUNCTION_EXISTS(munmap HAVE_MUNMAP)
-CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP)
-CHECK_FUNCTION_EXISTS(strndup HAVE_STRNDUP)
+check_function_exists(memset HAVE_MEMSET)
+check_function_exists(mmap HAVE_MMAP)
+check_function_exists(munmap HAVE_MUNMAP)
+check_function_exists(strdup HAVE_STRDUP)
+check_function_exists(strndup HAVE_STRNDUP)
 include(CheckTypeSize)
-CHECK_TYPE_SIZE(char SIZEOF_CHAR)
-CHECK_TYPE_SIZE(int SIZEOF_INT)
-CHECK_TYPE_SIZE(long SIZEOF_LONG)
-CHECK_TYPE_SIZE(short SIZEOF_SHORT)
+check_type_size(char SIZEOF_CHAR)
+check_type_size(int SIZEOF_INT)
+check_type_size(long SIZEOF_LONG)
+check_type_size(short SIZEOF_SHORT)
 
 configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
 add_definitions(-DHAVE_CONFIG_H)
Index: src/other/libutahrle/CMake/UTAH_CheckFunctions.cmake
===================================================================
--- src/other/libutahrle/CMake/UTAH_CheckFunctions.cmake	(revision 54114)
+++ src/other/libutahrle/CMake/UTAH_CheckFunctions.cmake	(working copy)
@@ -1,13 +1,13 @@
-INCLUDE(CheckLibraryExists)
-INCLUDE(ResolveCompilerPaths)
+include(CheckLibraryExists)
+include(ResolveCompilerPaths)
 
-MACRO(UTAH_CHECK_LIBRARY targetname lname func)
-	IF(NOT ${targetname}_LIBRARY)
-		CHECK_LIBRARY_EXISTS(${lname} ${func} "" HAVE_${targetname}_${lname})
-		IF(HAVE_${targetname}_${lname})
-			RESOLVE_LIBRARIES (${targetname}_LIBRARY "-l${lname}")
-			SET(${targetname}_LINKOPT "-l${lname}" CACHE STRING "${targetname} link option")
-			MARK_AS_ADVANCED(${targetname}_LINKOPT)
-		ENDIF(HAVE_${targetname}_${lname})
-	ENDIF(NOT ${targetname}_LIBRARY)
-ENDMACRO(UTAH_CHECK_LIBRARY lname func)
+macro(UTAH_CHECK_LIBRARY targetname lname func)
+	if(NOT ${targetname}_LIBRARY)
+		check_library_exists(${lname} ${func} "" HAVE_${targetname}_${lname})
+		if(HAVE_${targetname}_${lname})
+			resolve_libraries (${targetname}_LIBRARY "-l${lname}")
+			set(${targetname}_LINKOPT "-l${lname}" CACHE STRING "${targetname} link option")
+			mark_as_advanced(${targetname}_LINKOPT)
+		endif(HAVE_${targetname}_${lname})
+	endif(NOT ${targetname}_LIBRARY)
+endmacro(UTAH_CHECK_LIBRARY lname func)
Index: src/other/libutahrle/CMakeLists.txt
===================================================================
--- src/other/libutahrle/CMakeLists.txt	(revision 54114)
+++ src/other/libutahrle/CMakeLists.txt	(working copy)
@@ -1,9 +1,9 @@
-SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/CMake")
-INCLUDE(UTAH_CheckFunctions)
+set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/CMake")
+include(UTAH_CheckFunctions)
 
-IF(NOT WIN32)
-  UTAH_CHECK_LIBRARY(M m cos)
-ENDIF(NOT WIN32)
+if(NOT WIN32)
+  utah_check_library(M m cos)
+endif(NOT WIN32)
 
 include_directories(
   ${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/include
@@ -11,7 +11,7 @@
   ${CMAKE_CURRENT_BINARY_DIR}
   )
 
-SET(LIBUTAHRLE_PUBLIC_HDRS
+set(LIBUTAHRLE_PUBLIC_HDRS
   ${CMAKE_CURRENT_SOURCE_DIR}/include/exit_status.h
   ${CMAKE_CURRENT_SOURCE_DIR}/include/pyramid.h
   ${CMAKE_CURRENT_SOURCE_DIR}/include/rle.h
@@ -21,11 +21,11 @@
   ${CMAKE_CURRENT_SOURCE_DIR}/include/rle_raw.h
   )
 
-SET(LIBUTAHRLE_PRIVATE_HDRS
+set(LIBUTAHRLE_PRIVATE_HDRS
   ${CMAKE_CURRENT_SOURCE_DIR}/include/colorquant.h
   )
 
-SET(LIBUTAHRLE_SOURCES
+set(LIBUTAHRLE_SOURCES
   Runput.c
   buildmap.c
   cmd_name.c
@@ -54,18 +54,18 @@
   vaxshort.c
   )
 
-IF(MSVC)
+if(MSVC)
   add_definitions(
     -DRLE_DLL_EXPORTS
     -DNO_DECLARE_MALLOC
     -DNEED_BSTRING
     -DNO_OPEN_PIPES
     )
-ENDIF(MSVC)
+endif(MSVC)
 
 add_library(utahrle SHARED ${LIBUTAHRLE_SOURCES})
 target_link_libraries(utahrle ${M_LIBRARY})
-SET_TARGET_PROPERTIES(utahrle PROPERTIES VERSION 19.0.1 SOVERSION 19)
+set_target_properties(utahrle PROPERTIES VERSION 19.0.1 SOVERSION 19)
 install(TARGETS utahrle
 	RUNTIME DESTINATION ${BIN_DIR}
 	LIBRARY DESTINATION ${LIB_DIR}
@@ -76,11 +76,11 @@
 	RUNTIME DESTINATION ${BIN_DIR}
 	LIBRARY DESTINATION ${LIB_DIR}
 	ARCHIVE DESTINATION ${LIB_DIR})
-IF(NOT WIN32)
-  SET_TARGET_PROPERTIES(utahrle-static PROPERTIES OUTPUT_NAME "utahrle")
-ENDIF(NOT WIN32)
+if(NOT WIN32)
+  set_target_properties(utahrle-static PROPERTIES OUTPUT_NAME "utahrle")
+endif(NOT WIN32)
 
-SET(LIBUTAHRLE_MAN3
+set(LIBUTAHRLE_MAN3
   buildmap.3
   bwdithermap.3
   colorquant.3
@@ -128,12 +128,12 @@
   rle_skiprow.3
   scanargs.3
   )
-IF(NOT MAN_DIR)
-  SET(MAN_DIR "share/man")
-ENDIF(NOT MAN_DIR)
+if(NOT MAN_DIR)
+  set(MAN_DIR "share/man")
+endif(NOT MAN_DIR)
 
 if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
   install(FILES ${LIBUTAHRLE_MAN3} DESTINATION ${MAN_DIR}/man3)
   install(FILES rle.5 DESTINATION ${MAN_DIR}/man5)
-  INSTALL(FILES ${LIBUTAHRLE_PUBLIC_HDRS} DESTINATION include)
+  install(FILES ${LIBUTAHRLE_PUBLIC_HDRS} DESTINATION include)
 endif()
Index: src/other/URToolkit/man/CMakeLists.txt
===================================================================
--- src/other/URToolkit/man/CMakeLists.txt	(revision 54114)
+++ src/other/URToolkit/man/CMakeLists.txt	(working copy)
@@ -1,5 +1,5 @@
 
-SET(URT_MANS
+set(URT_MANS
 	aliastorle.1
 	applymap.1
 	avg4.1
Index: src/other/URToolkit/CMakeLists.txt
===================================================================
--- src/other/URToolkit/CMakeLists.txt	(revision 54114)
+++ src/other/URToolkit/CMakeLists.txt	(working copy)
@@ -1,12 +1,12 @@
-IF(NOT MSVC)
-  MACRO(URT_EXEC execname srcs)
-    STRING(REGEX REPLACE " " ";" srcslist "${srcs}")
+if(NOT MSVC)
+  macro(URT_EXEC execname srcs)
+    string(REGEX REPLACE " " ";" srcslist "${srcs}")
     add_executable(${execname} ${srcslist})
     target_link_libraries(${execname} ${UTAHRLE_LIBRARY})
-    INSTALL(TARGETS ${execname} RUNTIME DESTINATION bin)
-  ENDMACRO()
+    install(TARGETS ${execname} RUNTIME DESTINATION bin)
+  endmacro()
 
-  ADD_SUBDIRECTORY(cnv)
-  ADD_SUBDIRECTORY(man)
-  ADD_SUBDIRECTORY(tools)
-ENDIF(NOT MSVC)
+  add_subdirectory(cnv)
+  add_subdirectory(man)
+  add_subdirectory(tools)
+endif(NOT MSVC)
Index: src/other/URToolkit/tools/clock/CMakeLists.txt
===================================================================
--- src/other/URToolkit/tools/clock/CMakeLists.txt	(revision 54114)
+++ src/other/URToolkit/tools/clock/CMakeLists.txt	(working copy)
@@ -3,7 +3,7 @@
 	${CMAKE_CURRENT_SOURCE_DIR}
 	)
 
-IF(SH_EXEC)
+if(SH_EXEC)
 
 	#ADD_CUSTOM_COMMAND(
 	#		OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/font.c
@@ -14,10 +14,10 @@
 
 	#The font file is supposed to be generated, and the above code will do so, but it appears the makeFont
 	#script has some sort of issue, at least on OSX - font.c has been checked in to the repository.  Go with that for now.
-	URT_EXEC(rleClock "rleClock.c font.c")
+	urt_exec(rleClock "rleClock.c font.c")
 
-ELSE(SH_EXEC)
+else(SH_EXEC)
 
-	URT_EXEC(rleClock "rleClock.c font.c")
+	urt_exec(rleClock "rleClock.c font.c")
 
-ENDIF(SH_EXEC)
+endif(SH_EXEC)
Index: src/other/URToolkit/tools/CMakeLists.txt
===================================================================
--- src/other/URToolkit/tools/CMakeLists.txt	(revision 54114)
+++ src/other/URToolkit/tools/CMakeLists.txt	(working copy)
@@ -4,47 +4,47 @@
 	${CMAKE_CURRENT_SOURCE_DIR}
 )
 
-ADD_SUBDIRECTORY(clock)
+add_subdirectory(clock)
 
-URT_EXEC(applymap applymap.c)
-URT_EXEC(avg4 avg4.c)
-URT_EXEC(crop "crop.c rle_box.c")
-URT_EXEC(fant "fant.c mallocNd.c")
-URT_EXEC(into into.c)
-URT_EXEC(mcut mcut.c)
-URT_EXEC(mergechan mergechan.c)
-URT_EXEC(pyrmask "pyrmask.c pyrlib.c")
-URT_EXEC(repos repos.c)
-URT_EXEC(rleaddcom rleaddcom.c)
-URT_EXEC(rlebg rlebg.c)
-URT_EXEC(rlebox "rlebox.c rle_box.c")
-URT_EXEC(rlecat rlecat.c)
-URT_EXEC(rleccube rleccube.c)
-URT_EXEC(rlecomp rlecomp.c)
-URT_EXEC(rledither rledither.c)
-URT_EXEC(rleflip rleflip.c)
-URT_EXEC(rlegrid rlegrid.c)
-URT_EXEC(rlehdr rlehdr.c)
-URT_EXEC(rlehisto rlehisto.c)
-URT_EXEC(rleinterp rleinterp.c)
-URT_EXEC(rleldmap rleldmap.c)
-URT_EXEC(rlemandl rlemandl.c)
-URT_EXEC(rlenoise rlenoise.c)
-URT_EXEC(rlepatch rlepatch.c)
-URT_EXEC(rleprint rleprint.c)
-URT_EXEC(rlequant rlequant.c)
-URT_EXEC(rlescale rlescale.c)
-URT_EXEC(rleselect rleselect.c)
-URT_EXEC(rlesetbg rlesetbg.c)
-URT_EXEC(rlesortmap rlesortmap.c)
-URT_EXEC(rlespiff rlespiff.c)
-URT_EXEC(rlesplice rlesplice.c)
-URT_EXEC(rlesplit rlesplit.c)
-URT_EXEC(rlestereo rlestereo.c)
-URT_EXEC(rleswap rleswap.c)
-URT_EXEC(rlezoom rlezoom.c)
-URT_EXEC(smush smush.c)
-URT_EXEC(to8 to8.c)
-URT_EXEC(tobw tobw.c)
-URT_EXEC(unexp unexp.c)
-URT_EXEC(unslice unslice.c)
+urt_exec(applymap applymap.c)
+urt_exec(avg4 avg4.c)
+urt_exec(crop "crop.c rle_box.c")
+urt_exec(fant "fant.c mallocNd.c")
+urt_exec(into into.c)
+urt_exec(mcut mcut.c)
+urt_exec(mergechan mergechan.c)
+urt_exec(pyrmask "pyrmask.c pyrlib.c")
+urt_exec(repos repos.c)
+urt_exec(rleaddcom rleaddcom.c)
+urt_exec(rlebg rlebg.c)
+urt_exec(rlebox "rlebox.c rle_box.c")
+urt_exec(rlecat rlecat.c)
+urt_exec(rleccube rleccube.c)
+urt_exec(rlecomp rlecomp.c)
+urt_exec(rledither rledither.c)
+urt_exec(rleflip rleflip.c)
+urt_exec(rlegrid rlegrid.c)
+urt_exec(rlehdr rlehdr.c)
+urt_exec(rlehisto rlehisto.c)
+urt_exec(rleinterp rleinterp.c)
+urt_exec(rleldmap rleldmap.c)
+urt_exec(rlemandl rlemandl.c)
+urt_exec(rlenoise rlenoise.c)
+urt_exec(rlepatch rlepatch.c)
+urt_exec(rleprint rleprint.c)
+urt_exec(rlequant rlequant.c)
+urt_exec(rlescale rlescale.c)
+urt_exec(rleselect rleselect.c)
+urt_exec(rlesetbg rlesetbg.c)
+urt_exec(rlesortmap rlesortmap.c)
+urt_exec(rlespiff rlespiff.c)
+urt_exec(rlesplice rlesplice.c)
+urt_exec(rlesplit rlesplit.c)
+urt_exec(rlestereo rlestereo.c)
+urt_exec(rleswap rleswap.c)
+urt_exec(rlezoom rlezoom.c)
+urt_exec(smush smush.c)
+urt_exec(to8 to8.c)
+urt_exec(tobw tobw.c)
+urt_exec(unexp unexp.c)
+urt_exec(unslice unslice.c)
Index: src/other/URToolkit/cnv/CMakeLists.txt
===================================================================
--- src/other/URToolkit/cnv/CMakeLists.txt	(revision 54114)
+++ src/other/URToolkit/cnv/CMakeLists.txt	(working copy)
@@ -17,36 +17,36 @@
 #	rletotiff
 #	tifftorle
 
-URT_EXEC(aliastorle aliastorle.c)
-URT_EXEC(cubitorle cubitorle.c)
-URT_EXEC(giftorle giftorle.c)
-URT_EXEC(graytorle graytorle.c)
+urt_exec(aliastorle aliastorle.c)
+urt_exec(cubitorle cubitorle.c)
+urt_exec(giftorle giftorle.c)
+urt_exec(graytorle graytorle.c)
 # URT_EXEC(iristorle iristorle.c)
-URT_EXEC(painttorle painttorle.c)
+urt_exec(painttorle painttorle.c)
 # URT_EXEC(pgmtorle pgmtorle.c)
 # URT_EXEC(ppmtorle ppmtorle.c)
 # URT_EXEC(rastorle rastorle.c)
-URT_EXEC(rawtorle rawtorle.c)
-URT_EXEC(rletoabA60 rletoabA60.c)
-URT_EXEC(rletoalias rletoalias.c)
-URT_EXEC(rletoascii rletoascii.c)
+urt_exec(rawtorle rawtorle.c)
+urt_exec(rletoabA60 rletoabA60.c)
+urt_exec(rletoalias rletoalias.c)
+urt_exec(rletoascii rletoascii.c)
 # URT_EXEC(rletocgm rletocgm.c)
-URT_EXEC(rletogray rletogray.c)
+urt_exec(rletogray rletogray.c)
 # URT_EXEC(rletoiris rletoiris.c)
-URT_EXEC(rletopaint rletopaint.c)
+urt_exec(rletopaint rletopaint.c)
 # URT_EXEC(rletoppm rletoppm.c)
-URT_EXEC(rletops rletops.c)
+urt_exec(rletops rletops.c)
 # URT_EXEC(rletorast rletorast.c)
-URT_EXEC(rletoraw rletoraw.c)
-URT_EXEC(rletorla rletorla.c)
-URT_EXEC(rletotarga rletotarga.c)
+urt_exec(rletoraw rletoraw.c)
+urt_exec(rletorla rletorla.c)
+urt_exec(rletotarga rletotarga.c)
 # URT_EXEC(rletotiff rletotiff.c)
-URT_EXEC(rletovcr rletovcr.c)
-URT_EXEC(targatorle targatorle.c)
+urt_exec(rletovcr rletovcr.c)
+urt_exec(targatorle targatorle.c)
 # URT_EXEC(tifftorle tifftorle.c)
-URT_EXEC(vcrtorle vcrtorle.c)
-URT_EXEC(wasatchrle wasatchrle.c)
-URT_EXEC(xbmtorle xbmtorle.c)
+urt_exec(vcrtorle vcrtorle.c)
+urt_exec(wasatchrle wasatchrle.c)
+urt_exec(xbmtorle xbmtorle.c)
 
-URT_EXEC(rletoabA62 "rletoabA62/rle.c rletoabA62/rletoabA62.c")
-URT_EXEC(rletogif "rletogif/compgif.c rletogif/gifencod.c rletogif/rletogif.c")
+urt_exec(rletoabA62 "rletoabA62/rle.c rletoabA62/rletoabA62.c")
+urt_exec(rletogif "rletogif/compgif.c rletogif/gifencod.c rletogif/rletogif.c")
Index: src/other/clipper/CMakeLists.txt
===================================================================
--- src/other/clipper/CMakeLists.txt	(revision 54114)
+++ src/other/clipper/CMakeLists.txt	(working copy)
@@ -1,26 +1,26 @@
 # Minimum required version of CMake
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-IF(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND CMAKE_POLICY)
+cmake_minimum_required(VERSION 2.8)
+if(COMMAND CMAKE_POLICY)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND CMAKE_POLICY)
 
 # Set CMake project name
-PROJECT(CLIPPER)
+project(CLIPPER)
 
-INCLUDE_DIRECTORIES(
+include_directories(
   ${CMAKE_CURRENT_SOURCE_DIR}
   )
 
-IF(NOT LIB_DIR)
-    SET(LIB_DIR lib)
-ENDIF(NOT LIB_DIR)
-IF(NOT BIN_DIR)
-    SET(BIN_DIR bin)
-ENDIF(NOT BIN_DIR)
+if(NOT LIB_DIR)
+    set(LIB_DIR lib)
+endif(NOT LIB_DIR)
+if(NOT BIN_DIR)
+    set(BIN_DIR bin)
+endif(NOT BIN_DIR)
 
-IF(MSVC)
+if(MSVC)
   add_definitions("-DCLIPPER_DLL_EXPORTS")
-ENDIF(MSVC)
+endif(MSVC)
 
 add_library(clipper clipper.cpp)
 install(TARGETS clipper
Index: src/other/hv3/CMakeLists.txt
===================================================================
--- src/other/hv3/CMakeLists.txt	(revision 54114)
+++ src/other/hv3/CMakeLists.txt	(working copy)
@@ -1,4 +1,4 @@
-SET(hv3_TCLSCRIPTS
+set(hv3_TCLSCRIPTS
   bookmarks.html
   bugreport.html
   combobox.tcl
@@ -75,7 +75,7 @@
 file(APPEND ${CMAKE_BINARY_DIR}/lib/hv3/pkgIndex.tcl "package ifneeded hv3 0.1 [list source [file join $dir hv3.tcl]]")
 install(FILES ${CMAKE_BINARY_DIR}/lib/hv3/pkgIndex.tcl DESTINATION lib/hv3)
 
-SET(hv3_launch
+set(hv3_launch
   "#!/bin/sh
 #\\
 exec ${CMAKE_BINARY_DIR}/bin/wish $0 $\@
Index: src/other/libz/CMakeLists.txt
===================================================================
--- src/other/libz/CMakeLists.txt	(revision 54114)
+++ src/other/libz/CMakeLists.txt	(working copy)
@@ -51,15 +51,15 @@
 # Check for unistd.h
 #
 check_include_file(unistd.h Z_HAVE_UNISTD_H)
-IF(Z_HAVE_UNISTD_H)
+if(Z_HAVE_UNISTD_H)
 	add_definitions(-DZ_HAVE_UNISTD_H)
-ENDIF(Z_HAVE_UNISTD_H)
+endif(Z_HAVE_UNISTD_H)
 
-OPTION(ENABLE_Z_PREFIX "Add z_ prefix to all library functions." OFF)
-MARK_AS_ADVANCED(ENABLE_Z_PREFIX)
-IF(ENABLE_Z_PREFIX)
+option(ENABLE_Z_PREFIX "Add z_ prefix to all library functions." OFF)
+mark_as_advanced(ENABLE_Z_PREFIX)
+if(ENABLE_Z_PREFIX)
 	add_definitions(-DZ_PREFIX)
-ENDIF(ENABLE_Z_PREFIX)
+endif(ENABLE_Z_PREFIX)
 
 if(MSVC)
     #set(CMAKE_DEBUG_POSTFIX "d")
@@ -171,9 +171,9 @@
     install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION include)
 endif()
 
-IF(NOT MAN_DIR)
-  SET(MAN_DIR "share/man")
-ENDIF(NOT MAN_DIR)
+if(NOT MAN_DIR)
+  set(MAN_DIR "share/man")
+endif(NOT MAN_DIR)
 if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
     install(FILES zlib.3 DESTINATION ${MAN_DIR}/man3)
 endif()
Index: src/other/tkhtml/CMakeLists.txt
===================================================================
--- src/other/tkhtml/CMakeLists.txt	(revision 54114)
+++ src/other/tkhtml/CMakeLists.txt	(working copy)
@@ -1,25 +1,25 @@
 # Minimum required version of CMake
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-IF(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND CMAKE_POLICY)
+cmake_minimum_required(VERSION 2.8)
+if(COMMAND CMAKE_POLICY)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND CMAKE_POLICY)
 
 # set CMake project name
-PROJECT(TKHTML)
+project(TKHTML)
 
-SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/CMake")
+set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/CMake")
 
-IF(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY OR NOT TK_LIBRARY OR NOT
+if(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY OR NOT TK_LIBRARY OR NOT
     TK_STUB_LIBRARY OR NOT TCL_INCLUDE_DIRS OR NOT TK_INCLUDE_PATH OR NOT
     TCL_TCLSH OR NOT TCL_WISH_EXECUTABLE)
   find_package(TCL)
-ENDIF(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY OR NOT TK_LIBRARY OR NOT
+endif(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY OR NOT TK_LIBRARY OR NOT
   TK_STUB_LIBRARY OR NOT TCL_INCLUDE_DIRS OR NOT TK_INCLUDE_PATH OR NOT
   TCL_TCLSH OR NOT TCL_WISH_EXECUTABLE)
 
-IF(TK_SYSTEM_GRAPHICS MATCHES "x11")
+if(TK_SYSTEM_GRAPHICS MATCHES "x11")
   find_package(X11)
-ENDIF(TK_SYSTEM_GRAPHICS MATCHES "x11")
+endif(TK_SYSTEM_GRAPHICS MATCHES "x11")
 
 include_directories(
   ${CMAKE_CURRENT_SOURCE_DIR}/src
@@ -29,36 +29,36 @@
   ${X11_INCLUDE_DIR}
   )
 
-SET(TKHTML_PKGNAME Tkhtml)
-SET(TKHTML_PKGVERSION "3.0")
+set(TKHTML_PKGNAME Tkhtml)
+set(TKHTML_PKGVERSION "3.0")
 
 # Windows specific flags
-IF(WIN32)
-  SET(TKHTML_CFLAGS "${TKHTML_CFLAGS} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEP -Ot -Oi -fp:strict -Gs -GS -GL -DUSE_TCL_STUBS -DUSE_TK_STUBS -D__WIN32__")
-  SET(TKHTML_CFLAGS "${TKHTML_CFLAGS} -Dinline=__inline -DBUILD_tkhtml")
-ENDIF(WIN32)
+if(WIN32)
+  set(TKHTML_CFLAGS "${TKHTML_CFLAGS} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEP -Ot -Oi -fp:strict -Gs -GS -GL -DUSE_TCL_STUBS -DUSE_TK_STUBS -D__WIN32__")
+  set(TKHTML_CFLAGS "${TKHTML_CFLAGS} -Dinline=__inline -DBUILD_tkhtml")
+endif(WIN32)
 
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TKHTML_CFLAGS}")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TKHTML_CFLAGS}")
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/htmldefaultstyle.c
   COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_SOURCE_DIR}/src/mkdefaultstyle.tcl > ${CMAKE_CURRENT_BINARY_DIR}/htmldefaultstyle.c
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/mkdefaultstyle.tcl ${TCL_TCLSH}
   )
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/htmltokens.c ${CMAKE_CURRENT_BINARY_DIR}/htmltokens.h
   COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_SOURCE_DIR}/src/tokenlist.txt
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/tokenlist.txt ${TCL_TCLSH}
   )
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cssprop.c ${CMAKE_CURRENT_BINARY_DIR}/cssprop.h
   COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_SOURCE_DIR}/src/cssprop.tcl
   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/htmltokens.c ${CMAKE_CURRENT_SOURCE_DIR}/src/cssprop.tcl ${TCL_TCLSH}
   )
 
-SET(TKHTML_SRCS
+set(TKHTML_SRCS
   ${CMAKE_CURRENT_BINARY_DIR}/htmldefaultstyle.c
   ${CMAKE_CURRENT_BINARY_DIR}/cssprop.c
   src/css.c
@@ -85,38 +85,38 @@
   src/swproc.c
   )
 
-IF(NOT LIB_DIR)
-  IF(NOT WIN32)
-    SET(LIB_DIR lib)
-  ELSE(NOT WIN32)
-    SET(LIB_DIR bin)
-  ENDIF(NOT WIN32)
-ENDIF(NOT LIB_DIR)
+if(NOT LIB_DIR)
+  if(NOT WIN32)
+    set(LIB_DIR lib)
+  else(NOT WIN32)
+    set(LIB_DIR bin)
+  endif(NOT WIN32)
+endif(NOT LIB_DIR)
 
 add_library(Tkhtml SHARED ${TKHTML_SRCS})
-IF(TK_SYSTEM_GRAPHICS MATCHES "aqua")
+if(TK_SYSTEM_GRAPHICS MATCHES "aqua")
   # Need the X emulation functions from Tk when using aqua - the stubs
   # library doesn't seem to supply them
   target_link_libraries(Tkhtml ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY} ${TK_LIBRARY} ${X11_LIBRARIES})
-ELSE(TK_SYSTEM_GRAPHICS MATCHES "aqua")
+else(TK_SYSTEM_GRAPHICS MATCHES "aqua")
   target_link_libraries(Tkhtml ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY} ${X11_LIBRARIES})
-ENDIF(TK_SYSTEM_GRAPHICS MATCHES "aqua")
-SET_TARGET_PROPERTIES(Tkhtml PROPERTIES VERSION ${TKHTML_PKGVERSION})
-SET_PROPERTY(TARGET Tkhtml APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
-SET_PROPERTY(TARGET Tkhtml APPEND PROPERTY COMPILE_DEFINITIONS USE_TK_STUBS)
+endif(TK_SYSTEM_GRAPHICS MATCHES "aqua")
+set_target_properties(Tkhtml PROPERTIES VERSION ${TKHTML_PKGVERSION})
+set_property(TARGET Tkhtml APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
+set_property(TARGET Tkhtml APPEND PROPERTY COMPILE_DEFINITIONS USE_TK_STUBS)
 install(TARGETS Tkhtml 
 	RUNTIME DESTINATION ${BIN_DIR}
 	LIBRARY DESTINATION ${LIB_DIR}
 	ARCHIVE DESTINATION ${LIB_DIR})
 
-TCL_PKGINDEX(Tkhtml ${TKHTML_PKGNAME} ${TKHTML_PKGVERSION})
+tcl_pkgindex(Tkhtml ${TKHTML_PKGNAME} ${TKHTML_PKGVERSION})
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tkhtml.n
   COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_SOURCE_DIR}/doc/macros.tcl -nroff ${CMAKE_CURRENT_SOURCE_DIR}/doc/html.man > ${CMAKE_CURRENT_BINARY_DIR}/tkhtml.n
   )
-ADD_CUSTOM_TARGET(tkhtml_n_gen ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tkhtml.n)
+add_custom_target(tkhtml_n_gen ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tkhtml.n)
 if(NOT MAN_DIR)
-  SET(MAN_DIR man)
+  set(MAN_DIR man)
 endif(NOT MAN_DIR)
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tkhtml.n DESTINATION ${MAN_DIR}/mann)
Index: src/other/tkhtml/CMake/FindX11.cmake
===================================================================
--- src/other/tkhtml/CMake/FindX11.cmake	(revision 54114)
+++ src/other/tkhtml/CMake/FindX11.cmake	(working copy)
@@ -130,16 +130,16 @@
 # 
 #=============================================================================
 
-MACRO(X11_FIND_INCLUDE_PATH component header)
+macro(X11_FIND_INCLUDE_PATH component header)
   find_path(X11_${component}_INCLUDE_PATH ${header} ${X11_INC_SEARCH_PATH} NO_CMAKE_SYSTEM_PATH)
   set(X11_HDR_VARS ${X11_HDR_VARS} X11_${component}_INCLUDE_PATH)
   if(X11_${component}_INCLUDE_PATH)
     set(X11_HDR_PATHS ${X11_HDR_PATHS} ${X11_${component}_INCLUDE_PATH})
     list(REMOVE_DUPLICATES X11_HDR_PATHS)
   endif(X11_${component}_INCLUDE_PATH)
-ENDMACRO(X11_FIND_INCLUDE_PATH)
+endmacro(X11_FIND_INCLUDE_PATH)
 
-MACRO(X11_FIND_LIB_PATH component libname)
+macro(X11_FIND_LIB_PATH component libname)
   find_library(X11_${component}_LIB ${libname} ${X11_LIB_SEARCH_PATH} NO_CMAKE_SYSTEM_PATH)
   set(X11_LIB_VARS ${X11_LIB_VARS} X11_${component}_LIB)
   if(X11_${component}_LIB)
@@ -147,7 +147,7 @@
     set(X11_LIB_PATHS ${X11_LIB_PATHS} ${X11_${component}_DIR})
     list(REMOVE_DUPLICATES X11_LIB_PATHS)
   endif(X11_${component}_LIB)
-ENDMACRO(X11_FIND_LIB_PATH)
+endmacro(X11_FIND_LIB_PATH)
 
 if(UNIX)
   set(X11_FOUND 0)
@@ -208,63 +208,63 @@
   set(X11_LIB_PATHS)
   
   # Find primary X11 headers
-  X11_FIND_INCLUDE_PATH(X11		X11/X.h)
-  X11_FIND_INCLUDE_PATH(Xlib		X11/Xlib.h)
+  x11_find_include_path(X11		X11/X.h)
+  x11_find_include_path(Xlib		X11/Xlib.h)
   # Look for other X11 includes; keep the list sorted by name of the cmake X11_<component>_INCLUDE_PATH
   # variable (component doesn't need to match the include file name).
-  X11_FIND_INCLUDE_PATH(ICE 		X11/ICE/ICE.h)
-  X11_FIND_INCLUDE_PATH(Xaccessrules 	X11/extensions/XKBrules.h)
-  X11_FIND_INCLUDE_PATH(Xaccessstr 	X11/extensions/XKBstr.h)
-  X11_FIND_INCLUDE_PATH(Xau 		X11/Xauth.h)
-  X11_FIND_INCLUDE_PATH(Xcomposite 	X11/extensions/Xcomposite.h)
-  X11_FIND_INCLUDE_PATH(Xcursor 	X11/Xcursor/Xcursor.h)
-  X11_FIND_INCLUDE_PATH(Xdamage 	X11/extensions/Xdamage.h)
-  X11_FIND_INCLUDE_PATH(Xdmcp 		X11/Xdmcp.h)
-  X11_FIND_INCLUDE_PATH(dpms 		X11/extensions/dpms.h)
-  X11_FIND_INCLUDE_PATH(xf86misc 	X11/extensions/xf86misc.h)
-  X11_FIND_INCLUDE_PATH(xf86vmode 	X11/extensions/xf86vmode.h)
-  X11_FIND_INCLUDE_PATH(Xfixes		X11/extensions/Xfixes.h)
-  X11_FIND_INCLUDE_PATH(Xft		X11/Xft/Xft.h)
-  X11_FIND_INCLUDE_PATH(Xi		X11/extensions/XInput.h)
-  X11_FIND_INCLUDE_PATH(Xinerama	X11/extensions/Xinerama.h)
-  X11_FIND_INCLUDE_PATH(Xinput		X11/extensions/XInput.h)
-  X11_FIND_INCLUDE_PATH(Xkb		X11/extensions/XKB.h)
-  X11_FIND_INCLUDE_PATH(Xkblib		X11/XKBlib.h)
-  X11_FIND_INCLUDE_PATH(Xpm		X11/xpm.h)
-  X11_FIND_INCLUDE_PATH(XTest		X11/extensions/XTest.h)
-  X11_FIND_INCLUDE_PATH(XShm		X11/extensions/XShm.h)
-  X11_FIND_INCLUDE_PATH(Xrandr		X11/extensions/Xrandr.h)
-  X11_FIND_INCLUDE_PATH(Xrender		X11/extensions/Xrender.h)
-  X11_FIND_INCLUDE_PATH(Xscreensaver	X11/extensions/scrnsaver.h)
-  X11_FIND_INCLUDE_PATH(Xshape		X11/extensions/shape.h)
-  X11_FIND_INCLUDE_PATH(Xutil		X11/Xutil.h)
-  X11_FIND_INCLUDE_PATH(Xt		X11/Intrinsic.h)
-  X11_FIND_INCLUDE_PATH(Xv		X11/extensions/Xvlib.h)
+  x11_find_include_path(ICE 		X11/ICE/ICE.h)
+  x11_find_include_path(Xaccessrules 	X11/extensions/XKBrules.h)
+  x11_find_include_path(Xaccessstr 	X11/extensions/XKBstr.h)
+  x11_find_include_path(Xau 		X11/Xauth.h)
+  x11_find_include_path(Xcomposite 	X11/extensions/Xcomposite.h)
+  x11_find_include_path(Xcursor 	X11/Xcursor/Xcursor.h)
+  x11_find_include_path(Xdamage 	X11/extensions/Xdamage.h)
+  x11_find_include_path(Xdmcp 		X11/Xdmcp.h)
+  x11_find_include_path(dpms 		X11/extensions/dpms.h)
+  x11_find_include_path(xf86misc 	X11/extensions/xf86misc.h)
+  x11_find_include_path(xf86vmode 	X11/extensions/xf86vmode.h)
+  x11_find_include_path(Xfixes		X11/extensions/Xfixes.h)
+  x11_find_include_path(Xft		X11/Xft/Xft.h)
+  x11_find_include_path(Xi		X11/extensions/XInput.h)
+  x11_find_include_path(Xinerama	X11/extensions/Xinerama.h)
+  x11_find_include_path(Xinput		X11/extensions/XInput.h)
+  x11_find_include_path(Xkb		X11/extensions/XKB.h)
+  x11_find_include_path(Xkblib		X11/XKBlib.h)
+  x11_find_include_path(Xpm		X11/xpm.h)
+  x11_find_include_path(XTest		X11/extensions/XTest.h)
+  x11_find_include_path(XShm		X11/extensions/XShm.h)
+  x11_find_include_path(Xrandr		X11/extensions/Xrandr.h)
+  x11_find_include_path(Xrender		X11/extensions/Xrender.h)
+  x11_find_include_path(Xscreensaver	X11/extensions/scrnsaver.h)
+  x11_find_include_path(Xshape		X11/extensions/shape.h)
+  x11_find_include_path(Xutil		X11/Xutil.h)
+  x11_find_include_path(Xt		X11/Intrinsic.h)
+  x11_find_include_path(Xv		X11/extensions/Xvlib.h)
   
 
   # Find primary X11 library
-  X11_FIND_LIB_PATH(X11			X11)
+  x11_find_lib_path(X11			X11)
   # Find additional X libraries. Keep list sorted by library name.
-  X11_FIND_LIB_PATH(ICE			ICE)
-  X11_FIND_LIB_PATH(SM			SM)
-  X11_FIND_LIB_PATH(Xau			Xau)
-  X11_FIND_LIB_PATH(Xcomposite		Xcomposite)
-  X11_FIND_LIB_PATH(Xcursor		Xcursor)
-  X11_FIND_LIB_PATH(Xdamage		Xdamage)
-  X11_FIND_LIB_PATH(Xdmcp		Xdmcp)
-  X11_FIND_LIB_PATH(Xext		Xext)
-  X11_FIND_LIB_PATH(Xfixes		Xfixes)
-  X11_FIND_LIB_PATH(Xft			Xft)
-  X11_FIND_LIB_PATH(Xi			Xi)
-  X11_FIND_LIB_PATH(Xinerama		Xinerama)
-  X11_FIND_LIB_PATH(Xpm			Xpm)
-  X11_FIND_LIB_PATH(Xrandr		Xrandr)
-  X11_FIND_LIB_PATH(Xrender		Xrender)
-  X11_FIND_LIB_PATH(Xscreensaver	Xss)
-  X11_FIND_LIB_PATH(Xt			Xt)
-  X11_FIND_LIB_PATH(XTest		Xtst)
-  X11_FIND_LIB_PATH(Xv			Xv)
-  X11_FIND_LIB_PATH(Xxf86misc		Xxf86misc)
+  x11_find_lib_path(ICE			ICE)
+  x11_find_lib_path(SM			SM)
+  x11_find_lib_path(Xau			Xau)
+  x11_find_lib_path(Xcomposite		Xcomposite)
+  x11_find_lib_path(Xcursor		Xcursor)
+  x11_find_lib_path(Xdamage		Xdamage)
+  x11_find_lib_path(Xdmcp		Xdmcp)
+  x11_find_lib_path(Xext		Xext)
+  x11_find_lib_path(Xfixes		Xfixes)
+  x11_find_lib_path(Xft			Xft)
+  x11_find_lib_path(Xi			Xi)
+  x11_find_lib_path(Xinerama		Xinerama)
+  x11_find_lib_path(Xpm			Xpm)
+  x11_find_lib_path(Xrandr		Xrandr)
+  x11_find_lib_path(Xrender		Xrender)
+  x11_find_lib_path(Xscreensaver	Xss)
+  x11_find_lib_path(Xt			Xt)
+  x11_find_lib_path(XTest		Xtst)
+  x11_find_lib_path(Xv			Xv)
+  x11_find_lib_path(Xxf86misc		Xxf86misc)
 
   set(X11_LIBRARY_DIR "")
   if(X11_X11_LIB)
@@ -437,69 +437,69 @@
       set(X11_X_EXTRA_LIBS "")
 
       # See if XOpenDisplay in X11 works by itself.
-      CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
+      check_library_exists("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
       if(NOT X11_LIB_X11_SOLO)
         # Find library needed for dnet_ntoa.
-        CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
+        check_library_exists("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
         if(X11_LIB_DNET_HAS_DNET_NTOA)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
         else(X11_LIB_DNET_HAS_DNET_NTOA)
-          CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
+          check_library_exists("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
           if(X11_LIB_DNET_STUB_HAS_DNET_NTOA)
-            SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
+            set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
           endif(X11_LIB_DNET_STUB_HAS_DNET_NTOA)
         endif(X11_LIB_DNET_HAS_DNET_NTOA)
       endif(NOT X11_LIB_X11_SOLO)
 
       # Find library needed for gethostbyname.
-      CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
+      check_function_exists("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
       if(NOT CMAKE_HAVE_GETHOSTBYNAME)
-        CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+        check_library_exists("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
         if(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
         else(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-          CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+          check_library_exists("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
           if(CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
-            SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
+            set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
           endif(CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
         endif(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
       endif(NOT CMAKE_HAVE_GETHOSTBYNAME)
 
       # Find library needed for connect.
-      CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT)
+      check_function_exists("connect" CMAKE_HAVE_CONNECT)
       if(NOT CMAKE_HAVE_CONNECT)
-        CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
+        check_library_exists("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
         if(CMAKE_LIB_SOCKET_HAS_CONNECT)
-          SET (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
+          set (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
         endif(CMAKE_LIB_SOCKET_HAS_CONNECT)
       endif(NOT CMAKE_HAVE_CONNECT)
 
       # Find library needed for remove.
-      CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE)
+      check_function_exists("remove" CMAKE_HAVE_REMOVE)
       if(NOT CMAKE_HAVE_REMOVE)
-        CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
+        check_library_exists("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
         if(CMAKE_LIB_POSIX_HAS_REMOVE)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
         endif(CMAKE_LIB_POSIX_HAS_REMOVE)
       endif(NOT CMAKE_HAVE_REMOVE)
 
       # Find library needed for shmat.
-      CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT)
+      check_function_exists("shmat" CMAKE_HAVE_SHMAT)
       if(NOT CMAKE_HAVE_SHMAT)
-        CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
+        check_library_exists("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
         if(CMAKE_LIB_IPS_HAS_SHMAT)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
         endif(CMAKE_LIB_IPS_HAS_SHMAT)
       endif(NOT CMAKE_HAVE_SHMAT)
     endif($ENV{ISC} MATCHES "^yes$")
 
     if(X11_ICE_FOUND)
-      CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
+      check_library_exists("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
         CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
       if(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
-        SET (X11_X_PRE_LIBS ${X11_ICE_LIB})
+        set (X11_X_PRE_LIBS ${X11_ICE_LIB})
         if(X11_SM_LIB)
-          SET (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
+          set (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
         endif(X11_SM_LIB)
       endif(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
     endif(X11_ICE_FOUND)
@@ -548,7 +548,7 @@
     endif("${LIB_PATH_CNT}" GREATER 1)
 
     include(FindPackageMessage)
-    FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
+    find_package_message(X11 "Found X11: ${X11_X11_LIB}"
       "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
   else(X11_FOUND)
     if(X11_FIND_REQUIRED)
Index: src/other/tkhtml/CMake/FindTCL.cmake
===================================================================
--- src/other/tkhtml/CMake/FindTCL.cmake	(revision 54114)
+++ src/other/tkhtml/CMake/FindTCL.cmake	(working copy)
@@ -240,13 +240,13 @@
 set(TCL_POSSIBLE_MINOR_VERSIONS 6 5 4 3 2 1 0)
 
 # Create the Tcl/Tk options if not already present
-OPTION(TK_NATIVE_GRAPHICS "Require native Tk graphics." OFF)
-OPTION(TK_X11_GRAPHICS "Require X11 Tk graphics." OFF)
-OPTION(TCL_USE_FRAMEWORK_ONLY "Don't use any Tcl/Tk installation that isn't a Framework." OFF)
-OPTION(TCL_REQUIRE_TK "Look for Tk installation, not just Tcl." ON)
-OPTION(TCL_REQUIRE_THREADS "Reject a Tcl/Tk installation unless threads are enabled." OFF)
-OPTION(TCL_NEED_HEADERS "Don't report a found Tcl/Tk unless headers are present." ON)
-OPTION(TCL_NEED_STUB_LIBS "Don't report a found Tcl/Tk unless the stub libraries are present." ON)
+option(TK_NATIVE_GRAPHICS "Require native Tk graphics." OFF)
+option(TK_X11_GRAPHICS "Require X11 Tk graphics." OFF)
+option(TCL_USE_FRAMEWORK_ONLY "Don't use any Tcl/Tk installation that isn't a Framework." OFF)
+option(TCL_REQUIRE_TK "Look for Tk installation, not just Tcl." ON)
+option(TCL_REQUIRE_THREADS "Reject a Tcl/Tk installation unless threads are enabled." OFF)
+option(TCL_NEED_HEADERS "Don't report a found Tcl/Tk unless headers are present." ON)
+option(TCL_NEED_STUB_LIBS "Don't report a found Tcl/Tk unless the stub libraries are present." ON)
 
 # Sanity check the settings - can't require both Native and X11 if X11 isn't
 # the native windowing system on the platform
@@ -282,7 +282,7 @@
 macro(TK_GRAPHICS_SYSTEM wishcmd resultvar)
   set(${resultvar} "wm-NOTFOUND")
   file(WRITE ${tkwin_scriptfile} ${tkwin_script})
-  EXEC_PROGRAM(${wishcmd} ARGS ${tkwin_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+  exec_program(${wishcmd} ARGS ${tkwin_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
   file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM readresultvar)
   string(REGEX REPLACE "\n" "" "${resultvar}" "${readresultvar}")
 endmacro()
@@ -300,7 +300,7 @@
 macro(TCL_GET_VERSION tclshcmd resultvar)
   set(${resultvar} "NOTFOUND")
   file(WRITE ${tclversion_scriptfile} ${tclversion_script})
-  EXEC_PROGRAM(${tclshcmd} ARGS ${tclversion_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+  exec_program(${tclshcmd} ARGS ${tclversion_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
   file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/TCL_VERSION readresultvar)
   string(REGEX REPLACE "\n" "" "${resultvar}" "${readresultvar}")
 endmacro()
@@ -318,7 +318,7 @@
 	macro(TCL_ISTHREADED tclshcmd resultvar)
 	  set(${resultvar} "NOTFOUND")
 	  file(WRITE ${tclthreaded_scriptfile} ${tclthreaded_script})
-	  EXEC_PROGRAM(${tclshcmd} ARGS ${tclthreaded_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+	  exec_program(${tclshcmd} ARGS ${tclthreaded_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
 	  file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/TCL_THREADED readresultvar)
 	  string(REGEX REPLACE "\n" "" "${resultvar}" "${readresultvar}")
 	endmacro()
@@ -488,10 +488,10 @@
 	      foreach(SPATH ${${pathnames}})
 		set(TCL_CURRENTPATH TCL-NOTFOUND)
 		set(CURRENT_SEARCH_VERSION "${MAJORNUM}.${MINORNUM}")
-		VALIDATE_VERSION(dosearch ${CURRENT_SEARCH_VERSION})
+		validate_version(dosearch ${CURRENT_SEARCH_VERSION})
 		if(dosearch)
-		  FIND_PROGRAM_PATHS(BIN_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
-		  FIND_LIBRARY_PATHS(LIB_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		  find_program_paths(BIN_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		  find_library_paths(LIB_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
 		  foreach(targetbin ${targetbinnames})
 		    if(TCL_CURRENTPATH MATCHES "NOTFOUND$")
 		      find_program(TCL_CURRENTPATH NAMES ${targetbin}${MAJORNUM}.${MINORNUM} ${targetbin}${MAJORNUM}${MINORNUM} PATHS ${BIN_POSSIBLE_PATHS} ${options})
@@ -529,7 +529,7 @@
 	    foreach(MAJORNUM ${TCL_POSSIBLE_MAJOR_VERSIONS})
 	      foreach(MINORNUM ${TCL_POSSIBLE_MINOR_VERSIONS})
 		set(CURRENT_SEARCH_VERSION "${MAJORNUM}.${MINORNUM}")
-		VALIDATE_VERSION(isvalid ${CURRENT_SEARCH_VERSION})
+		validate_version(isvalid ${CURRENT_SEARCH_VERSION})
 		if(isvalid)
 		  foreach(genpath ${CONFIG_SEARCH_PATHS})
 		    set(CONFGENPATHS "${CONFGENPATHS};${genpath}${MAJORNUM}${MINORNUM};${genpath}${MAJORNUM}.${MINORNUM}")
@@ -619,7 +619,7 @@
 	#-----------------------------------------------------------------------------
 
 	macro(READ_TCLCONFIG_FILE tclconffile)
-	  RESET_TCL_VARS()
+	  reset_tcl_vars()
 	  set(TCL_CONF_FILE "")
 	  file(READ ${tclconffile} TCL_CONF_FILE)
 	  string(REGEX REPLACE "\r?\n" ";" ENT "${TCL_CONF_FILE}")
@@ -646,15 +646,15 @@
 		set(TCL_EXE_SUFFIX "")
 	      endif(MSVC)
 	      string(REGEX REPLACE ".*TCL_EXEC_PREFIX='(.+)'.*" "\\1" TCL_TCLSH_EXECUTABLE ${line})
-	      IF (EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      if (EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh")
 	      endif()
 	    endif()
@@ -669,7 +669,7 @@
 
 
 	macro(READ_TKCONFIG_FILE tkconffile)
-	  RESET_TK_VARS()
+	  reset_tk_vars()
 	  set(TK_CONF_FILE "")
 	  file(READ ${tkconffile} TK_CONF_FILE)
 	  string(REGEX REPLACE "\r?\n" ";" ENT "${TK_CONF_FILE}")
@@ -696,15 +696,15 @@
 		set(TK_EXE_SUFFIX "")
 	      endif(MSVC)
 	      string(REGEX REPLACE ".*TK_EXEC_PREFIX='(.+)'.*" "\\1" TCL_WISH_EXECUTABLE ${line})
-	      IF (EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      if (EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish")
 	      endif()
 	    endif()
@@ -723,16 +723,16 @@
 
 	macro(VALIDATE_TCL validvar)
 	  set(${validvar} 1)
-	  VALIDATE_TCL_VARIABLES(${validvar})
+	  validate_tcl_variables(${validvar})
 	  if(TCL_TCLSH_EXECUTABLE)
-	    TCL_GET_VERSION(${TCL_TCLSH_EXECUTABLE} CURRENT_SEARCH_VERSION)
-	    VALIDATE_VERSION(dosearch ${CURRENT_SEARCH_VERSION})
+	    tcl_get_version(${TCL_TCLSH_EXECUTABLE} CURRENT_SEARCH_VERSION)
+	    validate_version(dosearch ${CURRENT_SEARCH_VERSION})
 	    if(NOT dosearch)
 	      set(${validvar} 0)
 	    endif(NOT dosearch)
 	  endif(TCL_TCLSH_EXECUTABLE)
 	  if(TCL_REQUIRE_THREADS AND TCL_TCLSH_EXECUTABLE)
-	    TCL_ISTHREADED(${TCL_TCLSH_EXECUTABLE} TCL_THREADS)
+	    tcl_isthreaded(${TCL_TCLSH_EXECUTABLE} TCL_THREADS)
 	    if(NOT TCL_THREADS)
 	      set(${validvar} 0)
 	    endif(NOT TCL_THREADS)
@@ -741,9 +741,9 @@
 
 	macro(VALIDATE_TK validvar)
 	  set(${validvar} 1)
-	  VALIDATE_TK_VARIABLES(${validvar})
+	  validate_tk_variables(${validvar})
 	  if(TK_NATIVE_GRAPHICS OR TK_X11_GRAPHICS)
-	    TK_GRAPHICS_SYSTEM(${TCL_WISH_EXECUTABLE} TK_SYSTEM_GRAPHICS)
+	    tk_graphics_system(${TCL_WISH_EXECUTABLE} TK_SYSTEM_GRAPHICS)
 	    if(APPLE AND TK_NATIVE_GRAPHICS)
 	      if(NOT ${TK_SYSTEM_GRAPHICS} MATCHES "aqua")
 		set(${validvar} 0)
@@ -852,19 +852,19 @@
 	    set(TCL_PREFIX_LIBDIRS ${TCL_PREFIX_LIBDIRS} ${TCL_LIB_PATH_PARENT}/lib)
 	    set(TCL_PREFIX_LIBDIRS ${TCL_PREFIX_LIBDIRS} ${TCL_LIB_PATH_PARENT})
 	    list(REMOVE_DUPLICATES TCL_PREFIX_LIBDIRS)
-	    FIND_LIBRARY_VERSIONS(tcl TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
+	    find_library_versions(tcl TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
 	    set(FOUND_FILES "${TCL_tcl_LIST}")
-	    FIND_CONFIG_FILES(FOUND_FILES TCLCONFIG_LIST tclConfig.sh)
+	    find_config_files(FOUND_FILES TCLCONFIG_LIST tclConfig.sh)
 	    if(TCL_REQUIRE_TK)
-	      FIND_LIBRARY_VERSIONS(tk TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
+	      find_library_versions(tk TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
 	      set(FOUND_FILES "${TCL_tk_LIST}")
-	      FIND_CONFIG_FILES(FOUND_FILES TKCONFIG_LIST tkConfig.sh)
+	      find_config_files(FOUND_FILES TKCONFIG_LIST tkConfig.sh)
 	    endif(TCL_REQUIRE_TK)
 	  else(TCL_PREFIX)
 	    set(TCLCONFIG_LIST "")
 	    if(APPLE)
 	      include(CMakeFindFrameworks)
-	      CMAKE_FIND_FRAMEWORKS(Tcl)
+	      cmake_find_frameworks(Tcl)
 	      foreach(dir ${Tcl_FRAMEWORKS})
 		set(tclconf "tclConfig.sh-NOTFOUND") 
 		find_file(tclconf tclConfig.sh PATHS ${dir})
@@ -874,7 +874,7 @@
 		endif(NOT tclconf MATCHES "NOTFOUND$")
 	      endforeach(dir ${Tcl_FRAMEWORKS})
 	      if(TCL_REQUIRE_TK)
-		CMAKE_FIND_FRAMEWORKS(Tk)
+		cmake_find_frameworks(Tk)
 		foreach(dir ${Tk_FRAMEWORKS})
 		  set(tkconf "tkConfig.sh-NOTFOUND") 
 		  find_file(tkconf tkConfig.sh PATHS ${dir})
@@ -889,7 +889,7 @@
 	      set(PATHLIST "$ENV{LD_LIBRARY_PATH}:$ENV{DYLD_LIBRARY_PATH}:$ENV{DYLD_FALLBACK_LIBRARY_PATH}:$ENV{PATH}")
 	      set(PATHLIST "${TCL_ADDITIONAL_SEARCH_PATHS}:${PATHLIST}")
 	      if(WIN32)
-		WIN32TCLPATHS(PATHLIST "")
+		win32tclpaths(PATHLIST "")
 	      endif(WIN32)
 	      string(REGEX REPLACE "/s?bin:" ":" PATHLIST "${PATHLIST}")
 	      string(REGEX REPLACE "/s?bin;" ":" PATHLIST "${PATHLIST}")
@@ -906,41 +906,41 @@
 	      endforeach()
 	      set(TCLPATHLIST "${PATHLIST}")
 	      set(TKPATHLIST "${PATHLIST}")
-	      FIND_POSSIBLE_PATHS("tclsh" "tcl" TCLPATHLIST NO_SYSTEM_PATH)
+	      find_possible_paths("tclsh" "tcl" TCLPATHLIST NO_SYSTEM_PATH)
 	      if(TCL_REQUIRE_TK)
-		FIND_POSSIBLE_PATHS("wish" "tk" TKPATHLIST NO_SYSTEM_PATH)
+		find_possible_paths("wish" "tk" TKPATHLIST NO_SYSTEM_PATH)
 	      endif(TCL_REQUIRE_TK)
 	      # Hunt up tclConfig.sh files
-	      FIND_CONFIG_FILES(TCLPATHLIST TCLCONFIG_LIST tclConfig.sh)
+	      find_config_files(TCLPATHLIST TCLCONFIG_LIST tclConfig.sh)
 	      # Hunt up tkConfig.sh files 
-	      FIND_CONFIG_FILES(TKPATHLIST TKCONFIG_LIST tkConfig.sh)
+	      find_config_files(TKPATHLIST TKCONFIG_LIST tkConfig.sh)
 	    endif(NOT APPLE OR NOT TCL_USE_FRAMEWORK_ONLY)
 	  endif(TCL_PREFIX)
 	  set(TCLVALID 0)
-	  RESET_TCL_VARS()
+	  reset_tcl_vars()
 	  foreach(tcl_config_file ${TCLCONFIG_LIST}) 
 	    if(NOT TCLVALID)
-	      RESET_TCL_VARS()
-	      READ_TCLCONFIG_file(${tcl_config_file})
+	      reset_tcl_vars()
+	      read_tclconfig_file(${tcl_config_file})
 	      set(TCLVALID 1)
 	      set(CURRENTTCLVERSION "${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}.${TCL_VERSION_PATCH}")
-	      VALIDATE_VERSION(TCLVALID ${CURRENTTCLVERSION})
+	      validate_version(TCLVALID ${CURRENTTCLVERSION})
 	      if(TCLVALID)
 		get_filename_component(TCL_CONF_PREFIX "${tcl_config_file}" PATH)
 		get_filename_component(TCL_LIBRARY_DIR2 "${TCL_CONF_PREFIX}" PATH)
-		FIND_LIBRARY_PATHS(TCL_LIBRARY_SEARCH_PATHS TCL_PREFIX ${TCL_VERSION_MAJOR} ${TCL_VERSION_MINOR})
+		find_library_paths(TCL_LIBRARY_SEARCH_PATHS TCL_PREFIX ${TCL_VERSION_MAJOR} ${TCL_VERSION_MINOR})
 		set(TCL_LIBRARY_SEARCH_PATHS "${TCL_CONF_PREFIX};${TCL_LIBRARY_DIR2};${TCL_LIBRARY_SEARCH_PATHS}")
 		find_library(TCL_LIBRARY tcl Tcl tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR} tcl${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR} PATHS ${TCL_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
 		find_library(TCL_STUB_LIBRARY tclstub${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR} tclstub${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR} PATHS ${TCL_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
 	      endif(TCLVALID)
-	      VALIDATE_TCL(TCLVALID)
+	      validate_tcl(TCLVALID)
 	      if(TCLVALID)
 		if(TCL_REQUIRE_TK)
 		  set(TKVALID 0)
 		  foreach(tk_config_file ${TKCONFIG_LIST})
 		    if(NOT TKVALID)
-		      RESET_TK_VARS()
-		      READ_TKCONFIG_file(${tk_config_file})
+		      reset_tk_vars()
+		      read_tkconfig_file(${tk_config_file})
 		      set(TKVALID 0)
 		      set(CURRENTTKVERSION "${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}.${TK_VERSION_PATCH}")
 		      set(vtcltkcompare 0)
@@ -952,18 +952,18 @@
 		      if(TKVALID)
 			get_filename_component(TCL_TK_CONF_PREFIX "${tk_config_file}" PATH)
 			get_filename_component(TCL_TK_LIBRARY_DIR2 "${TCL_TK_CONF_PREFIX}" PATH)
-			FIND_LIBRARY_PATHS(TCL_TK_LIBRARY_SEARCH_PATHS TK_PREFIX ${TK_VERSION_MAJOR} ${TK_VERSION_MINOR})
+			find_library_paths(TCL_TK_LIBRARY_SEARCH_PATHS TK_PREFIX ${TK_VERSION_MAJOR} ${TK_VERSION_MINOR})
 			set(TCL_TK_LIBRARY_SEARCH_PATHS "${TCL_TK_CONF_PREFIX};${TCL_TK_LIBRARY_DIR2};${TCL_TK_LIBRARY_SEARCH_PATHS}")
 			find_library(TCL_TK_LIBRARY tk Tk tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR} tk${TK_VERSION_MAJOR}${TK_VERSION_MINOR} PATHS ${TCL_TK_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
 			find_library(TCL_TK_STUB_LIBRARY tkstub tkstub${TK_VERSION_MAJOR}.${TK_VERSION_MINOR} tkstub${TK_VERSION_MAJOR}${TK_VERSION_MINOR} PATHS ${TCL_TK_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
-			VALIDATE_TK(TKVALID)
+			validate_tk(TKVALID)
 		      endif(TKVALID)
 		    endif(NOT TKVALID)
 		  endforeach(tk_config_file ${TKCONFIG_LIST})
 		  if(NOT TKVALID)
 		    set(TCLVALID 0)
-		    RESET_TCL_VARS()
-		    RESET_TK_VARS()
+		    reset_tcl_vars()
+		    reset_tk_vars()
 		  endif(NOT TKVALID)
 		endif(TCL_REQUIRE_TK)
 	      endif(TCLVALID)
@@ -983,29 +983,29 @@
 	      foreach(MINORNUM ${TCL_POSSIBLE_MINOR_VERSIONS})
 		foreach(SPATH ${PATHLIST})
 		  if(NOT TCLVALID)
-		    RESET_TCL_VARS()
+		    reset_tcl_vars()
 		    set(CURRENT_SEARCH_VERSION "${MAJORNUM}.${MINORNUM}")
-		    VALIDATE_VERSION(dosearch ${CURRENT_SEARCH_VERSION})
+		    validate_version(dosearch ${CURRENT_SEARCH_VERSION})
 		    if(dosearch)
-		      FIND_LIBRARY_PATHS(TCL_LIBRARY_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
-		      FIND_PROGRAM_PATHS(TCL_PROGRAM_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		      find_library_paths(TCL_LIBRARY_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		      find_program_paths(TCL_PROGRAM_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
 		      find_program(TCL_TCLSH_EXECUTABLE NAMES tclsh${MAJORNUM}.${MINORNUM} tclsh${MAJORNUM}${MINORNUM} PATHS ${TCL_PROGRAM_SEARCH_PATHS} NO_SYSTEM_PATH)
 		    endif(dosearch)
-		    VALIDATE_TCL(TCLVALID)
+		    validate_tcl(TCLVALID)
 		    if(TCLVALID)
 		      if(TCL_REQUIRE_TK)
 			set(TKVALID 0)
-			RESET_TK_VARS()
+			reset_tk_vars()
 			find_program(TCL_WISH_EXECUTABLE NAMES wish${MAJORNUM}.${MINORNUM} wish${MAJORNUM}${MINORNUM} PATHS ${TCL_PROGRAM_SEARCH_PATHS} NO_SYSTEM_PATH)
-			VALIDATE_TK(TKVALID)
+			validate_tk(TKVALID)
 			if(NOT TKVALID)
 			  set(TCLVALID 0)
-			  RESET_TCL_VARS()
-			  RESET_TK_VARS()
+			  reset_tcl_vars()
+			  reset_tk_vars()
 			endif(NOT TKVALID)	
 		      endif(TCL_REQUIRE_TK)
 		    else(TCLVALID)
-		      RESET_TCL_VARS()
+		      reset_tcl_vars()
 		    endif(TCLVALID)
 		  endif(NOT TCLVALID)
 		endforeach(SPATH ${PATHLIST})
@@ -1023,11 +1023,11 @@
 	  set(TCL_STUB_LIBRARIES ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY})
 	  set(TCL_ROOT_PATH ${TCL_CONF_PREFIX})
 	  set(TCL_VERSION_STRING "${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}.${TCL_VERSION_PATCH}")
-	  FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCL DEFAULT_MSG TCL_LIBRARY ${PACKAGE_HANDLE_VARS})
+	  find_package_handle_standard_args(TCL DEFAULT_MSG TCL_LIBRARY ${PACKAGE_HANDLE_VARS})
 	  if(TCL_REQUIRE_TK)
 	    set(TK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
 	    set(PACKAGE_HANDLE_VARS "${PACKAGE_HANDLE_VARS};TCL_LIBRARY")
-	    FIND_PACKAGE_HANDLE_STANDARD_ARGS(TK DEFAULT_MSG TCL_TK_LIBRARY ${PACKAGE_HANDLE_VARS})
+	    find_package_handle_standard_args(TK DEFAULT_MSG TCL_TK_LIBRARY ${PACKAGE_HANDLE_VARS})
 	  endif(TCL_REQUIRE_TK)
 
 	  foreach(pkgvar ${PACKAGE_HANDLE_VARS})
Index: src/other/jove/CMakeLists.txt
===================================================================
--- src/other/jove/CMakeLists.txt	(revision 54114)
+++ src/other/jove/CMakeLists.txt	(working copy)
@@ -10,7 +10,7 @@
   -DBRLCADBUILD=1
   )
 
-SET(JOVE_SRCS
+set(JOVE_SRCS
   jove_buf.c
   jove_c.c
   jove_delete.c
@@ -33,23 +33,23 @@
 
 add_executable(jove ${JOVE_SRCS})
 target_link_libraries(jove ${TERMLIB_LIBRARY})
-INSTALL(TARGETS jove DESTINATION bin)
+install(TARGETS jove DESTINATION bin)
 
-SET(findcom_SOURCES
+set(findcom_SOURCES
   findcom.c
   jove_tune.c
   )
 add_executable(findcom ${findcom_SOURCES})
-INSTALL(TARGETS findcom DESTINATION bin)
+install(TARGETS findcom DESTINATION bin)
 
-FILE(COPY jove.1 DESTINATION ${CMAKE_BINARY_DIR}/${MAN_DIR}/man1)
-INSTALL(FILES jove.1 DESTINATION	${MAN_DIR}/man1)
+file(COPY jove.1 DESTINATION ${CMAKE_BINARY_DIR}/${MAN_DIR}/man1)
+install(FILES jove.1 DESTINATION	${MAN_DIR}/man1)
 
-SET(jove_DATA
+set(jove_DATA
   describe.com
   jove.emacs
   jove-tutorial
   )
 
-FILE(COPY ${jove_DATA} DESTINATION ${CMAKE_BINARY_DIR}/${DATA_DIR}/jove)
-INSTALL(FILES ${jove_DATA} DESTINATION	${DATA_DIR}/jove)
+file(COPY ${jove_DATA} DESTINATION ${CMAKE_BINARY_DIR}/${DATA_DIR}/jove)
+install(FILES ${jove_DATA} DESTINATION	${DATA_DIR}/jove)
Index: src/other/tnt/CMakeLists.txt
===================================================================
--- src/other/tnt/CMakeLists.txt	(revision 54114)
+++ src/other/tnt/CMakeLists.txt	(working copy)
@@ -1,5 +1,5 @@
 
-SET(tnt_HEADERS
+set(tnt_HEADERS
 	jama_cholesky.h
 	jama_eig.h
 	jama_lu.h
@@ -29,4 +29,4 @@
 	tnt_vector.h
 	tnt_version.h
 )
-INSTALL(FILES ${tnt_HEADERS} DESTINATION include)
+install(FILES ${tnt_HEADERS} DESTINATION include)
Index: src/other/lemon/CMakeLists.txt
===================================================================
--- src/other/lemon/CMakeLists.txt	(revision 54114)
+++ src/other/lemon/CMakeLists.txt	(working copy)
@@ -1,11 +1,11 @@
 # Minimum required version of CMake
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-IF(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND CMAKE_POLICY)
+cmake_minimum_required(VERSION 2.8)
+if(COMMAND CMAKE_POLICY)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND CMAKE_POLICY)
 
 # Set CMake project name
-PROJECT(LEMON)
+project(LEMON)
 
 add_executable(lemon lemon.c)
 # Install
Index: src/other/openNURBS/CMakeLists.txt
===================================================================
--- src/other/openNURBS/CMakeLists.txt	(revision 54114)
+++ src/other/openNURBS/CMakeLists.txt	(working copy)
@@ -1,12 +1,12 @@
 # build shared libs by default
-IF(NOT DEFINED BUILD_SHARED_LIBS)
+if(NOT DEFINED BUILD_SHARED_LIBS)
   set(BUILD_SHARED_LIBS ON)
-ENDIF(NOT DEFINED BUILD_SHARED_LIBS)
+endif(NOT DEFINED BUILD_SHARED_LIBS)
 
 # build static libs by default
-IF(NOT DEFINED BUILD_STATIC_LIBS)
+if(NOT DEFINED BUILD_STATIC_LIBS)
   set(BUILD_STATIC_LIBS ON)
-ENDIF(NOT DEFINED BUILD_STATIC_LIBS)
+endif(NOT DEFINED BUILD_STATIC_LIBS)
 
 set(OPENNURBS_SOURCES
 opennurbs_3dm_attributes.cpp
@@ -119,7 +119,7 @@
 opennurbs_zlib.cpp
   )
 
-SET(OPENNURBS_HEADERS
+set(OPENNURBS_HEADERS
 opennurbs.h
 opennurbs_3dm.h
 opennurbs_3dm_attributes.h
@@ -227,14 +227,14 @@
 opennurbs_zlib.h
   )
 
-SET(ON_DLL_HEADERS
+set(ON_DLL_HEADERS
   opennurbs_dll_resource.h
   )
 
-INCLUDE(CheckIncludeFiles)
-CHECK_INCLUDE_FILE(emmintrin.h HAVE_EMMINTRIN_H)
-CHECK_INCLUDE_FILE(ieeefp.h HAVE_IEEEFP_H)
-CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
+include(CheckIncludeFiles)
+check_include_file(emmintrin.h HAVE_EMMINTRIN_H)
+check_include_file(ieeefp.h HAVE_IEEEFP_H)
+check_include_file(sys/stat.h HAVE_SYS_STAT_H)
 if(HAVE_EMMINTRIN_H)
   add_definitions(-DHAVE_EMMINTRIN_H)
 endif(HAVE_EMMINTRIN_H)
@@ -245,15 +245,15 @@
   add_definitions(-DHAVE_SYS_STAT_H)
 endif(HAVE_SYS_STAT_H)
 
-IF(BUILD_STATIC_LIBS AND BRLCAD_ENABLE_BRLCAD_LIBRARY AND ${CMAKE_PROJECT_NAME}_ZLIB_BUILD AND NOT ${CMAKE_PROJECT_NAME}-ENABLE_SYSTEM_LIBS_ONLY)
+if(BUILD_STATIC_LIBS AND BRLCAD_ENABLE_BRLCAD_LIBRARY AND ${CMAKE_PROJECT_NAME}_ZLIB_BUILD AND NOT ${CMAKE_PROJECT_NAME}-ENABLE_SYSTEM_LIBS_ONLY)
   set(OPENNURBS_LINKLIBRARIES
     zlib-static
     )
-ELSE(BUILD_STATIC_LIBS AND BRLCAD_ENABLE_BRLCAD_LIBRARY AND ${CMAKE_PROJECT_NAME}_ZLIB_BUILD AND NOT ${CMAKE_PROJECT_NAME}-ENABLE_SYSTEM_LIBS_ONLY)
+else(BUILD_STATIC_LIBS AND BRLCAD_ENABLE_BRLCAD_LIBRARY AND ${CMAKE_PROJECT_NAME}_ZLIB_BUILD AND NOT ${CMAKE_PROJECT_NAME}-ENABLE_SYSTEM_LIBS_ONLY)
   set(OPENNURBS_LINKLIBRARIES
     ${ZLIB_LIBRARY}
     )
-ENDIF(BUILD_STATIC_LIBS AND BRLCAD_ENABLE_BRLCAD_LIBRARY AND ${CMAKE_PROJECT_NAME}_ZLIB_BUILD AND NOT ${CMAKE_PROJECT_NAME}-ENABLE_SYSTEM_LIBS_ONLY)
+endif(BUILD_STATIC_LIBS AND BRLCAD_ENABLE_BRLCAD_LIBRARY AND ${CMAKE_PROJECT_NAME}_ZLIB_BUILD AND NOT ${CMAKE_PROJECT_NAME}-ENABLE_SYSTEM_LIBS_ONLY)
 
 # Ideally, we should only need ZLIB here
 include_directories(
@@ -266,7 +266,7 @@
     -DON_COMPILING_OPENNURBS
     -DON_DLL_EXPORTS
     )
-  SET(OPENNURBS_HEADERS "${OPENNURBS_HEADERS};${ON_DLL_HEADERS}")
+  set(OPENNURBS_HEADERS "${OPENNURBS_HEADERS};${ON_DLL_HEADERS}")
 else (MSVC)
   add_definitions(
     -DON_COMPILING_OPENNURBS
@@ -285,28 +285,28 @@
     )
 endif(MSVC)
 
-IF(BUILD_SHARED_LIBS)
+if(BUILD_SHARED_LIBS)
   add_library(openNURBS SHARED ${OPENNURBS_SOURCES})
   target_link_libraries(openNURBS ${OPENNURBS_LINKLIBRARIES})
   set_property(TARGET openNURBS PROPERTY LINK_INTERFACE_LIBRARIES "")
-  SET_TARGET_PROPERTIES(openNURBS PROPERTIES VERSION "2010.04.95")
+  set_target_properties(openNURBS PROPERTIES VERSION "2010.04.95")
   install(TARGETS openNURBS
 	  RUNTIME DESTINATION ${BIN_DIR}
 	  LIBRARY DESTINATION ${LIB_DIR}
 	  ARCHIVE DESTINATION ${LIB_DIR})
-ENDIF(BUILD_SHARED_LIBS)
-IF(NOT MSVC)
-  IF(BUILD_STATIC_LIBS)
+endif(BUILD_SHARED_LIBS)
+if(NOT MSVC)
+  if(BUILD_STATIC_LIBS)
     add_library(openNURBS-static STATIC ${OPENNURBS_SOURCES})
     target_link_libraries(openNURBS-static ${OPENNURBS_LINKLIBRARIES})
-    IF(NOT WIN32)
-      SET_TARGET_PROPERTIES(openNURBS-static PROPERTIES OUTPUT_NAME "openNURBS")
-    ENDIF(NOT WIN32)
+    if(NOT WIN32)
+      set_target_properties(openNURBS-static PROPERTIES OUTPUT_NAME "openNURBS")
+    endif(NOT WIN32)
     install(TARGETS openNURBS-static
 	    RUNTIME DESTINATION ${BIN_DIR}
 	    LIBRARY DESTINATION ${LIB_DIR}
 	    ARCHIVE DESTINATION ${LIB_DIR})
-  ENDIF(BUILD_STATIC_LIBS)
-ENDIF(NOT MSVC)
+  endif(BUILD_STATIC_LIBS)
+endif(NOT MSVC)
 
 install(FILES ${OPENNURBS_HEADERS} DESTINATION include/openNURBS)
Index: src/other/step/src/cleditor/CMakeLists.txt
===================================================================
--- src/other/step/src/cleditor/CMakeLists.txt	(revision 54114)
+++ src/other/step/src/cleditor/CMakeLists.txt	(working copy)
@@ -9,7 +9,7 @@
     SdaiSchemaInit.cc
 )
 
-SET(LIBSTEPEDITOR_PRIVATE_HDRS
+set(LIBSTEPEDITOR_PRIVATE_HDRS
     STEPfile.h
     cmdmgr.h
     editordefines.h
@@ -27,4 +27,4 @@
     ${SCL_SOURCE_DIR}/src/clutils
 )
 
-SCL_ADDLIB(stepeditor "${LIBSTEPEDITOR_SRCS}" "stepcore;stepdai;steputils;base")
+scl_addlib(stepeditor "${LIBSTEPEDITOR_SRCS}" "stepcore;stepdai;steputils;base")
Index: src/other/step/src/express/CMakeLists.txt
===================================================================
--- src/other/step/src/express/CMakeLists.txt	(revision 54114)
+++ src/other/step/src/express/CMakeLists.txt	(working copy)
@@ -24,9 +24,9 @@
 # Depending on whether we're using pre-generated sources or building them on
 # the fly, set up targets and source lists.
 if(SCL_GENERATE_LP_SOURCES)
-  LEMON_TARGET(ExpParser expparse.y expparse.c expparse.h)
-  PERPLEX_TARGET(ExpScanner expscan.l ${CMAKE_CURRENT_BINARY_DIR}/expscan.c ${CMAKE_CURRENT_BINARY_DIR}/expscan.h)
-  ADD_PERPLEX_LEMON_DEPENDENCY(ExpScanner ExpParser)
+  lemon_target(ExpParser expparse.y expparse.c expparse.h)
+  perplex_target(ExpScanner expscan.l ${CMAKE_CURRENT_BINARY_DIR}/expscan.c ${CMAKE_CURRENT_BINARY_DIR}/expscan.h)
+  add_perplex_lemon_dependency(ExpScanner ExpParser)
   set(EXPRESS_GENERATED_SRCS
     ${LEMON_ExpParser_OUTPUT_SOURCE}
     ${PERPLEX_ExpScanner_OUTPUTS}
@@ -102,20 +102,20 @@
 # fedex.c's main() into an express library function. That way, programs only
 # need to link against express (not fedex.o too) and they can do initialization
 # in their own main (instead of in a local EXPRESSinit_init definition).
-SET(CHECK_EXPRESS_SOURCES
+set(CHECK_EXPRESS_SOURCES
   fedex.c
   inithook.c
   )
 
-SET(EXPRESS_PRIVATE_HDRS
+set(EXPRESS_PRIVATE_HDRS
   exptoks.h
   stack.h
   )
 
-SCL_ADDLIB(express "${EXPRESS_SOURCES}" "base")
+scl_addlib(express "${EXPRESS_SOURCES}" "base")
 add_dependencies(express express_verify)
 add_dependencies(express version_string)
-SCL_ADDEXEC("check-express" "${CHECK_EXPRESS_SOURCES}" "express;base" )
+scl_addexec("check-express" "${CHECK_EXPRESS_SOURCES}" "express;base" )
 
 # Local Variables:
 # tab-width: 8
Index: src/other/step/src/base/CMakeLists.txt
===================================================================
--- src/other/step/src/base/CMakeLists.txt	(revision 54114)
+++ src/other/step/src/base/CMakeLists.txt	(working copy)
@@ -14,4 +14,4 @@
 	add_definitions( -DSCL_MEMMGR_ENABLE_CHECKS )
 endif()
 
-SCL_ADDLIB(base "${SCL_BASE_SOURCES}" "")
+scl_addlib(base "${SCL_BASE_SOURCES}" "")
Index: src/other/step/src/cldai/CMakeLists.txt
===================================================================
--- src/other/step/src/cldai/CMakeLists.txt	(revision 54114)
+++ src/other/step/src/cldai/CMakeLists.txt	(working copy)
@@ -13,7 +13,7 @@
     sdaiString.cc
 )
 
-SET(LIBSTEPDAI_PRIVATE_HDRS
+set(LIBSTEPDAI_PRIVATE_HDRS
     sdaiApplication_instance_set.h
     sdaiBinary.h
     sdaiDaObject.h
@@ -34,4 +34,4 @@
     ${SCL_SOURCE_DIR}/src/clutils
 )
 
-SCL_ADDLIB(stepdai "${LIBSTEPDAI_SRCS}" "steputils;base")
+scl_addlib(stepdai "${LIBSTEPDAI_SRCS}" "steputils;base")
Index: src/other/step/src/exppp/CMakeLists.txt
===================================================================
--- src/other/step/src/exppp/CMakeLists.txt	(revision 54114)
+++ src/other/step/src/exppp/CMakeLists.txt	(working copy)
@@ -2,7 +2,7 @@
     exppp.c
 )
 
-SET(EXPPP_SOURCES
+set(EXPPP_SOURCES
     ../express/fedex.c
     exppp-main.c
 )
@@ -17,7 +17,7 @@
     add_definitions( -D__STDC__ )
 endif()
 
-SCL_ADDLIB(libexppp "${LIBEXPPP_SOURCES}" "express;base")
+scl_addlib(libexppp "${LIBEXPPP_SOURCES}" "express;base")
 set_target_properties(libexppp PROPERTIES PREFIX "")
 
-SCL_ADDEXEC(exppp "${EXPPP_SOURCES}" "libexppp;express;base")
+scl_addexec(exppp "${EXPPP_SOURCES}" "libexppp;express;base")
Index: src/other/step/src/fedex_python/CMakeLists.txt
===================================================================
--- src/other/step/src/fedex_python/CMakeLists.txt	(revision 54114)
+++ src/other/step/src/fedex_python/CMakeLists.txt	(working copy)
@@ -31,7 +31,7 @@
     ../fedex_plus/write.cc 
     ../fedex_plus/print.cc
 )
-SCL_ADDEXEC(fedex_python "${fedex_python_SOURCES}" "libexppp;express;base")
+scl_addexec(fedex_python "${fedex_python_SOURCES}" "libexppp;express;base")
 
 add_dependencies( fedex_python version_string )
 endif(SCL_PYTHON_GENERATOR)
Index: src/other/step/src/fedex_plus/CMakeLists.txt
===================================================================
--- src/other/step/src/fedex_plus/CMakeLists.txt	(revision 54114)
+++ src/other/step/src/fedex_plus/CMakeLists.txt	(working copy)
@@ -31,6 +31,6 @@
     ${SCL_SOURCE_DIR}/src/base
 )
 
-SCL_ADDEXEC(fedex_plus "${fedex_plus_SOURCES}" "libexppp;express;base")
+scl_addexec(fedex_plus "${fedex_plus_SOURCES}" "libexppp;express;base")
 
 add_dependencies( fedex_plus version_string )
Index: src/other/step/src/clutils/CMakeLists.txt
===================================================================
--- src/other/step/src/clutils/CMakeLists.txt	(revision 54114)
+++ src/other/step/src/clutils/CMakeLists.txt	(working copy)
@@ -9,7 +9,7 @@
     errordesc.cc
 )
 
-SET(LIBSTEPUTILS_PRIVATE_HDRS
+set(LIBSTEPUTILS_PRIVATE_HDRS
     dirobj.h
     errordesc.h
     gennodearray.h
@@ -25,8 +25,8 @@
     ${CMAKE_CURRENT_SOURCE_DIR}
 )
 
-SCL_ADDLIB(steputils "${LIBSTEPUTILS_SRCS}" "base")
+scl_addlib(steputils "${LIBSTEPUTILS_SRCS}" "base")
 
-IF(MINGW OR MSVC OR BORLAND)
-    TARGET_LINK_LIBRARIES(steputils shlwapi.lib)
-ENDIF()
+if(MINGW OR MSVC OR BORLAND)
+    target_link_libraries(steputils shlwapi.lib)
+endif()
Index: src/other/step/src/clstepcore/CMakeLists.txt
===================================================================
--- src/other/step/src/clstepcore/CMakeLists.txt	(revision 54114)
+++ src/other/step/src/clstepcore/CMakeLists.txt	(working copy)
@@ -34,7 +34,7 @@
     needFunc.cc
 )
 
-SET(LIBSTEPCORE_PRIVATE_HDRS
+set(LIBSTEPCORE_PRIVATE_HDRS
     baseType.h
     complexSupport.h
     dictdefs.h
@@ -67,4 +67,4 @@
     ${SCL_SOURCE_DIR}/src/clutils
 )
 
-SCL_ADDLIB(stepcore "${LIBSTEPCORE_SRCS}" "express;steputils;stepdai;base")
+scl_addlib(stepcore "${LIBSTEPCORE_SRCS}" "express;steputils;stepdai;base")
Index: src/other/step/doc/CMakeLists.txt
===================================================================
--- src/other/step/doc/CMakeLists.txt	(revision 54114)
+++ src/other/step/doc/CMakeLists.txt	(working copy)
@@ -1,4 +1,4 @@
-SET(scl_MANS
+set(scl_MANS
 	man/man1/dataprobe.1 
 	man/man1/fedex.1 
 	man/man1/fedex_plus.1 
@@ -9,6 +9,6 @@
   set(MAN_DIR share/man)
 endif(NOT DEFINED MAN_DIR)
 
-IF(NOT WIN32)
-  INSTALL(FILES ${scl_MANS} DESTINATION ${MAN_DIR}/man1)
-ENDIF(NOT WIN32)
+if(NOT WIN32)
+  install(FILES ${scl_MANS} DESTINATION ${MAN_DIR}/man1)
+endif(NOT WIN32)
Index: src/other/step/data/CMakeLists.txt
===================================================================
--- src/other/step/data/CMakeLists.txt	(revision 54114)
+++ src/other/step/data/CMakeLists.txt	(working copy)
@@ -1,11 +1,11 @@
 
 #this sets a property so that the target doesn't get built by 'make' or 'make all'
 #useful when testing generation of schema code/compiling schem libs/etc
-FUNCTION( TESTABLE_TARGET target )
+function( TESTABLE_TARGET target )
     if(ENABLE_TESTING)
         set_target_properties( ${target} PROPERTIES EXCLUDE_FROM_ALL ON )
     endif()
-ENDFUNCTION( TESTABLE_TARGET )
+endfunction( TESTABLE_TARGET )
 
 # To build one or more schemas, configure with 
 # 'cmake -DSCL_BUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
@@ -13,7 +13,7 @@
 # This function runs fedex on one express file. The generated source goes in a dir 
 # in the build dir, and it is compiled into a library. A p21read executable is 
 # compiled and linked to the lib. p21read is used to test the lib.
-FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
+function(BUILD_A_SCHEMA SCHEMA_FILE)
     if( EXISTS "${CMAKE_BINARY_DIR}/${SCHEMA_FILE}" )  #try absolute path. if that fails, must already be absolute.
         set( SCHEMA_FILE "${CMAKE_BINARY_DIR}/${SCHEMA_FILE}" )
     else()
@@ -68,7 +68,7 @@
     add_dependencies( ${PROJECT_NAME} generate_cpp_${SCHEMA_SHORT_NAME} )
     set_target_properties( ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
                            ${${PROJECT_NAME}_COMPILE_FLAGS} )
-    TESTABLE_TARGET( ${PROJECT_NAME} )
+    testable_target( ${PROJECT_NAME} )
 
     add_test( NAME generate_cpp_${SCHEMA_SHORT_NAME}
               WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
@@ -85,11 +85,11 @@
     set_tests_properties( generate_cpp_${SCHEMA_SHORT_NAME} PROPERTIES LABELS cpp_schema_gen )
     set_tests_properties( build_cpp_${PROJECT_NAME} PROPERTIES DEPENDS generate_cpp_${SCHEMA_SHORT_NAME} LABELS cpp_schema_build )
 
-    SCL_ADDEXEC( p21read_${PROJECT_NAME} "${SCL_SOURCE_DIR}/src/test/p21read/p21read.cc" "${PROJECT_NAME};base" )
+    scl_addexec( p21read_${PROJECT_NAME} "${SCL_SOURCE_DIR}/src/test/p21read/p21read.cc" "${PROJECT_NAME};base" )
     add_dependencies( p21read_${PROJECT_NAME} version_string )
     set_target_properties( p21read_${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
                            ${${PROJECT_NAME}_COMPILE_FLAGS} )
-    TESTABLE_TARGET( p21read_${PROJECT_NAME} )
+    testable_target( p21read_${PROJECT_NAME} )
 
     #find all part 21 files in schema dir, add a test for each one
     get_filename_component( SCHEMA_DIR ${SCHEMA_FILE} PATH )
@@ -102,13 +102,13 @@
         set_tests_properties( read_write_cpp_${SCHEMA_SHORT_NAME}_${FNAME} PROPERTIES DEPENDS build_cpp_${PROJECT_NAME} LABELS cpp_schema_rw )
     endforeach()
 
-ENDFUNCTION(BUILD_A_SCHEMA)
+endfunction(BUILD_A_SCHEMA)
 
 if( DEFINED SCL_BUILD_SCHEMAS )
     if( SCL_BUILD_SCHEMAS STREQUAL "ALL" )
         file( GLOB_RECURSE SCL_BUILD_SCHEMAS ${SCL_SOURCE_DIR}/data/*.exp )
     endif()
     foreach( ap ${SCL_BUILD_SCHEMAS} )
-        BUILD_A_SCHEMA( ${ap} )
+        build_a_schema( ${ap} )
     endforeach()
 endif()
Index: src/other/step/CMakeLists.txt
===================================================================
--- src/other/step/CMakeLists.txt	(revision 54114)
+++ src/other/step/CMakeLists.txt	(working copy)
@@ -38,96 +38,96 @@
 # This file contains the top level CMakeLists.txt logic for the 
 # SCL software package.
 
-PROJECT(SCL)
+project(SCL)
 
 # SCL version
-SET(SCL_VERSION_MAJOR 0)
-SET(SCL_VERSION_MINOR 5-dev)
-SET(SCL_VERSION ${SCL_VERSION_MAJOR}.${SCL_VERSION_MINOR})
+set(SCL_VERSION_MAJOR 0)
+set(SCL_VERSION_MINOR 5-dev)
+set(SCL_VERSION ${SCL_VERSION_MAJOR}.${SCL_VERSION_MINOR})
 
 # SCL ABI version. SCL_ABI_SOVERSION should be incremented
 # for each release introducing API incompatibilities
-SET(SCL_ABI_SOVERSION 2)
-SET(SCL_ABI_VERSION ${SCL_ABI_SOVERSION}.0.0)
+set(SCL_ABI_SOVERSION 2)
+set(SCL_ABI_VERSION ${SCL_ABI_SOVERSION}.0.0)
 
 # Minimum required version of CMake
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-IF(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND CMAKE_POLICY)
+cmake_minimum_required(VERSION 2.8)
+if(COMMAND CMAKE_POLICY)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND CMAKE_POLICY)
 
-IF( NOT DEFINED SCL_BUILD_TYPE )
-  SET( SCL_BUILD_TYPE "Debug" CACHE STRING "Build type" ) # By default set debug build
-ENDIF( NOT DEFINED SCL_BUILD_TYPE )
-SET(CMAKE_BUILD_TYPE ${SCL_BUILD_TYPE} CACHE INTERNAL "Build type, immutable" FORCE )
+if( NOT DEFINED SCL_BUILD_TYPE )
+  set( SCL_BUILD_TYPE "Debug" CACHE STRING "Build type" ) # By default set debug build
+endif( NOT DEFINED SCL_BUILD_TYPE )
+set(CMAKE_BUILD_TYPE ${SCL_BUILD_TYPE} CACHE INTERNAL "Build type, immutable" FORCE )
 
 # Define helper macro OPTION_WITH_DEFAULT
-MACRO( OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT )
-  IF( NOT DEFINED ${OPTION_NAME} )
-    SET( ${OPTION_NAME} ${OPTION_DEFAULT} )
-  ENDIF( NOT DEFINED ${OPTION_NAME} )
-  OPTION( ${OPTION_NAME} "${OPTION_STRING}" ${${OPTION_NAME}} )
-ENDMACRO( OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT )
+macro( OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT )
+  if( NOT DEFINED ${OPTION_NAME} )
+    set( ${OPTION_NAME} ${OPTION_DEFAULT} )
+  endif( NOT DEFINED ${OPTION_NAME} )
+  option( ${OPTION_NAME} "${OPTION_STRING}" ${${OPTION_NAME}} )
+endmacro( OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT )
 
 # build shared libs by default
-OPTION_WITH_DEFAULT(SCL_BUILD_SHARED_LIBS "Build shared libs" ON )
+option_with_default(SCL_BUILD_SHARED_LIBS "Build shared libs" ON )
 
 # build static libs by default
-OPTION_WITH_DEFAULT(SCL_BUILD_STATIC_LIBS "Build static libs" OFF)
+option_with_default(SCL_BUILD_STATIC_LIBS "Build static libs" OFF)
 
-OPTION_WITH_DEFAULT(SCL_PYTHON_GENERATOR "Compile fedex_plus_python" ON)
-OPTION_WITH_DEFAULT(SCL_CPP_GENERATOR "Compile fedex_plus" ON)
+option_with_default(SCL_PYTHON_GENERATOR "Compile fedex_plus_python" ON)
+option_with_default(SCL_CPP_GENERATOR "Compile fedex_plus" ON)
 
 # CMake derives much of its functionality from modules, typically
 # stored in one directory - let CMake know where to find them.
-SET(SCL_CMAKE_DIR "${SCL_SOURCE_DIR}/cmake")
+set(SCL_CMAKE_DIR "${SCL_SOURCE_DIR}/cmake")
 if(NOT IS_SUBBUILD)
-  SET(CMAKE_MODULE_PATH "${SCL_CMAKE_DIR};${CMAKE_MODULE_PATH}")
+  set(CMAKE_MODULE_PATH "${SCL_CMAKE_DIR};${CMAKE_MODULE_PATH}")
 else(NOT IS_SUBBUILD)
-  SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${SCL_CMAKE_DIR}")
+  set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${SCL_CMAKE_DIR}")
 endif(NOT IS_SUBBUILD)
 
-INCLUDE(${SCL_CMAKE_DIR}/SCL_Utils.cmake)
+include(${SCL_CMAKE_DIR}/SCL_Utils.cmake)
 
 # Save the current LC_ALL, LC_MESSAGES, and LANG environment variables and set them
 # to "C" so things like date output are as expected
-SET(_orig_lc_all      $ENV{LC_ALL})
-SET(_orig_lc_messages $ENV{LC_MESSAGES})
-SET(_orig_lang        $ENV{LANG})
-IF(_orig_lc_all)
-  SET(ENV{LC_ALL}      C)
-ENDIF(_orig_lc_all)
-IF(_orig_lc_messages)
-  SET(ENV{LC_MESSAGES} C)
-ENDIF(_orig_lc_messages)
-IF(_orig_lang)
-  SET(ENV{LANG}        C)
-ENDIF(_orig_lang)
+set(_orig_lc_all      $ENV{LC_ALL})
+set(_orig_lc_messages $ENV{LC_MESSAGES})
+set(_orig_lang        $ENV{LANG})
+if(_orig_lc_all)
+  set(ENV{LC_ALL}      C)
+endif(_orig_lc_all)
+if(_orig_lc_messages)
+  set(ENV{LC_MESSAGES} C)
+endif(_orig_lc_messages)
+if(_orig_lang)
+  set(ENV{LANG}        C)
+endif(_orig_lang)
 
 #---------------------------------------------------------------------
 # Testing option
-OPTION_WITH_DEFAULT( SCL_ENABLE_TESTING "Enable unittesting framework" OFF )
-IF(SCL_ENABLE_TESTING)
+option_with_default( SCL_ENABLE_TESTING "Enable unittesting framework" OFF )
+if(SCL_ENABLE_TESTING)
   if( NOT DEFINED SCL_BUILD_SCHEMAS )
     set( SCL_BUILD_SCHEMAS "ALL" ) #test all schemas, unless otherwise specified
   endif()
-  INCLUDE(CTest)
-  ENABLE_TESTING()
-ENDIF(SCL_ENABLE_TESTING)
+  include(CTest)
+  enable_testing()
+endif(SCL_ENABLE_TESTING)
 
 #---------------------------------------------------------------------
 # Coverage option
-OPTION_WITH_DEFAULT( SCL_ENABLE_COVERAGE "Enable code coverage test" OFF )
-IF(SCL_ENABLE_COVERAGE)
-  SET(SCL_ENABLE_TESTING ON CACHE BOOL "Testing enabled by coverage option" FORCE)
+option_with_default( SCL_ENABLE_COVERAGE "Enable code coverage test" OFF )
+if(SCL_ENABLE_COVERAGE)
+  set(SCL_ENABLE_TESTING ON CACHE BOOL "Testing enabled by coverage option" FORCE)
   # build static libs, better coverage report
-  SET(SCL_BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE )
-  SET(SCL_BUILD_STATIC_LIBS ON CACHE BOOL "Build static libs" FORCE )
-  SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
-  SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
-  SET(CMAKE_MODULE_LINKER_FLAGS_DEBUG "-fprofile-arcs -ftest-coverage" CACHE STRING "Extra linker flags required by code coverage" FORCE)
-  SET(SCL_BUILD_TYPE "Debug" CACHE STRING "Build type required by testing framework" FORCE)
-ENDIF(SCL_ENABLE_COVERAGE)
+  set(SCL_BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE )
+  set(SCL_BUILD_STATIC_LIBS ON CACHE BOOL "Build static libs" FORCE )
+  set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
+  set(CMAKE_C_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
+  set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "-fprofile-arcs -ftest-coverage" CACHE STRING "Extra linker flags required by code coverage" FORCE)
+  set(SCL_BUILD_TYPE "Debug" CACHE STRING "Build type required by testing framework" FORCE)
+endif(SCL_ENABLE_COVERAGE)
 
 #---------------------------------------------------------------------
 # The following logic is what allows binaries to run successfully in
@@ -157,28 +157,28 @@
 
 #-----------------------------------------------------------------------------
 # Output directories.
-IF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-  SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
-ENDIF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-IF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
-  SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
-ENDIF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
-IF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
-  SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
-ENDIF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
+endif(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
+  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
+endif(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
+if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
+endif(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
 
-FOREACH(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
-  STRING(TOUPPER "${CFG_TYPE}" CFG_TYPE)
-  IF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
-    SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
-  ENDIF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
-  IF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
-    SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
-  ENDIF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
-  IF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
-    SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
-  ENDIF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
-ENDFOREACH()
+foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
+  string(TOUPPER "${CFG_TYPE}" CFG_TYPE)
+  if(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
+    set("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
+  endif(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
+  if(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
+    set("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
+  endif(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
+  if(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
+    set("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
+  endif(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
+endforeach()
 
 
 #-----------------------------------------------------------------------------
@@ -188,25 +188,25 @@
 # for Windows.  Only do this if CMAKE_INSTALL_PREFIX hasn't been set
 # already, to try and allow parent builds (if any) some control.
 if(NOT SCL_IS_SUBBUILD)
-  IF(NOT WIN32)
-    IF (${CMAKE_BUILD_TYPE} MATCHES "Debug")
-      SET(SCL_INSTALL_PREFIX "${SCL_SOURCE_DIR}/../scl-install")
-    ELSE()
-      SET(SCL_INSTALL_PREFIX "/usr/local")
-    ENDIF()
-  ENDIF(NOT WIN32)
-  SET( SCL_INSTALL_PREFIX ${SCL_INSTALL_PREFIX} CACHE
+  if(NOT WIN32)
+    if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
+      set(SCL_INSTALL_PREFIX "${SCL_SOURCE_DIR}/../scl-install")
+    else()
+      set(SCL_INSTALL_PREFIX "/usr/local")
+    endif()
+  endif(NOT WIN32)
+  set( SCL_INSTALL_PREFIX ${SCL_INSTALL_PREFIX} CACHE
     PATH "Install prefix prepended to target to create install location" )
-  SET( CMAKE_INSTALL_PREFIX ${SCL_INSTALL_PREFIX} CACHE INTERNAL "Prefix prepended to install directories if target destination is not absolute, immutable" FORCE )
+  set( CMAKE_INSTALL_PREFIX ${SCL_INSTALL_PREFIX} CACHE INTERNAL "Prefix prepended to install directories if target destination is not absolute, immutable" FORCE )
 endif(NOT SCL_IS_SUBBUILD)
 
-OPTION(SCL_BUILD_EXPRESS_ONLY "Only build express parser." OFF)
-MARK_AS_ADVANCED(SCL_BUILD_EXPRESS_ONLY)
+option(SCL_BUILD_EXPRESS_ONLY "Only build express parser." OFF)
+mark_as_advanced(SCL_BUILD_EXPRESS_ONLY)
 
 # Take the scl config file template as the starting point for 
 # scl_cf.h.in - scripts may need to append to the template, so
 # it is read into memory initially.
-SET(CONFIG_H_FILE ${SCL_BINARY_DIR}/include/scl_cf.h.in)
+set(CONFIG_H_FILE ${SCL_BINARY_DIR}/include/scl_cf.h.in)
 set_source_files_properties(${CONFIG_H_FILE} PROPERTIES GENERATED TRUE)
 set(CMAKE_CURRENT_PROJECT SCL)
 define_property(GLOBAL PROPERTY SCL_CONFIG_H_CONTENTS BRIEF_DOCS "config.h.in contents" FULL_DOCS "config.h.in contents for SCL project")
@@ -220,7 +220,7 @@
   endmacro(CONFIG_H_APPEND NEW_CONTENTS)
 endif(NOT COMMAND CONFIG_H_APPEND)
 file(READ ${SCL_SOURCE_DIR}/include/scl_cf_cmake.h.in CONFIG_H_FILE_CONTENTS)
-CONFIG_H_APPEND(SCL "${CONFIG_H_FILE_CONTENTS}")
+config_h_append(SCL "${CONFIG_H_FILE_CONTENTS}")
 
 # The Express parser uses the tools Perplex, RE2C and Lemon to generate code
 # from higher level inputs.  Depending on available tools and options, the
@@ -281,28 +281,28 @@
 	set(SCL_GENERATE_LP_SOURCES 0)
 endif(NOT "${SCL_GENERATE_LEXER_PARSER}" STREQUAL "OFF")
 
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckTypeSize)
+include(CheckLibraryExists)
+include(CheckIncludeFile)
+include(CheckFunctionExists)
+include(CheckTypeSize)
 
-CHECK_INCLUDE_FILE(ndir.h HAVE_NDIR_H)
-CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
-CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
-CHECK_INCLUDE_FILE(sys/param.h HAVE_SYS_PARAM_H)
-CHECK_INCLUDE_FILE(sysent.h HAVE_SYSENT_H)
-CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
-CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
-CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
-CHECK_INCLUDE_FILE(process.h HAVE_PROCESS_H)
-CHECK_INCLUDE_FILE(io.h HAVE_IO_H)
+check_include_file(ndir.h HAVE_NDIR_H)
+check_include_file(stdarg.h HAVE_STDARG_H)
+check_include_file(sys/stat.h HAVE_SYS_STAT_H)
+check_include_file(sys/param.h HAVE_SYS_PARAM_H)
+check_include_file(sysent.h HAVE_SYSENT_H)
+check_include_file(unistd.h HAVE_UNISTD_H)
+check_include_file(dirent.h HAVE_DIRENT_H)
+check_include_file(stdbool.h HAVE_STDBOOL_H)
+check_include_file(process.h HAVE_PROCESS_H)
+check_include_file(io.h HAVE_IO_H)
 
-CHECK_FUNCTION_EXISTS(abs HAVE_ABS)
-CHECK_FUNCTION_EXISTS(memcpy HAVE_MEMCPY)
-CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE)
-CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
+check_function_exists(abs HAVE_ABS)
+check_function_exists(memcpy HAVE_MEMCPY)
+check_function_exists(memmove HAVE_MEMMOVE)
+check_function_exists(getopt HAVE_GETOPT)
 
-CHECK_TYPE_SIZE("ssize_t" SSIZE_T)
+check_type_size("ssize_t" SSIZE_T)
 
 # Now that all the tests are done, configure the scl_cf.h file:
 get_property(CONFIG_H_FILE_CONTENTS GLOBAL PROPERTY SCL_CONFIG_H_CONTENTS)
@@ -342,21 +342,21 @@
   ${SCL_BINARY_DIR}/include
   )
 
-ADD_SUBDIRECTORY(src/base)
-ADD_SUBDIRECTORY(src/express)
-ADD_SUBDIRECTORY(src/exppp)
-ADD_SUBDIRECTORY(src/fedex_plus)
-ADD_SUBDIRECTORY(src/fedex_python)
-ADD_SUBDIRECTORY(src/clstepcore)
-ADD_SUBDIRECTORY(src/cleditor)
-ADD_SUBDIRECTORY(src/cldai)
-ADD_SUBDIRECTORY(src/clutils)
-ADD_SUBDIRECTORY(include)
-ADD_SUBDIRECTORY(data)
-IF(ENABLE_TESTING)
-  ADD_SUBDIRECTORY( test )
-ENDIF(ENABLE_TESTING)
-ADD_SUBDIRECTORY(doc)
+add_subdirectory(src/base)
+add_subdirectory(src/express)
+add_subdirectory(src/exppp)
+add_subdirectory(src/fedex_plus)
+add_subdirectory(src/fedex_python)
+add_subdirectory(src/clstepcore)
+add_subdirectory(src/cleditor)
+add_subdirectory(src/cldai)
+add_subdirectory(src/clutils)
+add_subdirectory(include)
+add_subdirectory(data)
+if(ENABLE_TESTING)
+  add_subdirectory( test )
+endif(ENABLE_TESTING)
+add_subdirectory(doc)
 
 # this is for testing - 'make core' builds everything that isn't generated
 add_custom_target( core )
@@ -368,15 +368,15 @@
   # $make package                                                               #
   ###############################################################################
 
-  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "STEPcode")
-  SET(CPACK_SET_DESTDIR "ON")
+  set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "STEPcode")
+  set(CPACK_SET_DESTDIR "ON")
 
-  SET(CPACK_PACKAGE_VERSION_MAJOR ${SCL_VERSION_MAJOR})
-  SET(CPACK_PACKAGE_VERSION_MINOR ${SCL_VERSION_MINOR})
-  SET(CPACK_PACKAGE_NAME SCL )
+  set(CPACK_PACKAGE_VERSION_MAJOR ${SCL_VERSION_MAJOR})
+  set(CPACK_PACKAGE_VERSION_MINOR ${SCL_VERSION_MINOR})
+  set(CPACK_PACKAGE_NAME SCL )
 
-  SET(CPACK_PACKAGE_CONTACT "SCL Developers <scl-dev@googlegroups.com>")
-  INCLUDE(CPack)
+  set(CPACK_PACKAGE_CONTACT "SCL Developers <scl-dev@googlegroups.com>")
+  include(CPack)
 
   ########################################################################################
   # Uninstall code                                                                       #
Index: src/other/step/test/CMakeLists.txt
===================================================================
--- src/other/step/test/CMakeLists.txt	(revision 54114)
+++ src/other/step/test/CMakeLists.txt	(working copy)
@@ -2,14 +2,14 @@
 #
 # Adding unittest for unitary schemas
 #
-FILE(GLOB UNITARY_SCHEMAS "${CMAKE_CURRENT_SOURCE_DIR}/unitary_schemas/*.exp")
-FOREACH(UNITARY_SCHEMA ${UNITARY_SCHEMAS})
-  GET_FILENAME_COMPONENT(SCHEMA_NAME ${UNITARY_SCHEMA} NAME_WE)
+file(GLOB UNITARY_SCHEMAS "${CMAKE_CURRENT_SOURCE_DIR}/unitary_schemas/*.exp")
+foreach(UNITARY_SCHEMA ${UNITARY_SCHEMAS})
+  get_filename_component(SCHEMA_NAME ${UNITARY_SCHEMA} NAME_WE)
   # setting test_name
-  SET(TEST_NAME test${SCHEMA_NAME})
+  set(TEST_NAME test${SCHEMA_NAME})
   # add test
-  ADD_TEST(${TEST_NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/check-express ${UNITARY_SCHEMA})
+  add_test(${TEST_NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/check-express ${UNITARY_SCHEMA})
   set_tests_properties( ${TEST_NAME} PROPERTIES LABELS unitary_schemas )
-ENDFOREACH(UNITARY_SCHEMA ${UNITARY_SCHEMAS})
+endforeach(UNITARY_SCHEMA ${UNITARY_SCHEMAS})
 
 add_subdirectory(p21)
Index: src/other/step/test/p21/CMakeLists.txt
===================================================================
--- src/other/step/test/p21/CMakeLists.txt	(revision 54114)
+++ src/other/step/test/p21/CMakeLists.txt	(working copy)
@@ -1,4 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8)
 
 #test part 21 files
 #currently, the only tests are for the schema name
@@ -6,8 +6,8 @@
 set( schema_name_tests_head "
 ISO-10303-21;
 HEADER;
-FILE_DESCRIPTION(('SCL test file'),'2;1');
-FILE_NAME('test.stp','2011-11-29T',('mp'),(''),'0','1','2');
+file_description(('SCL test file'),'2;1');
+file_name('test.stp','2011-11-29T',('mp'),(''),'0','1','2');
 ")
 set( schema_name_tests_tail "
 ENDSEC;
Index: src/other/step/cmake/FindRE2C.cmake
===================================================================
--- src/other/step/cmake/FindRE2C.cmake	(revision 54114)
+++ src/other/step/cmake/FindRE2C.cmake	(working copy)
@@ -7,4 +7,4 @@
 mark_as_advanced(RE2C_EXECUTABLE)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(RE2C DEFAULT_MSG RE2C_EXECUTABLE)
+find_package_handle_standard_args(RE2C DEFAULT_MSG RE2C_EXECUTABLE)
Index: src/other/step/cmake/Generated_Source_Utils.cmake
===================================================================
--- src/other/step/cmake/Generated_Source_Utils.cmake	(revision 54114)
+++ src/other/step/cmake/Generated_Source_Utils.cmake	(working copy)
@@ -29,11 +29,11 @@
     if(NOT EXISTS ${filefullname})
       message(FATAL_ERROR "Attempted to verify non-existant file ${filefullname}")
     endif(NOT EXISTS ${filefullname})
-    FILEVAR(${filename} filevar)
+    filevar(${filename} filevar)
     if(NOT baseline_${filevar}_md5)
       message(FATAL_ERROR "No baseline MD5 available for ${filename} - baseline_${filevar}_md5 is not defined")
     endif(NOT baseline_${filevar}_md5)
-    MD5(${filefullname} ${filevar}_md5)
+    md5(${filefullname} ${filevar}_md5)
     if(NOT "${${filevar}_md5}" STREQUAL "${baseline_${filevar}_md5}")
       if("${warn}" STREQUAL "1")
 	message("\n${filename} differs from baseline: baseline md5 hash is ${baseline_${filevar}_md5} and current hash is ${${filevar}_md5}\n")
@@ -61,8 +61,8 @@
     if(NOT EXISTS ${filefullname})
       message(FATAL_ERROR "Attempted to get MD5 sum of non-existant file ${filefullname}")
     endif(NOT EXISTS ${filefullname})
-    FILEVAR(${filename} filevar)
-    MD5(${filefullname} ${filevar}_md5)
+    filevar(${filename} filevar)
+    md5(${filefullname} ${filevar}_md5)
     file(APPEND ${outfile} "set(baseline_${filevar}_md5 ${${filevar}_md5})\n")
   endforeach(fileitem ${filelist})
 endmacro(WRITE_MD5_SUMS)
Index: src/other/step/cmake/FindPERPLEX.cmake
===================================================================
--- src/other/step/cmake/FindPERPLEX.cmake	(revision 54114)
+++ src/other/step/cmake/FindPERPLEX.cmake	(working copy)
@@ -65,7 +65,7 @@
   endif(EXISTS /usr/share/perplex/perplex_template.c AND NOT PERPLEX_TEMPLATE)
 endif(PERPLEX_EXECUTABLE AND NOT PERPLEX_TEMPLATE)
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(PERPLEX DEFAULT_MSG PERPLEX_EXECUTABLE PERPLEX_TEMPLATE)
+find_package_handle_standard_args(PERPLEX DEFAULT_MSG PERPLEX_EXECUTABLE PERPLEX_TEMPLATE)
 mark_as_advanced(PERPLEX_TEMPLATE)
 
 #============================================================
Index: src/other/step/cmake/SCL_Utils.cmake
===================================================================
--- src/other/step/cmake/SCL_Utils.cmake	(revision 54114)
+++ src/other/step/cmake/SCL_Utils.cmake	(working copy)
@@ -1,13 +1,13 @@
 
 # set compile definitions for dll exports on windows
-MACRO(DEFINE_DLL_EXPORTS libname)
-    IF( MSVC OR BORLAND )
+macro(DEFINE_DLL_EXPORTS libname)
+    if( MSVC OR BORLAND )
         if( ${libname} MATCHES "sdai_.*" )
             set( export "SCL_SCHEMA_DLL_EXPORTS" )
         else()
-            STRING(REGEX REPLACE "lib" "" shortname "${libname}")
-            STRING(REGEX REPLACE "step" "" LOWERCORE "${shortname}")
-            STRING(TOUPPER ${LOWERCORE} UPPER_CORE)
+            string(REGEX REPLACE "lib" "" shortname "${libname}")
+            string(REGEX REPLACE "step" "" LOWERCORE "${shortname}")
+            string(TOUPPER ${LOWERCORE} UPPER_CORE)
             set( export "SCL_${UPPER_CORE}_DLL_EXPORTS" )
         endif()
         get_target_property(defs ${libname} COMPILE_DEFINITIONS )
@@ -17,20 +17,20 @@
             set( defs "${export}")
         endif( defs )
         set_target_properties(${libname} PROPERTIES COMPILE_DEFINITIONS "${defs}" )
-    ENDIF( MSVC OR BORLAND )
-ENDMACRO(DEFINE_DLL_EXPORTS libname)
+    endif( MSVC OR BORLAND )
+endmacro(DEFINE_DLL_EXPORTS libname)
 
 # set compile definitions for dll imports on windows
-MACRO( DEFINE_DLL_IMPORTS tgt libs )
-    IF( MSVC OR BORLAND )
+macro( DEFINE_DLL_IMPORTS tgt libs )
+    if( MSVC OR BORLAND )
         get_target_property(defs ${tgt} COMPILE_DEFINITIONS )
         if( NOT defs ) #if no properties, ${defs} will be defs-NOTFOUND which CMake interprets as false
             set( defs "")
         endif( NOT defs )
         foreach( lib ${libs} )
-            STRING(REGEX REPLACE "lib" "" shortname "${lib}")
-            STRING(REGEX REPLACE "step" "" LOWERCORE "${shortname}")
-            STRING(TOUPPER ${LOWERCORE} UPPER_CORE)
+            string(REGEX REPLACE "lib" "" shortname "${lib}")
+            string(REGEX REPLACE "step" "" LOWERCORE "${shortname}")
+            string(TOUPPER ${LOWERCORE} UPPER_CORE)
             list( APPEND defs "SCL_${UPPER_CORE}_DLL_IMPORTS" )
         endforeach( lib ${libs} )
         if( DEFINED defs )
@@ -38,96 +38,96 @@
                 set_target_properties( ${tgt} PROPERTIES COMPILE_DEFINITIONS "${defs}" )
             endif( defs )
         endif( DEFINED defs )
-    ENDIF( MSVC OR BORLAND )
-ENDMACRO( DEFINE_DLL_IMPORTS tgt libs )
+    endif( MSVC OR BORLAND )
+endmacro( DEFINE_DLL_IMPORTS tgt libs )
 
 #EXCLUDE_OR_INSTALL(target destination ARGV3)
 # installs ${target} in ${destination} unless testing is enabled AND ${arg_3} == "TESTABLE",
 # in which case the EXCLUDE_FROM_ALL property is set for testing.
 # EXCLUDE_FROM_ALL cannot be set on targets that are to be installed,
 # so either test the target or install it - but not both
-MACRO(EXCLUDE_OR_INSTALL target dest arg_3 )
+macro(EXCLUDE_OR_INSTALL target dest arg_3 )
     if( NOT ( ( SCL_ENABLE_TESTING ) AND ( "${arg_3}" STREQUAL "TESTABLE" ) ) )
-        INSTALL(TARGETS ${target} DESTINATION ${dest})
+        install(TARGETS ${target} DESTINATION ${dest})
     else( NOT ( ( SCL_ENABLE_TESTING ) AND ( "${arg_3}" STREQUAL "TESTABLE" ) ) )
         set_target_properties( ${target} PROPERTIES EXCLUDE_FROM_ALL ON )
     endif( NOT ( ( SCL_ENABLE_TESTING ) AND ( "${arg_3}" STREQUAL "TESTABLE" ) ) )
-ENDMACRO(EXCLUDE_OR_INSTALL target dest arg_3 )
+endmacro(EXCLUDE_OR_INSTALL target dest arg_3 )
 
 #SCL_ADDEXEC( execname "source files" "linked libs" ["TESTABLE"] ["MSVC flag" ...])
 # optional 4th argument of "TESTABLE", passed to EXCLUDE_OR_INSTALL macro
 # optional args can also be used by MSVC-specific code, but it looks like these two uses
 # will not conflict because the MSVC args must contain "STRICT"
-MACRO(SCL_ADDEXEC execname srcslist libslist)
+macro(SCL_ADDEXEC execname srcslist libslist)
     add_executable(${execname} ${srcslist})
     target_link_libraries(${execname} ${libslist})
-    DEFINE_DLL_IMPORTS(${execname} "${libslist}")  #add import definitions for all libs that the executable is linked to
-    EXCLUDE_OR_INSTALL( ${execname} "bin" "${ARGV3}" )
+    define_dll_imports(${execname} "${libslist}")  #add import definitions for all libs that the executable is linked to
+    exclude_or_install( ${execname} "bin" "${ARGV3}" )
     # Enable extra compiler flags if local executables and/or global options dictate
-    SET(LOCAL_COMPILE_FLAGS "")
-    FOREACH(extraarg ${ARGN})
-        IF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
-            SET(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
-        ENDIF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
-    ENDFOREACH(extraarg ${ARGN})
-    IF(LOCAL_COMPILE_FLAGS)
-        SET_TARGET_PROPERTIES(${execname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
-    ENDIF(LOCAL_COMPILE_FLAGS)
-ENDMACRO(SCL_ADDEXEC execname srcslist libslist)
+    set(LOCAL_COMPILE_FLAGS "")
+    foreach(extraarg ${ARGN})
+        if(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
+            set(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
+        endif(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
+    endforeach(extraarg ${ARGN})
+    if(LOCAL_COMPILE_FLAGS)
+        set_target_properties(${execname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
+    endif(LOCAL_COMPILE_FLAGS)
+endmacro(SCL_ADDEXEC execname srcslist libslist)
 
 #SCL_ADDLIB( libname "source files" "linked libs" ["TESTABLE"] ["MSVC flag" ...])
 # optional 4th argument of "TESTABLE", passed to EXCLUDE_OR_INSTALL macro
 # optional args can also be used by MSVC-specific code, but it looks like these two uses
 # will not conflict because the MSVC args must contain "STRICT"
-MACRO(SCL_ADDLIB libname srcslist libslist)
-  STRING(REGEX REPLACE "-framework;" "-framework " libslist "${libslist1}")
-  IF(SCL_BUILD_SHARED_LIBS)
+macro(SCL_ADDLIB libname srcslist libslist)
+  string(REGEX REPLACE "-framework;" "-framework " libslist "${libslist1}")
+  if(SCL_BUILD_SHARED_LIBS)
       add_library(${libname} SHARED ${srcslist})
-      DEFINE_DLL_EXPORTS(${libname})
+      define_dll_exports(${libname})
       if(NOT "${libs}" MATCHES "NONE")
           target_link_libraries(${libname} ${libslist})
-          DEFINE_DLL_IMPORTS(${libname} "${libslist}" )
+          define_dll_imports(${libname} "${libslist}" )
       endif(NOT "${libs}" MATCHES "NONE")
-      SET_TARGET_PROPERTIES(${libname} PROPERTIES VERSION ${SCL_ABI_VERSION} SOVERSION ${SCL_ABI_SOVERSION} )
-      EXCLUDE_OR_INSTALL( ${libname} "lib" "${ARGV3}" )
+      set_target_properties(${libname} PROPERTIES VERSION ${SCL_ABI_VERSION} SOVERSION ${SCL_ABI_SOVERSION} )
+      exclude_or_install( ${libname} "lib" "${ARGV3}" )
     if(APPLE)
         set_target_properties(${libname} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
     endif(APPLE)
-  ENDIF(SCL_BUILD_SHARED_LIBS)
-  IF(SCL_BUILD_STATIC_LIBS AND NOT MSVC)
+  endif(SCL_BUILD_SHARED_LIBS)
+  if(SCL_BUILD_STATIC_LIBS AND NOT MSVC)
       add_library(${libname}-static STATIC ${srcslist})
-      DEFINE_DLL_EXPORTS(${libname}-static)
+      define_dll_exports(${libname}-static)
       if(NOT ${libs} MATCHES "NONE")
           target_link_libraries(${libname}-static "${libslist}")
-          DEFINE_DLL_IMPORTS(${libname}-static ${libslist} )
+          define_dll_imports(${libname}-static ${libslist} )
       endif(NOT ${libs} MATCHES "NONE")
-      IF(NOT WIN32)
-          SET_TARGET_PROPERTIES(${libname}-static PROPERTIES OUTPUT_NAME "${libname}")
-      ENDIF(NOT WIN32)
-      IF(WIN32)
+      if(NOT WIN32)
+          set_target_properties(${libname}-static PROPERTIES OUTPUT_NAME "${libname}")
+      endif(NOT WIN32)
+      if(WIN32)
           # We need the lib prefix on win32, so add it even if our add_library
           # wrapper function has removed it due to the target name - see
           # http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_make_my_shared_and_static_libraries_have_the_same_root_name.2C_but_different_suffixes.3F
-          SET_TARGET_PROPERTIES(${libname}-static PROPERTIES PREFIX "lib")
-      ENDIF(WIN32)
-      EXCLUDE_OR_INSTALL( ${libname}-static "lib" "${ARGV3}" )
+          set_target_properties(${libname}-static PROPERTIES PREFIX "lib")
+      endif(WIN32)
+      exclude_or_install( ${libname}-static "lib" "${ARGV3}" )
     if(APPLE)
         set_target_properties(${libname}-static PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
     endif(APPLE)
-  ENDIF(SCL_BUILD_STATIC_LIBS AND NOT MSVC)
+  endif(SCL_BUILD_STATIC_LIBS AND NOT MSVC)
   # Enable extra compiler flags if local libraries and/or global options dictate
-  SET(LOCAL_COMPILE_FLAGS "")
-  FOREACH(extraarg ${ARGN})
-      IF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
-          SET(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
-      ENDIF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
-  ENDFOREACH(extraarg ${ARGN})
-  IF(LOCAL_COMPILE_FLAGS)
-      IF(BUILD_SHARED_LIBS)
-          SET_TARGET_PROPERTIES(${libname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
-      ENDIF(BUILD_SHARED_LIBS)
-      IF(BUILD_STATIC_LIBS AND NOT MSVC)
-          SET_TARGET_PROPERTIES(${libname}-static PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
-      ENDIF(BUILD_STATIC_LIBS AND NOT MSVC)
-  ENDIF(LOCAL_COMPILE_FLAGS)
-ENDMACRO(SCL_ADDLIB libname srcslist libslist)
+  set(LOCAL_COMPILE_FLAGS "")
+  foreach(extraarg ${ARGN})
+      if(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
+          set(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
+      endif(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
+  endforeach(extraarg ${ARGN})
+  if(LOCAL_COMPILE_FLAGS)
+      if(BUILD_SHARED_LIBS)
+          set_target_properties(${libname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
+      endif(BUILD_SHARED_LIBS)
+      if(BUILD_STATIC_LIBS AND NOT MSVC)
+          set_target_properties(${libname}-static PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
+      endif(BUILD_STATIC_LIBS AND NOT MSVC)
+  endif(LOCAL_COMPILE_FLAGS)
+endmacro(SCL_ADDLIB libname srcslist libslist)
Index: src/other/step/cmake/FindLEMON.cmake
===================================================================
--- src/other/step/cmake/FindLEMON.cmake	(revision 54114)
+++ src/other/step/cmake/FindLEMON.cmake	(working copy)
@@ -60,7 +60,7 @@
   endif(lemon_path)
 endif(LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LEMON DEFAULT_MSG LEMON_EXECUTABLE LEMON_TEMPLATE)
+find_package_handle_standard_args(LEMON DEFAULT_MSG LEMON_EXECUTABLE LEMON_TEMPLATE)
 mark_as_advanced(LEMON_TEMPLATE)
 
 #============================================================
Index: src/other/step/include/CMakeLists.txt
===================================================================
--- src/other/step/include/CMakeLists.txt	(revision 54114)
+++ src/other/step/include/CMakeLists.txt	(working copy)
@@ -1,4 +1,4 @@
-SET(express_HDRS
+set(express_HDRS
   express/alg.h
   express/basic.h
   express/caseitem.h
@@ -23,7 +23,7 @@
 )
 install(FILES ${express_HDRS} DESTINATION include/express)
 
-SET(exppp_HDRS
+set(exppp_HDRS
   exppp/exppp.h
 )
 install(FILES ${exppp_HDRS} DESTINATION include/exppp)
Index: src/other/step/run_ctest.cmake
===================================================================
--- src/other/step/run_ctest.cmake	(revision 54114)
+++ src/other/step/run_ctest.cmake	(working copy)
@@ -95,29 +95,29 @@
 ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
 
 ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND OPTIONS -DSCL_ENABLE_TESTING=ON )
-SUBMIT_TEST( Configure )
+submit_test( Configure )
 ctest_build( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND )
-SUBMIT_TEST( Build )
+submit_test( Build )
 # ctest_memcheck( BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL ${PROCESSOR_COUNT} )
 
 if(NOT SKIP_TEST_UNITARY_SCHEMAS )
     ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
                 PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "unitary_schemas" )
-    SUBMIT_TEST( Test )
+    submit_test( Test )
 endif()
 
 if(NOT SKIP_CPP_TEST_SCHEMA_GEN )
     ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
                 PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "cpp_schema_gen" )
-    SUBMIT_TEST( Test )
+    submit_test( Test )
     if(NOT SKIP_CPP_TEST_SCHEMA_BUILD )
         ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
                     PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "cpp_schema_build" )
-        SUBMIT_TEST( Test )
+        submit_test( Test )
         if(NOT SKIP_CPP_TEST_SCHEMA_RW )
             ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
                         PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "cpp_schema_rw" )
-            SUBMIT_TEST( Test )
+            submit_test( Test )
         endif()
     endif()
 endif()
@@ -126,11 +126,11 @@
     if( SKIP_CPP_TEST_SCHEMA_BUILD )
         ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
                 PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE "build_cpp_sdai_AP214E3_2010" )
-        SUBMIT_TEST( Test )
+        submit_test( Test )
     endif()
     ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
                 PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "exchange_file" )
-    SUBMIT_TEST( Test )
+    submit_test( Test )
 endif()
 
 # ctest_coverage( )
Index: src/other/libpng/CMakeLists.txt
===================================================================
--- src/other/libpng/CMakeLists.txt	(revision 54114)
+++ src/other/libpng/CMakeLists.txt	(working copy)
@@ -14,7 +14,7 @@
     # workaround CMake 2.4.x bug
     set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
         "Choose the type of build, options are:
-           None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used)
+           none(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used)
            Debug
            Release
            RelWithDebInfo
@@ -22,7 +22,7 @@
   else()
     set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
         "Choose the type of build, options are:
-           None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used)
+           none(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used)
            Debug
            Release
            RelWithDebInfo
@@ -175,23 +175,23 @@
 endif()
 
 # Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set
-IF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-  SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "lib")
-ENDIF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "lib")
+endif(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
 
 # Set a variable with CMake code which:
 # Creates a symlink from src to dest (if possible) or alternatively
 # copies if different.
 macro(CREATE_SYMLINK SRC_FILE DEST_FILE)
-  FILE(REMOVE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE})
+  file(REMOVE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE})
   if(WIN32 AND NOT CYGWIN AND NOT MSYS)
-    ADD_CUSTOM_COMMAND(
+    add_custom_command(
         OUTPUT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE}   ${CMAKE_CURRENT_BINARY_DIR}/${DEST_FILE}
         COMMAND ${CMAKE_COMMAND} -E copy        ${CMAKE_CURRENT_BINARY_DIR}/${SRC_FILE} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE}
         COMMAND ${CMAKE_COMMAND} -E copy        ${CMAKE_CURRENT_BINARY_DIR}/${SRC_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${DEST_FILE}
         DEPENDS ${PNG_LIB_NAME} ${PNG_LIB_NAME_STATIC}
         )
-    ADD_CUSTOM_TARGET(${DEST_FILE}_COPY ALL DEPENDS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE})
+    add_custom_target(${DEST_FILE}_COPY ALL DEPENDS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE})
   else(WIN32 AND NOT CYGWIN AND NOT MSYS)
     execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SRC_FILE} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
     execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SRC_FILE} ${DEST_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
@@ -215,11 +215,11 @@
   set(LIBS        "-lz -lm")
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
     ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY)
-  CREATE_SYMLINK(${PNGLIB_NAME}.pc libpng.pc)
+  create_symlink(${PNGLIB_NAME}.pc libpng.pc)
 
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in
     ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY)
-  CREATE_SYMLINK(${PNGLIB_NAME}-config libpng-config)
+  create_symlink(${PNGLIB_NAME}-config libpng-config)
 endif(NOT WIN32 OR CYGWIN OR MINGW)
 
 # SET UP LINKS
@@ -263,7 +263,7 @@
     if(CYGWIN OR MINGW)
        get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME} LOCATION_${CMAKE_BUILD_TYPE})
        get_filename_component(BUILD_TARGET_FILE ${BUILD_TARGET_LOCATION} NAME)
-       CREATE_SYMLINK(${BUILD_TARGET_FILE} libpng${CMAKE_IMPORT_LIBRARY_SUFFIX})
+       create_symlink(${BUILD_TARGET_FILE} libpng${CMAKE_IMPORT_LIBRARY_SUFFIX})
        install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX}
          DESTINATION ${CMAKE_INSTALL_LIBDIR})
     endif(CYGWIN OR MINGW)
@@ -271,7 +271,7 @@
     if(NOT WIN32)
       get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME} LOCATION_${CMAKE_BUILD_TYPE})
       get_filename_component(BUILD_TARGET_FILE ${BUILD_TARGET_LOCATION} NAME)
-      CREATE_SYMLINK(${BUILD_TARGET_FILE} libpng${CMAKE_SHARED_LIBRARY_SUFFIX})
+      create_symlink(${BUILD_TARGET_FILE} libpng${CMAKE_SHARED_LIBRARY_SUFFIX})
       install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}
          DESTINATION ${CMAKE_INSTALL_LIBDIR})
     endif(NOT WIN32)
@@ -285,7 +285,7 @@
     if(NOT WIN32 OR CYGWIN OR MINGW)
       get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME_STATIC} LOCATION_${CMAKE_BUILD_TYPE})
       get_filename_component(BUILD_TARGET_FILE ${BUILD_TARGET_LOCATION} NAME)
-      CREATE_SYMLINK(${BUILD_TARGET_FILE} libpng${CMAKE_STATIC_LIBRARY_SUFFIX})
+      create_symlink(${BUILD_TARGET_FILE} libpng${CMAKE_STATIC_LIBRARY_SUFFIX})
       install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}
          DESTINATION ${CMAKE_INSTALL_LIBDIR})
     endif(NOT WIN32 OR CYGWIN OR MINGW)
Index: src/other/iwidgets/doc/CMakeLists.txt
===================================================================
--- src/other/iwidgets/doc/CMakeLists.txt	(revision 54114)
+++ src/other/iwidgets/doc/CMakeLists.txt	(working copy)
@@ -1,4 +1,4 @@
-SET(iwidgets_MANS
+set(iwidgets_MANS
 	buttonbox.n
 	calendar.n
 	canvasprintbox.n
Index: src/other/iwidgets/CMakeLists.txt
===================================================================
--- src/other/iwidgets/CMakeLists.txt	(revision 54114)
+++ src/other/iwidgets/CMakeLists.txt	(working copy)
@@ -1,9 +1,9 @@
-SET(IWIDGETS_PKGNAME Iwidgets)
-SET(IWIDGETS_PKGVERSION "4.0.1")
-SET(VERSION ${IWIDGETS_PKGVERSION})
-SET(IWIDGETS_VERSION ${IWIDGETS_PKGVERSION})
+set(IWIDGETS_PKGNAME Iwidgets)
+set(IWIDGETS_PKGVERSION "4.0.1")
+set(VERSION ${IWIDGETS_PKGVERSION})
+set(IWIDGETS_VERSION ${IWIDGETS_PKGVERSION})
 
-SET(IWIDGETS_SCRIPTS
+set(IWIDGETS_SCRIPTS
   generic/buttonbox.itk
   generic/calendar.itk
   generic/canvasprintbox.itk
@@ -65,12 +65,12 @@
   generic/watch.itk
   )
 
-FOREACH(script ${IWIDGETS_SCRIPTS})
+foreach(script ${IWIDGETS_SCRIPTS})
   install(FILES ${script} DESTINATION lib/${IWIDGETS_PKGNAME}${IWIDGETS_PKGVERSION}/scripts)
-ENDFOREACH(script ${IWIDGETS_SCRIPTS})
-CMAKEFILES(${IWIDGETS_SCRIPTS})
+endforeach(script ${IWIDGETS_SCRIPTS})
+cmakefiles(${IWIDGETS_SCRIPTS})
 
-FOREACH(file ${IWIDGETS_SCRIPTS})
+foreach(file ${IWIDGETS_SCRIPTS})
   get_filename_component(filename ${file} NAME)
   if(NOT CMAKE_CONFIGURATION_TYPES)
     configure_file(${file} ${CMAKE_BINARY_DIR}/lib/${IWIDGETS_PKGNAME}${IWIDGETS_PKGVERSION}/scripts/${filename} COPYONLY)
@@ -80,10 +80,10 @@
       configure_file(${file} ${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/lib/${IWIDGETS_PKGNAME}${IWIDGETS_PKGVERSION}/scripts/${filename} COPYONLY)
     endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
   endif(NOT CMAKE_CONFIGURATION_TYPES)
-ENDFOREACH(file ${ITK_LIBRARY_FILES})
+endforeach(file ${ITK_LIBRARY_FILES})
 
 # Create the pkgIndex.tcl file and configure iwidgets.tcl.
-FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl "package ifneeded ${IWIDGETS_PKGNAME} ${IWIDGETS_PKGVERSION} [list source [file join $dir iwidgets.tcl]]")
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl "package ifneeded ${IWIDGETS_PKGNAME} ${IWIDGETS_PKGVERSION} [list source [file join $dir iwidgets.tcl]]")
 set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl PROPERTIES GENERATED TRUE)
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/iwidgets.tcl.in ${CMAKE_CURRENT_BINARY_DIR}/iwidgets.tcl)
 
@@ -104,4 +104,4 @@
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/iwidgets.tcl DESTINATION lib/${IWIDGETS_PKGNAME}${IWIDGETS_PKGVERSION})
 install(FILES license.terms DESTINATION lib/${IWIDGETS_PKGNAME}${IWIDGETS_PKGVERSION})
 
-ADD_SUBDIRECTORY(doc)
+add_subdirectory(doc)
Index: src/other/tcl/library/CMakeLists.txt
===================================================================
--- src/other/tcl/library/CMakeLists.txt	(revision 54114)
+++ src/other/tcl/library/CMakeLists.txt	(working copy)
@@ -1,7 +1,7 @@
 #ADD_SUBDIRECTORY(tzdata)
 
-MACRO(TCL_SCRIPTS_BUILD files destination)
-  FOREACH(file ${${files}})
+macro(TCL_SCRIPTS_BUILD files destination)
+  foreach(file ${${files}})
     get_filename_component(filename ${file} NAME)
     if(NOT CMAKE_CONFIGURATION_TYPES)
       configure_file(${file} ${CMAKE_BINARY_DIR}/${destination}/${filename} COPYONLY)
@@ -11,10 +11,10 @@
 	configure_file(${file} ${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/${destination}/${filename} COPYONLY)
       endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
     endif(NOT CMAKE_CONFIGURATION_TYPES)
-  ENDFOREACH(file ${${files}})
-ENDMACRO(TCL_SCRIPTS_BUILD)
+  endforeach(file ${${files}})
+endmacro(TCL_SCRIPTS_BUILD)
 
-SET(tcl_library_toplevel
+set(tcl_library_toplevel
   auto.tcl
   clock.tcl
   history.tcl
@@ -26,28 +26,28 @@
   word.tcl
   tclIndex
   )
-INSTALL(FILES ${tcl_library_toplevel} DESTINATION lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR})
-TCL_SCRIPTS_BUILD(tcl_library_toplevel lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR})
+install(FILES ${tcl_library_toplevel} DESTINATION lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR})
+tcl_scripts_build(tcl_library_toplevel lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR})
 
-SET(tcl_library_http1
+set(tcl_library_http1
   http1.0/http.tcl
   http1.0/pkgIndex.tcl
   )
-INSTALL(FILES ${tcl_library_http1} DESTINATION lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/http1.0)
-TCL_SCRIPTS_BUILD(tcl_library_http1 lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/http1.0)
+install(FILES ${tcl_library_http1} DESTINATION lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/http1.0)
+tcl_scripts_build(tcl_library_http1 lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/http1.0)
 
-SET(tcl_library_opt04
+set(tcl_library_opt04
   opt/optparse.tcl
   opt/pkgIndex.tcl
   )
-INSTALL(FILES ${tcl_library_opt04} DESTINATION lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/opt0.4)
-TCL_SCRIPTS_BUILD(tcl_library_opt04 lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/opt0.4)
+install(FILES ${tcl_library_opt04} DESTINATION lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/opt0.4)
+tcl_scripts_build(tcl_library_opt04 lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/opt0.4)
 
-INSTALL(FILES http/http.tcl DESTINATION lib/tcl8/8.4 RENAME http-2.7.5.tm)
-INSTALL(FILES platform/platform.tcl DESTINATION lib/tcl8/8.4 RENAME platform-1.0.9.tm)
-INSTALL(FILES platform/shell.tcl DESTINATION lib/tcl8/8.4/platform RENAME shell-1.1.4.tm)
-INSTALL(FILES msgcat/msgcat.tcl DESTINATION lib/tcl8/8.5 RENAME msgcat-1.4.3.tm)
-INSTALL(FILES tcltest/tcltest.tcl DESTINATION lib/tcl8/8.5 RENAME tcltest-2.3.2.tm)
+install(FILES http/http.tcl DESTINATION lib/tcl8/8.4 RENAME http-2.7.5.tm)
+install(FILES platform/platform.tcl DESTINATION lib/tcl8/8.4 RENAME platform-1.0.9.tm)
+install(FILES platform/shell.tcl DESTINATION lib/tcl8/8.4/platform RENAME shell-1.1.4.tm)
+install(FILES msgcat/msgcat.tcl DESTINATION lib/tcl8/8.5 RENAME msgcat-1.4.3.tm)
+install(FILES tcltest/tcltest.tcl DESTINATION lib/tcl8/8.5 RENAME tcltest-2.3.2.tm)
 
 if(CMAKE_CONFIGURATION_TYPES)
    foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
@@ -66,13 +66,13 @@
    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tcltest/tcltest.tcl ${CMAKE_BINARY_DIR}/lib/tcl8/8.5/tcltest-2.3.2.tm COPYONLY)
 endif(CMAKE_CONFIGURATION_TYPES)
 	
-IF(NOT WIN32)
-  INSTALL(FILES ../unix/tclAppInit.c DESTINATION lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR})
-ELSE(NOT WIN32)
-  INSTALL(FILES ../win/tclAppInit.c DESTINATION lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR})
-ENDIF(NOT WIN32)
+if(NOT WIN32)
+  install(FILES ../unix/tclAppInit.c DESTINATION lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR})
+else(NOT WIN32)
+  install(FILES ../win/tclAppInit.c DESTINATION lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR})
+endif(NOT WIN32)
 
-SET(tcl_msgs
+set(tcl_msgs
   msgs/af.msg
   msgs/af_za.msg
   msgs/ar.msg
@@ -202,10 +202,10 @@
   msgs/zh_tw.msg
   )
 
-INSTALL(FILES ${tcl_msgs} DESTINATION lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/msgs)
-TCL_SCRIPTS_BUILD(tcl_msgs lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/msgs)
+install(FILES ${tcl_msgs} DESTINATION lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/msgs)
+tcl_scripts_build(tcl_msgs lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/msgs)
 
-SET(tcl_encoding
+set(tcl_encoding
   encoding/ascii.enc
   encoding/big5.enc
   encoding/cp1250.enc
@@ -285,5 +285,5 @@
   encoding/symbol.enc
   encoding/tis-620.enc
   )
-INSTALL(FILES ${tcl_encoding} DESTINATION lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/encoding)
-TCL_SCRIPTS_BUILD(tcl_encoding lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/encoding)
+install(FILES ${tcl_encoding} DESTINATION lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/encoding)
+tcl_scripts_build(tcl_encoding lib/tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}/encoding)
Index: src/other/tcl/doc/CMakeLists.txt
===================================================================
--- src/other/tcl/doc/CMakeLists.txt	(revision 54114)
+++ src/other/tcl/doc/CMakeLists.txt	(working copy)
@@ -1,29 +1,29 @@
-IF(NOT MAN_DIR)
-	SET(MAN_DIR "man")
-ENDIF(NOT MAN_DIR)
+if(NOT MAN_DIR)
+	set(MAN_DIR "man")
+endif(NOT MAN_DIR)
 
-FIND_PROGRAM(SH_EXEC NAMES sh dash bash DOC "path to shell executable")
-FIND_PROGRAM(SED_EXEC NAMES sed DOC "path to sed executable")
-MARK_AS_ADVANCED(SH_EXEC)
-MARK_AS_ADVANCED(SED_EXEC)
+find_program(SH_EXEC NAMES sh dash bash DOC "path to shell executable")
+find_program(SED_EXEC NAMES sed DOC "path to sed executable")
+mark_as_advanced(SH_EXEC)
+mark_as_advanced(SED_EXEC)
 
-FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man1)
-FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man3)
-FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mann)
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man1)
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man3)
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mann)
 
-IF(SED_EXEC AND SH_EXEC AND NOT TCLMAN_GENERATED)
-	MESSAGE("Generating Tcl man pages...")
+if(SED_EXEC AND SH_EXEC AND NOT TCLMAN_GENERATED)
+	message("Generating Tcl man pages...")
 
-	SET(tcl_MAN1
+	set(tcl_MAN1
 		tclsh.1
 		)
-	FOREACH(manfile ${tcl_MAN1})
-		EXEC_PROGRAM(${SH_EXEC} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../unix/installManPage
+	foreach(manfile ${tcl_MAN1})
+		exec_program(${SH_EXEC} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../unix/installManPage
 			${CMAKE_CURRENT_SOURCE_DIR}/${manfile}
 			${CMAKE_CURRENT_BINARY_DIR}/man1 OUTPUT_VARIABLE MAN1_SH)
-	ENDFOREACH(manfile ${tcl_MAN1})
+	endforeach(manfile ${tcl_MAN1})
 
-	SET(tcl_MAN3
+	set(tcl_MAN3
 		Access.3
 		AddErrInfo.3
 		Alloc.3
@@ -125,13 +125,13 @@
 		Utf.3
 		WrongNumArgs.3
 		)
-	FOREACH(manfile ${tcl_MAN3})
-		EXEC_PROGRAM(${SH_EXEC} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../unix/installManPage
+	foreach(manfile ${tcl_MAN3})
+		exec_program(${SH_EXEC} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../unix/installManPage
 			${CMAKE_CURRENT_SOURCE_DIR}/${manfile}
 			${CMAKE_CURRENT_BINARY_DIR}/man3 OUTPUT_VARIABLE MAN3_SH)
-	ENDFOREACH(manfile ${tcl_MAN3})
+	endforeach(manfile ${tcl_MAN3})
 
-	SET(tcl_MANN
+	set(tcl_MANN
 		Tcl.n
 		after.n
 		append.n
@@ -241,19 +241,19 @@
 		vwait.n
 		while.n
 		)
-	FOREACH(manfile ${tcl_MANN})
-		EXEC_PROGRAM(${SH_EXEC} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../unix/installManPage
+	foreach(manfile ${tcl_MANN})
+		exec_program(${SH_EXEC} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../unix/installManPage
 			${CMAKE_CURRENT_SOURCE_DIR}/${manfile}
 			${CMAKE_CURRENT_BINARY_DIR}/mann OUTPUT_VARIABLE MAN5_SH)
-	ENDFOREACH(manfile ${tcl_MANN})
+	endforeach(manfile ${tcl_MANN})
 
-	SET(TCLMAN_GENERATED 1 CACHE BOOL "Flag signifying Tcl man pages are generated" FORCE)
-	MARK_AS_ADVANCED(TCLMAN_GENERATED)
+	set(TCLMAN_GENERATED 1 CACHE BOOL "Flag signifying Tcl man pages are generated" FORCE)
+	mark_as_advanced(TCLMAN_GENERATED)
 
-ENDIF(SED_EXEC AND SH_EXEC AND NOT TCLMAN_GENERATED)
+endif(SED_EXEC AND SH_EXEC AND NOT TCLMAN_GENERATED)
 
-IF(TCLMAN_GENERATED)
-	FILE(GLOB TCL_MAN1 "${CMAKE_CURRENT_BINARY_DIR}/man1/*")
+if(TCLMAN_GENERATED)
+	file(GLOB TCL_MAN1 "${CMAKE_CURRENT_BINARY_DIR}/man1/*")
         foreach(man ${TCL_MAN1})
 			 set_source_files_properties(${man} PROPERTIES GENERATED TRUE)
           get_filename_component(tclman1 ${man} NAME)
@@ -266,9 +266,9 @@
             endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
 	  endif (NOT CMAKE_CONFIGURATION_TYPES)
         endforeach(man ${TCL_MAN1})
-	INSTALL(FILES ${TCL_MAN1} DESTINATION ${MAN_DIR}/man1)
+	install(FILES ${TCL_MAN1} DESTINATION ${MAN_DIR}/man1)
 
-	FILE(GLOB TCL_MAN3 "${CMAKE_CURRENT_BINARY_DIR}/man3/*")
+	file(GLOB TCL_MAN3 "${CMAKE_CURRENT_BINARY_DIR}/man3/*")
         foreach(man ${TCL_MAN3})
 			 set_source_files_properties(${man} PROPERTIES GENERATED TRUE)
           get_filename_component(tclman3 ${man} NAME)
@@ -281,9 +281,9 @@
             endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
 	  endif (NOT CMAKE_CONFIGURATION_TYPES)
         endforeach(man ${TCL_MAN3})
-	INSTALL(FILES ${TCL_MAN3} DESTINATION ${MAN_DIR}/man3)
+	install(FILES ${TCL_MAN3} DESTINATION ${MAN_DIR}/man3)
 
-	FILE(GLOB TCL_MANN "${CMAKE_CURRENT_BINARY_DIR}/mann/*")
+	file(GLOB TCL_MANN "${CMAKE_CURRENT_BINARY_DIR}/mann/*")
         foreach(man ${TCL_MANN})
 			 set_source_files_properties(${man} PROPERTIES GENERATED TRUE)
           get_filename_component(tclmann ${man} NAME)
@@ -296,5 +296,5 @@
             endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
 	  endif (NOT CMAKE_CONFIGURATION_TYPES)
         endforeach(man ${TCL_MANN})	
-	INSTALL(FILES ${TCL_MANN} DESTINATION ${MAN_DIR}/mann)
-ENDIF(TCLMAN_GENERATED)
+	install(FILES ${TCL_MANN} DESTINATION ${MAN_DIR}/mann)
+endif(TCLMAN_GENERATED)
Index: src/other/tcl/CMakeLists.txt
===================================================================
--- src/other/tcl/CMakeLists.txt	(revision 54114)
+++ src/other/tcl/CMakeLists.txt	(working copy)
@@ -37,13 +37,13 @@
 # *******************************************************************
 
 # Minimum required version of CMake
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-IF(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND CMAKE_POLICY)
+cmake_minimum_required(VERSION 2.8)
+if(COMMAND CMAKE_POLICY)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND CMAKE_POLICY)
 
 # Set CMake project name
-PROJECT(TCL)
+project(TCL)
 
 # build shared libs by default
 set(BUILD_SHARED_LIBS ON)
@@ -52,16 +52,16 @@
 set(BUILD_STATIC_LIBS ON)
 
 # version numbers
-SET(TCL_VERSION_MAJOR 8)
-SET(TCL_VERSION_MINOR 5)
-SET(TCL_VERSION_PATCH 9)
+set(TCL_VERSION_MAJOR 8)
+set(TCL_VERSION_MINOR 5)
+set(TCL_VERSION_PATCH 9)
 
-SET(TCL_VERSION "${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}.${TCL_VERSION_PATCH}")
+set(TCL_VERSION "${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}.${TCL_VERSION_PATCH}")
 
 # For Windows, we need the Resource Compiler language
-IF(WIN32)
-  ENABLE_LANGUAGE(RC)
-ENDIF(WIN32)
+if(WIN32)
+  enable_language(RC)
+endif(WIN32)
 
 #---------------------------------------------------------------------
 # The following logic is what allows binaries to run successfully in
@@ -69,63 +69,63 @@
 # identifying the necessity of setting CMAKE_INSTALL_NAME_DIR on OSX.
 
 # use, i.e. don't skip the full RPATH for the build tree
-SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
+set(CMAKE_SKIP_BUILD_RPATH  FALSE)
 
 # when building, don't use the install RPATH already
 # (but later on when installing)
-SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
 
 # the RPATH/INSTALL_NAME_DIR to be used when installing
 if (NOT APPLE)
-  SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:\$ORIGIN/../lib")
+  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:\$ORIGIN/../lib")
 endif(NOT APPLE)
-SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
 
 # add the automatically determined parts of the RPATH which point to
 # directories outside the build tree to the install RPATH
-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 
 #----------------------------------------------------------------------------
 # The location in which to install Tcl.  Only do this if CMAKE_INSTALL_PREFIX 
 # hasn't been set already, to try and allow parent builds (if any) some control.
-IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-  IF(NOT WIN32)
-    IF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
-      SET(CMAKE_INSTALL_PREFIX "/usr/local/tcldev-${TCL_VERSION}")
-    ELSE ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
-      SET(CMAKE_INSTALL_PREFIX "/usr")
-    ENDIF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
-  ENDIF(NOT WIN32)
-  SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "TCL install prefix" FORCE)
-  SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 0)
-ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+  if(NOT WIN32)
+    if ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
+      set(CMAKE_INSTALL_PREFIX "/usr/local/tcldev-${TCL_VERSION}")
+    else ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
+      set(CMAKE_INSTALL_PREFIX "/usr")
+    endif ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
+  endif(NOT WIN32)
+  set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "TCL install prefix" FORCE)
+  set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 0)
+endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
 
 #-----------------------------------------------------------------------------
 # Output directories.
 
-IF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-  SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
-ENDIF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-IF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
-  SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
-ENDIF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
-IF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
-  SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
-ENDIF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
+endif(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
+  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
+endif(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
+if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
+endif(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
 
 #-----------------------------------------------------------------------------
 # Set CMake module path
-SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${TCL_SOURCE_DIR}/CMake")
+set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${TCL_SOURCE_DIR}/CMake")
 
 #-----------------------------------------------------------------------------
 # Tcl/Tk's normal build system uses autotools macros, referred to as the
 # TEA system.  An attempt to duplicate the required functionality from
 # TEA is found in tcl.cmake
-INCLUDE(${TCL_SOURCE_DIR}/CMake/tcl.cmake)
+include(${TCL_SOURCE_DIR}/CMake/tcl.cmake)
 
 #-----------------------------------------------------------------------------
 # Our replacement for SC_CONFIG_MANPAGES
-ADD_SUBDIRECTORY(doc)
+add_subdirectory(doc)
 
 #----------------------------------------------------------------------------
 # Define some standard configuration settings passed to all Tcl build targets
@@ -140,7 +140,7 @@
 
 # First, get some standard settings out of the way
 # Assume we have STDC_HEADERS until we meet a situation where we don't
-ADD_TCL_CFLAG(STDC_HEADERS)
+add_tcl_cflag(STDC_HEADERS)
 # Get the SHLIB extension from CMake
 add_definitions(-DTCL_SHLIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}")
 
@@ -149,124 +149,124 @@
 # Define some platform specific flags
 
 # Windows specific flags
-IF(WIN32)
+if(WIN32)
   add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEP -Ot -Oi -fp:strict -Gs -GS -GL -MD)
   add_definitions(-DTCL_PIPE_DLL="tclpip${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}.dll")
   add_definitions(-Dinline=__inline -DBUILD_tcl)
-ENDIF(WIN32)
+endif(WIN32)
 
-IF(APPLE)
-  ADD_TCL_CFLAG(MAC_OSX_TCL)
-ENDIF(APPLE)
+if(APPLE)
+  add_tcl_cflag(MAC_OSX_TCL)
+endif(APPLE)
 #----------------------------------------------------------------------------
 
 
 #--------------------------------------------------------------------
 # Supply substitutes for missing POSIX header files.
 #--------------------------------------------------------------------
-SC_MISSING_POSIX_HEADERS()
+sc_missing_posix_headers()
 
 #------------------------------------------------------------------------
 # Check if the compiler understands -pipe.  If so, use it.
 # It makes compiling go faster.  (This is only a performance feature.)
 #------------------------------------------------------------------------
-INCLUDE(CheckCCompilerFlag)
-CHECK_C_COMPILER_FLAG(-pipe PIPE_COMPILER_FLAG)
-IF(PIPE_COMPILER_FLAG)
-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe")
-ENDIF(PIPE_COMPILER_FLAG)
+include(CheckCCompilerFlag)
+check_c_compiler_flag(-pipe PIPE_COMPILER_FLAG)
+if(PIPE_COMPILER_FLAG)
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe")
+endif(PIPE_COMPILER_FLAG)
 
 #------------------------------------------------------------------------
 # Threads support
 #------------------------------------------------------------------------
-SC_ENABLE_THREADS()
+sc_enable_threads()
 
 #------------------------------------------------------------------------
 # Embedded configuration information, encoding to use for the values, TIP #59
 #------------------------------------------------------------------------
-SC_TCL_CFG_ENCODING()
+sc_tcl_cfg_encoding()
 
 #--------------------------------------------------------------------
 # Look for libraries that we will need when compiling the Tcl shell
 #--------------------------------------------------------------------
-SC_TCL_LINK_LIBS()
+sc_tcl_link_libs()
 
 # Add the Threading library, if we're using it
-SET(TCL_LINK_LIBS ${TCL_LINK_LIBS} ${TCL_THREADS_LIB})
+set(TCL_LINK_LIBS ${TCL_LINK_LIBS} ${TCL_THREADS_LIB})
 
 # Same for the math library
-SET(TCL_LINK_LIBS ${TCL_LINK_LIBS} ${M_LIBRARY})
+set(TCL_LINK_LIBS ${TCL_LINK_LIBS} ${M_LIBRARY})
 
 # TODO - look over SC_ENABLE_SHARED, SC_CONFIG_CFLAGS and SC_ENABLE_SYMBOLS
 # need to decide how much of that logic is needed.  Clearly we need SOME
 # of it.
 
 # Load and Unload
-OPTION(TCL_ENABLE_LOAD "Enable dynamic loading" ON)
-IF(TCL_ENABLE_LOAD)
-  CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_DL_LIBRARY)
-  IF(HAVE_DL_LIBRARY)
-    RESOLVE_LIBRARIES(DL_LIBRARY "-ldl")
-  ENDIF(HAVE_DL_LIBRARY)
-ENDIF(TCL_ENABLE_LOAD)
+option(TCL_ENABLE_LOAD "Enable dynamic loading" ON)
+if(TCL_ENABLE_LOAD)
+  check_library_exists(dl dlopen "" HAVE_DL_LIBRARY)
+  if(HAVE_DL_LIBRARY)
+    resolve_libraries(DL_LIBRARY "-ldl")
+  endif(HAVE_DL_LIBRARY)
+endif(TCL_ENABLE_LOAD)
 
-OPTION(TCL_ENABLE_DLL_UNLOADING "Allow unloading of shared libraries" ON)
-IF(TCL_ENABLE_DLL_UNLOADING)
-  ADD_TCL_CFLAG(TCL_UNLOAD_DLLS)
-ENDIF(TCL_ENABLE_DLL_UNLOADING)
+option(TCL_ENABLE_DLL_UNLOADING "Allow unloading of shared libraries" ON)
+if(TCL_ENABLE_DLL_UNLOADING)
+  add_tcl_cflag(TCL_UNLOAD_DLLS)
+endif(TCL_ENABLE_DLL_UNLOADING)
 
 # CoreFoundation check.  TODO - check for 64-bit stuff at some point
-IF(APPLE)
-  OPTION(TCL_ENABLE_COREFOUNDATION "Use CoreFoundation" ON)
-  IF(TCL_ENABLE_COREFOUNDATION)
-    INCLUDE(CMakeFindFrameworks)
-    CMAKE_FIND_FRAMEWORKS(CoreFoundation)
-    IF(CoreFoundation_FRAMEWORKS)
-      SET(CoreFoundation_LIBRARIES "-framework CoreFoundation")
-      ADD_TCL_CFLAG(HAVE_COREFOUNDATION)
-    ENDIF(CoreFoundation_FRAMEWORKS)
-  ENDIF(TCL_ENABLE_COREFOUNDATION)
-ENDIF(APPLE)
+if(APPLE)
+  option(TCL_ENABLE_COREFOUNDATION "Use CoreFoundation" ON)
+  if(TCL_ENABLE_COREFOUNDATION)
+    include(CMakeFindFrameworks)
+    cmake_find_frameworks(CoreFoundation)
+    if(CoreFoundation_FRAMEWORKS)
+      set(CoreFoundation_LIBRARIES "-framework CoreFoundation")
+      add_tcl_cflag(HAVE_COREFOUNDATION)
+    endif(CoreFoundation_FRAMEWORKS)
+  endif(TCL_ENABLE_COREFOUNDATION)
+endif(APPLE)
 
 #----------------------------------------------------------------------------
 # Tom's math library - should MP_PREC be an option?
 #----------------------------------------------------------------------------
-OPTION(TCL_TOMMATH "Enable Tom's Math Library" ON)
-IF(TCL_TOMMATH)
-  ADD_TCL_CFLAG(TCL_TOMMATH)
+option(TCL_TOMMATH "Enable Tom's Math Library" ON)
+if(TCL_TOMMATH)
+  add_tcl_cflag(TCL_TOMMATH)
   add_definitions(-DMP_PREC=4)
-ENDIF(TCL_TOMMATH)
+endif(TCL_TOMMATH)
 
 #----------------------------------------------------------------------------
 # 64-bit support - unlike TEA, we enable by default if the platform looks
 # like it's 64-bit.  Can be overridden by specifying CMAKE_WORD_SIZE=32BIT
 #----------------------------------------------------------------------------
-SC_TCL_64BIT_FLAGS()
+sc_tcl_64bit_flags()
 
 #----------------------------------------------------------------------------
 # Add options for optimized and debug compile options - replaces 
 # SC_ENABLE_SYMBOLS
 #----------------------------------------------------------------------------
-OPTION(TCL_OPTIMIZED "Built optimized Tcl" ON)
-IF(TCL_OPTIMIZED)
-  ADD_TCL_CFLAG(TCL_CFG_OPTIMIZED)
-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNDEBUG -O2")
-ENDIF(TCL_OPTIMIZED)
+option(TCL_OPTIMIZED "Built optimized Tcl" ON)
+if(TCL_OPTIMIZED)
+  add_tcl_cflag(TCL_CFG_OPTIMIZED)
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNDEBUG -O2")
+endif(TCL_OPTIMIZED)
 
-OPTION(TCL_DEBUG "Enable Debugging" ON)
-IF(TCL_DEBUG)
-  ADD_TCL_CFLAG(TCL_CFG_DEBUG)
-ENDIF(TCL_DEBUG)
+option(TCL_DEBUG "Enable Debugging" ON)
+if(TCL_DEBUG)
+  add_tcl_cflag(TCL_CFG_DEBUG)
+endif(TCL_DEBUG)
 
-OPTION(TCL_COMPILE_DEBUG "Bytecode debugging" OFF)
-IF(TCL_COMPILE_DEBUG)
-  ADD_TCL_CFLAG(TCL_COMPILE_DEBUG)
-ENDIF(TCL_COMPILE_DEBUG)
+option(TCL_COMPILE_DEBUG "Bytecode debugging" OFF)
+if(TCL_COMPILE_DEBUG)
+  add_tcl_cflag(TCL_COMPILE_DEBUG)
+endif(TCL_COMPILE_DEBUG)
 
-OPTION(TCL_COMPILE_STATS "Bytecode statistics" OFF)
-IF(TCL_COMPILE_STATS)
-  ADD_TCL_CFLAG(TCL_COMPILE_STATS)
-ENDIF(TCL_COMPILE_STATS)
+option(TCL_COMPILE_STATS "Bytecode statistics" OFF)
+if(TCL_COMPILE_STATS)
+  add_tcl_cflag(TCL_COMPILE_STATS)
+endif(TCL_COMPILE_STATS)
 
 
 #--------------------------------------------------------------------
@@ -274,118 +274,118 @@
 #       Tcl_UniChar strings to memcmp on big-endian systems.
 #--------------------------------------------------------------------
 # Test endianness 
-IF(NOT MSVC)
-  INCLUDE(TestBigEndian)
-  TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
-  IF(WORDS_BIGENDIAN)
-    ADD_TCL_CFLAG(WORDS_BIGENDIAN)
-  ENDIF(WORDS_BIGENDIAN)
-ENDIF(NOT MSVC)
+if(NOT MSVC)
+  include(TestBigEndian)
+  test_big_endian(WORDS_BIGENDIAN)
+  if(WORDS_BIGENDIAN)
+    add_tcl_cflag(WORDS_BIGENDIAN)
+  endif(WORDS_BIGENDIAN)
+endif(NOT MSVC)
 
 #--------------------------------------------------------------------
 #       Supply substitutes for missing POSIX library procedures, or
 #       set flags so Tcl uses alternate procedures.
 #--------------------------------------------------------------------
-TCL_CHECK_FUNCTION_EXISTS(getcwd HAVE_GETCWD)
-IF(NOT HAVE_GETCWD)
-  TCL_CHECK_FUNCTION_EXISTS(getwd HAVE_GETWD)
-  IF(NOT HAVE_GETWD)
-    ADD_TCL_CFLAG(NO_GETWD)
-  ELSE(NOT HAVE_GETWD)
-    ADD_TCL_CFLAG(USEGETWD)
-  ENDIF(NOT HAVE_GETWD)
-ENDIF(NOT HAVE_GETCWD)
-TCL_CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP)
-IF(NOT HAVE_MKSTEMP)
-  SET(COMPAT_SRCS ${COMPAT_SRCS} compat/mkstemp.c)
-ENDIF(NOT HAVE_MKSTEMP)
-TCL_CHECK_FUNCTION_EXISTS(opendir HAVE_OPENDIR)
-IF(NOT HAVE_OPENDIR)
-  SET(COMPAT_SRCS ${COMPAT_SRCS} compat/opendir.c)
-ENDIF(NOT HAVE_OPENDIR)
-TCL_CHECK_FUNCTION_EXISTS(strtol HAVE_STRTOL)
-IF(NOT HAVE_STRTOL)
-  SET(COMPAT_SRCS ${COMPAT_SRCS} compat/strtol.c)
-ENDIF(NOT HAVE_STRTOL)
-TCL_CHECK_FUNCTION_EXISTS(waitpid HAVE_WAITPID)
-IF(NOT HAVE_WAITPID)
-  SET(COMPAT_SRCS ${COMPAT_SRCS} compat/waitpid.c)
-ENDIF(NOT HAVE_WAITPID)
-CHECK_FUNCTION_EXISTS(strerror HAVE_STRERROR)
-IF(NOT HAVE_STRERROR)
-  ADD_TCL_CFLAG(NO_STRERROR)
-ENDIF(NOT HAVE_STRERROR)
-CHECK_FUNCTION_EXISTS(wait3 HAVE_WAIT3)
-IF(NOT HAVE_WAIT3)
-  ADD_TCL_CFLAG(NO_WAIT3)
-ENDIF(NOT HAVE_WAIT3)
-CHECK_FUNCTION_EXISTS(uname HAVE_UNAME)
-IF(NOT HAVE_UNAME)
-  ADD_TCL_CFLAG(NO_UNAME)
-ENDIF(NOT HAVE_UNAME)
+tcl_check_function_exists(getcwd HAVE_GETCWD)
+if(NOT HAVE_GETCWD)
+  tcl_check_function_exists(getwd HAVE_GETWD)
+  if(NOT HAVE_GETWD)
+    add_tcl_cflag(NO_GETWD)
+  else(NOT HAVE_GETWD)
+    add_tcl_cflag(USEGETWD)
+  endif(NOT HAVE_GETWD)
+endif(NOT HAVE_GETCWD)
+tcl_check_function_exists(mkstemp HAVE_MKSTEMP)
+if(NOT HAVE_MKSTEMP)
+  set(COMPAT_SRCS ${COMPAT_SRCS} compat/mkstemp.c)
+endif(NOT HAVE_MKSTEMP)
+tcl_check_function_exists(opendir HAVE_OPENDIR)
+if(NOT HAVE_OPENDIR)
+  set(COMPAT_SRCS ${COMPAT_SRCS} compat/opendir.c)
+endif(NOT HAVE_OPENDIR)
+tcl_check_function_exists(strtol HAVE_STRTOL)
+if(NOT HAVE_STRTOL)
+  set(COMPAT_SRCS ${COMPAT_SRCS} compat/strtol.c)
+endif(NOT HAVE_STRTOL)
+tcl_check_function_exists(waitpid HAVE_WAITPID)
+if(NOT HAVE_WAITPID)
+  set(COMPAT_SRCS ${COMPAT_SRCS} compat/waitpid.c)
+endif(NOT HAVE_WAITPID)
+check_function_exists(strerror HAVE_STRERROR)
+if(NOT HAVE_STRERROR)
+  add_tcl_cflag(NO_STRERROR)
+endif(NOT HAVE_STRERROR)
+check_function_exists(wait3 HAVE_WAIT3)
+if(NOT HAVE_WAIT3)
+  add_tcl_cflag(NO_WAIT3)
+endif(NOT HAVE_WAIT3)
+check_function_exists(uname HAVE_UNAME)
+if(NOT HAVE_UNAME)
+  add_tcl_cflag(NO_UNAME)
+endif(NOT HAVE_UNAME)
 
 # Check for early Darwin version here - realpath
 # is not threadsafe prior to Darwin 7
-CHECK_FUNCTION_EXISTS(realpath HAVE_REALPATH)
-IF(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$" AND TCL_THREADS AND HAVE_REALPATH)
-  STRING(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
-  IF (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 7)
-    MESSAGE("realpath is not threadsafe in Darwin versions prior to 7, disabling")
-    SET(HAVE_REALPATH)
-  ENDIF (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 7)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$" AND TCL_THREADS AND HAVE_REALPATH)
-IF(NOT HAVE_REALPATH)
-  ADD_TCL_CFLAG(NO_REALPATH)
-ENDIF(NOT HAVE_REALPATH)
+check_function_exists(realpath HAVE_REALPATH)
+if(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$" AND TCL_THREADS AND HAVE_REALPATH)
+  string(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
+  if (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 7)
+    message("realpath is not threadsafe in Darwin versions prior to 7, disabling")
+    set(HAVE_REALPATH)
+  endif (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 7)
+endif(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$" AND TCL_THREADS AND HAVE_REALPATH)
+if(NOT HAVE_REALPATH)
+  add_tcl_cflag(NO_REALPATH)
+endif(NOT HAVE_REALPATH)
 
-SC_TCL_IPV6()
+sc_tcl_ipv6()
 
 #-------------------------------------------------------------------- 
 #       Look for thread-safe variants of some library functions.
 #--------------------------------------------------------------------
 
-IF(TCL_THREADS)
+if(TCL_THREADS)
 
-  SC_TCL_GETPWUID_R()
+  sc_tcl_getpwuid_r()
 
-  SC_TCL_GETPWNAM_R()
+  sc_tcl_getpwnam_r()
 
-  SC_TCL_GETGRGID_R()
+  sc_tcl_getgrgid_r()
 
-  SC_TCL_GETGRNAM_R()
+  sc_tcl_getgrnam_r()
 
-  IF(NOT HAVE_GETHOSTBYNAME)
-    CHECK_LIBRARY_EXISTS(GHBN lnsl "" gethostbyname)
-    SET(HAVE_GETHOSTBYNAME ${GHBN})
-  ENDIF(NOT HAVE_GETHOSTBYNAME)
+  if(NOT HAVE_GETHOSTBYNAME)
+    check_library_exists(GHBN lnsl "" gethostbyname)
+    set(HAVE_GETHOSTBYNAME ${GHBN})
+  endif(NOT HAVE_GETHOSTBYNAME)
 
-  SC_TCL_GETHOSTBYADDR_R()
-  SC_TCL_GETHOSTBYNAME_R()
+  sc_tcl_gethostbyaddr_r()
+  sc_tcl_gethostbyname_r()
 
-  IF(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
-    STRING(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
-    IF (${CMAKE_SYSTEM_MAJOR_VERSION} GREATER 5)
-      ADD_TCL_CFLAG(HAVE_MTSAFE_GETHOSTBYNAME)
-      ADD_TCL_CFLAG(HAVE_MTSAFE_GETHOSTBYADDR)
-    ENDIF (${CMAKE_SYSTEM_MAJOR_VERSION} GREATER 5)
-  ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
+  if(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
+    string(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
+    if (${CMAKE_SYSTEM_MAJOR_VERSION} GREATER 5)
+      add_tcl_cflag(HAVE_MTSAFE_GETHOSTBYNAME)
+      add_tcl_cflag(HAVE_MTSAFE_GETHOSTBYADDR)
+    endif (${CMAKE_SYSTEM_MAJOR_VERSION} GREATER 5)
+  endif(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
 
-  IF(${CMAKE_SYSTEM_NAME} MATCHES "^HP-UX$")
-    STRING(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
-    IF (${CMAKE_SYSTEM_MAJOR_VERSION} GREATER 10)
-      ADD_TCL_CFLAG(HAVE_MTSAFE_GETHOSTBYNAME)
-      ADD_TCL_CFLAG(HAVE_MTSAFE_GETHOSTBYADDR)
-    ENDIF (${CMAKE_SYSTEM_MAJOR_VERSION} GREATER 10)
-  ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^HP-UX$")
+  if(${CMAKE_SYSTEM_NAME} MATCHES "^HP-UX$")
+    string(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
+    if (${CMAKE_SYSTEM_MAJOR_VERSION} GREATER 10)
+      add_tcl_cflag(HAVE_MTSAFE_GETHOSTBYNAME)
+      add_tcl_cflag(HAVE_MTSAFE_GETHOSTBYADDR)
+    endif (${CMAKE_SYSTEM_MAJOR_VERSION} GREATER 10)
+  endif(${CMAKE_SYSTEM_NAME} MATCHES "^HP-UX$")
 
-ENDIF(TCL_THREADS)
+endif(TCL_THREADS)
 
 #---------------------------------------------------------------------------
 #       Determine which interface to use to talk to the serial port.
 #       Note that #include lines must begin in leftmost column for
 #       some compilers to recognize them as preprocessor directives.
 #---------------------------------------------------------------------------
-SC_SERIAL_PORT()
+sc_serial_port()
 
 #---------------------------------------------------------------------------
 # TODO - Do we need the sys/select.h check these days?
@@ -394,30 +394,30 @@
 #------------------------------------------------------------------------------
 #       Find out all about time handling differences.
 #------------------------------------------------------------------------------
-SC_TIME_HANDLER()
+sc_time_handler()
 
 #---------------------------------------------------------------------------
 # Check for stat structure files and blkcnt_t
 #---------------------------------------------------------------------------
 
-TCL_CHECK_STRUCT_HAS_MEMBER("struct stat" st_blocks sys/stat.h	STRUCT_HAS_ST_BLOCKS)
-TCL_CHECK_STRUCT_HAS_MEMBER("struct stat" st_blksize sys/stat.h STRUCT_HAS_ST_BLKSIZE)
-CHECK_TYPE_SIZE(blkcnt_t HAVE_BLKCNT_T)
-IF(HAVE_BLKCNT_T)
-  ADD_TCL_CFLAG(HAVE_BLKCNT_T)
-ENDIF(HAVE_BLKCNT_T)
-TCL_CHECK_FUNCTION_EXISTS(fstatfs, HAVE_FSTATFS)
-IF(NOT HAVE_FSTATFS)
-  ADD_TCL_CFLAG(NO_FSTATFS)
-ENDIF(NOT HAVE_FSTATFS)
+tcl_check_struct_has_member("struct stat" st_blocks sys/stat.h	STRUCT_HAS_ST_BLOCKS)
+tcl_check_struct_has_member("struct stat" st_blksize sys/stat.h STRUCT_HAS_ST_BLKSIZE)
+check_type_size(blkcnt_t HAVE_BLKCNT_T)
+if(HAVE_BLKCNT_T)
+  add_tcl_cflag(HAVE_BLKCNT_T)
+endif(HAVE_BLKCNT_T)
+tcl_check_function_exists(fstatfs, HAVE_FSTATFS)
+if(NOT HAVE_FSTATFS)
+  add_tcl_cflag(NO_FSTATFS)
+endif(NOT HAVE_FSTATFS)
 
 #---------------------------------------------------------------------------
 # GNU manual lists AC_FUNC_MEMCMP as obsolete - just check for memcmp
 #---------------------------------------------------------------------------
-TCL_CHECK_FUNCTION_EXISTS(memcmp HAVE_MEMCMP)
-IF(NOT HAVE_MEMCMP)
-  SET(COMPAT_SRCS ${COMPAT_SRCS} compat/memcmp.c)
-ENDIF(NOT HAVE_MEMCMP)
+tcl_check_function_exists(memcmp HAVE_MEMCMP)
+if(NOT HAVE_MEMCMP)
+  set(COMPAT_SRCS ${COMPAT_SRCS} compat/memcmp.c)
+endif(NOT HAVE_MEMCMP)
 
 #---------------------------------------------------------------------------
 # Check for memmove
@@ -435,14 +435,14 @@
 #------------------------------------------------------------------------------
 # Test for broken functions.  Not clear how many of these are still needed.
 #------------------------------------------------------------------------------
-SC_TCL_CHECK_BROKEN_FUNC(
+sc_tcl_check_broken_func(
   strstr "
 	extern int strstr();
 	exit(strstr(\"\\\0test\", \"test\") ? 1 : 0);"
   )
 
 
-SC_TCL_CHECK_BROKEN_FUNC(
+sc_tcl_check_broken_func(
   strtoul "
 	extern int strtoul();
 	char *term, *string = \"0\";
@@ -450,7 +450,7 @@
   )
 
 
-SC_TCL_CHECK_BROKEN_FUNC(
+sc_tcl_check_broken_func(
   strtod "
 	extern double strtod();
 	char *term, *string = \" +69\";
@@ -465,21 +465,21 @@
 #       Check for various typedefs and provide substitutes if
 #       they don't exist.
 #--------------------------------------------------------------------
-TCL_CHECK_TYPE_SIZE(mode_t MODE)
-TCL_CHECK_TYPE_SIZE(pid_t PID)
-TCL_CHECK_TYPE_SIZE(size_t SIZE)
-TCL_CHECK_TYPE_SIZE(uid_t UID)
+tcl_check_type_size(mode_t MODE)
+tcl_check_type_size(pid_t PID)
+tcl_check_type_size(size_t SIZE)
+tcl_check_type_size(uid_t UID)
 # The following tests may need to be more elaborate to function properly
-TCL_CHECK_TYPE_SIZE(socklen_t SOCKLEN sys/types.h sys/socket.h)
-TCL_CHECK_TYPE_SIZE(intptr_t INTPTR)
-TCL_CHECK_TYPE_SIZE(uintptr_t UINTPTR)
+tcl_check_type_size(socklen_t SOCKLEN sys/types.h sys/socket.h)
+tcl_check_type_size(intptr_t INTPTR)
+tcl_check_type_size(uintptr_t UINTPTR)
 
-IF(NOT HAVE_OPENDIR)
-  ADD_TCL_CFLAG(USE_DIRENT2_H)
-ENDIF(NOT HAVE_OPENDIR)
+if(NOT HAVE_OPENDIR)
+  add_tcl_cflag(USE_DIRENT2_H)
+endif(NOT HAVE_OPENDIR)
 
 # The union wait test was for HP-UX - do we still need this?
-SET(UNION_WAIT_SRC "
+set(UNION_WAIT_SRC "
 #include <sys/types.h>
 #include <sys/wait.h>
 int
@@ -487,50 +487,50 @@
 {
 
 union wait x;
-WIFEXITED(x);           /* Generates compiler error if WIFEXITED
+wifexited(x);           /* Generates compiler error if WIFEXITED
                          * uses an int. */
 return 0;
 }
 ")
-CHECK_C_SOURCE_RUNS("${UNION_WAIT_SRC}" HAVE_UNION_WAIT)
-IF(NOT HAVE_UNION_WAIT)
-  ADD_TCL_CFLAG(NO_UNION_WAIT)
-ENDIF(NOT HAVE_UNION_WAIT)
+check_c_source_runs("${UNION_WAIT_SRC}" HAVE_UNION_WAIT)
+if(NOT HAVE_UNION_WAIT)
+  add_tcl_cflag(NO_UNION_WAIT)
+endif(NOT HAVE_UNION_WAIT)
 
 #----------------------------------------------------------------------------
 # Check for strncasecmp
 #----------------------------------------------------------------------------
-CHECK_FUNCTION_EXISTS(strncasecmp HAVE_STRNCASECMP)
-IF(NOT HAVE_STRNCASECMP)
-  CHECK_LIBRARY_EXISTS(socket strncasecmp "" HAVE_SOCKET_STRNCASECMP)
-  CHECK_LIBRARY_EXISTS(inet strncasecmp "" HAVE_INET_STRNCASECMP)
-  IF(NOT HAVE_SOCKET_STRNCASECMP AND NOT HAVE_INET_STRNCASECMP)
-    SET(COMPAT_SRCS ${COMPAT_SRCS} compat/strncasecmp.c)
-  ENDIF(NOT HAVE_SOCKET_STRNCASECMP AND NOT HAVE_INET_STRNCASECMP)
-ENDIF(NOT HAVE_STRNCASECMP)
+check_function_exists(strncasecmp HAVE_STRNCASECMP)
+if(NOT HAVE_STRNCASECMP)
+  check_library_exists(socket strncasecmp "" HAVE_SOCKET_STRNCASECMP)
+  check_library_exists(inet strncasecmp "" HAVE_INET_STRNCASECMP)
+  if(NOT HAVE_SOCKET_STRNCASECMP AND NOT HAVE_INET_STRNCASECMP)
+    set(COMPAT_SRCS ${COMPAT_SRCS} compat/strncasecmp.c)
+  endif(NOT HAVE_SOCKET_STRNCASECMP AND NOT HAVE_INET_STRNCASECMP)
+endif(NOT HAVE_STRNCASECMP)
 
 #----------------------------------------------------------------------------
 # gettimeofday issues
 #----------------------------------------------------------------------------
-TCL_CHECK_FUNCTION_EXISTS(BSDgettimeofday HAVE_BSDGETTIMEOFDAY)
-IF(NOT HAVE_BSDGETTIMEOFDAY)
-  CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
-  IF(NOT HAVE_GETTIMEOFDAY)
-    ADD_TCL_CFLAG(NO_GETTOD)
-  ENDIF(NOT HAVE_GETTIMEOFDAY)
-ENDIF(NOT HAVE_BSDGETTIMEOFDAY)
-INCLUDE(CheckSymbolExists)
-CHECK_SYMBOL_EXISTS(gettimeofday "sys/time.h" IS_GETTOD_DECLARED)
-IF(NOT IS_GETTOD_DECLARED)
-  ADD_TCL_CFLAG(GETTOD_NOT_DECLARED)
-ENDIF(NOT IS_GETTOD_DECLARED)
+tcl_check_function_exists(BSDgettimeofday HAVE_BSDGETTIMEOFDAY)
+if(NOT HAVE_BSDGETTIMEOFDAY)
+  check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
+  if(NOT HAVE_GETTIMEOFDAY)
+    add_tcl_cflag(NO_GETTOD)
+  endif(NOT HAVE_GETTIMEOFDAY)
+endif(NOT HAVE_BSDGETTIMEOFDAY)
+include(CheckSymbolExists)
+check_symbol_exists(gettimeofday "sys/time.h" IS_GETTOD_DECLARED)
+if(NOT IS_GETTOD_DECLARED)
+  add_tcl_cflag(GETTOD_NOT_DECLARED)
+endif(NOT IS_GETTOD_DECLARED)
 
 
 #----------------------------------------------------------------------------
 # signed/unsigned char - does the Tcl code still need this? See
 # http://lists.gnu.org/archive/html/autoconf/2008-06/msg00054.html
 #----------------------------------------------------------------------------
-SET(unsigned_char_srcs "
+set(unsigned_char_srcs "
 int
 main ()
 {
@@ -539,11 +539,11 @@
    return 0;
 }
 ")
-CHECK_C_SOURCE_RUNS("${unsigned_char_srcs}" CHAR_IS_UNSIGNED)
-IF(CHAR_IS_UNSIGNED)
-  ADD_TCL_CFLAG(__CHAR_UNSIGNED__)
-ENDIF(CHAR_IS_UNSIGNED)
-SET(signed_char_srcs "
+check_c_source_runs("${unsigned_char_srcs}" CHAR_IS_UNSIGNED)
+if(CHAR_IS_UNSIGNED)
+  add_tcl_cflag(__CHAR_UNSIGNED__)
+endif(CHAR_IS_UNSIGNED)
+set(signed_char_srcs "
 int
 main ()
 {
@@ -552,57 +552,57 @@
 	return 0;
 }
 ")
-CHECK_C_SOURCE_COMPILES("${signed_char_srcs}" HAVE_SIGNED_CHAR)
-IF(HAVE_SIGNED_CHAR)
-  ADD_TCL_CFLAG(HAVE_SIGNED_CHAR)
-ENDIF(HAVE_SIGNED_CHAR)
+check_c_source_compiles("${signed_char_srcs}" HAVE_SIGNED_CHAR)
+if(HAVE_SIGNED_CHAR)
+  add_tcl_cflag(HAVE_SIGNED_CHAR)
+endif(HAVE_SIGNED_CHAR)
 
 #--------------------------------------------------------------------
 # Check for support of nl_langinfo function
 #--------------------------------------------------------------------
-SC_ENABLE_LANGINFO()
+sc_enable_langinfo()
 
 #--------------------------------------------------------------------
 # Check for chflags and mkstemps
 #--------------------------------------------------------------------
-TCL_CHECK_FUNCTION_EXISTS(chflags HAVE_CHFLAGS)
-TCL_CHECK_FUNCTION_EXISTS(mkstemps HAVE_MKSTEMPS)
+tcl_check_function_exists(chflags HAVE_CHFLAGS)
+tcl_check_function_exists(mkstemps HAVE_MKSTEMPS)
 
 
 #--------------------------------------------------------------------
 # Check for support of isnan() function or macro
 #--------------------------------------------------------------------
-SET(isnan_srcs "
+set(isnan_srcs "
 #include <math.h>
 int main () {
    isnan(0.0); /* Generates an error if isnan is missing */
 	return 0;
 }
 ")
-CHECK_C_SOURCE_RUNS("${isnan_srcs}" USABLE_ISNAN)
-IF(NOT USABLE_ISNAN)
-  ADD_TCL_CFLAG(NO_ISNAN)
-ENDIF(NOT USABLE_ISNAN)
+check_c_source_runs("${isnan_srcs}" USABLE_ISNAN)
+if(NOT USABLE_ISNAN)
+  add_tcl_cflag(NO_ISNAN)
+endif(NOT USABLE_ISNAN)
 
 #----------------------------------------------------------------------------
 # Darwin specific API checks and defines
 #--------------------------------------------------------------------
-IF(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
-  TCL_CHECK_FUNCTION_EXISTS(getattrlist HAVE_GETATTRLIST)
-  TCL_CHECK_INCLUDE_FILE(copyfile.h HAVE_COPYFILE_H)
-  TCL_CHECK_FUNCTION_EXISTS(copyfile HAVE_COPYFILE)
-  IF(${CoreFoundation_LIBRARIES})
-    TCL_CHECK_INCLUDE_FILE(libkern/OSAtomic.h HAVE_LIBKERN_OSATOMIC_H)
-    TCL_CHECK_FUNCTION_EXISTS(OSSpinLockLock HAVE_OSSPINLOCKLOCK)
-    TCL_CHECK_FUNCTION_EXISTS(pthread_atfork HAVE_PTHREAD_ATFORK)
-  ENDIF(${CoreFoundation_LIBRARIES})
-  ADD_TCL_CFLAG(USE_VFORK)
+if(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
+  tcl_check_function_exists(getattrlist HAVE_GETATTRLIST)
+  tcl_check_include_file(copyfile.h HAVE_COPYFILE_H)
+  tcl_check_function_exists(copyfile HAVE_COPYFILE)
+  if(${CoreFoundation_LIBRARIES})
+    tcl_check_include_file(libkern/OSAtomic.h HAVE_LIBKERN_OSATOMIC_H)
+    tcl_check_function_exists(OSSpinLockLock HAVE_OSSPINLOCKLOCK)
+    tcl_check_function_exists(pthread_atfork HAVE_PTHREAD_ATFORK)
+  endif(${CoreFoundation_LIBRARIES})
+  add_tcl_cflag(USE_VFORK)
   add_definitions(-DTCL_DEFAULT_ENCODING="utf-8")
-  ADD_TCL_CFLAG(TCL_LOAD_FROM_MEMORY)
-  ADD_TCL_CFLAG(TCL_WIDE_CLICKS)
-  TCL_CHECK_INCLUDE_FILE_USABILITY(AvailabilityMacros.h HAVE_AVAILABILITYMACROS_H)
-  IF(HAVE_AVAILABILITYMACROS_H)
-    SET(WEAK_IMPORT_SRCS "
+  add_tcl_cflag(TCL_LOAD_FROM_MEMORY)
+  add_tcl_cflag(TCL_WIDE_CLICKS)
+  tcl_check_include_file_usability(AvailabilityMacros.h HAVE_AVAILABILITYMACROS_H)
+  if(HAVE_AVAILABILITYMACROS_H)
+    set(WEAK_IMPORT_SRCS "
 #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
 #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020
 #error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020
@@ -616,11 +616,11 @@
 return 0;
 }
 		")
-    CHECK_C_SOURCE_COMPILES("${WEAK_IMPORT_SRCS}" WEAK_IMPORT_WORKING)
-    IF(WEAK_IMPORT_WORKING)
-      ADD_TCL_CFLAG(HAVE_WEAK_IMPORT)
-    ENDIF(WEAK_IMPORT_WORKING)
-    SET(SUSV3_SRCS "
+    check_c_source_compiles("${WEAK_IMPORT_SRCS}" WEAK_IMPORT_WORKING)
+    if(WEAK_IMPORT_WORKING)
+      add_tcl_cflag(HAVE_WEAK_IMPORT)
+    endif(WEAK_IMPORT_WORKING)
+    set(SUSV3_SRCS "
 #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
 #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050
 #error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050
@@ -633,18 +633,18 @@
 
 int main ()	{return 0;}
 		")
-    CHECK_C_SOURCE_COMPILES("${SUSV3_SRCS}" SUSV3_WORKING)
-    IF(SUSV3_WORKING)
-      ADD_TCL_CFLAG(_DARWIN_C_SOURCE)
-    ENDIF(SUSV3_WORKING)
+    check_c_source_compiles("${SUSV3_SRCS}" SUSV3_WORKING)
+    if(SUSV3_WORKING)
+      add_tcl_cflag(_DARWIN_C_SOURCE)
+    endif(SUSV3_WORKING)
 
-  ENDIF(HAVE_AVAILABILITYMACROS_H)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
+  endif(HAVE_AVAILABILITYMACROS_H)
+endif(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
 
 #--------------------------------------------------------------------
 #       Check for support of fts functions (readdir replacement)
 #--------------------------------------------------------------------
-SET(FTS_SRCS "
+set(FTS_SRCS "
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <fts.h>
@@ -656,10 +656,10 @@
 return 0;
 }
 ")
-CHECK_C_SOURCE_COMPILES("${FTS_SRCS}" FTS_WORKING)
-IF(FTS_WORKING)
-  ADD_TCL_CFLAG(HAVE_FTS)
-ENDIF(FTS_WORKING)
+check_c_source_compiles("${FTS_SRCS}" FTS_WORKING)
+if(FTS_WORKING)
+  add_tcl_cflag(HAVE_FTS)
+endif(FTS_WORKING)
 
 # TODO SC_BLOCKING_STYLE is for older systems, do we still need it?
 
@@ -668,22 +668,22 @@
 #       to be installed by Tcl. The default is autodetection, but can
 #       be overriden on the configure command line either way.
 #------------------------------------------------------------------------
-IF(TCL_TIMEZONE_DATA)
-  IF(${TCL_TIMEZONE_DATA} STREQUAL "")
-    SET(TCL_TIMEZONE_DATA "AUTO" CACHE STRING "Use Tcl's local timezone data")
-  ENDIF(${TCL_TIMEZONE_DATA} STREQUAL "")
-ELSE(TCL_TIMEZONE_DATA)
-  SET(TCL_TIMEZONE_DATA "AUTO" CACHE STRING "Use Tcl's local timezone data")
-ENDIF(TCL_TIMEZONE_DATA)
-IF(${TCL_TIMEZONE_DATA} STREQUAL "AUTO")
-  SET(LOCAL_TZ_DATA OFF)
+if(TCL_TIMEZONE_DATA)
+  if(${TCL_TIMEZONE_DATA} STREQUAL "")
+    set(TCL_TIMEZONE_DATA "AUTO" CACHE STRING "Use Tcl's local timezone data")
+  endif(${TCL_TIMEZONE_DATA} STREQUAL "")
+else(TCL_TIMEZONE_DATA)
+  set(TCL_TIMEZONE_DATA "AUTO" CACHE STRING "Use Tcl's local timezone data")
+endif(TCL_TIMEZONE_DATA)
+if(${TCL_TIMEZONE_DATA} STREQUAL "AUTO")
+  set(LOCAL_TZ_DATA OFF)
   find_package(TIMEZONE)
-  IF(NOT TIMEZONE_FOUND)
-    SET(LOCAL_TZ_DATA ON)
-  ENDIF(NOT TIMEZONE_FOUND)
-ELSE(${TCL_TIMEZONE_DATA} STREQUAL "AUTO")
-  SET(LOCAL_TZ_DATA ${TCL_TIMEZONE_DATA})
-ENDIF(${TCL_TIMEZONE_DATA} STREQUAL "AUTO")
+  if(NOT TIMEZONE_FOUND)
+    set(LOCAL_TZ_DATA ON)
+  endif(NOT TIMEZONE_FOUND)
+else(${TCL_TIMEZONE_DATA} STREQUAL "AUTO")
+  set(LOCAL_TZ_DATA ${TCL_TIMEZONE_DATA})
+endif(${TCL_TIMEZONE_DATA} STREQUAL "AUTO")
 
 #--------------------------------------------------------------------
 #       DTrace support
@@ -693,7 +693,7 @@
 #--------------------------------------------------------------------
 #  Does the C stack grow upwards or downwards? Or cross-compiling?
 #--------------------------------------------------------------------
-SET(C_STACK_SRC "
+set(C_STACK_SRC "
 int StackGrowsUp(int *parent) {
 int here;
 return (&here < parent);
@@ -703,29 +703,29 @@
 return StackGrowsUp(&foo);
 }
 ")
-CHECK_C_SOURCE_RUNS("${C_STACK_SRC}" STACK_GROWS_UP)
-IF(STACK_GROWS_UP)
-  ADD_TCL_CFLAG(TCL_STACK_GROWS_UP)
-ENDIF(STACK_GROWS_UP)
+check_c_source_runs("${C_STACK_SRC}" STACK_GROWS_UP)
+if(STACK_GROWS_UP)
+  add_tcl_cflag(TCL_STACK_GROWS_UP)
+endif(STACK_GROWS_UP)
 
-TCL_CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
-TCL_CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
-TCL_CHECK_INCLUDE_FILE(sys/fstatfs.h HAVE_SYS_FSTATFS_H)
-IF(NOT HAVE_SYS_FSTATFS_H)
+tcl_check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+tcl_check_include_file(sys/stat.h HAVE_SYS_STAT_H)
+tcl_check_include_file(sys/fstatfs.h HAVE_SYS_FSTATFS_H)
+if(NOT HAVE_SYS_FSTATFS_H)
   add_definitions(-DNO_FSTATFS=1)
-ENDIF(NOT HAVE_SYS_FSTATFS_H)
-TCL_CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
-TCL_CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-TCL_CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
-TCL_CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
-TCL_CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
+endif(NOT HAVE_SYS_FSTATFS_H)
+tcl_check_include_file(memory.h HAVE_MEMORY_H)
+tcl_check_include_file(strings.h HAVE_STRINGS_H)
+tcl_check_include_file(inttypes.h HAVE_INTTYPES_H)
+tcl_check_include_file(stdint.h HAVE_STDINT_H)
+tcl_check_include_file(unistd.h HAVE_UNISTD_H)
 
-CHECK_COMPILER_SUPPORTS_HIDDEN_D()
+check_compiler_supports_hidden_d()
 
-TCL_CHECK_INCLUDE_FILE_USABILITY(sys/modem.h SYS_MODEM_H)
+tcl_check_include_file_usability(sys/modem.h SYS_MODEM_H)
 
 
-CHECK_FD_SET_IN_TYPES_D()
+check_fd_set_in_types_d()
 
 #--------------------------------------------------------------------
 #       OSX Framework Configuration
@@ -733,18 +733,18 @@
 # TODO
 
 # If we collected any compat sources, pass the flag
-IF(COMPAT_SRCS)
-  ADD_TCL_CFLAG(USE_COMPAT)
-ENDIF(COMPAT_SRCS)
+if(COMPAT_SRCS)
+  add_tcl_cflag(USE_COMPAT)
+endif(COMPAT_SRCS)
 
-IF(APPLE)
+if(APPLE)
   # Now that all the tests are done, configure the tclConfig.h file:
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/unix/tclConfig.h.in ${TCL_BINARY_DIR}/include/tclConfig.h)
-ENDIF(APPLE)
+endif(APPLE)
 
-ADD_SUBDIRECTORY(library)
+add_subdirectory(library)
 
-SET(TCL_GENERIC_SRCS
+set(TCL_GENERIC_SRCS
   generic/regcomp.c
   generic/regexec.c
   generic/regfree.c
@@ -821,27 +821,27 @@
   generic/tclUniData.c
   )
 
-IF(TCL_TOMMATH)
-  SET(TCL_GENERIC_SRCS ${TCL_GENERIC_SRCS} generic/tclTomMathInterface.c)
-ENDIF(TCL_TOMMATH)
+if(TCL_TOMMATH)
+  set(TCL_GENERIC_SRCS ${TCL_GENERIC_SRCS} generic/tclTomMathInterface.c)
+endif(TCL_TOMMATH)
 
-SET_PROPERTY(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_INSTALL_LIBDIR="${CMAKE_INSTALL_PREFIX}/lib")
-SET_PROPERTY(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_INSTALL_BINDIR="${CMAKE_INSTALL_PREFIX}/bin")
-SET_PROPERTY(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_INSTALL_SCRDIR="${CMAKE_INSTALL_PREFIX}/scripts")
-SET_PROPERTY(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_INSTALL_INCDIR="${CMAKE_INSTALL_PREFIX}/include")
-SET_PROPERTY(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_INSTALL_DOCDIR="${CMAKE_INSTALL_PREFIX}/share/man") 
-SET_PROPERTY(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_RUNTIME_LIBDIR="${CMAKE_INSTALL_PREFIX}/lib")
-SET_PROPERTY(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_RUNTIME_BINDIR="${CMAKE_INSTALL_PREFIX}/bin")
-SET_PROPERTY(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_RUNTIME_SCRDIR="${CMAKE_INSTALL_PREFIX}/scripts")
-SET_PROPERTY(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_RUNTIME_INCDIR="${CMAKE_INSTALL_PREFIX}/include")
-SET_PROPERTY(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_RUNTIME_DOCDIR="${CMAKE_INSTALL_PREFIX}/share/man")
+set_property(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_INSTALL_LIBDIR="${CMAKE_INSTALL_PREFIX}/lib")
+set_property(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_INSTALL_BINDIR="${CMAKE_INSTALL_PREFIX}/bin")
+set_property(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_INSTALL_SCRDIR="${CMAKE_INSTALL_PREFIX}/scripts")
+set_property(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_INSTALL_INCDIR="${CMAKE_INSTALL_PREFIX}/include")
+set_property(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_INSTALL_DOCDIR="${CMAKE_INSTALL_PREFIX}/share/man") 
+set_property(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_RUNTIME_LIBDIR="${CMAKE_INSTALL_PREFIX}/lib")
+set_property(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_RUNTIME_BINDIR="${CMAKE_INSTALL_PREFIX}/bin")
+set_property(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_RUNTIME_SCRDIR="${CMAKE_INSTALL_PREFIX}/scripts")
+set_property(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_RUNTIME_INCDIR="${CMAKE_INSTALL_PREFIX}/include")
+set_property(SOURCE generic/tclPkgConfig.c APPEND PROPERTY COMPILE_DEFINITIONS CFG_RUNTIME_DOCDIR="${CMAKE_INSTALL_PREFIX}/share/man")
 
 
-SET(TCL_STUB_SRCS
+set(TCL_STUB_SRCS
   generic/tclStubLib.c
   )
 
-SET(TCL_TOMMATH_SRCS
+set(TCL_TOMMATH_SRCS
   libtommath/bncore.c
   libtommath/bn_reverse.c
   libtommath/bn_fast_s_mp_mul_digs.c
@@ -905,13 +905,13 @@
   libtommath/bn_s_mp_sub.c
   )
 
-SET(TCL_OSX_SRCS
+set(TCL_OSX_SRCS
   macosx/tclMacOSXBundle.c
   macosx/tclMacOSXFCmd.c
   macosx/tclMacOSXNotify.c
   )
 
-SET(TCL_WIN_SRCS
+set(TCL_WIN_SRCS
   win/tcl.rc
   win/tclAppInit.c
   win/tclWin32Dll.c
@@ -933,19 +933,19 @@
   win/tclWinTime.c
   )
 
-IF(NOT LIB_DIR)
-  IF(NOT WIN32)
-    SET(LIB_DIR lib)
-  ELSE(NOT WIN32)
-    SET(LIB_DIR bin)
-  ENDIF(NOT WIN32)
-ENDIF(NOT LIB_DIR)
+if(NOT LIB_DIR)
+  if(NOT WIN32)
+    set(LIB_DIR lib)
+  else(NOT WIN32)
+    set(LIB_DIR bin)
+  endif(NOT WIN32)
+endif(NOT LIB_DIR)
 
 
-SET_PROPERTY(SOURCE win/tclWinInit.c APPEND PROPERTY COMPILE_DEFINITIONS TCL_LIBRARY="${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${CMAKE_SHARED_LIBRARY_SUFFIX}")
-SET_PROPERTY(SOURCE win/tclWinInit.c APPEND PROPERTY COMPILE_DEFINITIONS TCL_PACKAGE_PATH="${CMAKE_INSTALL_PREFIX}/lib")
+set_property(SOURCE win/tclWinInit.c APPEND PROPERTY COMPILE_DEFINITIONS TCL_LIBRARY="${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${CMAKE_SHARED_LIBRARY_SUFFIX}")
+set_property(SOURCE win/tclWinInit.c APPEND PROPERTY COMPILE_DEFINITIONS TCL_PACKAGE_PATH="${CMAKE_INSTALL_PREFIX}/lib")
 
-SET(TCL_UNIX_SRCS
+set(TCL_UNIX_SRCS
   unix/tclAppInit.c
   unix/tclUnixChan.c
   unix/tclUnixEvent.c
@@ -960,14 +960,14 @@
   unix/tclUnixCompat.c
   )
 
-SET_PROPERTY(SOURCE unix/tclUnixInit.c APPEND PROPERTY COMPILE_DEFINITIONS TCL_LIBRARY="${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${CMAKE_SHARED_LIBRARY_SUFFIX}")
-SET_PROPERTY(SOURCE unix/tclUnixInit.c APPEND PROPERTY COMPILE_DEFINITIONS TCL_PACKAGE_PATH="${CMAKE_INSTALL_PREFIX}/lib")
+set_property(SOURCE unix/tclUnixInit.c APPEND PROPERTY COMPILE_DEFINITIONS TCL_LIBRARY="${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${CMAKE_SHARED_LIBRARY_SUFFIX}")
+set_property(SOURCE unix/tclUnixInit.c APPEND PROPERTY COMPILE_DEFINITIONS TCL_PACKAGE_PATH="${CMAKE_INSTALL_PREFIX}/lib")
 
-SET(TCL_NOTIFY_SRCS
+set(TCL_NOTIFY_SRCS
   unix/tclUnixNotfy.c
   )
 
-SET(TCL_DL_SRCS
+set(TCL_DL_SRCS
   unix/tclLoadAix.c
   unix/tclLoadDl.c
   unix/tclLoadDyld.c
@@ -976,35 +976,35 @@
   unix/tclLoadShl.c
   )
 
-SET(TCL_SRCS ${TCL_GENERIC_SRCS} ${TCL_TOMMATH_SRCS} ${TCL_STUB_SRCS}) 
-IF(WIN32)
-  SET(TCL_SRCS ${TCL_SRCS} ${TCL_WIN_SRCS})
-ELSE(WIN32)
-  SET(TCL_SRCS ${TCL_SRCS} ${TCL_NOTIFY_SRCS} ${TCL_UNIX_SRCS})
-  IF(APPLE)
-    SET(TCL_SRCS ${TCL_SRCS} ${TCL_OSX_SRCS} unix/tclLoadDyld.c)
-  ENDIF(APPLE)
-  IF(NOT APPLE)
-    SET(TCL_SRCS ${TCL_SRCS} unix/tclLoadDl.c)
-  ENDIF(NOT APPLE)
-ENDIF(WIN32)
+set(TCL_SRCS ${TCL_GENERIC_SRCS} ${TCL_TOMMATH_SRCS} ${TCL_STUB_SRCS}) 
+if(WIN32)
+  set(TCL_SRCS ${TCL_SRCS} ${TCL_WIN_SRCS})
+else(WIN32)
+  set(TCL_SRCS ${TCL_SRCS} ${TCL_NOTIFY_SRCS} ${TCL_UNIX_SRCS})
+  if(APPLE)
+    set(TCL_SRCS ${TCL_SRCS} ${TCL_OSX_SRCS} unix/tclLoadDyld.c)
+  endif(APPLE)
+  if(NOT APPLE)
+    set(TCL_SRCS ${TCL_SRCS} unix/tclLoadDl.c)
+  endif(NOT APPLE)
+endif(WIN32)
 
-SET(TCL_INCLUDE_DIRS ${TCL_SOURCE_DIR}/generic ${TCL_SOURCE_DIR}/libtommath ${TCL_BINARY_DIR}/include)
-IF(WIN32)
-  SET(TCL_INCLUDE_DIRS ${TCL_SOURCE_DIR}/win ${TCL_INCLUDE_DIRS})
-ELSE(WIN32)
-  SET(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${TCL_SOURCE_DIR}/unix)
-ENDIF(WIN32)
+set(TCL_INCLUDE_DIRS ${TCL_SOURCE_DIR}/generic ${TCL_SOURCE_DIR}/libtommath ${TCL_BINARY_DIR}/include)
+if(WIN32)
+  set(TCL_INCLUDE_DIRS ${TCL_SOURCE_DIR}/win ${TCL_INCLUDE_DIRS})
+else(WIN32)
+  set(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${TCL_SOURCE_DIR}/unix)
+endif(WIN32)
 
 include_directories(
   ${TCL_INCLUDE_DIRS}
   )
 
-IF(WIN32)
-  SET(TCLSH_SRCS win/tclAppInit.c win/tclsh.rc)
-ELSE(WIN32)
-  SET(TCLSH_SRCS unix/tclAppInit.c)
-ENDIF(WIN32)
+if(WIN32)
+  set(TCLSH_SRCS win/tclAppInit.c win/tclsh.rc)
+else(WIN32)
+  set(TCLSH_SRCS unix/tclAppInit.c)
+endif(WIN32)
 
 add_library(tcl ${TCL_SRCS})
 target_link_libraries(tcl ${CoreFoundation_LIBRARIES} ${TCL_LINK_LIBS} ${DL_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
@@ -1012,14 +1012,14 @@
 	RUNTIME DESTINATION ${BIN_DIR}
 	LIBRARY DESTINATION ${LIB_DIR}
 	ARCHIVE DESTINATION ${LIB_DIR})
-GET_TARGET_PROPERTY(TCL_INSTALL_LIBNAME tcl LOCATION)
-SET_TARGET_PROPERTIES(tcl PROPERTIES VERSION ${TCL_VERSION} SOVERSION ${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR})
-IF(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
-  SET_TARGET_PROPERTIES(tcl PROPERTIES LINK_FLAGS "-compatibility_version ${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR} -current_version ${TCL_VERSION} -install_name \"${TCL_INSTALL_LIBNAME}\" -seg1addr 0xa000000 -sectcreate __TEXT __info_plist \"${TCL_BINARY_DIR}/Tcl-Info.plist\"")
-  SET(EXTRA_TCLSH_LIBS "-sectcreate __TEXT __info_plist \"${TCL_BINARY_DIR}/Tclsh-Info.plist\"")
+get_target_property(TCL_INSTALL_LIBNAME tcl LOCATION)
+set_target_properties(tcl PROPERTIES VERSION ${TCL_VERSION} SOVERSION ${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR})
+if(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
+  set_target_properties(tcl PROPERTIES LINK_FLAGS "-compatibility_version ${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR} -current_version ${TCL_VERSION} -install_name \"${TCL_INSTALL_LIBNAME}\" -seg1addr 0xa000000 -sectcreate __TEXT __info_plist \"${TCL_BINARY_DIR}/Tcl-Info.plist\"")
+  set(EXTRA_TCLSH_LIBS "-sectcreate __TEXT __info_plist \"${TCL_BINARY_DIR}/Tclsh-Info.plist\"")
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/macosx/Tcl-Info.plist.in ${TCL_BINARY_DIR}/Tcl-Info.plist)
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/macosx/Tclsh-Info.plist.in ${TCL_BINARY_DIR}/Tclsh-Info.plist)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
+endif(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
 
 
 add_library(tclstub STATIC ${TCL_STUB_SRCS})
@@ -1033,9 +1033,9 @@
 add_executable(tclsh ${TCLSH_SRCS})
 target_link_libraries(tclsh tcl ${M_LIBRARY} ${TCL_THREADS_LIB} ${EXTRA_TCLSH_LIBS})
 install(TARGETS tclsh DESTINATION bin)
-SET_TARGET_PROPERTIES(tclsh PROPERTIES VERSION ${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR})
+set_target_properties(tclsh PROPERTIES VERSION ${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR})
 
-SET(TCL_HDRS
+set(TCL_HDRS
   generic/tcl.h
   generic/tclDecls.h
   generic/tclPlatDecls.h
@@ -1044,8 +1044,8 @@
   )
 install(FILES ${TCL_HDRS} DESTINATION include)
 
-MARK_AS_ADVANCED(TCL_LIBRARIES TCL_CONF_PREFIX TCL_INCLUDE_DIRS TCL_INCLUDE_PATH)
-MARK_AS_ADVANCED(TCL_STUB_LIBRARIES TCL_TCLSH TCL_TCLSH_EXECUTABLE)
-MARK_AS_ADVANCED(TCL_TK_CONF_PREFIX TCL_TOMMATH)
-MARK_AS_ADVANCED(TCL_VERSION_MAJOR TCL_VERSION_MINOR TCL_WISH_EXECUTABLE)
+mark_as_advanced(TCL_LIBRARIES TCL_CONF_PREFIX TCL_INCLUDE_DIRS TCL_INCLUDE_PATH)
+mark_as_advanced(TCL_STUB_LIBRARIES TCL_TCLSH TCL_TCLSH_EXECUTABLE)
+mark_as_advanced(TCL_TK_CONF_PREFIX TCL_TOMMATH)
+mark_as_advanced(TCL_VERSION_MAJOR TCL_VERSION_MINOR TCL_WISH_EXECUTABLE)
 
Index: src/other/tcl/CMake/CheckCSourceRuns.cmake
===================================================================
--- src/other/tcl/CMake/CheckCSourceRuns.cmake	(revision 54114)
+++ src/other/tcl/CMake/CheckCSourceRuns.cmake	(working copy)
@@ -70,32 +70,32 @@
 # 
 #=============================================================================
 
-MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
-  IF("${VAR}" MATCHES "^${VAR}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS 
+macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
+  if("${VAR}" MATCHES "^${VAR}$")
+    set(MACRO_CHECK_FUNCTION_DEFINITIONS 
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    IF(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
+    if(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
+    else(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    IF(EXISTS "${SOURCE}")
-      SET(CHECK_SRC "${SOURCE}")
-    ELSE(EXISTS "${SOURCE}")
-      FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    if(EXISTS "${SOURCE}")
+      set(CHECK_SRC "${SOURCE}")
+    else(EXISTS "${SOURCE}")
+      file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
         "${SOURCE}\n")
-      SET(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
-    ENDIF(EXISTS "${SOURCE}")
+      set(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
+    endif(EXISTS "${SOURCE}")
     
-    MESSAGE(STATUS "Performing Test ${VAR}")
-    TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
+    message(STATUS "Performing Test ${VAR}")
+    try_run(${VAR}_EXITCODE ${VAR}_COMPILED
       ${CMAKE_BINARY_DIR}
       ${CHECK_SRC}
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -105,33 +105,33 @@
       "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
       COMPILE_OUTPUT_VARIABLE OUTPUT)
     # if it did not compile make the return value fail code of 1
-    IF(NOT ${VAR}_COMPILED)
-      SET(${VAR}_EXITCODE 1)
-    ENDIF(NOT ${VAR}_COMPILED)
+    if(NOT ${VAR}_COMPILED)
+      set(${VAR}_EXITCODE 1)
+    endif(NOT ${VAR}_COMPILED)
     # if the return value was 0 then it worked
-    IF("${${VAR}_EXITCODE}" EQUAL 0)
-      SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
-      MESSAGE(STATUS "Performing Test ${VAR} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+    if("${${VAR}_EXITCODE}" EQUAL 0)
+      set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+      message(STATUS "Performing Test ${VAR} - Success")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
         "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}}\n"
         "Source file was:\n${SOURCE}\n")
-    ELSE("${${VAR}_EXITCODE}" EQUAL 0)
-      IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "${${VAR}_EXITCODE}")
-      ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+    else("${${VAR}_EXITCODE}" EQUAL 0)
+      if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "${${VAR}_EXITCODE}")
+      else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+      endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
 
-      MESSAGE(STATUS "Performing Test ${VAR} - Failed")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      message(STATUS "Performing Test ${VAR} - Failed")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
         "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}_EXITCODE}\n"
         "Source file was:\n${SOURCE}\n")
 
-    ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
-  ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_C_SOURCE_RUNS)
+    endif("${${VAR}_EXITCODE}" EQUAL 0)
+  endif("${VAR}" MATCHES "^${VAR}$")
+endmacro(CHECK_C_SOURCE_RUNS)
 
Index: src/other/tcl/CMake/CheckSystemFunctionality.cmake
===================================================================
--- src/other/tcl/CMake/CheckSystemFunctionality.cmake	(revision 54114)
+++ src/other/tcl/CMake/CheckSystemFunctionality.cmake	(working copy)
@@ -1,35 +1,35 @@
 # Checking compiler flags benefits from some macro logic
 
-INCLUDE(CheckCCompilerFlag)
+include(CheckCCompilerFlag)
 
-MACRO(CHECK_C_FLAG flag)
-  STRING(TOUPPER ${flag} UPPER_FLAG)
-  STRING(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
-  STRING(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
-  IF(${ARGC} LESS 2)
-    CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-  ELSE(${ARGC} LESS 2)
-    IF(NOT ${ARGV1})
-      CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-      IF(${UPPER_FLAG}_COMPILER_FLAG)
-	MESSAGE("- Found ${ARGV1} - setting to -${flag}")
-	SET(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
-      ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-    ENDIF(NOT ${ARGV1})
-  ENDIF(${ARGC} LESS 2)
-  IF(${UPPER_FLAG}_COMPILER_FLAG)
-    SET(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
-  ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-ENDMACRO()
+macro(CHECK_C_FLAG flag)
+  string(TOUPPER ${flag} UPPER_FLAG)
+  string(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
+  string(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
+  if(${ARGC} LESS 2)
+    check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+  else(${ARGC} LESS 2)
+    if(NOT ${ARGV1})
+      check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+      if(${UPPER_FLAG}_COMPILER_FLAG)
+	message("- Found ${ARGV1} - setting to -${flag}")
+	set(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
+      endif(${UPPER_FLAG}_COMPILER_FLAG)
+    endif(NOT ${ARGV1})
+  endif(${ARGC} LESS 2)
+  if(${UPPER_FLAG}_COMPILER_FLAG)
+    set(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
+  endif(${UPPER_FLAG}_COMPILER_FLAG)
+endmacro()
 
-MACRO(CHECK_C_FLAG_GATHER flag FLAGS)
-  STRING(TOUPPER ${flag} UPPER_FLAG)
-  STRING(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
-  CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-  IF(${UPPER_FLAG}_COMPILER_FLAG)
-    SET(${FLAGS} "${${FLAGS}} -${flag}")
-  ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-ENDMACRO()
+macro(CHECK_C_FLAG_GATHER flag FLAGS)
+  string(TOUPPER ${flag} UPPER_FLAG)
+  string(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
+  check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+  if(${UPPER_FLAG}_COMPILER_FLAG)
+    set(${FLAGS} "${${FLAGS}} -${flag}")
+  endif(${UPPER_FLAG}_COMPILER_FLAG)
+endmacro()
 
 
 # Automate putting variables from tests into CFLAGS,
@@ -40,78 +40,78 @@
 # If a CONFIG_CFLAGS variable is defined, they will append
 # an appropriate definition to that variable.
 
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckIncludeFileCXX)
-INCLUDE(CheckTypeSize)
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckStructHasMember)
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(ResolveCompilerPaths)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckTypeSize)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(ResolveCompilerPaths)
 
-MACRO(CONFIG_CHECK_FUNCTION_EXISTS function var)
-  CHECK_FUNCTION_EXISTS(${function} ${var})
-  IF(${var})
+macro(CONFIG_CHECK_FUNCTION_EXISTS function var)
+  check_function_exists(${function} ${var})
+  if(${var})
     add_definitions(-D${var}=1)
-  ENDIF(${var})
-ENDMACRO(CONFIG_CHECK_FUNCTION_EXISTS)
+  endif(${var})
+endmacro(CONFIG_CHECK_FUNCTION_EXISTS)
 
-MACRO(CONFIG_CHECK_INCLUDE_FILE filename var)
-  CHECK_INCLUDE_FILE(${filename} ${var})
-  IF(${var})
+macro(CONFIG_CHECK_INCLUDE_FILE filename var)
+  check_include_file(${filename} ${var})
+  if(${var})
     add_definitions(-D${var}=1)
-  ENDIF(${var})
-ENDMACRO(CONFIG_CHECK_INCLUDE_FILE)
+  endif(${var})
+endmacro(CONFIG_CHECK_INCLUDE_FILE)
 
-MACRO(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
-  CHECK_INCLUDE_FILE(${filename} HAVE_${var})
-  IF(HAVE_${var})
-    SET(HEADER_SRC "
+macro(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
+  check_include_file(${filename} HAVE_${var})
+  if(HAVE_${var})
+    set(HEADER_SRC "
 		#include <${filename}>
 		main(){};
 		")
-    CHECK_C_SOURCE_COMPILES("${HEADER_SRC}" ${var}_USABLE)
-  ENDIF(HAVE_${var})
-  IF(NOT HAVE_${var} OR NOT ${var}_USABLE)
+    check_c_source_compiles("${HEADER_SRC}" ${var}_USABLE)
+  endif(HAVE_${var})
+  if(NOT HAVE_${var} OR NOT ${var}_USABLE)
     add_definitions(-DNO_${var}=1)
-  ENDIF(NOT HAVE_${var} OR NOT ${var}_USABLE)
-ENDMACRO(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
+  endif(NOT HAVE_${var} OR NOT ${var}_USABLE)
+endmacro(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
 
-MACRO(CONFIG_CHECK_INCLUDE_FILE_CXX filename var)
-  CHECK_INCLUDE_FILE_CXX(${filename} ${var})
-  IF(${var})
+macro(CONFIG_CHECK_INCLUDE_FILE_CXX filename var)
+  check_include_file_cxx(${filename} ${var})
+  if(${var})
     add_definitions(-D${var}=1)
-  ENDIF(${var})
-ENDMACRO(CONFIG_CHECK_INCLUDE_FILE_CXX)
+  endif(${var})
+endmacro(CONFIG_CHECK_INCLUDE_FILE_CXX)
 
-MACRO(CONFIG_CHECK_TYPE_SIZE typename var)
-  FOREACH(arg ${ARGN})
-    SET(headers ${headers} ${arg})
-  ENDFOREACH(arg ${ARGN})
-  SET(CHECK_EXTRA_INCLUDE_FILES ${headers})
-  CHECK_TYPE_SIZE(${typename} HAVE_${var}_T)
-  SET(CHECK_EXTRA_INCLUDE_FILES)
-  IF(HAVE_${var}_T)
+macro(CONFIG_CHECK_TYPE_SIZE typename var)
+  foreach(arg ${ARGN})
+    set(headers ${headers} ${arg})
+  endforeach(arg ${ARGN})
+  set(CHECK_EXTRA_INCLUDE_FILES ${headers})
+  check_type_size(${typename} HAVE_${var}_T)
+  set(CHECK_EXTRA_INCLUDE_FILES)
+  if(HAVE_${var}_T)
     add_definitions(-DHAVE_${var}_T=1)
     add_definitions(-DSIZEOF${var}=${HAVE_${var}_T})		
-  ENDIF(HAVE_${var}_T)
-ENDMACRO(CONFIG_CHECK_TYPE_SIZE)
+  endif(HAVE_${var}_T)
+endmacro(CONFIG_CHECK_TYPE_SIZE)
 
-MACRO(CONFIG_CHECK_STRUCT_HAS_MEMBER structname member header var)
-  CHECK_STRUCT_HAS_MEMBER(${structname} ${member} ${header} HAVE_${var})
-  IF(HAVE_${var})
+macro(CONFIG_CHECK_STRUCT_HAS_MEMBER structname member header var)
+  check_struct_has_member(${structname} ${member} ${header} HAVE_${var})
+  if(HAVE_${var})
     add_definitions(-DHAVE_${var}=1)
-  ENDIF(HAVE_${var})
-ENDMACRO(CONFIG_CHECK_STRUCT_HAS_MEMBER)
+  endif(HAVE_${var})
+endmacro(CONFIG_CHECK_STRUCT_HAS_MEMBER)
 
-MACRO(CONFIG_CHECK_LIBRARY targetname lname func)
-  IF(NOT ${targetname}_LIBRARY)
-    CHECK_LIBRARY_EXISTS(${lname} ${func} "" HAVE_${targetname}_${lname})
-    IF(HAVE_${targetname}_${lname})
-      RESOLVE_LIBRARIES(${targetname}_LIBRARY "-l${lname}")
-      SET(${targetname}_LINKOPT "-l${lname}")
-    ENDIF(HAVE_${targetname}_${lname})
-  ENDIF(NOT ${targetname}_LIBRARY)
-ENDMACRO(CONFIG_CHECK_LIBRARY lname func)
+macro(CONFIG_CHECK_LIBRARY targetname lname func)
+  if(NOT ${targetname}_LIBRARY)
+    check_library_exists(${lname} ${func} "" HAVE_${targetname}_${lname})
+    if(HAVE_${targetname}_${lname})
+      resolve_libraries(${targetname}_LIBRARY "-l${lname}")
+      set(${targetname}_LINKOPT "-l${lname}")
+    endif(HAVE_${targetname}_${lname})
+  endif(NOT ${targetname}_LIBRARY)
+endmacro(CONFIG_CHECK_LIBRARY lname func)
 
Index: src/other/tcl/CMake/FindTIMEZONE.cmake
===================================================================
--- src/other/tcl/CMake/FindTIMEZONE.cmake	(revision 54114)
+++ src/other/tcl/CMake/FindTIMEZONE.cmake	(working copy)
@@ -5,16 +5,16 @@
 #
 #=============================================================================
 
-SET(TZ_SEARCH_PATHS
+set(TZ_SEARCH_PATHS
 	/usr/share/zoneinfo
 	/usr/share/lib/zoneinfo
 	/usr/lib/zoneinfo
 	)
-FIND_PATH(TIMEZONE_DATA_DIR UTC PATHS ${TZ_SEARCH_PATHS} NO_DEFAULT_PATH)
-MARK_AS_ADVANCED(TIMEZONE_DATA_DIR)
+find_path(TIMEZONE_DATA_DIR UTC PATHS ${TZ_SEARCH_PATHS} NO_DEFAULT_PATH)
+mark_as_advanced(TIMEZONE_DATA_DIR)
 
 # handle the QUIETLY and REQUIRED arguments and set REGEX_FOUND to TRUE if 
 # all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIMEZONE DEFAULT_MSG TIMEZONE_DATA_DIR)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(TIMEZONE DEFAULT_MSG TIMEZONE_DATA_DIR)
 
Index: src/other/tcl/CMake/ac_std_funcs.cmake
===================================================================
--- src/other/tcl/CMake/ac_std_funcs.cmake	(revision 54114)
+++ src/other/tcl/CMake/ac_std_funcs.cmake	(working copy)
@@ -1,97 +1,97 @@
 # Standard tests and wrappers for CMake functions
 
-INCLUDE(CheckCCompilerFlag)
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckIncludeFileCXX)
-INCLUDE(CheckTypeSize)
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckStructHasMember)
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(ResolveCompilerPaths)
+include(CheckCCompilerFlag)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckTypeSize)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(ResolveCompilerPaths)
 
-SET(CMAKE_TEST_SRCS_DIR "NOTFOUND")
-FOREACH($candidate_dir ${CMAKE_MODULE_PATH})
-	IF(NOT CMAKE_TEST_SRCS_DIR)
-		IF(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
-			SET(CMAKE_TEST_SRCS_DIR ${candidate_dir}/test_sources)
-		ENDIF(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
-	ENDIF(NOT CMAKE_TEST_SRCS_DIR)
-ENDFOREACH($candidate_dir ${CMAKE_MODULE_PATH})
+set(CMAKE_TEST_SRCS_DIR "NOTFOUND")
+foreach($candidate_dir ${CMAKE_MODULE_PATH})
+	if(NOT CMAKE_TEST_SRCS_DIR)
+		if(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
+			set(CMAKE_TEST_SRCS_DIR ${candidate_dir}/test_sources)
+		endif(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
+	endif(NOT CMAKE_TEST_SRCS_DIR)
+endforeach($candidate_dir ${CMAKE_MODULE_PATH})
 
-INCLUDE(CheckPrototypeExists)
-INCLUDE(CheckCSourceRuns)
-INCLUDE(CheckCSourceRuns)
+include(CheckPrototypeExists)
+include(CheckCSourceRuns)
+include(CheckCSourceRuns)
 
-MACRO(CHECK_BASENAME_D)
-	SET(BASENAME_SRC "
+macro(CHECK_BASENAME_D)
+	set(BASENAME_SRC "
 	#include <libgen.h>
 	int main(int argc, char *argv[]) {
 	(void)basename(argv[0]);
 	return 0;
 	}")
-	CHECK_C_SOURCE_RUNS("${BASENAME_SRC}" HAVE_BASENAME)
-	IF(HAVE_BASENAME)
+	check_c_source_runs("${BASENAME_SRC}" HAVE_BASENAME)
+	if(HAVE_BASENAME)
 	  add_definitions(-DHAVE_BASENAME=1)
-	ENDIF(HAVE_BASENAME)
-ENDMACRO(CHECK_BASENAME_D)
+	endif(HAVE_BASENAME)
+endmacro(CHECK_BASENAME_D)
 
-MACRO(CHECK_DIRNAME_D)
-	SET(DIRNAME_SRC "
+macro(CHECK_DIRNAME_D)
+	set(DIRNAME_SRC "
 	#include <libgen.h>
 	int main(int argc, char *argv[]) {
 	(void)dirname(argv[0]);
 	return 0;
 	}")
-	CHECK_C_SOURCE_RUNS("${DIRNAME_SRC}" HAVE_DIRNAME)
-	IF(HAVE_DIRNAME)
+	check_c_source_runs("${DIRNAME_SRC}" HAVE_DIRNAME)
+	if(HAVE_DIRNAME)
 		add_definitions(-DHAVE_DIRNAME=1)
-	ENDIF(HAVE_DIRNAME)
-ENDMACRO(CHECK_DIRNAME_D)
+	endif(HAVE_DIRNAME)
+endmacro(CHECK_DIRNAME_D)
 
 # Based on AC_HEADER_STDC - using the source code for ctype
 # checking found in the generated configure file
-MACRO(CMAKE_HEADER_STDC_D)
-  CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-  IF(HAVE_STDLIB_H)
+macro(CMAKE_HEADER_STDC_D)
+  check_include_file(stdlib.h HAVE_STDLIB_H)
+  if(HAVE_STDLIB_H)
   add_definitions(-DHAVE_STDLIB_H=1)
-  ENDIF(HAVE_STDLIB_H)
-  CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
-  CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-  IF(HAVE_STRING_H)
+  endif(HAVE_STDLIB_H)
+  check_include_file(stdarg.h HAVE_STDARG_H)
+  check_include_file(string.h HAVE_STRING_H)
+  if(HAVE_STRING_H)
   add_definitions(-DHAVE_STRING_H=1)
-  ENDIF(HAVE_STRING_H)
-  CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-  IF(HAVE_STRINGS_H)
+  endif(HAVE_STRING_H)
+  check_include_file(strings.h HAVE_STRINGS_H)
+  if(HAVE_STRINGS_H)
   add_definitions(-DHAVE_STRINGS_H=1)
-  ENDIF(HAVE_STRINGS_H)
-  CHECK_INCLUDE_FILE(float.h HAVE_FLOAT_H)
-  CHECK_PROTOTYPE_EXISTS(memchr string.h HAVE_STRING_H_MEMCHR)
-  CHECK_PROTOTYPE_EXISTS(free stdlib.h HAVE_STDLIB_H_FREE)
-  CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/ctypes_test.c WORKING_CTYPE_MACROS)
-  IF(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
+  endif(HAVE_STRINGS_H)
+  check_include_file(float.h HAVE_FLOAT_H)
+  check_prototype_exists(memchr string.h HAVE_STRING_H_MEMCHR)
+  check_prototype_exists(free stdlib.h HAVE_STDLIB_H_FREE)
+  check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/ctypes_test.c WORKING_CTYPE_MACROS)
+  if(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
 	 add_definitions(-DSTDC_HEADERS=1)
-  ENDIF(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
-ENDMACRO(CMAKE_HEADER_STDC_D)
+  endif(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
+endmacro(CMAKE_HEADER_STDC_D)
 
 # Based on AC_HEADER_SYS_WAIT
-MACRO(CMAKE_HEADER_SYS_WAIT_D)
-  CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/sys_wait_test.c WORKING_SYS_WAIT)
-  IF(WORKING_SYS_WAIT)
+macro(CMAKE_HEADER_SYS_WAIT_D)
+  check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/sys_wait_test.c WORKING_SYS_WAIT)
+  if(WORKING_SYS_WAIT)
 	 add_definitions(-DHAVE_SYS_WAIT_H=1)
-  ENDIF(WORKING_SYS_WAIT)
-ENDMACRO(CMAKE_HEADER_SYS_WAIT_D)
+  endif(WORKING_SYS_WAIT)
+endmacro(CMAKE_HEADER_SYS_WAIT_D)
 
 # Based on AC_FUNC_ALLOCA
-MACRO(CMAKE_ALLOCA_D)
-	CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/alloca_header_test.c WORKING_ALLOCA_H)
-	IF(WORKING_ALLOCA_H)
+macro(CMAKE_ALLOCA_D)
+	check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/alloca_header_test.c WORKING_ALLOCA_H)
+	if(WORKING_ALLOCA_H)
 		add_definitions(-DHAVE_ALLOCA_H=1)
-	ENDIF(WORKING_ALLOCA_H)
-	CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/alloca_test.c WORKING_ALLOCA)
-	IF(WORKING_ALLOCA)
+	endif(WORKING_ALLOCA_H)
+	check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/alloca_test.c WORKING_ALLOCA)
+	if(WORKING_ALLOCA)
 		add_definitions(-DHAVE_ALLOCA=1)
-	ENDIF(WORKING_ALLOCA)
-ENDMACRO(CMAKE_ALLOCA_D)
+	endif(WORKING_ALLOCA)
+endmacro(CMAKE_ALLOCA_D)
 
Index: src/other/tcl/CMake/tcl.cmake
===================================================================
--- src/other/tcl/CMake/tcl.cmake	(revision 54114)
+++ src/other/tcl/CMake/tcl.cmake	(working copy)
@@ -1,99 +1,99 @@
 # CMake version of the tcl.m4 logic, insofar as it maps to CMake and has been
 # needed.
 
-INCLUDE(CheckCCompilerFlag)
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckIncludeFileCXX)
-INCLUDE(CheckTypeSize)
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckStructHasMember)
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(ResolveCompilerPaths)
-INCLUDE(CheckPrototypeExists)
-INCLUDE(CheckCSourceRuns)
-INCLUDE(CheckCSourceRuns)
+include(CheckCCompilerFlag)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckTypeSize)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(ResolveCompilerPaths)
+include(CheckPrototypeExists)
+include(CheckCSourceRuns)
+include(CheckCSourceRuns)
 
-INCLUDE(ac_std_funcs)
+include(ac_std_funcs)
 
-MACRO(ADD_TCL_CFLAG TCL_CFLAG)
+macro(ADD_TCL_CFLAG TCL_CFLAG)
 	add_definitions(-D${TCL_CFLAG}=1)
-ENDMACRO(ADD_TCL_CFLAG)
+endmacro(ADD_TCL_CFLAG)
 
-MACRO(CHECK_C_FLAG flag)
-   STRING(TOUPPER ${flag} UPPER_FLAG)
-   STRING(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
-   STRING(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
-   IF(${ARGC} LESS 2)
-      CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-   ELSE(${ARGC} LESS 2)
-      IF(NOT ${ARGV1})
-         CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-         IF(${UPPER_FLAG}_COMPILER_FLAG)
-            MESSAGE("- Found ${ARGV1} - setting to -${flag}")
-            SET(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
-         ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-      ENDIF(NOT ${ARGV1})
-   ENDIF(${ARGC} LESS 2)
-   IF(${UPPER_FLAG}_COMPILER_FLAG)
-      SET(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
-   ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-ENDMACRO()
+macro(CHECK_C_FLAG flag)
+   string(TOUPPER ${flag} UPPER_FLAG)
+   string(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
+   string(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
+   if(${ARGC} LESS 2)
+      check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+   else(${ARGC} LESS 2)
+      if(NOT ${ARGV1})
+         check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+         if(${UPPER_FLAG}_COMPILER_FLAG)
+            message("- Found ${ARGV1} - setting to -${flag}")
+            set(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
+         endif(${UPPER_FLAG}_COMPILER_FLAG)
+      endif(NOT ${ARGV1})
+   endif(${ARGC} LESS 2)
+   if(${UPPER_FLAG}_COMPILER_FLAG)
+      set(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
+   endif(${UPPER_FLAG}_COMPILER_FLAG)
+endmacro()
 
 # Wrappers for include file checks
-MACRO(TCL_CHECK_INCLUDE_FILE filename var)
-	CHECK_INCLUDE_FILE(${filename} ${var})
-	IF(${var})
+macro(TCL_CHECK_INCLUDE_FILE filename var)
+	check_include_file(${filename} ${var})
+	if(${var})
 		add_definitions(-D${var}=1)
-	ENDIF(${var})
-ENDMACRO(TCL_CHECK_INCLUDE_FILE)
+	endif(${var})
+endmacro(TCL_CHECK_INCLUDE_FILE)
 
-MACRO(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
-	CHECK_INCLUDE_FILE(${filename} HAVE_${var})
-	IF(HAVE_${var})
-		SET(HEADER_SRC "
+macro(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
+	check_include_file(${filename} HAVE_${var})
+	if(HAVE_${var})
+		set(HEADER_SRC "
 #include <${filename}>
 main(){};
 		")
-		CHECK_C_SOURCE_COMPILES("${HEADER_SRC}" ${var}_USABLE)
-	ENDIF(HAVE_${var})
-	IF(NOT HAVE_${var} OR NOT ${var}_USABLE)
+		check_c_source_compiles("${HEADER_SRC}" ${var}_USABLE)
+	endif(HAVE_${var})
+	if(NOT HAVE_${var} OR NOT ${var}_USABLE)
 		add_definitions(-DNO_${var}=1)
-	ELSE(NOT HAVE_${var} OR NOT ${var}_USABLE)
+	else(NOT HAVE_${var} OR NOT ${var}_USABLE)
 		add_definitions(-DHAVE_${var}=1)
-	ENDIF(NOT HAVE_${var} OR NOT ${var}_USABLE)
-ENDMACRO(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
+	endif(NOT HAVE_${var} OR NOT ${var}_USABLE)
+endmacro(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
 
 # Wrapper for function testing
-MACRO(TCL_CHECK_FUNCTION_EXISTS function var)
-	CHECK_FUNCTION_EXISTS(${function} ${var})
-	IF(${var})
+macro(TCL_CHECK_FUNCTION_EXISTS function var)
+	check_function_exists(${function} ${var})
+	if(${var})
 		add_definitions(-D${var}=1)
-	ENDIF(${var})
-ENDMACRO(TCL_CHECK_FUNCTION_EXISTS)
+	endif(${var})
+endmacro(TCL_CHECK_FUNCTION_EXISTS)
 
 # Check sizes (accepts extra headers)
-MACRO(TCL_CHECK_TYPE_SIZE typename var)
-   FOREACH(arg ${ARGN})
-      SET(headers ${headers} ${arg})
-   ENDFOREACH(arg ${ARGN})
-   SET(CHECK_EXTRA_INCLUDE_FILES ${headers})
-   CHECK_TYPE_SIZE(${typename} HAVE_${var}_T)
-   SET(CHECK_EXTRA_INCLUDE_FILES)
-   IF(HAVE_${var}_T)
+macro(TCL_CHECK_TYPE_SIZE typename var)
+   foreach(arg ${ARGN})
+      set(headers ${headers} ${arg})
+   endforeach(arg ${ARGN})
+   set(CHECK_EXTRA_INCLUDE_FILES ${headers})
+   check_type_size(${typename} HAVE_${var}_T)
+   set(CHECK_EXTRA_INCLUDE_FILES)
+   if(HAVE_${var}_T)
       add_definitions(-DHAVE_${var}_T=1)
       add_definitions(-DSIZEOF${var}=${HAVE_${var}_T})
-   ENDIF(HAVE_${var}_T)
-ENDMACRO(TCL_CHECK_TYPE_SIZE)
+   endif(HAVE_${var}_T)
+endmacro(TCL_CHECK_TYPE_SIZE)
 
 # Check for a member of a structure
-MACRO(TCL_CHECK_STRUCT_HAS_MEMBER structname member header var)
-   CHECK_STRUCT_HAS_MEMBER(${structname} ${member} ${header} HAVE_${var})
-   IF(HAVE_${var})
+macro(TCL_CHECK_STRUCT_HAS_MEMBER structname member header var)
+   check_struct_has_member(${structname} ${member} ${header} HAVE_${var})
+   if(HAVE_${var})
       add_definitions(-DHAVE_${var}=1)
-   ENDIF(HAVE_${var})
-ENDMACRO(TCL_CHECK_STRUCT_HAS_MEMBER)
+   endif(HAVE_${var})
+endmacro(TCL_CHECK_STRUCT_HAS_MEMBER)
 
 
 
@@ -153,42 +153,42 @@
 #------------------------------------------------------------------------
 # SC_ENABLE_THREADS
 #------------------------------------------------------------------------
-MACRO(SC_ENABLE_THREADS)
-   FIND_PACKAGE(Threads)
-   IF(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
-		SET(TCL_FOUND_THREADS ON)
-   ELSE(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
-		SET(TCL_FOUND_THREADS OFF)
-   ENDIF(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
-	OPTION(TCL_THREADS "Enable Tcl Thread support" ${TCL_FOUND_THREADS})
-   IF(TCL_THREADS)
-		ADD_TCL_CFLAG(TCL_THREADS)
-		ADD_TCL_CFLAG(USE_THREAD_ALLOC)
-		ADD_TCL_CFLAG(_REENTRANT)
-		ADD_TCL_CFLAG(_THREAD_SAFE)
-	   SET(TCL_THREADS_LIB ${CMAKE_THREAD_LIBS_INIT})
-		IF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
-			ADD_TCL_CFLAG(_POSIX_PTHREAD_SEMANTICS)
-		ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
-		CHECK_FUNCTION_EXISTS(pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-		IF(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-			ADD_TCL_CFLAG(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-		ENDIF(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-		CHECK_FUNCTION_EXISTS(pthread_attr_get_np HAVE_PTHREAD_ATTR_GET_NP)
-		CHECK_FUNCTION_EXISTS(pthread_getattr_np HAVE_PTHREAD_GETATTR_NP)
-		IF(HAVE_PTHREAD_ATTR_GET_NP)
-			ADD_TCL_CFLAG(HAVE_PTHREAD_ATTR_GET_NP)
-		ELSEIF(HAVE_PTHREAD_GETATTR_NP)
-			ADD_TCL_CFLAG(HAVE_PTHREAD_GETATTR_NP)
-		ENDIF(HAVE_PTHREAD_ATTR_GET_NP)
-		IF(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
-			CHECK_FUNCTION_EXISTS(pthread_get_stacksize_np HAVE_PTHREAD_GET_STACKSIZE_NP)
-			IF(HAVE_PTHREAD_GET_STACKSIZE_NP)
-				ADD_TCL_CFLAG(HAVE_PTHREAD_GET_STACKSIZE_NP)
-			ENDIF(HAVE_PTHREAD_GET_STACKSIZE_NP)
-		ENDIF(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
-	ENDIF(TCL_THREADS)
-ENDMACRO(SC_ENABLE_THREADS)
+macro(SC_ENABLE_THREADS)
+   find_package(Threads)
+   if(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
+		set(TCL_FOUND_THREADS ON)
+   else(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
+		set(TCL_FOUND_THREADS OFF)
+   endif(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
+	option(TCL_THREADS "Enable Tcl Thread support" ${TCL_FOUND_THREADS})
+   if(TCL_THREADS)
+		add_tcl_cflag(TCL_THREADS)
+		add_tcl_cflag(USE_THREAD_ALLOC)
+		add_tcl_cflag(_REENTRANT)
+		add_tcl_cflag(_THREAD_SAFE)
+	   set(TCL_THREADS_LIB ${CMAKE_THREAD_LIBS_INIT})
+		if(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+			add_tcl_cflag(_POSIX_PTHREAD_SEMANTICS)
+		endif(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+		check_function_exists(pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+		if(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+			add_tcl_cflag(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+		endif(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+		check_function_exists(pthread_attr_get_np HAVE_PTHREAD_ATTR_GET_NP)
+		check_function_exists(pthread_getattr_np HAVE_PTHREAD_GETATTR_NP)
+		if(HAVE_PTHREAD_ATTR_GET_NP)
+			add_tcl_cflag(HAVE_PTHREAD_ATTR_GET_NP)
+		elseif(HAVE_PTHREAD_GETATTR_NP)
+			add_tcl_cflag(HAVE_PTHREAD_GETATTR_NP)
+		endif(HAVE_PTHREAD_ATTR_GET_NP)
+		if(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
+			check_function_exists(pthread_get_stacksize_np HAVE_PTHREAD_GET_STACKSIZE_NP)
+			if(HAVE_PTHREAD_GET_STACKSIZE_NP)
+				add_tcl_cflag(HAVE_PTHREAD_GET_STACKSIZE_NP)
+			endif(HAVE_PTHREAD_GET_STACKSIZE_NP)
+		endif(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
+	endif(TCL_THREADS)
+endmacro(SC_ENABLE_THREADS)
 
 #------------------------------------------------------------------------
 # SC_ENABLE_SYMBOLS
@@ -199,28 +199,28 @@
 #------------------------------------------------------------------------
 # SC_ENABLE_LANGINFO
 #------------------------------------------------------------------------
-MACRO(SC_ENABLE_LANGINFO)
+macro(SC_ENABLE_LANGINFO)
 	set(TCL_ENABLE_LANGINFO ON CACHE STRING "Trigger use of nl_langinfo if available.")
-	IF(TCL_ENABLE_LANGINFO)
-		CHECK_INCLUDE_FILE(langinfo.h HAVE_LANGINFO)
-		IF(HAVE_LANGINFO)
-			SET(LANGINFO_SRC "
+	if(TCL_ENABLE_LANGINFO)
+		check_include_file(langinfo.h HAVE_LANGINFO)
+		if(HAVE_LANGINFO)
+			set(LANGINFO_SRC "
 			#include <langinfo.h>
 			int main() {
 			nl_langinfo(CODESET);
 			}
 			")
-			CHECK_C_SOURCE_COMPILES("${LANGINFO_SRC}" LANGINFO_COMPILES)
-			IF(LANGINFO_COMPILES)
-				ADD_TCL_CFLAG(HAVE_LANGINFO)
-			ELSE(LANGINFO_COMPILES)
-				SET(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
-			ENDIF(LANGINFO_COMPILES)
-		ELSE(HAVE_LANGINFO)
-			SET(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
-		ENDIF(HAVE_LANGINFO)
-	ENDIF(TCL_ENABLE_LANGINFO)
-ENDMACRO(SC_ENABLE_LANGINFO)
+			check_c_source_compiles("${LANGINFO_SRC}" LANGINFO_COMPILES)
+			if(LANGINFO_COMPILES)
+				add_tcl_cflag(HAVE_LANGINFO)
+			else(LANGINFO_COMPILES)
+				set(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
+			endif(LANGINFO_COMPILES)
+		else(HAVE_LANGINFO)
+			set(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
+		endif(HAVE_LANGINFO)
+	endif(TCL_ENABLE_LANGINFO)
+endmacro(SC_ENABLE_LANGINFO)
 
 #--------------------------------------------------------------------
 # SC_CONFIG_MANPAGES
@@ -245,8 +245,8 @@
 #--------------------------------------------------------------------
 # SC_SERIAL_PORT
 #--------------------------------------------------------------------
-MACRO(SC_SERIAL_PORT)
-	SET(TERMIOS_SRC_1 "
+macro(SC_SERIAL_PORT)
+	set(TERMIOS_SRC_1 "
 #include <termios.h>
 int main() {
 struct termios t;
@@ -258,7 +258,7 @@
 	return 1;
 }
 	")
-	SET(TERMIOS_SRC_2 "
+	set(TERMIOS_SRC_2 "
 #include <termios.h>
 #include <errno.h>
 
@@ -273,7 +273,7 @@
 	return 1;
 }
 	")
-	SET(TERMIO_SRC_1 "
+	set(TERMIO_SRC_1 "
 #include <termio.h>
 int main() {
 struct termio t;
@@ -284,7 +284,7 @@
 	return 1;
 }
    ")
-	SET(TERMIO_SRC_2 "
+	set(TERMIO_SRC_2 "
 #include <termio.h>
 #include <errno.h>
 
@@ -298,7 +298,7 @@
 	return 1;
 }
 	")
-	SET(SGTTY_SRC_1 "
+	set(SGTTY_SRC_1 "
 #include <sgtty.h>
 int main() {
 struct sgttyb t;
@@ -310,7 +310,7 @@
 	return 1;
 }
    ")
-	SET(SGTTY_SRC_2 "
+	set(SGTTY_SRC_2 "
 #include <sgtty.h>
 #include <errno.h>
 
@@ -325,57 +325,57 @@
 	return 1;
 }
 	")
-	CHECK_C_SOURCE_RUNS("${TERMIOS_SRC_1}" HAVE_TERMIOS)
-	IF(NOT HAVE_TERMIOS)
-		CHECK_C_SOURCE_RUNS("${TERMIO_SRC_1}" HAVE_TERMIO)
-	ENDIF(NOT HAVE_TERMIOS)
-	IF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-		CHECK_C_SOURCE_RUNS("${SGTTY_SRC_1}" HAVE_SGTTY)
-	ENDIF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-	IF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
-		CHECK_C_SOURCE_RUNS("${TERMIOS_SRC_2}" HAVE_TERMIOS)
-		IF(NOT HAVE_TERMIOS)
-			CHECK_C_SOURCE_RUNS("${TERMIO_SRC_2}" HAVE_TERMIO)
-		ENDIF(NOT HAVE_TERMIOS)
-		IF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-			CHECK_C_SOURCE_RUNS("${SGTTY_SRC_2}" HAVE_SGTTY)
-		ENDIF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-	ENDIF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
+	check_c_source_runs("${TERMIOS_SRC_1}" HAVE_TERMIOS)
+	if(NOT HAVE_TERMIOS)
+		check_c_source_runs("${TERMIO_SRC_1}" HAVE_TERMIO)
+	endif(NOT HAVE_TERMIOS)
+	if(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+		check_c_source_runs("${SGTTY_SRC_1}" HAVE_SGTTY)
+	endif(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+	if(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
+		check_c_source_runs("${TERMIOS_SRC_2}" HAVE_TERMIOS)
+		if(NOT HAVE_TERMIOS)
+			check_c_source_runs("${TERMIO_SRC_2}" HAVE_TERMIO)
+		endif(NOT HAVE_TERMIOS)
+		if(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+			check_c_source_runs("${SGTTY_SRC_2}" HAVE_SGTTY)
+		endif(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+	endif(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
 
-	IF(HAVE_TERMIOS)
-		ADD_TCL_CFLAG(USE_TERMIOS)
-	ELSE(HAVE_TERMIOS)
-		IF(HAVE_TERMIO)
-		   ADD_TCL_CFLAG(USE_TERMIO)
-		ELSE(HAVE_TERMIO)
-			IF(HAVE_SGTTY)
-				ADD_TCL_CFLAG(USE_SGTTY)
-			ENDIF(HAVE_SGTTY)
-		ENDIF(HAVE_TERMIO)
-	ENDIF(HAVE_TERMIOS)
-ENDMACRO(SC_SERIAL_PORT)
+	if(HAVE_TERMIOS)
+		add_tcl_cflag(USE_TERMIOS)
+	else(HAVE_TERMIOS)
+		if(HAVE_TERMIO)
+		   add_tcl_cflag(USE_TERMIO)
+		else(HAVE_TERMIO)
+			if(HAVE_SGTTY)
+				add_tcl_cflag(USE_SGTTY)
+			endif(HAVE_SGTTY)
+		endif(HAVE_TERMIO)
+	endif(HAVE_TERMIOS)
+endmacro(SC_SERIAL_PORT)
 
 
 #--------------------------------------------------------------------
 # SC_MISSING_POSIX_HEADERS
 #--------------------------------------------------------------------
-MACRO(SC_MISSING_POSIX_HEADERS)
-	TCL_CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
-	IF(NOT HAVE_DIRENT_H)
+macro(SC_MISSING_POSIX_HEADERS)
+	tcl_check_include_file(dirent.h HAVE_DIRENT_H)
+	if(NOT HAVE_DIRENT_H)
 		add_definitions(-DNO_DIRENT_H=1)
-	ENDIF(NOT HAVE_DIRENT_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(float.h FLOAT_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(values.h VALUES_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(limits.h LIMITS_H)
-	TCL_CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-	TCL_CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-	IF(NOT HAVE_STRING_H)
+	endif(NOT HAVE_DIRENT_H)
+	tcl_check_include_file_usability(float.h FLOAT_H)
+	tcl_check_include_file_usability(values.h VALUES_H)
+	tcl_check_include_file_usability(limits.h LIMITS_H)
+	tcl_check_include_file(stdlib.h HAVE_STDLIB_H)
+	tcl_check_include_file(string.h HAVE_STRING_H)
+	if(NOT HAVE_STRING_H)
 		add_definitions(-DNO_STRING_H=1)
-	ENDIF(NOT HAVE_STRING_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(sys/wait.h SYS_WAIT_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(dlfcn.h DLFCN_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(sys/param.h SYS_PARAM_H)
-ENDMACRO(SC_MISSING_POSIX_HEADERS)
+	endif(NOT HAVE_STRING_H)
+	tcl_check_include_file_usability(sys/wait.h SYS_WAIT_H)
+	tcl_check_include_file_usability(dlfcn.h DLFCN_H)
+	tcl_check_include_file_usability(sys/param.h SYS_PARAM_H)
+endmacro(SC_MISSING_POSIX_HEADERS)
 
 
 #--------------------------------------------------------------------
@@ -387,17 +387,17 @@
 #--------------------------------------------------------------------
 # SC_BLOCKING_STYLE
 #--------------------------------------------------------------------
-TCL_CHECK_INCLUDE_FILE(sys/ioctl.h HAVE_SYS_IOCTL_H) 
-TCL_CHECK_INCLUDE_FILE(sys/filio.h HAVE_SYS_FILIO_H)
-IF(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
-	ADD_TCL_CFLAG(USE_FIONBIO)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
-IF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
-	STRING(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
-	IF (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
-		ADD_TCL_CFLAG(USE_FIONBIO)
-	ENDIF (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+tcl_check_include_file(sys/ioctl.h HAVE_SYS_IOCTL_H) 
+tcl_check_include_file(sys/filio.h HAVE_SYS_FILIO_H)
+if(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
+	add_tcl_cflag(USE_FIONBIO)
+endif(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
+if(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+	string(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
+	if (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
+		add_tcl_cflag(USE_FIONBIO)
+	endif (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
+endif(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
 
 #--------------------------------------------------------------------
 # SC_TIME_HANLDER
@@ -408,13 +408,13 @@
 # TODO - tzname testing from AC_STRUCT_TIMEZONE is incomplete
 #
 #--------------------------------------------------------------------
-MACRO(SC_TIME_HANDLER)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(sys/time.h SYS_TIME_H)
-	TCL_CHECK_STRUCT_HAS_MEMBER("struct tm" tm_zone time.h STRUCT_TM_TM_ZONE)
-	IF(HAVE_STRUCT_TM_TM_ZONE)
-		ADD_TCL_CFLAG(HAVE_TM_ZONE)
-	ELSE(HAVE_STRUCT_TM_TM_ZONE)
-		SET(TZNAME_SRC "
+macro(SC_TIME_HANDLER)
+	tcl_check_include_file_usability(sys/time.h SYS_TIME_H)
+	tcl_check_struct_has_member("struct tm" tm_zone time.h STRUCT_TM_TM_ZONE)
+	if(HAVE_STRUCT_TM_TM_ZONE)
+		add_tcl_cflag(HAVE_TM_ZONE)
+	else(HAVE_STRUCT_TM_TM_ZONE)
+		set(TZNAME_SRC "
 #include <time.h>
 int main () {
 #ifndef tzname
@@ -422,17 +422,17 @@
 #endif
 return 0;
 }")
-      CHECK_C_SOURCE_COMPILES("${TZNAME_SRC}" HAVE_TZNAME)
-		IF(HAVE_TZNAME)
-			ADD_TCL_CFLAG(HAVE_DECL_TZNAME)
-		ENDIF(HAVE_TZNAME)
-	ENDIF(HAVE_STRUCT_TM_TM_ZONE)
-	TCL_CHECK_FUNCTION_EXISTS(gmtime_r HAVE_GMTIME_R)
-	TCL_CHECK_FUNCTION_EXISTS(localtime_r HAVE_LOCALTIME_R)
-	TCL_CHECK_FUNCTION_EXISTS(mktime HAVE_MKTIME)
-	TCL_CHECK_STRUCT_HAS_MEMBER("struct tm" tm_tzadj time.h TM_TZADJ)
-	TCL_CHECK_STRUCT_HAS_MEMBER("struct tm" tm_gmtoff time.h TM_GMTOFF)
-	SET(TZONE_SRC_1 "
+      check_c_source_compiles("${TZNAME_SRC}" HAVE_TZNAME)
+		if(HAVE_TZNAME)
+			add_tcl_cflag(HAVE_DECL_TZNAME)
+		endif(HAVE_TZNAME)
+	endif(HAVE_STRUCT_TM_TM_ZONE)
+	tcl_check_function_exists(gmtime_r HAVE_GMTIME_R)
+	tcl_check_function_exists(localtime_r HAVE_LOCALTIME_R)
+	tcl_check_function_exists(mktime HAVE_MKTIME)
+	tcl_check_struct_has_member("struct tm" tm_tzadj time.h TM_TZADJ)
+	tcl_check_struct_has_member("struct tm" tm_gmtoff time.h TM_GMTOFF)
+	set(TZONE_SRC_1 "
 #include <time.h>
 int main () {
 extern long timezone;
@@ -441,11 +441,11 @@
 return 0;
 }
    ")
-	CHECK_C_SOURCE_COMPILES("${TZONE_SRC_1}" HAVE_TIMEZONE_VAR)
-   IF(HAVE_TIMEZONE_VAR)
-		ADD_TCL_CFLAG(HAVE_TIMEZONE_VAR)
-	ELSE(HAVE_TIMEZONE_VAR)
-		SET(TZONE_SRC_2 "
+	check_c_source_compiles("${TZONE_SRC_1}" HAVE_TIMEZONE_VAR)
+   if(HAVE_TIMEZONE_VAR)
+		add_tcl_cflag(HAVE_TIMEZONE_VAR)
+	else(HAVE_TIMEZONE_VAR)
+		set(TZONE_SRC_2 "
 #include <time.h>
 int main() {
 extern time_t timezone;
@@ -454,13 +454,13 @@
 return 0;
 }
       ")
-		CHECK_C_SOURCE_COMPILES("${TZONE_SRC_2}" HAVE_TIMEZONE_VAR)
-		IF(HAVE_TIMEZONE_VAR)
-			ADD_TCL_CFLAG(HAVE_TIMEZONE_VAR)
-		ENDIF(HAVE_TIMEZONE_VAR)
-	ENDIF(HAVE_TIMEZONE_VAR)
-	IF(HAVE_SYS_TIME_H)
-		SET(TIME_WITH_SYS_TIME_SRC "
+		check_c_source_compiles("${TZONE_SRC_2}" HAVE_TIMEZONE_VAR)
+		if(HAVE_TIMEZONE_VAR)
+			add_tcl_cflag(HAVE_TIMEZONE_VAR)
+		endif(HAVE_TIMEZONE_VAR)
+	endif(HAVE_TIMEZONE_VAR)
+	if(HAVE_SYS_TIME_H)
+		set(TIME_WITH_SYS_TIME_SRC "
 #include <sys/time.h>
 #include <time.h>
 int main() {
@@ -470,12 +470,12 @@
 return 0;
 }
       ")
-		CHECK_C_SOURCE_COMPILES("${TIME_WITH_SYS_TIME_SRC}" TIME_WITH_SYS_TIME_WORKS)
-		IF(TIME_WITH_SYS_TIME_WORKS)
+		check_c_source_compiles("${TIME_WITH_SYS_TIME_SRC}" TIME_WITH_SYS_TIME_WORKS)
+		if(TIME_WITH_SYS_TIME_WORKS)
 			add_definitions(-DTIME_WITH_SYS_TIME=1)
-		ENDIF(TIME_WITH_SYS_TIME_WORKS)
-	ENDIF(HAVE_SYS_TIME_H)
-ENDMACRO(SC_TIME_HANDLER)
+		endif(TIME_WITH_SYS_TIME_WORKS)
+	endif(HAVE_SYS_TIME_H)
+endmacro(SC_TIME_HANDLER)
 
 #--------------------------------------------------------------------
 # SC_BUGGY_STRTOD
@@ -487,74 +487,74 @@
 #--------------------------------------------------------------------
 # SC_TCL_LINK_LIBS
 #--------------------------------------------------------------------
-MACRO(SC_TCL_LINK_LIBS)
-	SET(TCL_LINK_LIBS "")
+macro(SC_TCL_LINK_LIBS)
+	set(TCL_LINK_LIBS "")
 
 	# Math libraries 
-	IF(NOT WIN32)
-		CHECK_LIBRARY_EXISTS(m cos "" HAVE_M_LIBRARY)
-		IF(HAVE_M_LIBRARY)
-			RESOLVE_LIBRARIES(M_LIBRARY "-lm")
-		ENDIF(HAVE_M_LIBRARY)
+	if(NOT WIN32)
+		check_library_exists(m cos "" HAVE_M_LIBRARY)
+		if(HAVE_M_LIBRARY)
+			resolve_libraries(M_LIBRARY "-lm")
+		endif(HAVE_M_LIBRARY)
 		#find_library(IEEE_LIB ieee)
 		#MARK_AS_ADVANCED(IEEE_LIB)
 		#IF(IEEE_LIB)
 		#	SET(M_LIBRARY "-lieee ${M_LIBRARY}")
 		#ENDIF(IEEE_LIB)
-		CHECK_LIBRARY_EXISTS(sunmath ieee_flags "" HAVE_SUNMATH_LIBRARY)
-		IF(HAVE_SUNMATH_LIBRARY)
-			SET(M_LIBRARY "-lsunmath ${M_LIBRARY}")
-		ENDIF(HAVE_SUNMATH_LIBRARY)
-	ENDIF(NOT WIN32)
+		check_library_exists(sunmath ieee_flags "" HAVE_SUNMATH_LIBRARY)
+		if(HAVE_SUNMATH_LIBRARY)
+			set(M_LIBRARY "-lsunmath ${M_LIBRARY}")
+		endif(HAVE_SUNMATH_LIBRARY)
+	endif(NOT WIN32)
 
-	IF(NOT INET_LIBRARY AND NOT INET_QUIET)
-		MESSAGE("-- Looking for INET library")
-		RESOLVE_LIBRARIES(INET_LIBRARY "-linet")
-		IF(INET_LIBRARY)
-			MESSAGE("-- Found INET library: ${INET_LIBRARY}")
-		ELSE(INET_LIBRARY)
-			MESSAGE("-- Looking for INET library - not found")
-		ENDIF(INET_LIBRARY)
-		SET(INET_QUIET 1 CACHE STRING "INET quiet")
-		MARK_AS_ADVANCED(INET_QUIET)
-	ENDIF(NOT INET_LIBRARY AND NOT INET_QUIET)
-	IF(TCL_LINK_LIBS)
-		SET(TCL_LINK_LIBS "${TCL_LINK_LIBS};${M_LIBRARY};${INET_LIBRARY}")
-	ELSEIF(TCL_LINK_LIBS)
-		SET(TCL_LINK_LIBS "${M_LIBRARY};${INET_LIBRARY}")
-	ENDIF(TCL_LINK_LIBS)
-	MARK_AS_ADVANCED(TCL_LINK_LIBS)
+	if(NOT INET_LIBRARY AND NOT INET_QUIET)
+		message("-- Looking for INET library")
+		resolve_libraries(INET_LIBRARY "-linet")
+		if(INET_LIBRARY)
+			message("-- Found INET library: ${INET_LIBRARY}")
+		else(INET_LIBRARY)
+			message("-- Looking for INET library - not found")
+		endif(INET_LIBRARY)
+		set(INET_QUIET 1 CACHE STRING "INET quiet")
+		mark_as_advanced(INET_QUIET)
+	endif(NOT INET_LIBRARY AND NOT INET_QUIET)
+	if(TCL_LINK_LIBS)
+		set(TCL_LINK_LIBS "${TCL_LINK_LIBS};${M_LIBRARY};${INET_LIBRARY}")
+	elseif(TCL_LINK_LIBS)
+		set(TCL_LINK_LIBS "${M_LIBRARY};${INET_LIBRARY}")
+	endif(TCL_LINK_LIBS)
+	mark_as_advanced(TCL_LINK_LIBS)
 
-	TCL_CHECK_INCLUDE_FILE_USABILITY(net/errno.h NET_ERRNO_H)
-	CHECK_FUNCTION_EXISTS(connect HAVE_CONNECT)
-	IF(NOT HAVE_CONNECT)
-		CHECK_FUNCTION_EXISTS(setsockopt HAVE_SETSOCKOPT)
-		IF(NOT HAVE_SETSOCKOPT)
-			CHECK_LIBRARY_EXISTS(socket connect "" HAVE_SOCKET_LIBRARY)
-			IF(HAVE_SOCKET_LIBRARY)
-				RESOLVE_LIBRARIES(SOCKET_LIBRARY "-lsocket")
-				IF(TCL_LINK_LIBS)
-					SET(TCL_LINK_LIBS ${TCL_LINK_LIBS};${SOCKET_LIBRARY})
-				ELSE(TCL_LINK_LIBS)
-					SET(TCL_LINK_LIBS ${SOCKET_LIBRARY})
-				ENDIF(TCL_LINK_LIBS)
-			ENDIF(HAVE_SOCKET_LIBRARY)
-		ENDIF(NOT HAVE_SETSOCKOPT)
-	ENDIF(NOT HAVE_CONNECT)
-	CHECK_FUNCTION_EXISTS(gethostbyname HAVE_GETHOSTBYNAME)
-	IF(NOT HAVE_GETHOSTBYNAME)
-		CHECK_LIBRARY_EXISTS(nsl gethostbyname "" HAVE_NSL_LIBRARY)
-		IF(HAVE_NSL_LIBRARY)
-			RESOLVE_LIBRARIES(NSL_LIBRARY "-nsl")
-			IF(TCL_LINK_LIBS)
-				SET(TCL_LINK_LIBS ${TCL_LINK_LIBS};${NSL_LIBRARY})
-			ELSE(TCL_LINK_LIBS)
-				SET(TCL_LINK_LIBS ${NSL_LIBRARY})
-			ENDIF(TCL_LINK_LIBS)
-		ENDIF(HAVE_NSL_LIBRARY)
-	ENDIF(NOT HAVE_GETHOSTBYNAME)
+	tcl_check_include_file_usability(net/errno.h NET_ERRNO_H)
+	check_function_exists(connect HAVE_CONNECT)
+	if(NOT HAVE_CONNECT)
+		check_function_exists(setsockopt HAVE_SETSOCKOPT)
+		if(NOT HAVE_SETSOCKOPT)
+			check_library_exists(socket connect "" HAVE_SOCKET_LIBRARY)
+			if(HAVE_SOCKET_LIBRARY)
+				resolve_libraries(SOCKET_LIBRARY "-lsocket")
+				if(TCL_LINK_LIBS)
+					set(TCL_LINK_LIBS ${TCL_LINK_LIBS};${SOCKET_LIBRARY})
+				else(TCL_LINK_LIBS)
+					set(TCL_LINK_LIBS ${SOCKET_LIBRARY})
+				endif(TCL_LINK_LIBS)
+			endif(HAVE_SOCKET_LIBRARY)
+		endif(NOT HAVE_SETSOCKOPT)
+	endif(NOT HAVE_CONNECT)
+	check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
+	if(NOT HAVE_GETHOSTBYNAME)
+		check_library_exists(nsl gethostbyname "" HAVE_NSL_LIBRARY)
+		if(HAVE_NSL_LIBRARY)
+			resolve_libraries(NSL_LIBRARY "-nsl")
+			if(TCL_LINK_LIBS)
+				set(TCL_LINK_LIBS ${TCL_LINK_LIBS};${NSL_LIBRARY})
+			else(TCL_LINK_LIBS)
+				set(TCL_LINK_LIBS ${NSL_LIBRARY})
+			endif(TCL_LINK_LIBS)
+		endif(HAVE_NSL_LIBRARY)
+	endif(NOT HAVE_GETHOSTBYNAME)
 
-ENDMACRO(SC_TCL_LINK_LIBS)
+endmacro(SC_TCL_LINK_LIBS)
 
 #--------------------------------------------------------------------
 # SC_TCL_EARLY_FLAGS
@@ -567,94 +567,94 @@
 #
 # Detect and set up 64-bit compiling here.  LOTS of TODO here
 #--------------------------------------------------------------------
-MACRO(SC_TCL_64BIT_FLAGS)
-	IF(NOT CMAKE_SIZEOF_VOID_P)
-		MESSAGE(WARNING "CMAKE_SIZEOF_VOID_P is not defined - assuming 32-bit platform")
-		SET(CMAKE_SIZEOF_VOID_P 4)
-	ENDIF(NOT CMAKE_SIZEOF_VOID_P)
-	IF(NOT CMAKE_WORD_SIZE)
-		IF(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
-			SET(CMAKE_WORD_SIZE "64BIT")
-		ELSE(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
-			SET(CMAKE_WORD_SIZE "32BIT")
-		ENDIF(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
-	ENDIF(NOT CMAKE_WORD_SIZE)
-	IF(NOT TCL_ENABLE_64BIT)
-		IF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+macro(SC_TCL_64BIT_FLAGS)
+	if(NOT CMAKE_SIZEOF_VOID_P)
+		message(WARNING "CMAKE_SIZEOF_VOID_P is not defined - assuming 32-bit platform")
+		set(CMAKE_SIZEOF_VOID_P 4)
+	endif(NOT CMAKE_SIZEOF_VOID_P)
+	if(NOT CMAKE_WORD_SIZE)
+		if(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
+			set(CMAKE_WORD_SIZE "64BIT")
+		else(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
+			set(CMAKE_WORD_SIZE "32BIT")
+		endif(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
+	endif(NOT CMAKE_WORD_SIZE)
+	if(NOT TCL_ENABLE_64BIT)
+		if(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT "ON" CACHE STRING "Enable 64-bit support")
-		ELSE(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+		else(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT "OFF" CACHE STRING "Enable 64-bit support")
-		ENDIF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
-	ENDIF(NOT TCL_ENABLE_64BIT)
-	IF(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
-		IF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+		endif(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+	endif(NOT TCL_ENABLE_64BIT)
+	if(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
+		if(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT ON CACHE STRING "Enable 64-bit support")
-		ELSE(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+		else(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT OFF CACHE STRING "Enable 64-bit support")
-		ENDIF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
-	ENDIF(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
+		endif(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+	endif(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
 	set(TCL_ENABLE_64BIT ${TCL_ENABLE_64BIT} CACHE STRING "Enable 64-bit support")
-	IF(TCL_ENABLE_64BIT)
-		IF(NOT 64BIT_FLAG)
-			CHECK_C_FLAG("arch x86_64" 64BIT_FLAG)
-			CHECK_C_FLAG(64 64BIT_FLAG)
-			CHECK_C_FLAG("mabi=64" 64BIT_FLAG)
-			CHECK_C_FLAG(m64 64BIT_FLAG)
-			CHECK_C_FLAG(q64 64BIT_FLAG)
-		ENDIF(NOT 64BIT_FLAG)
-		MARK_AS_ADVANCED(64BIT_FLAG)
-		SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${64BIT_FLAG}")
-		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${64BIT_FLAG}")
-		SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${64BIT_FLAG}")
-		SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${64BIT_FLAG}")
+	if(TCL_ENABLE_64BIT)
+		if(NOT 64BIT_FLAG)
+			check_c_flag("arch x86_64" 64BIT_FLAG)
+			check_c_flag(64 64BIT_FLAG)
+			check_c_flag("mabi=64" 64BIT_FLAG)
+			check_c_flag(m64 64BIT_FLAG)
+			check_c_flag(q64 64BIT_FLAG)
+		endif(NOT 64BIT_FLAG)
+		mark_as_advanced(64BIT_FLAG)
+		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${64BIT_FLAG}")
+		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${64BIT_FLAG}")
+		set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${64BIT_FLAG}")
+		set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${64BIT_FLAG}")
 		add_definitions(-DTCL_CFG_DO64BIT=1)
-	ENDIF(TCL_ENABLE_64BIT)
-	IF(CMAKE_CL_64)
+	endif(TCL_ENABLE_64BIT)
+	if(CMAKE_CL_64)
 		add_definitions(-D_stati64=_stat64)
-	ENDIF(CMAKE_CL_64)
-ENDMACRO(SC_TCL_64BIT_FLAGS)
+	endif(CMAKE_CL_64)
+endmacro(SC_TCL_64BIT_FLAGS)
 
 #--------------------------------------------------------------------
 # SC_TCL_CFG_ENCODING   TIP #59
 #--------------------------------------------------------------------
-MACRO(SC_TCL_CFG_ENCODING)
-	IF(NOT TCL_CFGVAL_ENCODING)
-		IF(WIN32)
-			SET(TCL_CFGVAL_ENCODING "cp1252")
-		ELSE(WIN32)
-			SET(TCL_CFGVAL_ENCODING "iso8859-1")
-		ENDIF(WIN32)
-	ENDIF(NOT TCL_CFGVAL_ENCODING)
+macro(SC_TCL_CFG_ENCODING)
+	if(NOT TCL_CFGVAL_ENCODING)
+		if(WIN32)
+			set(TCL_CFGVAL_ENCODING "cp1252")
+		else(WIN32)
+			set(TCL_CFGVAL_ENCODING "iso8859-1")
+		endif(WIN32)
+	endif(NOT TCL_CFGVAL_ENCODING)
 	add_definitions(-DTCL_CFGVAL_ENCODING="${TCL_CFGVAL_ENCODING}")
-ENDMACRO(SC_TCL_CFG_ENCODING)
+endmacro(SC_TCL_CFG_ENCODING)
 
 
 #--------------------------------------------------------------------
 # SC_TCL_CHECK_BROKEN_FUNC
 #--------------------------------------------------------------------
-MACRO(SC_TCL_CHECK_BROKEN_FUNC)
-	CHECK_FUNCTION_EXISTS(${ARGV0} HAVE_${ARGV0})
-	IF(HAVE_${ARGV0})
-		SET(COMPILE_SRC "
+macro(SC_TCL_CHECK_BROKEN_FUNC)
+	check_function_exists(${ARGV0} HAVE_${ARGV0})
+	if(HAVE_${ARGV0})
+		set(COMPILE_SRC "
 		int main() {
 		${ARGV1}
 		}")
-		CHECK_C_SOURCE_RUNS("${COMPILE_SRC}"  WORKING_${ARGV0})
-		IF(NOT WORKING_${ARGV0})
-			SET(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
-		ENDIF(NOT WORKING_${ARGV0})
-	ELSE(HAVE_${ARGV0})
-		SET(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
-	ENDIF(HAVE_${ARGV0})
-ENDMACRO(SC_TCL_CHECK_BROKEN_FUNC)
+		check_c_source_runs("${COMPILE_SRC}"  WORKING_${ARGV0})
+		if(NOT WORKING_${ARGV0})
+			set(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
+		endif(NOT WORKING_${ARGV0})
+	else(HAVE_${ARGV0})
+		set(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
+	endif(HAVE_${ARGV0})
+endmacro(SC_TCL_CHECK_BROKEN_FUNC)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETHOSTBYADDR_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETHOSTBYADDR_R)
-	TCL_CHECK_FUNCTION_EXISTS(gethostbyaddr_r HAVE_GETHOSTBYADDR_R)
-	IF(HAVE_GETHOSTBYADDR_R)
-		SET(HAVE_GETHOSTBYADDR_R_7_SRC "
+macro(SC_TCL_GETHOSTBYADDR_R)
+	tcl_check_function_exists(gethostbyaddr_r HAVE_GETHOSTBYADDR_R)
+	if(HAVE_GETHOSTBYADDR_R)
+		set(HAVE_GETHOSTBYADDR_R_7_SRC "
 #include <netdb.h>
 int main(){
 char *addr;
@@ -668,11 +668,11 @@
 (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &h_errnop);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYADDR_R_7_SRC}"  HAVE_GETHOSTBYADDR_R_7)
-		IF(HAVE_GETHOSTBYADDR_R_7)
-			ADD_TCL_CFLAG(HAVE_GETHOSTBYADDR_R_7)
-		ELSE(HAVE_GETHOSTBYADDR_R_7)
-			SET(HAVE_GETHOSTBYADDR_R_8_SRC "
+		check_c_source_compiles("${HAVE_GETHOSTBYADDR_R_7_SRC}"  HAVE_GETHOSTBYADDR_R_7)
+		if(HAVE_GETHOSTBYADDR_R_7)
+			add_tcl_cflag(HAVE_GETHOSTBYADDR_R_7)
+		else(HAVE_GETHOSTBYADDR_R_7)
+			set(HAVE_GETHOSTBYADDR_R_8_SRC "
 #include <netdb.h>
 int main(){
 char *addr;
@@ -686,21 +686,21 @@
 (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &resultp, &h_errnop);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYADDR_R_8_SRC}" HAVE_GETHOSTBYADDR_R_8)
-			IF(HAVE_GETHOSTBYADDR_R_8)
-			   ADD_TCL_CFLAG(HAVE_GETHOSTBYADDR_R_8)
-			ENDIF(HAVE_GETHOSTBYADDR_R_8)
-		ENDIF(HAVE_GETHOSTBYADDR_R_7)
-	ENDIF(HAVE_GETHOSTBYADDR_R)
-ENDMACRO(SC_TCL_GETHOSTBYADDR_R)
+			check_c_source_compiles("${HAVE_GETHOSTBYADDR_R_8_SRC}" HAVE_GETHOSTBYADDR_R_8)
+			if(HAVE_GETHOSTBYADDR_R_8)
+			   add_tcl_cflag(HAVE_GETHOSTBYADDR_R_8)
+			endif(HAVE_GETHOSTBYADDR_R_8)
+		endif(HAVE_GETHOSTBYADDR_R_7)
+	endif(HAVE_GETHOSTBYADDR_R)
+endmacro(SC_TCL_GETHOSTBYADDR_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETHOSTBYNAME_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETHOSTBYNAME_R)
-	TCL_CHECK_FUNCTION_EXISTS(gethostbyname_r HAVE_GETHOSTBYNAME_R)
-	IF(HAVE_GETHOSTBYNAME_R)
-		SET(HAVE_GETHOSTBYNAME_R_6_SRC "
+macro(SC_TCL_GETHOSTBYNAME_R)
+	tcl_check_function_exists(gethostbyname_r HAVE_GETHOSTBYNAME_R)
+	if(HAVE_GETHOSTBYNAME_R)
+		set(HAVE_GETHOSTBYNAME_R_6_SRC "
 #include <netdb.h>
 int main(){
 char *name;
@@ -712,11 +712,11 @@
 (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYNAME_R_6_SRC}"  HAVE_GETHOSTBYNAME_R_6)
-		IF(HAVE_GETHOSTBYNAME_R_6)
-			ADD_TCL_CFLAG(HAVE_GETHOSTBYNAME_R_6)
-		ELSE(HAVE_GETHOSTBYNAME_R_6)
-			SET(HAVE_GETHOSTBYNAME_R_5_SRC "
+		check_c_source_compiles("${HAVE_GETHOSTBYNAME_R_6_SRC}"  HAVE_GETHOSTBYNAME_R_6)
+		if(HAVE_GETHOSTBYNAME_R_6)
+			add_tcl_cflag(HAVE_GETHOSTBYNAME_R_6)
+		else(HAVE_GETHOSTBYNAME_R_6)
+			set(HAVE_GETHOSTBYNAME_R_5_SRC "
 #include <netdb.h>
 int main(){
 char *name;
@@ -728,12 +728,12 @@
 (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYNAME_R_5_SRC}"  HAVE_GETHOSTBYNAME_R_5)
+			check_c_source_compiles("${HAVE_GETHOSTBYNAME_R_5_SRC}"  HAVE_GETHOSTBYNAME_R_5)
 
-			IF(HAVE_GETHOSTBYNAME_R_5)
-				ADD_TCL_CFLAG(HAVE_GETHOSTBYNAME_R_5)
-			ELSE(HAVE_GETHOSTBYNAME_R_5)
-				SET(HAVE_GETHOSTBYNAME_R_3_SRC "
+			if(HAVE_GETHOSTBYNAME_R_5)
+				add_tcl_cflag(HAVE_GETHOSTBYNAME_R_5)
+			else(HAVE_GETHOSTBYNAME_R_5)
+				set(HAVE_GETHOSTBYNAME_R_3_SRC "
 #include <netdb.h>
 int main(){
 char *name;
@@ -743,22 +743,22 @@
 (void) gethostbyname_r(name, he, &data);
 return 0;}
 				")
-				CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYNAME_R_3_SRC}" HAVE_GETHOSTBYNAME_R_3)
-				IF(HAVE_GETHOSTBYNAME_R_3)
-					ADD_TCL_CFLAG(HAVE_GETHOSTBYNAME_R_3)
-				ENDIF(HAVE_GETHOSTBYNAME_R_3)
-			ENDIF(HAVE_GETHOSTBYNAME_R_5)
-		ENDIF(HAVE_GETHOSTBYNAME_R_6)
-	ENDIF(HAVE_GETHOSTBYNAME_R)
-ENDMACRO(SC_TCL_GETHOSTBYNAME_R)
+				check_c_source_compiles("${HAVE_GETHOSTBYNAME_R_3_SRC}" HAVE_GETHOSTBYNAME_R_3)
+				if(HAVE_GETHOSTBYNAME_R_3)
+					add_tcl_cflag(HAVE_GETHOSTBYNAME_R_3)
+				endif(HAVE_GETHOSTBYNAME_R_3)
+			endif(HAVE_GETHOSTBYNAME_R_5)
+		endif(HAVE_GETHOSTBYNAME_R_6)
+	endif(HAVE_GETHOSTBYNAME_R)
+endmacro(SC_TCL_GETHOSTBYNAME_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_IPV6
 #--------------------------------------------------------------------
-MACRO(SC_TCL_IPV6)
-	CHECK_FUNCTION_EXISTS(getaddrinfo HAVE_GETADDRINFO)
-	IF(HAVE_GETADDRINFO)
-		SET(GETADDRINFO_SRC "
+macro(SC_TCL_IPV6)
+	check_function_exists(getaddrinfo HAVE_GETADDRINFO)
+	if(HAVE_GETADDRINFO)
+		set(GETADDRINFO_SRC "
 #include <netdb.h>
 int main () {
 const char *name, *port;
@@ -768,20 +768,20 @@
 return 0;
 }
 		")
-		CHECK_C_SOURCE_COMPILES("${GETADDRINFO_SRC}" WORKING_GETADDRINFO)
-		IF(WORKING_GETADDRINFO)
-			ADD_TCL_CFLAG(HAVE_GETADDRINFO)
-		ENDIF(WORKING_GETADDRINFO)
-	ENDIF(HAVE_GETADDRINFO)
-ENDMACRO(SC_TCL_IPV6)
+		check_c_source_compiles("${GETADDRINFO_SRC}" WORKING_GETADDRINFO)
+		if(WORKING_GETADDRINFO)
+			add_tcl_cflag(HAVE_GETADDRINFO)
+		endif(WORKING_GETADDRINFO)
+	endif(HAVE_GETADDRINFO)
+endmacro(SC_TCL_IPV6)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETPWUID_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETPWUID_R)
-	TCL_CHECK_FUNCTION_EXISTS(getpwuid_r HAVE_GETPWUID_R)
-	IF(HAVE_GETPWUID_R)
-		SET(HAVE_GETPWUID_R_5_SRC "
+macro(SC_TCL_GETPWUID_R)
+	tcl_check_function_exists(getpwuid_r HAVE_GETPWUID_R)
+	if(HAVE_GETPWUID_R)
+		set(HAVE_GETPWUID_R_5_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -793,11 +793,11 @@
 (void) getpwuid_r(uid, &pw, buf, buflen, &pwp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETPWUID_R_5_SRC}"  HAVE_GETPWUID_R_5)
-		IF(HAVE_GETPWUID_R_5)
-			ADD_TCL_CFLAG(HAVE_GETPWUID_R_5)
-		ELSE(HAVE_GETPWUID_R_5)
-			SET(HAVE_GETPWUID_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETPWUID_R_5_SRC}"  HAVE_GETPWUID_R_5)
+		if(HAVE_GETPWUID_R_5)
+			add_tcl_cflag(HAVE_GETPWUID_R_5)
+		else(HAVE_GETPWUID_R_5)
+			set(HAVE_GETPWUID_R_4_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -809,21 +809,21 @@
 (void) getpwuid_r(uid, &pw, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETPWUID_R_4_SRC}" HAVE_GETPWUID_R_4)
-			IF(HAVE_GETPWUID_R_4)
-				ADD_TCL_CFLAG(HAVE_GETPWUID_R_4)
-			ENDIF(HAVE_GETPWUID_R_4)
-		ENDIF(HAVE_GETPWUID_R_5)
-	ENDIF(HAVE_GETPWUID_R)
-ENDMACRO(SC_TCL_GETPWUID_R)
+			check_c_source_compiles("${HAVE_GETPWUID_R_4_SRC}" HAVE_GETPWUID_R_4)
+			if(HAVE_GETPWUID_R_4)
+				add_tcl_cflag(HAVE_GETPWUID_R_4)
+			endif(HAVE_GETPWUID_R_4)
+		endif(HAVE_GETPWUID_R_5)
+	endif(HAVE_GETPWUID_R)
+endmacro(SC_TCL_GETPWUID_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETPWNAM_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETPWNAM_R)
-	TCL_CHECK_FUNCTION_EXISTS(getpwnam_r HAVE_GETPWNAM_R)
-	IF(HAVE_GETPWNAM_R)
-		SET(HAVE_GETPWNAM_R_5_SRC "
+macro(SC_TCL_GETPWNAM_R)
+	tcl_check_function_exists(getpwnam_r HAVE_GETPWNAM_R)
+	if(HAVE_GETPWNAM_R)
+		set(HAVE_GETPWNAM_R_5_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -835,11 +835,11 @@
 (void) getpwnam_r(name, &pw, buf, buflen, &pwp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETPWNAM_R_5_SRC}"  HAVE_GETPWNAM_R_5)
-		IF(HAVE_GETPWNAM_R_5)
-			ADD_TCL_CFLAG(HAVE_GETPWNAM_R_5)
-		ELSE(HAVE_GETPWNAM_R_5)
-			SET(HAVE_GETPWNAM_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETPWNAM_R_5_SRC}"  HAVE_GETPWNAM_R_5)
+		if(HAVE_GETPWNAM_R_5)
+			add_tcl_cflag(HAVE_GETPWNAM_R_5)
+		else(HAVE_GETPWNAM_R_5)
+			set(HAVE_GETPWNAM_R_4_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -851,21 +851,21 @@
 (void)getpwnam_r(name, &pw, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETPWNAM_R_4_SRC}" HAVE_GETPWNAM_R_4)
-			IF(HAVE_GETPWNAM_R_4)
-			   ADD_TCL_CFLAG(HAVE_GETPWNAM_R_4)
-			ENDIF(HAVE_GETPWNAM_R_4)
-		ENDIF(HAVE_GETPWNAM_R_5)
-	ENDIF(HAVE_GETPWNAM_R)
-ENDMACRO(SC_TCL_GETPWNAM_R)
+			check_c_source_compiles("${HAVE_GETPWNAM_R_4_SRC}" HAVE_GETPWNAM_R_4)
+			if(HAVE_GETPWNAM_R_4)
+			   add_tcl_cflag(HAVE_GETPWNAM_R_4)
+			endif(HAVE_GETPWNAM_R_4)
+		endif(HAVE_GETPWNAM_R_5)
+	endif(HAVE_GETPWNAM_R)
+endmacro(SC_TCL_GETPWNAM_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETGRGID_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETGRGID_R)
-	TCL_CHECK_FUNCTION_EXISTS(getgrgid_r HAVE_GETGRGID_R)
-	IF(HAVE_GETGRGID_R)
-		SET(HAVE_GETGRGID_R_5_SRC "
+macro(SC_TCL_GETGRGID_R)
+	tcl_check_function_exists(getgrgid_r HAVE_GETGRGID_R)
+	if(HAVE_GETGRGID_R)
+		set(HAVE_GETGRGID_R_5_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -877,11 +877,11 @@
 (void) getgrgid_r(gid, &gr, buf, buflen, &grp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETGRGID_R_5_SRC}"  HAVE_GETGRGID_R_5)
-		IF(HAVE_GETGRGID_R_5)
-			ADD_TCL_CFLAG(HAVE_GETGRGID_R_5)
-		ELSE(HAVE_GETGRGID_R_5)
-			SET(HAVE_GETGRGID_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETGRGID_R_5_SRC}"  HAVE_GETGRGID_R_5)
+		if(HAVE_GETGRGID_R_5)
+			add_tcl_cflag(HAVE_GETGRGID_R_5)
+		else(HAVE_GETGRGID_R_5)
+			set(HAVE_GETGRGID_R_4_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -893,21 +893,21 @@
 (void)getgrgid_r(gid, &gr, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETGRGID_R_4_SRC}" HAVE_GETGRGID_R_4)
-			IF(HAVE_GETGRGID_R_4)
-				ADD_TCL_CFLAG(HAVE_GETGRGID_R_4)
-			ENDIF(HAVE_GETGRGID_R_4)
-		ENDIF(HAVE_GETGRGID_R_5)
-	ENDIF(HAVE_GETGRGID_R)
-ENDMACRO(SC_TCL_GETGRGID_R)
+			check_c_source_compiles("${HAVE_GETGRGID_R_4_SRC}" HAVE_GETGRGID_R_4)
+			if(HAVE_GETGRGID_R_4)
+				add_tcl_cflag(HAVE_GETGRGID_R_4)
+			endif(HAVE_GETGRGID_R_4)
+		endif(HAVE_GETGRGID_R_5)
+	endif(HAVE_GETGRGID_R)
+endmacro(SC_TCL_GETGRGID_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETGRNAM_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETGRNAM_R)
-	TCL_CHECK_FUNCTION_EXISTS(getgrnam_r HAVE_GETGRNAM_R)
-	IF(HAVE_GETGRNAM_R)
-		SET(HAVE_GETGRNAM_R_5_SRC "
+macro(SC_TCL_GETGRNAM_R)
+	tcl_check_function_exists(getgrnam_r HAVE_GETGRNAM_R)
+	if(HAVE_GETGRNAM_R)
+		set(HAVE_GETGRNAM_R_5_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -919,11 +919,11 @@
 (void) getgrnam_r(name, &gr, buf, buflen, &grp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETGRNAM_R_5_SRC}"  HAVE_GETGRNAM_R_5)
-		IF(HAVE_GETGRNAM_R_5)
-			ADD_TCL_CFLAG(HAVE_GETGRNAM_R_5)
-		ELSE(HAVE_GETGRNAM_R_5)
-			SET(HAVE_GETGRNAM_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETGRNAM_R_5_SRC}"  HAVE_GETGRNAM_R_5)
+		if(HAVE_GETGRNAM_R_5)
+			add_tcl_cflag(HAVE_GETGRNAM_R_5)
+		else(HAVE_GETGRNAM_R_5)
+			set(HAVE_GETGRNAM_R_4_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -935,19 +935,19 @@
 (void)getgrnam_r(name, &gr, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETGRNAM_R_4_SRC}" HAVE_GETGRNAM_R_4)
-			IF(HAVE_GETGRNAM_R_4)
-			   ADD_TCL_CFLAG(HAVE_GETGRNAM_R_4)
-			ENDIF(HAVE_GETGRNAM_R_4)
-		ENDIF(HAVE_GETGRNAM_R_5)
-	ENDIF(HAVE_GETGRNAM_R)
-ENDMACRO(SC_TCL_GETGRNAM_R)
+			check_c_source_compiles("${HAVE_GETGRNAM_R_4_SRC}" HAVE_GETGRNAM_R_4)
+			if(HAVE_GETGRNAM_R_4)
+			   add_tcl_cflag(HAVE_GETGRNAM_R_4)
+			endif(HAVE_GETGRNAM_R_4)
+		endif(HAVE_GETGRNAM_R_5)
+	endif(HAVE_GETGRNAM_R)
+endmacro(SC_TCL_GETGRNAM_R)
 
 
 
 
-MACRO(CHECK_FD_SET_IN_TYPES_D)
-	SET(TEST_SRC "
+macro(CHECK_FD_SET_IN_TYPES_D)
+	set(TEST_SRC "
 	#include <sys/types.h>
 	int main ()
 	{
@@ -955,16 +955,16 @@
 	return 0;
 	}
 	")
-	CHECK_C_SOURCE_COMPILES("${TEST_SRC}" FD_SET_IN_TYPES_H)
-ENDMACRO(CHECK_FD_SET_IN_TYPES_D)
+	check_c_source_compiles("${TEST_SRC}" FD_SET_IN_TYPES_H)
+endmacro(CHECK_FD_SET_IN_TYPES_D)
 
-MACRO(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
-	SET(TEST_SRC"
+macro(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
+	set(TEST_SRC"
 	#define MODULE_SCOPE extern __attribute__((__visibility__("hidden")))
 	main(){};
 	")
-	CHECK_C_SOURCE_COMPILES("${TEST_SRC}" COMPILER_SUPPORTS_HIDDEN)
-ENDMACRO(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
+	check_c_source_compiles("${TEST_SRC}" COMPILER_SUPPORTS_HIDDEN)
+endmacro(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
 
 
 
Index: src/other/tcl/CMake/CheckPrototypeExists.cmake
===================================================================
--- src/other/tcl/CMake/CheckPrototypeExists.cmake	(revision 54114)
+++ src/other/tcl/CMake/CheckPrototypeExists.cmake	(working copy)
@@ -57,6 +57,6 @@
   return 0;
 }
 ")
-  CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
+  check_cxx_source_compiles("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
 endmacro(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
 
Index: src/other/sqlite3/CMakeLists.txt
===================================================================
--- src/other/sqlite3/CMakeLists.txt	(revision 54114)
+++ src/other/sqlite3/CMakeLists.txt	(working copy)
@@ -20,29 +20,29 @@
 #
 cmake_minimum_required(VERSION 2.8)
 
-PROJECT(sqlite)
+project(sqlite)
 
 find_package(Threads REQUIRED)
-SET(SQLITE_LIBS ${CMAKE_THREAD_LIBS_INIT})
+set(SQLITE_LIBS ${CMAKE_THREAD_LIBS_INIT})
 
 include_directories(
   ${CMAKE_CURRENT_SOURCE_DIR}
   )
 
-IF(NOT LIB_DIR)
-  IF(NOT WIN32)
-    SET(LIB_DIR lib)
-  ELSE(NOT WIN32)
-    SET(LIB_DIR bin)
-  ENDIF(NOT WIN32)
-ENDIF(NOT LIB_DIR)
+if(NOT LIB_DIR)
+  if(NOT WIN32)
+    set(LIB_DIR lib)
+  else(NOT WIN32)
+    set(LIB_DIR bin)
+  endif(NOT WIN32)
+endif(NOT LIB_DIR)
 
 add_definitions(-DBUILD_sqlite)
 
-IF(MSVC)
+if(MSVC)
   add_definitions(-DSQLITE_MAX_TRIGGER_DEPTH=100)
   add_definitions(-DSQLITE_ENABLE_COLUMN_METADATA)
-ENDIF(MSVC)
+endif(MSVC)
 
 add_definitions(-D_REENTRANT=1)
 
@@ -51,17 +51,17 @@
 add_definitions(-DSQLITE_ENABLE_FTS3)
 add_definitions(-DSQLITE_ENABLE_RTREE)
 
-INCLUDE(CheckLibraryExists)
-INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/ResolveCompilerPaths.cmake)
-CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_DL_LIBRARY)
-IF(HAVE_DL_LIBRARY)
-  RESOLVE_LIBRARIES(DL_LIBRARY "-ldl")
-  SET(SQLITE_LIBS ${SQLITE_LIBS} ${DL_LIBRARY})
-ENDIF(HAVE_DL_LIBRARY)
+include(CheckLibraryExists)
+include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/ResolveCompilerPaths.cmake)
+check_library_exists(dl dlopen "" HAVE_DL_LIBRARY)
+if(HAVE_DL_LIBRARY)
+  resolve_libraries(DL_LIBRARY "-ldl")
+  set(SQLITE_LIBS ${SQLITE_LIBS} ${DL_LIBRARY})
+endif(HAVE_DL_LIBRARY)
 
 add_executable(sqlite3 shell.c sqlite3.c)
 target_link_libraries(sqlite3 ${SQLITE_LIBS})
 install(TARGETS sqlite3 DESTINATION bin)
 
 # Tcl bindings
-ADD_SUBDIRECTORY(tcl)
+add_subdirectory(tcl)
Index: src/other/sqlite3/CMake/CheckCSourceRuns.cmake
===================================================================
--- src/other/sqlite3/CMake/CheckCSourceRuns.cmake	(revision 54114)
+++ src/other/sqlite3/CMake/CheckCSourceRuns.cmake	(working copy)
@@ -70,32 +70,32 @@
 # 
 #=============================================================================
 
-MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
-  IF("${VAR}" MATCHES "^${VAR}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS 
+macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
+  if("${VAR}" MATCHES "^${VAR}$")
+    set(MACRO_CHECK_FUNCTION_DEFINITIONS 
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    IF(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
+    if(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
+    else(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    IF(EXISTS "${SOURCE}")
-      SET(CHECK_SRC "${SOURCE}")
-    ELSE(EXISTS "${SOURCE}")
-      FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    if(EXISTS "${SOURCE}")
+      set(CHECK_SRC "${SOURCE}")
+    else(EXISTS "${SOURCE}")
+      file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
         "${SOURCE}\n")
-      SET(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
-    ENDIF(EXISTS "${SOURCE}")
+      set(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
+    endif(EXISTS "${SOURCE}")
     
-    MESSAGE(STATUS "Performing Test ${VAR}")
-    TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
+    message(STATUS "Performing Test ${VAR}")
+    try_run(${VAR}_EXITCODE ${VAR}_COMPILED
       ${CMAKE_BINARY_DIR}
       ${CHECK_SRC}
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -105,33 +105,33 @@
       "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
       COMPILE_OUTPUT_VARIABLE OUTPUT)
     # if it did not compile make the return value fail code of 1
-    IF(NOT ${VAR}_COMPILED)
-      SET(${VAR}_EXITCODE 1)
-    ENDIF(NOT ${VAR}_COMPILED)
+    if(NOT ${VAR}_COMPILED)
+      set(${VAR}_EXITCODE 1)
+    endif(NOT ${VAR}_COMPILED)
     # if the return value was 0 then it worked
-    IF("${${VAR}_EXITCODE}" EQUAL 0)
-      SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
-      MESSAGE(STATUS "Performing Test ${VAR} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+    if("${${VAR}_EXITCODE}" EQUAL 0)
+      set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+      message(STATUS "Performing Test ${VAR} - Success")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
         "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}}\n"
         "Source file was:\n${SOURCE}\n")
-    ELSE("${${VAR}_EXITCODE}" EQUAL 0)
-      IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "${${VAR}_EXITCODE}")
-      ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+    else("${${VAR}_EXITCODE}" EQUAL 0)
+      if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "${${VAR}_EXITCODE}")
+      else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+      endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
 
-      MESSAGE(STATUS "Performing Test ${VAR} - Failed")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      message(STATUS "Performing Test ${VAR} - Failed")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
         "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}_EXITCODE}\n"
         "Source file was:\n${SOURCE}\n")
 
-    ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
-  ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_C_SOURCE_RUNS)
+    endif("${${VAR}_EXITCODE}" EQUAL 0)
+  endif("${VAR}" MATCHES "^${VAR}$")
+endmacro(CHECK_C_SOURCE_RUNS)
 
Index: src/other/sqlite3/tcl/CMakeLists.txt
===================================================================
--- src/other/sqlite3/tcl/CMakeLists.txt	(revision 54114)
+++ src/other/sqlite3/tcl/CMakeLists.txt	(working copy)
@@ -1,5 +1,5 @@
 # Tcl bindings
-SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/CMake")
+set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/CMake")
 include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/tcl.cmake)
 
 # First, get some standard options out of the way - things that are constant
@@ -10,23 +10,23 @@
 add_definitions(-DPACKAGE_BUGREPORT="")
 add_definitions(-DSTDC_HEADERS=1)
 
-TCL_CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
-TCL_CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
-TCL_CHECK_INCLUDE_FILE(sys/fstatfs.h HAVE_SYS_FSTATFS_H)
-IF(NOT HAVE_SYS_FSTATFS_H)
+tcl_check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+tcl_check_include_file(sys/stat.h HAVE_SYS_STAT_H)
+tcl_check_include_file(sys/fstatfs.h HAVE_SYS_FSTATFS_H)
+if(NOT HAVE_SYS_FSTATFS_H)
   add_definitions(-DNO_FSTATFS=1)
-ENDIF(NOT HAVE_SYS_FSTATFS_H)
-TCL_CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
-TCL_CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-TCL_CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
-TCL_CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
-TCL_CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
-TCL_CHECK_INCLUDE_FILE(values.h HAVE_VALUES_H)
-IF(NOT HAVE_VALUES_H)
+endif(NOT HAVE_SYS_FSTATFS_H)
+tcl_check_include_file(memory.h HAVE_MEMORY_H)
+tcl_check_include_file(strings.h HAVE_STRINGS_H)
+tcl_check_include_file(inttypes.h HAVE_INTTYPES_H)
+tcl_check_include_file(stdint.h HAVE_STDINT_H)
+tcl_check_include_file(unistd.h HAVE_UNISTD_H)
+tcl_check_include_file(values.h HAVE_VALUES_H)
+if(NOT HAVE_VALUES_H)
   add_definitions(-DNO_VALUES_H=1)
-ENDIF(NOT HAVE_VALUES_H)
-TCL_CHECK_INCLUDE_FILE(limits.h HAVE_LIMITS_H)
-TCL_CHECK_INCLUDE_FILE(sys/param.h HAVE_SYS_PARAM_H)
+endif(NOT HAVE_VALUES_H)
+tcl_check_include_file(limits.h HAVE_LIMITS_H)
+tcl_check_include_file(sys/param.h HAVE_SYS_PARAM_H)
 
 add_definitions(-DUSE_THREAD_ALLOC=1)
 add_definitions(-D_THREAD_SAFE=1)
@@ -43,4 +43,4 @@
 	LIBRARY DESTINATION ${LIB_DIR}
 	ARCHIVE DESTINATION ${LIB_DIR})
 
-TCL_PKGINDEX(libtclsqlite3 sqlite3 "3.7.8")
+tcl_pkgindex(libtclsqlite3 sqlite3 "3.7.8")
Index: src/other/sqlite3/tcl/CMake/CheckPrototypeExists.cmake
===================================================================
--- src/other/sqlite3/tcl/CMake/CheckPrototypeExists.cmake	(revision 54114)
+++ src/other/sqlite3/tcl/CMake/CheckPrototypeExists.cmake	(working copy)
@@ -57,6 +57,6 @@
   return 0;
 }
 ")
-  CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
+  check_cxx_source_compiles("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
 endmacro(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
 
Index: src/other/sqlite3/tcl/CMake/CheckCSourceRuns.cmake
===================================================================
--- src/other/sqlite3/tcl/CMake/CheckCSourceRuns.cmake	(revision 54114)
+++ src/other/sqlite3/tcl/CMake/CheckCSourceRuns.cmake	(working copy)
@@ -24,32 +24,32 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
-  IF("${VAR}" MATCHES "^${VAR}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS 
+macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
+  if("${VAR}" MATCHES "^${VAR}$")
+    set(MACRO_CHECK_FUNCTION_DEFINITIONS 
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    IF(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
+    if(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
+    else(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    IF(EXISTS ${SOURCE})
-      SET(CHECK_SRC ${SOURCE})
-    ELSE(EXISTS ${SOURCE})
-      FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    if(EXISTS ${SOURCE})
+      set(CHECK_SRC ${SOURCE})
+    else(EXISTS ${SOURCE})
+      file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
         "${SOURCE}\n")
-      SET(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
-    ENDIF(EXISTS ${SOURCE})
+      set(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
+    endif(EXISTS ${SOURCE})
     
-    MESSAGE(STATUS "Performing Test ${VAR}")
-    TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
+    message(STATUS "Performing Test ${VAR}")
+    try_run(${VAR}_EXITCODE ${VAR}_COMPILED
       ${CMAKE_BINARY_DIR}
       ${CHECK_SRC}
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -59,33 +59,33 @@
       "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
       COMPILE_OUTPUT_VARIABLE OUTPUT)
     # if it did not compile make the return value fail code of 1
-    IF(NOT ${VAR}_COMPILED)
-      SET(${VAR}_EXITCODE 1)
-    ENDIF(NOT ${VAR}_COMPILED)
+    if(NOT ${VAR}_COMPILED)
+      set(${VAR}_EXITCODE 1)
+    endif(NOT ${VAR}_COMPILED)
     # if the return value was 0 then it worked
-    IF("${${VAR}_EXITCODE}" EQUAL 0)
-      SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
-      MESSAGE(STATUS "Performing Test ${VAR} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+    if("${${VAR}_EXITCODE}" EQUAL 0)
+      set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+      message(STATUS "Performing Test ${VAR} - Success")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
         "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}}\n"
         "Source file was:\n${SOURCE}\n")
-    ELSE("${${VAR}_EXITCODE}" EQUAL 0)
-      IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "${${VAR}_EXITCODE}")
-      ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+    else("${${VAR}_EXITCODE}" EQUAL 0)
+      if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "${${VAR}_EXITCODE}")
+      else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+      endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
 
-      MESSAGE(STATUS "Performing Test ${VAR} - Failed")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      message(STATUS "Performing Test ${VAR} - Failed")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
         "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}_EXITCODE}\n"
         "Source file was:\n${SOURCE}\n")
 
-    ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
-  ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_C_SOURCE_RUNS)
+    endif("${${VAR}_EXITCODE}" EQUAL 0)
+  endif("${VAR}" MATCHES "^${VAR}$")
+endmacro(CHECK_C_SOURCE_RUNS)
 
Index: src/other/sqlite3/tcl/CMake/ac_std_funcs.cmake
===================================================================
--- src/other/sqlite3/tcl/CMake/ac_std_funcs.cmake	(revision 54114)
+++ src/other/sqlite3/tcl/CMake/ac_std_funcs.cmake	(working copy)
@@ -1,97 +1,97 @@
 # Standard tests and wrappers for CMake functions
 
-INCLUDE(CheckCCompilerFlag)
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckIncludeFileCXX)
-INCLUDE(CheckTypeSize)
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckStructHasMember)
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(ResolveCompilerPaths)
+include(CheckCCompilerFlag)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckTypeSize)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(ResolveCompilerPaths)
 
-SET(CMAKE_TEST_SRCS_DIR "NOTFOUND")
-FOREACH($candidate_dir ${CMAKE_MODULE_PATH})
-	IF(NOT CMAKE_TEST_SRCS_DIR)
-		IF(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
-			SET(CMAKE_TEST_SRCS_DIR ${candidate_dir}/test_sources)
-		ENDIF(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
-	ENDIF(NOT CMAKE_TEST_SRCS_DIR)
-ENDFOREACH($candidate_dir ${CMAKE_MODULE_PATH})
+set(CMAKE_TEST_SRCS_DIR "NOTFOUND")
+foreach($candidate_dir ${CMAKE_MODULE_PATH})
+	if(NOT CMAKE_TEST_SRCS_DIR)
+		if(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
+			set(CMAKE_TEST_SRCS_DIR ${candidate_dir}/test_sources)
+		endif(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
+	endif(NOT CMAKE_TEST_SRCS_DIR)
+endforeach($candidate_dir ${CMAKE_MODULE_PATH})
 
-INCLUDE(CheckPrototypeExists)
-INCLUDE(CheckCSourceRuns)
-INCLUDE(CheckCSourceRuns)
+include(CheckPrototypeExists)
+include(CheckCSourceRuns)
+include(CheckCSourceRuns)
 
-MACRO(CHECK_BASENAME_D)
-	SET(BASENAME_SRC "
+macro(CHECK_BASENAME_D)
+	set(BASENAME_SRC "
 	#include <libgen.h>
 	int main(int argc, char *argv[]) {
 	(void)basename(argv[0]);
 	return 0;
 	}")
-	CHECK_C_SOURCE_RUNS("${BASENAME_SRC}" HAVE_BASENAME)
-	IF(HAVE_BASENAME)
+	check_c_source_runs("${BASENAME_SRC}" HAVE_BASENAME)
+	if(HAVE_BASENAME)
 	  add_definitions(-DHAVE_BASENAME=1)
-	ENDIF(HAVE_BASENAME)
-ENDMACRO(CHECK_BASENAME_D)
+	endif(HAVE_BASENAME)
+endmacro(CHECK_BASENAME_D)
 
-MACRO(CHECK_DIRNAME_D)
-	SET(DIRNAME_SRC "
+macro(CHECK_DIRNAME_D)
+	set(DIRNAME_SRC "
 	#include <libgen.h>
 	int main(int argc, char *argv[]) {
 	(void)dirname(argv[0]);
 	return 0;
 	}")
-	CHECK_C_SOURCE_RUNS("${DIRNAME_SRC}" HAVE_DIRNAME)
-	IF(HAVE_DIRNAME)
+	check_c_source_runs("${DIRNAME_SRC}" HAVE_DIRNAME)
+	if(HAVE_DIRNAME)
 		add_definitions(-DHAVE_DIRNAME=1)
-	ENDIF(HAVE_DIRNAME)
-ENDMACRO(CHECK_DIRNAME_D)
+	endif(HAVE_DIRNAME)
+endmacro(CHECK_DIRNAME_D)
 
 # Based on AC_HEADER_STDC - using the source code for ctype
 # checking found in the generated configure file
-MACRO(CMAKE_HEADER_STDC_D)
-  CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-  IF(HAVE_STDLIB_H)
+macro(CMAKE_HEADER_STDC_D)
+  check_include_file(stdlib.h HAVE_STDLIB_H)
+  if(HAVE_STDLIB_H)
   add_definitions(-DHAVE_STDLIB_H=1)
-  ENDIF(HAVE_STDLIB_H)
-  CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
-  CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-  IF(HAVE_STRING_H)
+  endif(HAVE_STDLIB_H)
+  check_include_file(stdarg.h HAVE_STDARG_H)
+  check_include_file(string.h HAVE_STRING_H)
+  if(HAVE_STRING_H)
   add_definitions(-DHAVE_STRING_H=1)
-  ENDIF(HAVE_STRING_H)
-  CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-  IF(HAVE_STRINGS_H)
+  endif(HAVE_STRING_H)
+  check_include_file(strings.h HAVE_STRINGS_H)
+  if(HAVE_STRINGS_H)
   add_definitions(-DHAVE_STRINGS_H=1)
-  ENDIF(HAVE_STRINGS_H)
-  CHECK_INCLUDE_FILE(float.h HAVE_FLOAT_H)
-  CHECK_PROTOTYPE_EXISTS(memchr string.h HAVE_STRING_H_MEMCHR)
-  CHECK_PROTOTYPE_EXISTS(free stdlib.h HAVE_STDLIB_H_FREE)
-  CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/ctypes_test.c WORKING_CTYPE_MACROS)
-  IF(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
+  endif(HAVE_STRINGS_H)
+  check_include_file(float.h HAVE_FLOAT_H)
+  check_prototype_exists(memchr string.h HAVE_STRING_H_MEMCHR)
+  check_prototype_exists(free stdlib.h HAVE_STDLIB_H_FREE)
+  check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/ctypes_test.c WORKING_CTYPE_MACROS)
+  if(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
 	 add_definitions(-DSTDC_HEADERS=1)
-  ENDIF(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
-ENDMACRO(CMAKE_HEADER_STDC_D)
+  endif(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
+endmacro(CMAKE_HEADER_STDC_D)
 
 # Based on AC_HEADER_SYS_WAIT
-MACRO(CMAKE_HEADER_SYS_WAIT_D)
-  CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/sys_wait_test.c WORKING_SYS_WAIT)
-  IF(WORKING_SYS_WAIT)
+macro(CMAKE_HEADER_SYS_WAIT_D)
+  check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/sys_wait_test.c WORKING_SYS_WAIT)
+  if(WORKING_SYS_WAIT)
 	 add_definitions(-DHAVE_SYS_WAIT_H=1)
-  ENDIF(WORKING_SYS_WAIT)
-ENDMACRO(CMAKE_HEADER_SYS_WAIT_D)
+  endif(WORKING_SYS_WAIT)
+endmacro(CMAKE_HEADER_SYS_WAIT_D)
 
 # Based on AC_FUNC_ALLOCA
-MACRO(CMAKE_ALLOCA_D)
-	CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/alloca_header_test.c WORKING_ALLOCA_H)
-	IF(WORKING_ALLOCA_H)
+macro(CMAKE_ALLOCA_D)
+	check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/alloca_header_test.c WORKING_ALLOCA_H)
+	if(WORKING_ALLOCA_H)
 		add_definitions(-DHAVE_ALLOCA_H=1)
-	ENDIF(WORKING_ALLOCA_H)
-	CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/alloca_test.c WORKING_ALLOCA)
-	IF(WORKING_ALLOCA)
+	endif(WORKING_ALLOCA_H)
+	check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/alloca_test.c WORKING_ALLOCA)
+	if(WORKING_ALLOCA)
 		add_definitions(-DHAVE_ALLOCA=1)
-	ENDIF(WORKING_ALLOCA)
-ENDMACRO(CMAKE_ALLOCA_D)
+	endif(WORKING_ALLOCA)
+endmacro(CMAKE_ALLOCA_D)
 
Index: src/other/sqlite3/tcl/CMake/tcl.cmake
===================================================================
--- src/other/sqlite3/tcl/CMake/tcl.cmake	(revision 54114)
+++ src/other/sqlite3/tcl/CMake/tcl.cmake	(working copy)
@@ -1,99 +1,99 @@
 # CMake version of the tcl.m4 logic, insofar as it maps to CMake and has been
 # needed.
 
-INCLUDE(CheckCCompilerFlag)
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckIncludeFileCXX)
-INCLUDE(CheckTypeSize)
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckStructHasMember)
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(ResolveCompilerPaths)
-INCLUDE(CheckPrototypeExists)
-INCLUDE(CheckCSourceRuns)
-INCLUDE(CheckCSourceRuns)
+include(CheckCCompilerFlag)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckTypeSize)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(ResolveCompilerPaths)
+include(CheckPrototypeExists)
+include(CheckCSourceRuns)
+include(CheckCSourceRuns)
 
-INCLUDE(ac_std_funcs)
+include(ac_std_funcs)
 
-MACRO(ADD_TCL_CFLAG TCL_CFLAG)
+macro(ADD_TCL_CFLAG TCL_CFLAG)
 	add_definitions(-D${TCL_CFLAG}=1)
-ENDMACRO(ADD_TCL_CFLAG)
+endmacro(ADD_TCL_CFLAG)
 
-MACRO(CHECK_C_FLAG flag)
-   STRING(TOUPPER ${flag} UPPER_FLAG)
-   STRING(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
-   STRING(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
-   IF(${ARGC} LESS 2)
-      CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-   ELSE(${ARGC} LESS 2)
-      IF(NOT ${ARGV1})
-         CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-         IF(${UPPER_FLAG}_COMPILER_FLAG)
-            MESSAGE("- Found ${ARGV1} - setting to -${flag}")
-            SET(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
-         ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-      ENDIF(NOT ${ARGV1})
-   ENDIF(${ARGC} LESS 2)
-   IF(${UPPER_FLAG}_COMPILER_FLAG)
-      SET(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
-   ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-ENDMACRO()
+macro(CHECK_C_FLAG flag)
+   string(TOUPPER ${flag} UPPER_FLAG)
+   string(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
+   string(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
+   if(${ARGC} LESS 2)
+      check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+   else(${ARGC} LESS 2)
+      if(NOT ${ARGV1})
+         check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+         if(${UPPER_FLAG}_COMPILER_FLAG)
+            message("- Found ${ARGV1} - setting to -${flag}")
+            set(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
+         endif(${UPPER_FLAG}_COMPILER_FLAG)
+      endif(NOT ${ARGV1})
+   endif(${ARGC} LESS 2)
+   if(${UPPER_FLAG}_COMPILER_FLAG)
+      set(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
+   endif(${UPPER_FLAG}_COMPILER_FLAG)
+endmacro()
 
 # Wrappers for include file checks
-MACRO(TCL_CHECK_INCLUDE_FILE filename var)
-	CHECK_INCLUDE_FILE(${filename} ${var})
-	IF(${var})
+macro(TCL_CHECK_INCLUDE_FILE filename var)
+	check_include_file(${filename} ${var})
+	if(${var})
 		add_definitions(-D${var}=1)
-	ENDIF(${var})
-ENDMACRO(TCL_CHECK_INCLUDE_FILE)
+	endif(${var})
+endmacro(TCL_CHECK_INCLUDE_FILE)
 
-MACRO(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
-	CHECK_INCLUDE_FILE(${filename} HAVE_${var})
-	IF(HAVE_${var})
-		SET(HEADER_SRC "
+macro(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
+	check_include_file(${filename} HAVE_${var})
+	if(HAVE_${var})
+		set(HEADER_SRC "
 #include <${filename}>
 main(){};
 		")
-		CHECK_C_SOURCE_COMPILES("${HEADER_SRC}" ${var}_USABLE)
-	ENDIF(HAVE_${var})
-	IF(NOT HAVE_${var} OR NOT ${var}_USABLE)
+		check_c_source_compiles("${HEADER_SRC}" ${var}_USABLE)
+	endif(HAVE_${var})
+	if(NOT HAVE_${var} OR NOT ${var}_USABLE)
 		add_definitions(-DNO_${var}=1)
-	ELSE(NOT HAVE_${var} OR NOT ${var}_USABLE)
+	else(NOT HAVE_${var} OR NOT ${var}_USABLE)
 		add_definitions(-DHAVE_${var}=1)
-	ENDIF(NOT HAVE_${var} OR NOT ${var}_USABLE)
-ENDMACRO(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
+	endif(NOT HAVE_${var} OR NOT ${var}_USABLE)
+endmacro(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
 
 # Wrapper for function testing
-MACRO(TCL_CHECK_FUNCTION_EXISTS function var)
-	CHECK_FUNCTION_EXISTS(${function} ${var})
-	IF(${var})
+macro(TCL_CHECK_FUNCTION_EXISTS function var)
+	check_function_exists(${function} ${var})
+	if(${var})
 		add_definitions(-D${var}=1)
-	ENDIF(${var})
-ENDMACRO(TCL_CHECK_FUNCTION_EXISTS)
+	endif(${var})
+endmacro(TCL_CHECK_FUNCTION_EXISTS)
 
 # Check sizes (accepts extra headers)
-MACRO(TCL_CHECK_TYPE_SIZE typename var)
-   FOREACH(arg ${ARGN})
-      SET(headers ${headers} ${arg})
-   ENDFOREACH(arg ${ARGN})
-   SET(CHECK_EXTRA_INCLUDE_FILES ${headers})
-   CHECK_TYPE_SIZE(${typename} HAVE_${var}_T)
-   SET(CHECK_EXTRA_INCLUDE_FILES)
-   IF(HAVE_${var}_T)
+macro(TCL_CHECK_TYPE_SIZE typename var)
+   foreach(arg ${ARGN})
+      set(headers ${headers} ${arg})
+   endforeach(arg ${ARGN})
+   set(CHECK_EXTRA_INCLUDE_FILES ${headers})
+   check_type_size(${typename} HAVE_${var}_T)
+   set(CHECK_EXTRA_INCLUDE_FILES)
+   if(HAVE_${var}_T)
       add_definitions(-DHAVE_${var}_T=1)
       add_definitions(-DSIZEOF${var}=${HAVE_${var}_T})
-   ENDIF(HAVE_${var}_T)
-ENDMACRO(TCL_CHECK_TYPE_SIZE)
+   endif(HAVE_${var}_T)
+endmacro(TCL_CHECK_TYPE_SIZE)
 
 # Check for a member of a structure
-MACRO(TCL_CHECK_STRUCT_HAS_MEMBER structname member header var)
-   CHECK_STRUCT_HAS_MEMBER(${structname} ${member} ${header} HAVE_${var})
-   IF(HAVE_${var})
+macro(TCL_CHECK_STRUCT_HAS_MEMBER structname member header var)
+   check_struct_has_member(${structname} ${member} ${header} HAVE_${var})
+   if(HAVE_${var})
       add_definitions(-DHAVE_${var}=1)
-   ENDIF(HAVE_${var})
-ENDMACRO(TCL_CHECK_STRUCT_HAS_MEMBER)
+   endif(HAVE_${var})
+endmacro(TCL_CHECK_STRUCT_HAS_MEMBER)
 
 
 
@@ -153,42 +153,42 @@
 #------------------------------------------------------------------------
 # SC_ENABLE_THREADS
 #------------------------------------------------------------------------
-MACRO(SC_ENABLE_THREADS)
-   FIND_PACKAGE(Threads)
-   IF(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
-		SET(TCL_FOUND_THREADS ON)
-   ELSE(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
-		SET(TCL_FOUND_THREADS OFF)
-   ENDIF(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
-	OPTION(TCL_THREADS "Enable Tcl Thread support" ${TCL_FOUND_THREADS})
-   IF(TCL_THREADS)
-		ADD_TCL_CFLAG(TCL_THREADS)
-		ADD_TCL_CFLAG(USE_THREAD_ALLOC)
-		ADD_TCL_CFLAG(_REENTRANT)
-		ADD_TCL_CFLAG(_THREAD_SAFE)
-	   SET(TCL_THREADS_LIB ${CMAKE_THREAD_LIBS_INIT})
-		IF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
-			ADD_TCL_CFLAG(_POSIX_PTHREAD_SEMANTICS)
-		ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
-		CHECK_FUNCTION_EXISTS(pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-		IF(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-			ADD_TCL_CFLAG(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-		ENDIF(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-		CHECK_FUNCTION_EXISTS(pthread_attr_get_np HAVE_PTHREAD_ATTR_GET_NP)
-		CHECK_FUNCTION_EXISTS(pthread_getattr_np HAVE_PTHREAD_GETATTR_NP)
-		IF(HAVE_PTHREAD_ATTR_GET_NP)
-			ADD_TCL_CFLAG(HAVE_PTHREAD_ATTR_GET_NP)
-		ELSEIF(HAVE_PTHREAD_GETATTR_NP)
-			ADD_TCL_CFLAG(HAVE_PTHREAD_GETATTR_NP)
-		ENDIF(HAVE_PTHREAD_ATTR_GET_NP)
-		IF(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
-			CHECK_FUNCTION_EXISTS(pthread_get_stacksize_np HAVE_PTHREAD_GET_STACKSIZE_NP)
-			IF(HAVE_PTHREAD_GET_STACKSIZE_NP)
-				ADD_TCL_CFLAG(HAVE_PTHREAD_GET_STACKSIZE_NP)
-			ENDIF(HAVE_PTHREAD_GET_STACKSIZE_NP)
-		ENDIF(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
-	ENDIF(TCL_THREADS)
-ENDMACRO(SC_ENABLE_THREADS)
+macro(SC_ENABLE_THREADS)
+   find_package(Threads)
+   if(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
+		set(TCL_FOUND_THREADS ON)
+   else(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
+		set(TCL_FOUND_THREADS OFF)
+   endif(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
+	option(TCL_THREADS "Enable Tcl Thread support" ${TCL_FOUND_THREADS})
+   if(TCL_THREADS)
+		add_tcl_cflag(TCL_THREADS)
+		add_tcl_cflag(USE_THREAD_ALLOC)
+		add_tcl_cflag(_REENTRANT)
+		add_tcl_cflag(_THREAD_SAFE)
+	   set(TCL_THREADS_LIB ${CMAKE_THREAD_LIBS_INIT})
+		if(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+			add_tcl_cflag(_POSIX_PTHREAD_SEMANTICS)
+		endif(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+		check_function_exists(pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+		if(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+			add_tcl_cflag(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+		endif(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+		check_function_exists(pthread_attr_get_np HAVE_PTHREAD_ATTR_GET_NP)
+		check_function_exists(pthread_getattr_np HAVE_PTHREAD_GETATTR_NP)
+		if(HAVE_PTHREAD_ATTR_GET_NP)
+			add_tcl_cflag(HAVE_PTHREAD_ATTR_GET_NP)
+		elseif(HAVE_PTHREAD_GETATTR_NP)
+			add_tcl_cflag(HAVE_PTHREAD_GETATTR_NP)
+		endif(HAVE_PTHREAD_ATTR_GET_NP)
+		if(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
+			check_function_exists(pthread_get_stacksize_np HAVE_PTHREAD_GET_STACKSIZE_NP)
+			if(HAVE_PTHREAD_GET_STACKSIZE_NP)
+				add_tcl_cflag(HAVE_PTHREAD_GET_STACKSIZE_NP)
+			endif(HAVE_PTHREAD_GET_STACKSIZE_NP)
+		endif(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
+	endif(TCL_THREADS)
+endmacro(SC_ENABLE_THREADS)
 
 #------------------------------------------------------------------------
 # SC_ENABLE_SYMBOLS
@@ -199,28 +199,28 @@
 #------------------------------------------------------------------------
 # SC_ENABLE_LANGINFO
 #------------------------------------------------------------------------
-MACRO(SC_ENABLE_LANGINFO)
+macro(SC_ENABLE_LANGINFO)
 	set(TCL_ENABLE_LANGINFO ON CACHE STRING "Trigger use of nl_langinfo if available.")
-	IF(TCL_ENABLE_LANGINFO)
-		CHECK_INCLUDE_FILE(langinfo.h HAVE_LANGINFO)
-		IF(HAVE_LANGINFO)
-			SET(LANGINFO_SRC "
+	if(TCL_ENABLE_LANGINFO)
+		check_include_file(langinfo.h HAVE_LANGINFO)
+		if(HAVE_LANGINFO)
+			set(LANGINFO_SRC "
 			#include <langinfo.h>
 			int main() {
 			nl_langinfo(CODESET);
 			}
 			")
-			CHECK_C_SOURCE_COMPILES("${LANGINFO_SRC}" LANGINFO_COMPILES)
-			IF(LANGINFO_COMPILES)
-				ADD_TCL_CFLAG(HAVE_LANGINFO)
-			ELSE(LANGINFO_COMPILES)
-				SET(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
-			ENDIF(LANGINFO_COMPILES)
-		ELSE(HAVE_LANGINFO)
-			SET(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
-		ENDIF(HAVE_LANGINFO)
-	ENDIF(TCL_ENABLE_LANGINFO)
-ENDMACRO(SC_ENABLE_LANGINFO)
+			check_c_source_compiles("${LANGINFO_SRC}" LANGINFO_COMPILES)
+			if(LANGINFO_COMPILES)
+				add_tcl_cflag(HAVE_LANGINFO)
+			else(LANGINFO_COMPILES)
+				set(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
+			endif(LANGINFO_COMPILES)
+		else(HAVE_LANGINFO)
+			set(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
+		endif(HAVE_LANGINFO)
+	endif(TCL_ENABLE_LANGINFO)
+endmacro(SC_ENABLE_LANGINFO)
 
 #--------------------------------------------------------------------
 # SC_CONFIG_MANPAGES
@@ -245,8 +245,8 @@
 #--------------------------------------------------------------------
 # SC_SERIAL_PORT
 #--------------------------------------------------------------------
-MACRO(SC_SERIAL_PORT)
-	SET(TERMIOS_SRC_1 "
+macro(SC_SERIAL_PORT)
+	set(TERMIOS_SRC_1 "
 #include <termios.h>
 int main() {
 struct termios t;
@@ -258,7 +258,7 @@
 	return 1;
 }
 	")
-	SET(TERMIOS_SRC_2 "
+	set(TERMIOS_SRC_2 "
 #include <termios.h>
 #include <errno.h>
 
@@ -273,7 +273,7 @@
 	return 1;
 }
 	")
-	SET(TERMIO_SRC_1 "
+	set(TERMIO_SRC_1 "
 #include <termio.h>
 int main() {
 struct termio t;
@@ -284,7 +284,7 @@
 	return 1;
 }
    ")
-	SET(TERMIO_SRC_2 "
+	set(TERMIO_SRC_2 "
 #include <termio.h>
 #include <errno.h>
 
@@ -298,7 +298,7 @@
 	return 1;
 }
 	")
-	SET(SGTTY_SRC_1 "
+	set(SGTTY_SRC_1 "
 #include <sgtty.h>
 int main() {
 struct sgttyb t;
@@ -310,7 +310,7 @@
 	return 1;
 }
    ")
-	SET(SGTTY_SRC_2 "
+	set(SGTTY_SRC_2 "
 #include <sgtty.h>
 #include <errno.h>
 
@@ -325,57 +325,57 @@
 	return 1;
 }
 	")
-	CHECK_C_SOURCE_RUNS("${TERMIOS_SRC_1}" HAVE_TERMIOS)
-	IF(NOT HAVE_TERMIOS)
-		CHECK_C_SOURCE_RUNS("${TERMIO_SRC_1}" HAVE_TERMIO)
-	ENDIF(NOT HAVE_TERMIOS)
-	IF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-		CHECK_C_SOURCE_RUNS("${SGTTY_SRC_1}" HAVE_SGTTY)
-	ENDIF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-	IF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
-		CHECK_C_SOURCE_RUNS("${TERMIOS_SRC_2}" HAVE_TERMIOS)
-		IF(NOT HAVE_TERMIOS)
-			CHECK_C_SOURCE_RUNS("${TERMIO_SRC_2}" HAVE_TERMIO)
-		ENDIF(NOT HAVE_TERMIOS)
-		IF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-			CHECK_C_SOURCE_RUNS("${SGTTY_SRC_2}" HAVE_SGTTY)
-		ENDIF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-	ENDIF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
+	check_c_source_runs("${TERMIOS_SRC_1}" HAVE_TERMIOS)
+	if(NOT HAVE_TERMIOS)
+		check_c_source_runs("${TERMIO_SRC_1}" HAVE_TERMIO)
+	endif(NOT HAVE_TERMIOS)
+	if(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+		check_c_source_runs("${SGTTY_SRC_1}" HAVE_SGTTY)
+	endif(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+	if(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
+		check_c_source_runs("${TERMIOS_SRC_2}" HAVE_TERMIOS)
+		if(NOT HAVE_TERMIOS)
+			check_c_source_runs("${TERMIO_SRC_2}" HAVE_TERMIO)
+		endif(NOT HAVE_TERMIOS)
+		if(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+			check_c_source_runs("${SGTTY_SRC_2}" HAVE_SGTTY)
+		endif(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+	endif(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
 
-	IF(HAVE_TERMIOS)
-		ADD_TCL_CFLAG(USE_TERMIOS)
-	ELSE(HAVE_TERMIOS)
-		IF(HAVE_TERMIO)
-		   ADD_TCL_CFLAG(USE_TERMIO)
-		ELSE(HAVE_TERMIO)
-			IF(HAVE_SGTTY)
-				ADD_TCL_CFLAG(USE_SGTTY)
-			ENDIF(HAVE_SGTTY)
-		ENDIF(HAVE_TERMIO)
-	ENDIF(HAVE_TERMIOS)
-ENDMACRO(SC_SERIAL_PORT)
+	if(HAVE_TERMIOS)
+		add_tcl_cflag(USE_TERMIOS)
+	else(HAVE_TERMIOS)
+		if(HAVE_TERMIO)
+		   add_tcl_cflag(USE_TERMIO)
+		else(HAVE_TERMIO)
+			if(HAVE_SGTTY)
+				add_tcl_cflag(USE_SGTTY)
+			endif(HAVE_SGTTY)
+		endif(HAVE_TERMIO)
+	endif(HAVE_TERMIOS)
+endmacro(SC_SERIAL_PORT)
 
 
 #--------------------------------------------------------------------
 # SC_MISSING_POSIX_HEADERS
 #--------------------------------------------------------------------
-MACRO(SC_MISSING_POSIX_HEADERS)
-	TCL_CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
-	IF(NOT HAVE_DIRENT_H)
+macro(SC_MISSING_POSIX_HEADERS)
+	tcl_check_include_file(dirent.h HAVE_DIRENT_H)
+	if(NOT HAVE_DIRENT_H)
 		add_definitions(-DNO_DIRENT_H=1)
-	ENDIF(NOT HAVE_DIRENT_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(float.h FLOAT_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(values.h VALUES_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(limits.h LIMITS_H)
-	TCL_CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-	TCL_CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-	IF(NOT HAVE_STRING_H)
+	endif(NOT HAVE_DIRENT_H)
+	tcl_check_include_file_usability(float.h FLOAT_H)
+	tcl_check_include_file_usability(values.h VALUES_H)
+	tcl_check_include_file_usability(limits.h LIMITS_H)
+	tcl_check_include_file(stdlib.h HAVE_STDLIB_H)
+	tcl_check_include_file(string.h HAVE_STRING_H)
+	if(NOT HAVE_STRING_H)
 		add_definitions(-DNO_STRING_H=1)
-	ENDIF(NOT HAVE_STRING_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(sys/wait.h SYS_WAIT_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(dlfcn.h DLFCN_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(sys/param.h SYS_PARAM_H)
-ENDMACRO(SC_MISSING_POSIX_HEADERS)
+	endif(NOT HAVE_STRING_H)
+	tcl_check_include_file_usability(sys/wait.h SYS_WAIT_H)
+	tcl_check_include_file_usability(dlfcn.h DLFCN_H)
+	tcl_check_include_file_usability(sys/param.h SYS_PARAM_H)
+endmacro(SC_MISSING_POSIX_HEADERS)
 
 
 #--------------------------------------------------------------------
@@ -387,17 +387,17 @@
 #--------------------------------------------------------------------
 # SC_BLOCKING_STYLE
 #--------------------------------------------------------------------
-TCL_CHECK_INCLUDE_FILE(sys/ioctl.h HAVE_SYS_IOCTL_H) 
-TCL_CHECK_INCLUDE_FILE(sys/filio.h HAVE_SYS_FILIO_H)
-IF(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
-	ADD_TCL_CFLAG(USE_FIONBIO)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
-IF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
-	STRING(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
-	IF (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
-		ADD_TCL_CFLAG(USE_FIONBIO)
-	ENDIF (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+tcl_check_include_file(sys/ioctl.h HAVE_SYS_IOCTL_H) 
+tcl_check_include_file(sys/filio.h HAVE_SYS_FILIO_H)
+if(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
+	add_tcl_cflag(USE_FIONBIO)
+endif(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
+if(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+	string(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
+	if (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
+		add_tcl_cflag(USE_FIONBIO)
+	endif (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
+endif(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
 
 #--------------------------------------------------------------------
 # SC_TIME_HANLDER
@@ -408,13 +408,13 @@
 # TODO - tzname testing from AC_STRUCT_TIMEZONE is incomplete
 #
 #--------------------------------------------------------------------
-MACRO(SC_TIME_HANDLER)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(sys/time.h SYS_TIME_H)
-	TCL_CHECK_STRUCT_HAS_MEMBER("struct tm" tm_zone time.h STRUCT_TM_TM_ZONE)
-	IF(HAVE_STRUCT_TM_TM_ZONE)
-		ADD_TCL_CFLAG(HAVE_TM_ZONE)
-	ELSE(HAVE_STRUCT_TM_TM_ZONE)
-		SET(TZNAME_SRC "
+macro(SC_TIME_HANDLER)
+	tcl_check_include_file_usability(sys/time.h SYS_TIME_H)
+	tcl_check_struct_has_member("struct tm" tm_zone time.h STRUCT_TM_TM_ZONE)
+	if(HAVE_STRUCT_TM_TM_ZONE)
+		add_tcl_cflag(HAVE_TM_ZONE)
+	else(HAVE_STRUCT_TM_TM_ZONE)
+		set(TZNAME_SRC "
 #include <time.h>
 int main () {
 #ifndef tzname
@@ -422,17 +422,17 @@
 #endif
 return 0;
 }")
-      CHECK_C_SOURCE_COMPILES("${TZNAME_SRC}" HAVE_TZNAME)
-		IF(HAVE_TZNAME)
-			ADD_TCL_CFLAG(HAVE_DECL_TZNAME)
-		ENDIF(HAVE_TZNAME)
-	ENDIF(HAVE_STRUCT_TM_TM_ZONE)
-	TCL_CHECK_FUNCTION_EXISTS(gmtime_r HAVE_GMTIME_R)
-	TCL_CHECK_FUNCTION_EXISTS(localtime_r HAVE_LOCALTIME_R)
-	TCL_CHECK_FUNCTION_EXISTS(mktime HAVE_MKTIME)
-	TCL_CHECK_STRUCT_HAS_MEMBER("struct tm" tm_tzadj time.h TM_TZADJ)
-	TCL_CHECK_STRUCT_HAS_MEMBER("struct tm" tm_gmtoff time.h TM_GMTOFF)
-	SET(TZONE_SRC_1 "
+      check_c_source_compiles("${TZNAME_SRC}" HAVE_TZNAME)
+		if(HAVE_TZNAME)
+			add_tcl_cflag(HAVE_DECL_TZNAME)
+		endif(HAVE_TZNAME)
+	endif(HAVE_STRUCT_TM_TM_ZONE)
+	tcl_check_function_exists(gmtime_r HAVE_GMTIME_R)
+	tcl_check_function_exists(localtime_r HAVE_LOCALTIME_R)
+	tcl_check_function_exists(mktime HAVE_MKTIME)
+	tcl_check_struct_has_member("struct tm" tm_tzadj time.h TM_TZADJ)
+	tcl_check_struct_has_member("struct tm" tm_gmtoff time.h TM_GMTOFF)
+	set(TZONE_SRC_1 "
 #include <time.h>
 int main () {
 extern long timezone;
@@ -441,11 +441,11 @@
 return 0;
 }
    ")
-	CHECK_C_SOURCE_COMPILES("${TZONE_SRC_1}" HAVE_TIMEZONE_VAR)
-   IF(HAVE_TIMEZONE_VAR)
-		ADD_TCL_CFLAG(HAVE_TIMEZONE_VAR)
-	ELSE(HAVE_TIMEZONE_VAR)
-		SET(TZONE_SRC_2 "
+	check_c_source_compiles("${TZONE_SRC_1}" HAVE_TIMEZONE_VAR)
+   if(HAVE_TIMEZONE_VAR)
+		add_tcl_cflag(HAVE_TIMEZONE_VAR)
+	else(HAVE_TIMEZONE_VAR)
+		set(TZONE_SRC_2 "
 #include <time.h>
 int main() {
 extern time_t timezone;
@@ -454,13 +454,13 @@
 return 0;
 }
       ")
-		CHECK_C_SOURCE_COMPILES("${TZONE_SRC_2}" HAVE_TIMEZONE_VAR)
-		IF(HAVE_TIMEZONE_VAR)
-			ADD_TCL_CFLAG(HAVE_TIMEZONE_VAR)
-		ENDIF(HAVE_TIMEZONE_VAR)
-	ENDIF(HAVE_TIMEZONE_VAR)
-	IF(HAVE_SYS_TIME_H)
-		SET(TIME_WITH_SYS_TIME_SRC "
+		check_c_source_compiles("${TZONE_SRC_2}" HAVE_TIMEZONE_VAR)
+		if(HAVE_TIMEZONE_VAR)
+			add_tcl_cflag(HAVE_TIMEZONE_VAR)
+		endif(HAVE_TIMEZONE_VAR)
+	endif(HAVE_TIMEZONE_VAR)
+	if(HAVE_SYS_TIME_H)
+		set(TIME_WITH_SYS_TIME_SRC "
 #include <sys/time.h>
 #include <time.h>
 int main() {
@@ -470,12 +470,12 @@
 return 0;
 }
       ")
-		CHECK_C_SOURCE_COMPILES("${TIME_WITH_SYS_TIME_SRC}" TIME_WITH_SYS_TIME_WORKS)
-		IF(TIME_WITH_SYS_TIME_WORKS)
+		check_c_source_compiles("${TIME_WITH_SYS_TIME_SRC}" TIME_WITH_SYS_TIME_WORKS)
+		if(TIME_WITH_SYS_TIME_WORKS)
 			add_definitions(-DTIME_WITH_SYS_TIME=1)
-		ENDIF(TIME_WITH_SYS_TIME_WORKS)
-	ENDIF(HAVE_SYS_TIME_H)
-ENDMACRO(SC_TIME_HANDLER)
+		endif(TIME_WITH_SYS_TIME_WORKS)
+	endif(HAVE_SYS_TIME_H)
+endmacro(SC_TIME_HANDLER)
 
 #--------------------------------------------------------------------
 # SC_BUGGY_STRTOD
@@ -487,74 +487,74 @@
 #--------------------------------------------------------------------
 # SC_TCL_LINK_LIBS
 #--------------------------------------------------------------------
-MACRO(SC_TCL_LINK_LIBS)
-	SET(TCL_LINK_LIBS "")
+macro(SC_TCL_LINK_LIBS)
+	set(TCL_LINK_LIBS "")
 
 	# Math libraries 
-	IF(NOT WIN32)
-		CHECK_LIBRARY_EXISTS(m cos "" HAVE_M_LIBRARY)
-		IF(HAVE_M_LIBRARY)
-			RESOLVE_LIBRARIES(M_LIBRARY "-lm")
-		ENDIF(HAVE_M_LIBRARY)
+	if(NOT WIN32)
+		check_library_exists(m cos "" HAVE_M_LIBRARY)
+		if(HAVE_M_LIBRARY)
+			resolve_libraries(M_LIBRARY "-lm")
+		endif(HAVE_M_LIBRARY)
 		#find_library(IEEE_LIB ieee)
 		#MARK_AS_ADVANCED(IEEE_LIB)
 		#IF(IEEE_LIB)
 		#	SET(M_LIBRARY "-lieee ${M_LIBRARY}")
 		#ENDIF(IEEE_LIB)
-		CHECK_LIBRARY_EXISTS(sunmath ieee_flags "" HAVE_SUNMATH_LIBRARY)
-		IF(HAVE_SUNMATH_LIBRARY)
-			SET(M_LIBRARY "-lsunmath ${M_LIBRARY}")
-		ENDIF(HAVE_SUNMATH_LIBRARY)
-	ENDIF(NOT WIN32)
+		check_library_exists(sunmath ieee_flags "" HAVE_SUNMATH_LIBRARY)
+		if(HAVE_SUNMATH_LIBRARY)
+			set(M_LIBRARY "-lsunmath ${M_LIBRARY}")
+		endif(HAVE_SUNMATH_LIBRARY)
+	endif(NOT WIN32)
 
-	IF(NOT INET_LIBRARY AND NOT INET_QUIET)
-		MESSAGE("-- Looking for INET library")
-		RESOLVE_LIBRARIES(INET_LIBRARY "-linet")
-		IF(INET_LIBRARY)
-			MESSAGE("-- Found INET library: ${INET_LIBRARY}")
-		ELSE(INET_LIBRARY)
-			MESSAGE("-- Looking for INET library - not found")
-		ENDIF(INET_LIBRARY)
-		SET(INET_QUIET 1 CACHE STRING "INET quiet")
-		MARK_AS_ADVANCED(INET_QUIET)
-	ENDIF(NOT INET_LIBRARY AND NOT INET_QUIET)
-	IF(TCL_LINK_LIBS)
-		SET(TCL_LINK_LIBS "${TCL_LINK_LIBS};${M_LIBRARY};${INET_LIBRARY}")
-	ELSEIF(TCL_LINK_LIBS)
-		SET(TCL_LINK_LIBS "${M_LIBRARY};${INET_LIBRARY}")
-	ENDIF(TCL_LINK_LIBS)
-	MARK_AS_ADVANCED(TCL_LINK_LIBS)
+	if(NOT INET_LIBRARY AND NOT INET_QUIET)
+		message("-- Looking for INET library")
+		resolve_libraries(INET_LIBRARY "-linet")
+		if(INET_LIBRARY)
+			message("-- Found INET library: ${INET_LIBRARY}")
+		else(INET_LIBRARY)
+			message("-- Looking for INET library - not found")
+		endif(INET_LIBRARY)
+		set(INET_QUIET 1 CACHE STRING "INET quiet")
+		mark_as_advanced(INET_QUIET)
+	endif(NOT INET_LIBRARY AND NOT INET_QUIET)
+	if(TCL_LINK_LIBS)
+		set(TCL_LINK_LIBS "${TCL_LINK_LIBS};${M_LIBRARY};${INET_LIBRARY}")
+	elseif(TCL_LINK_LIBS)
+		set(TCL_LINK_LIBS "${M_LIBRARY};${INET_LIBRARY}")
+	endif(TCL_LINK_LIBS)
+	mark_as_advanced(TCL_LINK_LIBS)
 
-	TCL_CHECK_INCLUDE_FILE_USABILITY(net/errno.h NET_ERRNO_H)
-	CHECK_FUNCTION_EXISTS(connect HAVE_CONNECT)
-	IF(NOT HAVE_CONNECT)
-		CHECK_FUNCTION_EXISTS(setsockopt HAVE_SETSOCKOPT)
-		IF(NOT HAVE_SETSOCKOPT)
-			CHECK_LIBRARY_EXISTS(socket connect "" HAVE_SOCKET_LIBRARY)
-			IF(HAVE_SOCKET_LIBRARY)
-				RESOLVE_LIBRARIES(SOCKET_LIBRARY "-lsocket")
-				IF(TCL_LINK_LIBS)
-					SET(TCL_LINK_LIBS ${TCL_LINK_LIBS};${SOCKET_LIBRARY})
-				ELSE(TCL_LINK_LIBS)
-					SET(TCL_LINK_LIBS ${SOCKET_LIBRARY})
-				ENDIF(TCL_LINK_LIBS)
-			ENDIF(HAVE_SOCKET_LIBRARY)
-		ENDIF(NOT HAVE_SETSOCKOPT)
-	ENDIF(NOT HAVE_CONNECT)
-	CHECK_FUNCTION_EXISTS(gethostbyname HAVE_GETHOSTBYNAME)
-	IF(NOT HAVE_GETHOSTBYNAME)
-		CHECK_LIBRARY_EXISTS(nsl gethostbyname "" HAVE_NSL_LIBRARY)
-		IF(HAVE_NSL_LIBRARY)
-			RESOLVE_LIBRARIES(NSL_LIBRARY "-nsl")
-			IF(TCL_LINK_LIBS)
-				SET(TCL_LINK_LIBS ${TCL_LINK_LIBS};${NSL_LIBRARY})
-			ELSE(TCL_LINK_LIBS)
-				SET(TCL_LINK_LIBS ${NSL_LIBRARY})
-			ENDIF(TCL_LINK_LIBS)
-		ENDIF(HAVE_NSL_LIBRARY)
-	ENDIF(NOT HAVE_GETHOSTBYNAME)
+	tcl_check_include_file_usability(net/errno.h NET_ERRNO_H)
+	check_function_exists(connect HAVE_CONNECT)
+	if(NOT HAVE_CONNECT)
+		check_function_exists(setsockopt HAVE_SETSOCKOPT)
+		if(NOT HAVE_SETSOCKOPT)
+			check_library_exists(socket connect "" HAVE_SOCKET_LIBRARY)
+			if(HAVE_SOCKET_LIBRARY)
+				resolve_libraries(SOCKET_LIBRARY "-lsocket")
+				if(TCL_LINK_LIBS)
+					set(TCL_LINK_LIBS ${TCL_LINK_LIBS};${SOCKET_LIBRARY})
+				else(TCL_LINK_LIBS)
+					set(TCL_LINK_LIBS ${SOCKET_LIBRARY})
+				endif(TCL_LINK_LIBS)
+			endif(HAVE_SOCKET_LIBRARY)
+		endif(NOT HAVE_SETSOCKOPT)
+	endif(NOT HAVE_CONNECT)
+	check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
+	if(NOT HAVE_GETHOSTBYNAME)
+		check_library_exists(nsl gethostbyname "" HAVE_NSL_LIBRARY)
+		if(HAVE_NSL_LIBRARY)
+			resolve_libraries(NSL_LIBRARY "-nsl")
+			if(TCL_LINK_LIBS)
+				set(TCL_LINK_LIBS ${TCL_LINK_LIBS};${NSL_LIBRARY})
+			else(TCL_LINK_LIBS)
+				set(TCL_LINK_LIBS ${NSL_LIBRARY})
+			endif(TCL_LINK_LIBS)
+		endif(HAVE_NSL_LIBRARY)
+	endif(NOT HAVE_GETHOSTBYNAME)
 
-ENDMACRO(SC_TCL_LINK_LIBS)
+endmacro(SC_TCL_LINK_LIBS)
 
 #--------------------------------------------------------------------
 # SC_TCL_EARLY_FLAGS
@@ -567,94 +567,94 @@
 #
 # Detect and set up 64-bit compiling here.  LOTS of TODO here
 #--------------------------------------------------------------------
-MACRO(SC_TCL_64BIT_FLAGS)
-	IF(NOT CMAKE_SIZEOF_VOID_P)
-		MESSAGE(WARNING "CMAKE_SIZEOF_VOID_P is not defined - assuming 32-bit platform")
-		SET(CMAKE_SIZEOF_VOID_P 4)
-	ENDIF(NOT CMAKE_SIZEOF_VOID_P)
-	IF(NOT CMAKE_WORD_SIZE)
-		IF(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
-			SET(CMAKE_WORD_SIZE "64BIT")
-		ELSE(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
-			SET(CMAKE_WORD_SIZE "32BIT")
-		ENDIF(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
-	ENDIF(NOT CMAKE_WORD_SIZE)
-	IF(NOT TCL_ENABLE_64BIT)
-		IF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+macro(SC_TCL_64BIT_FLAGS)
+	if(NOT CMAKE_SIZEOF_VOID_P)
+		message(WARNING "CMAKE_SIZEOF_VOID_P is not defined - assuming 32-bit platform")
+		set(CMAKE_SIZEOF_VOID_P 4)
+	endif(NOT CMAKE_SIZEOF_VOID_P)
+	if(NOT CMAKE_WORD_SIZE)
+		if(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
+			set(CMAKE_WORD_SIZE "64BIT")
+		else(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
+			set(CMAKE_WORD_SIZE "32BIT")
+		endif(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
+	endif(NOT CMAKE_WORD_SIZE)
+	if(NOT TCL_ENABLE_64BIT)
+		if(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT "ON" CACHE STRING "Enable 64-bit support")
-		ELSE(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+		else(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT "OFF" CACHE STRING "Enable 64-bit support")
-		ENDIF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
-	ENDIF(NOT TCL_ENABLE_64BIT)
-	IF(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
-		IF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+		endif(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+	endif(NOT TCL_ENABLE_64BIT)
+	if(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
+		if(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT ON CACHE STRING "Enable 64-bit support")
-		ELSE(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+		else(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT OFF CACHE STRING "Enable 64-bit support")
-		ENDIF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
-	ENDIF(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
+		endif(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+	endif(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
 	set(TCL_ENABLE_64BIT ${TCL_ENABLE_64BIT} CACHE STRING "Enable 64-bit support")
-	IF(TCL_ENABLE_64BIT)
-		IF(NOT 64BIT_FLAG)
-			CHECK_C_FLAG("arch x86_64" 64BIT_FLAG)
-			CHECK_C_FLAG(64 64BIT_FLAG)
-			CHECK_C_FLAG("mabi=64" 64BIT_FLAG)
-			CHECK_C_FLAG(m64 64BIT_FLAG)
-			CHECK_C_FLAG(q64 64BIT_FLAG)
-		ENDIF(NOT 64BIT_FLAG)
-		MARK_AS_ADVANCED(64BIT_FLAG)
-		SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${64BIT_FLAG}")
-		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${64BIT_FLAG}")
-		SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${64BIT_FLAG}")
-		SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${64BIT_FLAG}")
+	if(TCL_ENABLE_64BIT)
+		if(NOT 64BIT_FLAG)
+			check_c_flag("arch x86_64" 64BIT_FLAG)
+			check_c_flag(64 64BIT_FLAG)
+			check_c_flag("mabi=64" 64BIT_FLAG)
+			check_c_flag(m64 64BIT_FLAG)
+			check_c_flag(q64 64BIT_FLAG)
+		endif(NOT 64BIT_FLAG)
+		mark_as_advanced(64BIT_FLAG)
+		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${64BIT_FLAG}")
+		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${64BIT_FLAG}")
+		set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${64BIT_FLAG}")
+		set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${64BIT_FLAG}")
 		add_definitions(-DTCL_CFG_DO64BIT=1)
-	ENDIF(TCL_ENABLE_64BIT)
-	IF(CMAKE_CL_64)
+	endif(TCL_ENABLE_64BIT)
+	if(CMAKE_CL_64)
 		add_definitions(-D_stati64=_stat64)
-	ENDIF(CMAKE_CL_64)
-ENDMACRO(SC_TCL_64BIT_FLAGS)
+	endif(CMAKE_CL_64)
+endmacro(SC_TCL_64BIT_FLAGS)
 
 #--------------------------------------------------------------------
 # SC_TCL_CFG_ENCODING   TIP #59
 #--------------------------------------------------------------------
-MACRO(SC_TCL_CFG_ENCODING)
-	IF(NOT TCL_CFGVAL_ENCODING)
-		IF(WIN32)
-			SET(TCL_CFGVAL_ENCODING "cp1252")
-		ELSE(WIN32)
-			SET(TCL_CFGVAL_ENCODING "iso8859-1")
-		ENDIF(WIN32)
-	ENDIF(NOT TCL_CFGVAL_ENCODING)
+macro(SC_TCL_CFG_ENCODING)
+	if(NOT TCL_CFGVAL_ENCODING)
+		if(WIN32)
+			set(TCL_CFGVAL_ENCODING "cp1252")
+		else(WIN32)
+			set(TCL_CFGVAL_ENCODING "iso8859-1")
+		endif(WIN32)
+	endif(NOT TCL_CFGVAL_ENCODING)
 	add_definitions(-DTCL_CFGVAL_ENCODING="${TCL_CFGVAL_ENCODING}")
-ENDMACRO(SC_TCL_CFG_ENCODING)
+endmacro(SC_TCL_CFG_ENCODING)
 
 
 #--------------------------------------------------------------------
 # SC_TCL_CHECK_BROKEN_FUNC
 #--------------------------------------------------------------------
-MACRO(SC_TCL_CHECK_BROKEN_FUNC)
-	CHECK_FUNCTION_EXISTS(${ARGV0} HAVE_${ARGV0})
-	IF(HAVE_${ARGV0})
-		SET(COMPILE_SRC "
+macro(SC_TCL_CHECK_BROKEN_FUNC)
+	check_function_exists(${ARGV0} HAVE_${ARGV0})
+	if(HAVE_${ARGV0})
+		set(COMPILE_SRC "
 		int main() {
 		${ARGV1}
 		}")
-		CHECK_C_SOURCE_RUNS("${COMPILE_SRC}"  WORKING_${ARGV0})
-		IF(NOT WORKING_${ARGV0})
-			SET(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
-		ENDIF(NOT WORKING_${ARGV0})
-	ELSE(HAVE_${ARGV0})
-		SET(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
-	ENDIF(HAVE_${ARGV0})
-ENDMACRO(SC_TCL_CHECK_BROKEN_FUNC)
+		check_c_source_runs("${COMPILE_SRC}"  WORKING_${ARGV0})
+		if(NOT WORKING_${ARGV0})
+			set(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
+		endif(NOT WORKING_${ARGV0})
+	else(HAVE_${ARGV0})
+		set(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
+	endif(HAVE_${ARGV0})
+endmacro(SC_TCL_CHECK_BROKEN_FUNC)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETHOSTBYADDR_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETHOSTBYADDR_R)
-	TCL_CHECK_FUNCTION_EXISTS(gethostbyaddr_r HAVE_GETHOSTBYADDR_R)
-	IF(HAVE_GETHOSTBYADDR_R)
-		SET(HAVE_GETHOSTBYADDR_R_7_SRC "
+macro(SC_TCL_GETHOSTBYADDR_R)
+	tcl_check_function_exists(gethostbyaddr_r HAVE_GETHOSTBYADDR_R)
+	if(HAVE_GETHOSTBYADDR_R)
+		set(HAVE_GETHOSTBYADDR_R_7_SRC "
 #include <netdb.h>
 int main(){
 char *addr;
@@ -668,11 +668,11 @@
 (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &h_errnop);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYADDR_R_7_SRC}"  HAVE_GETHOSTBYADDR_R_7)
-		IF(HAVE_GETHOSTBYADDR_R_7)
-			ADD_TCL_CFLAG(HAVE_GETHOSTBYADDR_R_7)
-		ELSE(HAVE_GETHOSTBYADDR_R_7)
-			SET(HAVE_GETHOSTBYADDR_R_8_SRC "
+		check_c_source_compiles("${HAVE_GETHOSTBYADDR_R_7_SRC}"  HAVE_GETHOSTBYADDR_R_7)
+		if(HAVE_GETHOSTBYADDR_R_7)
+			add_tcl_cflag(HAVE_GETHOSTBYADDR_R_7)
+		else(HAVE_GETHOSTBYADDR_R_7)
+			set(HAVE_GETHOSTBYADDR_R_8_SRC "
 #include <netdb.h>
 int main(){
 char *addr;
@@ -686,21 +686,21 @@
 (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &resultp, &h_errnop);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYADDR_R_8_SRC}" HAVE_GETHOSTBYADDR_R_8)
-			IF(HAVE_GETHOSTBYADDR_R_8)
-			   ADD_TCL_CFLAG(HAVE_GETHOSTBYADDR_R_8)
-			ENDIF(HAVE_GETHOSTBYADDR_R_8)
-		ENDIF(HAVE_GETHOSTBYADDR_R_7)
-	ENDIF(HAVE_GETHOSTBYADDR_R)
-ENDMACRO(SC_TCL_GETHOSTBYADDR_R)
+			check_c_source_compiles("${HAVE_GETHOSTBYADDR_R_8_SRC}" HAVE_GETHOSTBYADDR_R_8)
+			if(HAVE_GETHOSTBYADDR_R_8)
+			   add_tcl_cflag(HAVE_GETHOSTBYADDR_R_8)
+			endif(HAVE_GETHOSTBYADDR_R_8)
+		endif(HAVE_GETHOSTBYADDR_R_7)
+	endif(HAVE_GETHOSTBYADDR_R)
+endmacro(SC_TCL_GETHOSTBYADDR_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETHOSTBYNAME_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETHOSTBYNAME_R)
-	TCL_CHECK_FUNCTION_EXISTS(gethostbyname_r HAVE_GETHOSTBYNAME_R)
-	IF(HAVE_GETHOSTBYNAME_R)
-		SET(HAVE_GETHOSTBYNAME_R_6_SRC "
+macro(SC_TCL_GETHOSTBYNAME_R)
+	tcl_check_function_exists(gethostbyname_r HAVE_GETHOSTBYNAME_R)
+	if(HAVE_GETHOSTBYNAME_R)
+		set(HAVE_GETHOSTBYNAME_R_6_SRC "
 #include <netdb.h>
 int main(){
 char *name;
@@ -712,11 +712,11 @@
 (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYNAME_R_6_SRC}"  HAVE_GETHOSTBYNAME_R_6)
-		IF(HAVE_GETHOSTBYNAME_R_6)
-			ADD_TCL_CFLAG(HAVE_GETHOSTBYNAME_R_6)
-		ELSE(HAVE_GETHOSTBYNAME_R_6)
-			SET(HAVE_GETHOSTBYNAME_R_5_SRC "
+		check_c_source_compiles("${HAVE_GETHOSTBYNAME_R_6_SRC}"  HAVE_GETHOSTBYNAME_R_6)
+		if(HAVE_GETHOSTBYNAME_R_6)
+			add_tcl_cflag(HAVE_GETHOSTBYNAME_R_6)
+		else(HAVE_GETHOSTBYNAME_R_6)
+			set(HAVE_GETHOSTBYNAME_R_5_SRC "
 #include <netdb.h>
 int main(){
 char *name;
@@ -728,12 +728,12 @@
 (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYNAME_R_5_SRC}"  HAVE_GETHOSTBYNAME_R_5)
+			check_c_source_compiles("${HAVE_GETHOSTBYNAME_R_5_SRC}"  HAVE_GETHOSTBYNAME_R_5)
 
-			IF(HAVE_GETHOSTBYNAME_R_5)
-				ADD_TCL_CFLAG(HAVE_GETHOSTBYNAME_R_5)
-			ELSE(HAVE_GETHOSTBYNAME_R_5)
-				SET(HAVE_GETHOSTBYNAME_R_3_SRC "
+			if(HAVE_GETHOSTBYNAME_R_5)
+				add_tcl_cflag(HAVE_GETHOSTBYNAME_R_5)
+			else(HAVE_GETHOSTBYNAME_R_5)
+				set(HAVE_GETHOSTBYNAME_R_3_SRC "
 #include <netdb.h>
 int main(){
 char *name;
@@ -743,22 +743,22 @@
 (void) gethostbyname_r(name, he, &data);
 return 0;}
 				")
-				CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYNAME_R_3_SRC}" HAVE_GETHOSTBYNAME_R_3)
-				IF(HAVE_GETHOSTBYNAME_R_3)
-					ADD_TCL_CFLAG(HAVE_GETHOSTBYNAME_R_3)
-				ENDIF(HAVE_GETHOSTBYNAME_R_3)
-			ENDIF(HAVE_GETHOSTBYNAME_R_5)
-		ENDIF(HAVE_GETHOSTBYNAME_R_6)
-	ENDIF(HAVE_GETHOSTBYNAME_R)
-ENDMACRO(SC_TCL_GETHOSTBYNAME_R)
+				check_c_source_compiles("${HAVE_GETHOSTBYNAME_R_3_SRC}" HAVE_GETHOSTBYNAME_R_3)
+				if(HAVE_GETHOSTBYNAME_R_3)
+					add_tcl_cflag(HAVE_GETHOSTBYNAME_R_3)
+				endif(HAVE_GETHOSTBYNAME_R_3)
+			endif(HAVE_GETHOSTBYNAME_R_5)
+		endif(HAVE_GETHOSTBYNAME_R_6)
+	endif(HAVE_GETHOSTBYNAME_R)
+endmacro(SC_TCL_GETHOSTBYNAME_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_IPV6
 #--------------------------------------------------------------------
-MACRO(SC_TCL_IPV6)
-	CHECK_FUNCTION_EXISTS(getaddrinfo HAVE_GETADDRINFO)
-	IF(HAVE_GETADDRINFO)
-		SET(GETADDRINFO_SRC "
+macro(SC_TCL_IPV6)
+	check_function_exists(getaddrinfo HAVE_GETADDRINFO)
+	if(HAVE_GETADDRINFO)
+		set(GETADDRINFO_SRC "
 #include <netdb.h>
 int main () {
 const char *name, *port;
@@ -768,20 +768,20 @@
 return 0;
 }
 		")
-		CHECK_C_SOURCE_COMPILES("${GETADDRINFO_SRC}" WORKING_GETADDRINFO)
-		IF(WORKING_GETADDRINFO)
-			ADD_TCL_CFLAG(HAVE_GETADDRINFO)
-		ENDIF(WORKING_GETADDRINFO)
-	ENDIF(HAVE_GETADDRINFO)
-ENDMACRO(SC_TCL_IPV6)
+		check_c_source_compiles("${GETADDRINFO_SRC}" WORKING_GETADDRINFO)
+		if(WORKING_GETADDRINFO)
+			add_tcl_cflag(HAVE_GETADDRINFO)
+		endif(WORKING_GETADDRINFO)
+	endif(HAVE_GETADDRINFO)
+endmacro(SC_TCL_IPV6)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETPWUID_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETPWUID_R)
-	TCL_CHECK_FUNCTION_EXISTS(getpwuid_r HAVE_GETPWUID_R)
-	IF(HAVE_GETPWUID_R)
-		SET(HAVE_GETPWUID_R_5_SRC "
+macro(SC_TCL_GETPWUID_R)
+	tcl_check_function_exists(getpwuid_r HAVE_GETPWUID_R)
+	if(HAVE_GETPWUID_R)
+		set(HAVE_GETPWUID_R_5_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -793,11 +793,11 @@
 (void) getpwuid_r(uid, &pw, buf, buflen, &pwp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETPWUID_R_5_SRC}"  HAVE_GETPWUID_R_5)
-		IF(HAVE_GETPWUID_R_5)
-			ADD_TCL_CFLAG(HAVE_GETPWUID_R_5)
-		ELSE(HAVE_GETPWUID_R_5)
-			SET(HAVE_GETPWUID_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETPWUID_R_5_SRC}"  HAVE_GETPWUID_R_5)
+		if(HAVE_GETPWUID_R_5)
+			add_tcl_cflag(HAVE_GETPWUID_R_5)
+		else(HAVE_GETPWUID_R_5)
+			set(HAVE_GETPWUID_R_4_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -809,21 +809,21 @@
 (void) getpwuid_r(uid, &pw, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETPWUID_R_4_SRC}" HAVE_GETPWUID_R_4)
-			IF(HAVE_GETPWUID_R_4)
-				ADD_TCL_CFLAG(HAVE_GETPWUID_R_4)
-			ENDIF(HAVE_GETPWUID_R_4)
-		ENDIF(HAVE_GETPWUID_R_5)
-	ENDIF(HAVE_GETPWUID_R)
-ENDMACRO(SC_TCL_GETPWUID_R)
+			check_c_source_compiles("${HAVE_GETPWUID_R_4_SRC}" HAVE_GETPWUID_R_4)
+			if(HAVE_GETPWUID_R_4)
+				add_tcl_cflag(HAVE_GETPWUID_R_4)
+			endif(HAVE_GETPWUID_R_4)
+		endif(HAVE_GETPWUID_R_5)
+	endif(HAVE_GETPWUID_R)
+endmacro(SC_TCL_GETPWUID_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETPWNAM_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETPWNAM_R)
-	TCL_CHECK_FUNCTION_EXISTS(getpwnam_r HAVE_GETPWNAM_R)
-	IF(HAVE_GETPWNAM_R)
-		SET(HAVE_GETPWNAM_R_5_SRC "
+macro(SC_TCL_GETPWNAM_R)
+	tcl_check_function_exists(getpwnam_r HAVE_GETPWNAM_R)
+	if(HAVE_GETPWNAM_R)
+		set(HAVE_GETPWNAM_R_5_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -835,11 +835,11 @@
 (void) getpwnam_r(name, &pw, buf, buflen, &pwp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETPWNAM_R_5_SRC}"  HAVE_GETPWNAM_R_5)
-		IF(HAVE_GETPWNAM_R_5)
-			ADD_TCL_CFLAG(HAVE_GETPWNAM_R_5)
-		ELSE(HAVE_GETPWNAM_R_5)
-			SET(HAVE_GETPWNAM_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETPWNAM_R_5_SRC}"  HAVE_GETPWNAM_R_5)
+		if(HAVE_GETPWNAM_R_5)
+			add_tcl_cflag(HAVE_GETPWNAM_R_5)
+		else(HAVE_GETPWNAM_R_5)
+			set(HAVE_GETPWNAM_R_4_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -851,21 +851,21 @@
 (void)getpwnam_r(name, &pw, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETPWNAM_R_4_SRC}" HAVE_GETPWNAM_R_4)
-			IF(HAVE_GETPWNAM_R_4)
-			   ADD_TCL_CFLAG(HAVE_GETPWNAM_R_4)
-			ENDIF(HAVE_GETPWNAM_R_4)
-		ENDIF(HAVE_GETPWNAM_R_5)
-	ENDIF(HAVE_GETPWNAM_R)
-ENDMACRO(SC_TCL_GETPWNAM_R)
+			check_c_source_compiles("${HAVE_GETPWNAM_R_4_SRC}" HAVE_GETPWNAM_R_4)
+			if(HAVE_GETPWNAM_R_4)
+			   add_tcl_cflag(HAVE_GETPWNAM_R_4)
+			endif(HAVE_GETPWNAM_R_4)
+		endif(HAVE_GETPWNAM_R_5)
+	endif(HAVE_GETPWNAM_R)
+endmacro(SC_TCL_GETPWNAM_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETGRGID_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETGRGID_R)
-	TCL_CHECK_FUNCTION_EXISTS(getgrgid_r HAVE_GETGRGID_R)
-	IF(HAVE_GETGRGID_R)
-		SET(HAVE_GETGRGID_R_5_SRC "
+macro(SC_TCL_GETGRGID_R)
+	tcl_check_function_exists(getgrgid_r HAVE_GETGRGID_R)
+	if(HAVE_GETGRGID_R)
+		set(HAVE_GETGRGID_R_5_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -877,11 +877,11 @@
 (void) getgrgid_r(gid, &gr, buf, buflen, &grp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETGRGID_R_5_SRC}"  HAVE_GETGRGID_R_5)
-		IF(HAVE_GETGRGID_R_5)
-			ADD_TCL_CFLAG(HAVE_GETGRGID_R_5)
-		ELSE(HAVE_GETGRGID_R_5)
-			SET(HAVE_GETGRGID_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETGRGID_R_5_SRC}"  HAVE_GETGRGID_R_5)
+		if(HAVE_GETGRGID_R_5)
+			add_tcl_cflag(HAVE_GETGRGID_R_5)
+		else(HAVE_GETGRGID_R_5)
+			set(HAVE_GETGRGID_R_4_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -893,21 +893,21 @@
 (void)getgrgid_r(gid, &gr, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETGRGID_R_4_SRC}" HAVE_GETGRGID_R_4)
-			IF(HAVE_GETGRGID_R_4)
-				ADD_TCL_CFLAG(HAVE_GETGRGID_R_4)
-			ENDIF(HAVE_GETGRGID_R_4)
-		ENDIF(HAVE_GETGRGID_R_5)
-	ENDIF(HAVE_GETGRGID_R)
-ENDMACRO(SC_TCL_GETGRGID_R)
+			check_c_source_compiles("${HAVE_GETGRGID_R_4_SRC}" HAVE_GETGRGID_R_4)
+			if(HAVE_GETGRGID_R_4)
+				add_tcl_cflag(HAVE_GETGRGID_R_4)
+			endif(HAVE_GETGRGID_R_4)
+		endif(HAVE_GETGRGID_R_5)
+	endif(HAVE_GETGRGID_R)
+endmacro(SC_TCL_GETGRGID_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETGRNAM_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETGRNAM_R)
-	TCL_CHECK_FUNCTION_EXISTS(getgrnam_r HAVE_GETGRNAM_R)
-	IF(HAVE_GETGRNAM_R)
-		SET(HAVE_GETGRNAM_R_5_SRC "
+macro(SC_TCL_GETGRNAM_R)
+	tcl_check_function_exists(getgrnam_r HAVE_GETGRNAM_R)
+	if(HAVE_GETGRNAM_R)
+		set(HAVE_GETGRNAM_R_5_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -919,11 +919,11 @@
 (void) getgrnam_r(name, &gr, buf, buflen, &grp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETGRNAM_R_5_SRC}"  HAVE_GETGRNAM_R_5)
-		IF(HAVE_GETGRNAM_R_5)
-			ADD_TCL_CFLAG(HAVE_GETGRNAM_R_5)
-		ELSE(HAVE_GETGRNAM_R_5)
-			SET(HAVE_GETGRNAM_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETGRNAM_R_5_SRC}"  HAVE_GETGRNAM_R_5)
+		if(HAVE_GETGRNAM_R_5)
+			add_tcl_cflag(HAVE_GETGRNAM_R_5)
+		else(HAVE_GETGRNAM_R_5)
+			set(HAVE_GETGRNAM_R_4_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -935,19 +935,19 @@
 (void)getgrnam_r(name, &gr, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETGRNAM_R_4_SRC}" HAVE_GETGRNAM_R_4)
-			IF(HAVE_GETGRNAM_R_4)
-			   ADD_TCL_CFLAG(HAVE_GETGRNAM_R_4)
-			ENDIF(HAVE_GETGRNAM_R_4)
-		ENDIF(HAVE_GETGRNAM_R_5)
-	ENDIF(HAVE_GETGRNAM_R)
-ENDMACRO(SC_TCL_GETGRNAM_R)
+			check_c_source_compiles("${HAVE_GETGRNAM_R_4_SRC}" HAVE_GETGRNAM_R_4)
+			if(HAVE_GETGRNAM_R_4)
+			   add_tcl_cflag(HAVE_GETGRNAM_R_4)
+			endif(HAVE_GETGRNAM_R_4)
+		endif(HAVE_GETGRNAM_R_5)
+	endif(HAVE_GETGRNAM_R)
+endmacro(SC_TCL_GETGRNAM_R)
 
 
 
 
-MACRO(CHECK_FD_SET_IN_TYPES_D)
-	SET(TEST_SRC "
+macro(CHECK_FD_SET_IN_TYPES_D)
+	set(TEST_SRC "
 	#include <sys/types.h>
 	int main ()
 	{
@@ -955,16 +955,16 @@
 	return 0;
 	}
 	")
-	CHECK_C_SOURCE_COMPILES("${TEST_SRC}" FD_SET_IN_TYPES_H)
-ENDMACRO(CHECK_FD_SET_IN_TYPES_D)
+	check_c_source_compiles("${TEST_SRC}" FD_SET_IN_TYPES_H)
+endmacro(CHECK_FD_SET_IN_TYPES_D)
 
-MACRO(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
-	SET(TEST_SRC"
+macro(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
+	set(TEST_SRC"
 	#define MODULE_SCOPE extern __attribute__((__visibility__("hidden")))
 	main(){};
 	")
-	CHECK_C_SOURCE_COMPILES("${TEST_SRC}" COMPILER_SUPPORTS_HIDDEN)
-ENDMACRO(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
+	check_c_source_compiles("${TEST_SRC}" COMPILER_SUPPORTS_HIDDEN)
+endmacro(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
 
 
 
Index: src/other/libtermlib/CMakeLists.txt
===================================================================
--- src/other/libtermlib/CMakeLists.txt	(revision 54114)
+++ src/other/libtermlib/CMakeLists.txt	(working copy)
@@ -1,23 +1,23 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-IF(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND CMAKE_POLICY)
+cmake_minimum_required(VERSION 2.8)
+if(COMMAND CMAKE_POLICY)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND CMAKE_POLICY)
 
-PROJECT(LIBTERMLIB)
+project(LIBTERMLIB)
 
 
-IF(NOT MSVC)
+if(NOT MSVC)
 
   if(NOT CONF_DIR)
     set(CONF_DIR etc)
   endif(NOT CONF_DIR)
 
-  SET(LIBTERMLIB_PRIVATE_HDRS
+  set(LIBTERMLIB_PRIVATE_HDRS
     termcap.h
     )
 
 
-  SET(LIBTERM_SOURCES
+  set(LIBTERM_SOURCES
     termcap.c
     tgoto.c
     tputs.c
@@ -43,21 +43,21 @@
     LIBRARY DESTINATION ${LIB_DIR}
     ARCHIVE DESTINATION ${LIB_DIR})
 
-  SET_TARGET_PROPERTIES(termlib-static PROPERTIES OUTPUT_NAME "termlib")
+  set_target_properties(termlib-static PROPERTIES OUTPUT_NAME "termlib")
 
   if (NOT CMAKE_CONFIGURATION_TYPES)
     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/termcap.src ${CMAKE_BINARY_DIR}/${CONF_DIR}/termcap COPYONLY)
-    INSTALL(FILES ${CMAKE_BINARY_DIR}/${CONF_DIR}/termcap DESTINATION ${CONF_DIR})
+    install(FILES ${CMAKE_BINARY_DIR}/${CONF_DIR}/termcap DESTINATION ${CONF_DIR})
   else (NOT CMAKE_CONFIGURATION_TYPES)
     foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
       string(TOUPPER "${CFG_TYPE}" CFG_TYPE_UPPER)
       configure_file(${CMAKE_CURRENT_SOURCE_DIR}/termcap.src ${CMAKE_BINARY_DIR}/${CFG_TYPE_UPPER}/${DATA_DIR}/etc/termcap COPYONLY)
     endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
-    INSTALL(FILES ${CMAKE_BINARY_DIR}/\${BUILD_TYPE}/${CONF_DIR}/termcap DESTINATION ${CONF_DIR})
+    install(FILES ${CMAKE_BINARY_DIR}/\${BUILD_TYPE}/${CONF_DIR}/termcap DESTINATION ${CONF_DIR})
   endif (NOT CMAKE_CONFIGURATION_TYPES)
 
 
-ENDIF(NOT MSVC)
+endif(NOT MSVC)
 
 # Local Variables:
 # tab-width: 8
Index: src/other/tktable/CMakeLists.txt
===================================================================
--- src/other/tktable/CMakeLists.txt	(revision 54114)
+++ src/other/tktable/CMakeLists.txt	(working copy)
@@ -1,13 +1,13 @@
 # Minimum required version of CMake
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-IF(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND CMAKE_POLICY)
+cmake_minimum_required(VERSION 2.8)
+if(COMMAND CMAKE_POLICY)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND CMAKE_POLICY)
 
 # set CMake project name
-PROJECT(TKTABLE)
+project(TKTABLE)
 
-SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/CMake")
+set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/CMake")
 find_package(TCL)
 find_package(X11)
 
@@ -19,28 +19,28 @@
   ${X11_INCLUDE_DIR}
   )
 
-SET(TKTABLE_PKGNAME Tktable)
-SET(TKTABLE_PKGVERSION "2.10")
+set(TKTABLE_PKGNAME Tktable)
+set(TKTABLE_PKGVERSION "2.10")
 
 # Windows specific flags
-IF(WIN32)
-  SET(TKTABLE_CFLAGS "${TKTABLE_CFLAGS} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEP -Ot -Oi -fp:strict -Gs -GS -GL")
-  SET(TKTABLE_CFLAGS "${TKTABLE_CFLAGS} -Dinline=__inline -DBUILD_Tktable")
-  SET(TKTABLE_CFLAGS "${TKTABLE_CFLAGS} -DTBL_COMMAND=\"table\" -DTBL_RUNTIME=\"tkTable.tcl\" -DTBL_RUNTIME_DIR=\"\"")
-ENDIF(WIN32)
+if(WIN32)
+  set(TKTABLE_CFLAGS "${TKTABLE_CFLAGS} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEP -Ot -Oi -fp:strict -Gs -GS -GL")
+  set(TKTABLE_CFLAGS "${TKTABLE_CFLAGS} -Dinline=__inline -DBUILD_Tktable")
+  set(TKTABLE_CFLAGS "${TKTABLE_CFLAGS} -DTBL_COMMAND=\"table\" -DTBL_RUNTIME=\"tkTable.tcl\" -DTBL_RUNTIME_DIR=\"\"")
+endif(WIN32)
 
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TKTABLE_CFLAGS}")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TKTABLE_CFLAGS}")
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tkTable.tcl.h
   COMMAND ${TCL_TCLSH_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/misc/tkTable_header.tcl ${CMAKE_CURRENT_SOURCE_DIR}/library/tkTable.tcl ${CMAKE_CURRENT_BINARY_DIR}/tkTable.tcl.h.new
   COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/tkTable.tcl.h.new ${CMAKE_CURRENT_BINARY_DIR}/tkTable.tcl.h
   COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/tkTable.tcl.h.new
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/library/tkTable.tcl ${CMAKE_CURRENT_SOURCE_DIR}/misc/tkTable_header.tcl ${TCL_TCLSH_EXECUTABLE}
   )
-ADD_CUSTOM_TARGET(tktable_header_gen ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tkTable.tcl.h)
+add_custom_target(tktable_header_gen ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tkTable.tcl.h)
 
-SET(TKTABLE_SRCS
+set(TKTABLE_SRCS
   generic/tkTable.c
   generic/tkTableCell.c
   generic/tkTableCellSort.c
@@ -52,13 +52,13 @@
   generic/tkTableWin.c
   )
 
-SET(TKTABLE_CFG_H_FILE ${CMAKE_CURRENT_BINARY_DIR}/tktable_cfg.h.tmp)
-FILE(WRITE ${TKTABLE_CFG_H_FILE} "/**** Variables for Tktable build - replaces -D options ****/\n")
-FILE(APPEND ${TKTABLE_CFG_H_FILE} "#define PACKAGE_NAME \"${TKTABLE_PKGNAME}\"\n")
-FILE(APPEND ${TKTABLE_CFG_H_FILE} "#define PACKAGE_VERSION \"${TKTABLE_PKGVERSION}\"\n")
-FILE(APPEND ${TKTABLE_CFG_H_FILE} "#define TBL_COMMAND \"table\"\n")
-FILE(APPEND ${TKTABLE_CFG_H_FILE} "#define TBL_RUNTIME \"tkTable.tcl\"\n")
-FILE(APPEND ${TKTABLE_CFG_H_FILE} "#define TBL_RUNTIME_DIR \"${CMAKE_INSTALL_PREFIX}/lib/${TKTABLE_PKGNAME}${TKTABLE_PKGVERSION}\"\n")
+set(TKTABLE_CFG_H_FILE ${CMAKE_CURRENT_BINARY_DIR}/tktable_cfg.h.tmp)
+file(WRITE ${TKTABLE_CFG_H_FILE} "/**** Variables for Tktable build - replaces -D options ****/\n")
+file(APPEND ${TKTABLE_CFG_H_FILE} "#define PACKAGE_NAME \"${TKTABLE_PKGNAME}\"\n")
+file(APPEND ${TKTABLE_CFG_H_FILE} "#define PACKAGE_VERSION \"${TKTABLE_PKGVERSION}\"\n")
+file(APPEND ${TKTABLE_CFG_H_FILE} "#define TBL_COMMAND \"table\"\n")
+file(APPEND ${TKTABLE_CFG_H_FILE} "#define TBL_RUNTIME \"tkTable.tcl\"\n")
+file(APPEND ${TKTABLE_CFG_H_FILE} "#define TBL_RUNTIME_DIR \"${CMAKE_INSTALL_PREFIX}/lib/${TKTABLE_PKGNAME}${TKTABLE_PKGVERSION}\"\n")
 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/tktable_cfg.h.tmp ${CMAKE_CURRENT_BINARY_DIR}/tktable_cfg.h)
 execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/tktable_cfg.h.tmp)
 
@@ -71,29 +71,29 @@
 add_library(Tktable SHARED ${TKTABLE_SRCS})
 add_dependencies(Tktable tktable_header_gen)
 target_link_libraries(Tktable ${TCL_LIBRARY} ${TCL_TK_LIBRARY} ${X11_LIBRARIES})
-SET_TARGET_PROPERTIES(Tktable PROPERTIES VERSION ${TKTABLE_PKGVERSION})
+set_target_properties(Tktable PROPERTIES VERSION ${TKTABLE_PKGVERSION})
 install(TARGETS Tktable 
 	RUNTIME DESTINATION ${BIN_DIR}
 	LIBRARY DESTINATION ${LIB_DIR}
 	ARCHIVE DESTINATION ${LIB_DIR})
 
 # Create the pkgIndex.tcl file.
-TCL_PKGINDEX(Tktable ${TKTABLE_PKGNAME} ${TKTABLE_PKGVERSION})
+tcl_pkgindex(Tktable ${TKTABLE_PKGNAME} ${TKTABLE_PKGVERSION})
 
 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.txt DESTINATION lib/${TKTABLE_PKGNAME}${TKTABLE_PKGVERSION})
 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/license.txt DESTINATION lib/${TKTABLE_PKGNAME}${TKTABLE_PKGVERSION})
 
-SET(TKTABLE_MISC
+set(TKTABLE_MISC
   library/tkTable.tcl
   library/tktable.py
   )
 if(CMAKE_CONFIGURATION_TYPES)
    foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
      string(TOUPPER "${CFG_TYPE}" CFG_TYPE_UPPER)
-     FILE(COPY ${TKTABLE_MISC} DESTINATION ${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/lib/${TKTABLE_PKGNAME}${TKTABLE_PKGVERSION})
+     file(COPY ${TKTABLE_MISC} DESTINATION ${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/lib/${TKTABLE_PKGNAME}${TKTABLE_PKGVERSION})
    endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
 else(CMAKE_CONFIGURATION_TYPES)
-   FILE(COPY ${TKTABLE_MISC} DESTINATION ${CMAKE_BINARY_DIR}/lib/${TKTABLE_PKGNAME}${TKTABLE_PKGVERSION})
+   file(COPY ${TKTABLE_MISC} DESTINATION ${CMAKE_BINARY_DIR}/lib/${TKTABLE_PKGNAME}${TKTABLE_PKGVERSION})
 endif(CMAKE_CONFIGURATION_TYPES)
 
-INSTALL(FILES ${TKTABLE_MISC} DESTINATION lib/${TKTABLE_PKGNAME}${TKTABLE_PKGVERSION})
+install(FILES ${TKTABLE_MISC} DESTINATION lib/${TKTABLE_PKGNAME}${TKTABLE_PKGVERSION})
Index: src/other/tktable/CMake/FindTCL.cmake
===================================================================
--- src/other/tktable/CMake/FindTCL.cmake	(revision 54114)
+++ src/other/tktable/CMake/FindTCL.cmake	(working copy)
@@ -240,13 +240,13 @@
 set(TCL_POSSIBLE_MINOR_VERSIONS 6 5 4 3 2 1 0)
 
 # Create the Tcl/Tk options if not already present
-OPTION(TK_NATIVE_GRAPHICS "Require native Tk graphics." OFF)
-OPTION(TK_X11_GRAPHICS "Require X11 Tk graphics." OFF)
-OPTION(TCL_USE_FRAMEWORK_ONLY "Don't use any Tcl/Tk installation that isn't a Framework." OFF)
-OPTION(TCL_REQUIRE_TK "Look for Tk installation, not just Tcl." ON)
-OPTION(TCL_REQUIRE_THREADS "Reject a Tcl/Tk installation unless threads are enabled." OFF)
-OPTION(TCL_NEED_HEADERS "Don't report a found Tcl/Tk unless headers are present." ON)
-OPTION(TCL_NEED_STUB_LIBS "Don't report a found Tcl/Tk unless the stub libraries are present." ON)
+option(TK_NATIVE_GRAPHICS "Require native Tk graphics." OFF)
+option(TK_X11_GRAPHICS "Require X11 Tk graphics." OFF)
+option(TCL_USE_FRAMEWORK_ONLY "Don't use any Tcl/Tk installation that isn't a Framework." OFF)
+option(TCL_REQUIRE_TK "Look for Tk installation, not just Tcl." ON)
+option(TCL_REQUIRE_THREADS "Reject a Tcl/Tk installation unless threads are enabled." OFF)
+option(TCL_NEED_HEADERS "Don't report a found Tcl/Tk unless headers are present." ON)
+option(TCL_NEED_STUB_LIBS "Don't report a found Tcl/Tk unless the stub libraries are present." ON)
 
 # Sanity check the settings - can't require both Native and X11 if X11 isn't
 # the native windowing system on the platform
@@ -282,7 +282,7 @@
 macro(TK_GRAPHICS_SYSTEM wishcmd resultvar)
   set(${resultvar} "wm-NOTFOUND")
   file(WRITE ${tkwin_scriptfile} ${tkwin_script})
-  EXEC_PROGRAM(${wishcmd} ARGS ${tkwin_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+  exec_program(${wishcmd} ARGS ${tkwin_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
   file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM readresultvar)
   string(REGEX REPLACE "\n" "" "${resultvar}" "${readresultvar}")
 endmacro()
@@ -300,7 +300,7 @@
 macro(TCL_GET_VERSION tclshcmd resultvar)
   set(${resultvar} "NOTFOUND")
   file(WRITE ${tclversion_scriptfile} ${tclversion_script})
-  EXEC_PROGRAM(${tclshcmd} ARGS ${tclversion_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+  exec_program(${tclshcmd} ARGS ${tclversion_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
   file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/TCL_VERSION readresultvar)
   string(REGEX REPLACE "\n" "" "${resultvar}" "${readresultvar}")
 endmacro()
@@ -318,7 +318,7 @@
 	macro(TCL_ISTHREADED tclshcmd resultvar)
 	  set(${resultvar} "NOTFOUND")
 	  file(WRITE ${tclthreaded_scriptfile} ${tclthreaded_script})
-	  EXEC_PROGRAM(${tclshcmd} ARGS ${tclthreaded_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+	  exec_program(${tclshcmd} ARGS ${tclthreaded_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
 	  file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/TCL_THREADED readresultvar)
 	  string(REGEX REPLACE "\n" "" "${resultvar}" "${readresultvar}")
 	endmacro()
@@ -488,10 +488,10 @@
 	      foreach(SPATH ${${pathnames}})
 		set(TCL_CURRENTPATH TCL-NOTFOUND)
 		set(CURRENT_SEARCH_VERSION "${MAJORNUM}.${MINORNUM}")
-		VALIDATE_VERSION(dosearch ${CURRENT_SEARCH_VERSION})
+		validate_version(dosearch ${CURRENT_SEARCH_VERSION})
 		if(dosearch)
-		  FIND_PROGRAM_PATHS(BIN_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
-		  FIND_LIBRARY_PATHS(LIB_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		  find_program_paths(BIN_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		  find_library_paths(LIB_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
 		  foreach(targetbin ${targetbinnames})
 		    if(TCL_CURRENTPATH MATCHES "NOTFOUND$")
 		      find_program(TCL_CURRENTPATH NAMES ${targetbin}${MAJORNUM}.${MINORNUM} ${targetbin}${MAJORNUM}${MINORNUM} PATHS ${BIN_POSSIBLE_PATHS} ${options})
@@ -529,7 +529,7 @@
 	    foreach(MAJORNUM ${TCL_POSSIBLE_MAJOR_VERSIONS})
 	      foreach(MINORNUM ${TCL_POSSIBLE_MINOR_VERSIONS})
 		set(CURRENT_SEARCH_VERSION "${MAJORNUM}.${MINORNUM}")
-		VALIDATE_VERSION(isvalid ${CURRENT_SEARCH_VERSION})
+		validate_version(isvalid ${CURRENT_SEARCH_VERSION})
 		if(isvalid)
 		  foreach(genpath ${CONFIG_SEARCH_PATHS})
 		    set(CONFGENPATHS "${CONFGENPATHS};${genpath}${MAJORNUM}${MINORNUM};${genpath}${MAJORNUM}.${MINORNUM}")
@@ -619,7 +619,7 @@
 	#-----------------------------------------------------------------------------
 
 	macro(READ_TCLCONFIG_FILE tclconffile)
-	  RESET_TCL_VARS()
+	  reset_tcl_vars()
 	  set(TCL_CONF_FILE "")
 	  file(READ ${tclconffile} TCL_CONF_FILE)
 	  string(REGEX REPLACE "\r?\n" ";" ENT "${TCL_CONF_FILE}")
@@ -646,15 +646,15 @@
 		set(TCL_EXE_SUFFIX "")
 	      endif(MSVC)
 	      string(REGEX REPLACE ".*TCL_EXEC_PREFIX='(.+)'.*" "\\1" TCL_TCLSH_EXECUTABLE ${line})
-	      IF (EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      if (EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh")
 	      endif()
 	    endif()
@@ -669,7 +669,7 @@
 
 
 	macro(READ_TKCONFIG_FILE tkconffile)
-	  RESET_TK_VARS()
+	  reset_tk_vars()
 	  set(TK_CONF_FILE "")
 	  file(READ ${tkconffile} TK_CONF_FILE)
 	  string(REGEX REPLACE "\r?\n" ";" ENT "${TK_CONF_FILE}")
@@ -696,15 +696,15 @@
 		set(TK_EXE_SUFFIX "")
 	      endif(MSVC)
 	      string(REGEX REPLACE ".*TK_EXEC_PREFIX='(.+)'.*" "\\1" TCL_WISH_EXECUTABLE ${line})
-	      IF (EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      if (EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish")
 	      endif()
 	    endif()
@@ -723,16 +723,16 @@
 
 	macro(VALIDATE_TCL validvar)
 	  set(${validvar} 1)
-	  VALIDATE_TCL_VARIABLES(${validvar})
+	  validate_tcl_variables(${validvar})
 	  if(TCL_TCLSH_EXECUTABLE)
-	    TCL_GET_VERSION(${TCL_TCLSH_EXECUTABLE} CURRENT_SEARCH_VERSION)
-	    VALIDATE_VERSION(dosearch ${CURRENT_SEARCH_VERSION})
+	    tcl_get_version(${TCL_TCLSH_EXECUTABLE} CURRENT_SEARCH_VERSION)
+	    validate_version(dosearch ${CURRENT_SEARCH_VERSION})
 	    if(NOT dosearch)
 	      set(${validvar} 0)
 	    endif(NOT dosearch)
 	  endif(TCL_TCLSH_EXECUTABLE)
 	  if(TCL_REQUIRE_THREADS AND TCL_TCLSH_EXECUTABLE)
-	    TCL_ISTHREADED(${TCL_TCLSH_EXECUTABLE} TCL_THREADS)
+	    tcl_isthreaded(${TCL_TCLSH_EXECUTABLE} TCL_THREADS)
 	    if(NOT TCL_THREADS)
 	      set(${validvar} 0)
 	    endif(NOT TCL_THREADS)
@@ -741,9 +741,9 @@
 
 	macro(VALIDATE_TK validvar)
 	  set(${validvar} 1)
-	  VALIDATE_TK_VARIABLES(${validvar})
+	  validate_tk_variables(${validvar})
 	  if(TK_NATIVE_GRAPHICS OR TK_X11_GRAPHICS)
-	    TK_GRAPHICS_SYSTEM(${TCL_WISH_EXECUTABLE} TK_SYSTEM_GRAPHICS)
+	    tk_graphics_system(${TCL_WISH_EXECUTABLE} TK_SYSTEM_GRAPHICS)
 	    if(APPLE AND TK_NATIVE_GRAPHICS)
 	      if(NOT ${TK_SYSTEM_GRAPHICS} MATCHES "aqua")
 		set(${validvar} 0)
@@ -852,19 +852,19 @@
 	    set(TCL_PREFIX_LIBDIRS ${TCL_PREFIX_LIBDIRS} ${TCL_LIB_PATH_PARENT}/lib)
 	    set(TCL_PREFIX_LIBDIRS ${TCL_PREFIX_LIBDIRS} ${TCL_LIB_PATH_PARENT})
 	    list(REMOVE_DUPLICATES TCL_PREFIX_LIBDIRS)
-	    FIND_LIBRARY_VERSIONS(tcl TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
+	    find_library_versions(tcl TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
 	    set(FOUND_FILES "${TCL_tcl_LIST}")
-	    FIND_CONFIG_FILES(FOUND_FILES TCLCONFIG_LIST tclConfig.sh)
+	    find_config_files(FOUND_FILES TCLCONFIG_LIST tclConfig.sh)
 	    if(TCL_REQUIRE_TK)
-	      FIND_LIBRARY_VERSIONS(tk TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
+	      find_library_versions(tk TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
 	      set(FOUND_FILES "${TCL_tk_LIST}")
-	      FIND_CONFIG_FILES(FOUND_FILES TKCONFIG_LIST tkConfig.sh)
+	      find_config_files(FOUND_FILES TKCONFIG_LIST tkConfig.sh)
 	    endif(TCL_REQUIRE_TK)
 	  else(TCL_PREFIX)
 	    set(TCLCONFIG_LIST "")
 	    if(APPLE)
 	      include(CMakeFindFrameworks)
-	      CMAKE_FIND_FRAMEWORKS(Tcl)
+	      cmake_find_frameworks(Tcl)
 	      foreach(dir ${Tcl_FRAMEWORKS})
 		set(tclconf "tclConfig.sh-NOTFOUND") 
 		find_file(tclconf tclConfig.sh PATHS ${dir})
@@ -874,7 +874,7 @@
 		endif(NOT tclconf MATCHES "NOTFOUND$")
 	      endforeach(dir ${Tcl_FRAMEWORKS})
 	      if(TCL_REQUIRE_TK)
-		CMAKE_FIND_FRAMEWORKS(Tk)
+		cmake_find_frameworks(Tk)
 		foreach(dir ${Tk_FRAMEWORKS})
 		  set(tkconf "tkConfig.sh-NOTFOUND") 
 		  find_file(tkconf tkConfig.sh PATHS ${dir})
@@ -889,7 +889,7 @@
 	      set(PATHLIST "$ENV{LD_LIBRARY_PATH}:$ENV{DYLD_LIBRARY_PATH}:$ENV{DYLD_FALLBACK_LIBRARY_PATH}:$ENV{PATH}")
 	      set(PATHLIST "${TCL_ADDITIONAL_SEARCH_PATHS}:${PATHLIST}")
 	      if(WIN32)
-		WIN32TCLPATHS(PATHLIST "")
+		win32tclpaths(PATHLIST "")
 	      endif(WIN32)
 	      string(REGEX REPLACE "/s?bin:" ":" PATHLIST "${PATHLIST}")
 	      string(REGEX REPLACE "/s?bin;" ":" PATHLIST "${PATHLIST}")
@@ -906,41 +906,41 @@
 	      endforeach()
 	      set(TCLPATHLIST "${PATHLIST}")
 	      set(TKPATHLIST "${PATHLIST}")
-	      FIND_POSSIBLE_PATHS("tclsh" "tcl" TCLPATHLIST NO_SYSTEM_PATH)
+	      find_possible_paths("tclsh" "tcl" TCLPATHLIST NO_SYSTEM_PATH)
 	      if(TCL_REQUIRE_TK)
-		FIND_POSSIBLE_PATHS("wish" "tk" TKPATHLIST NO_SYSTEM_PATH)
+		find_possible_paths("wish" "tk" TKPATHLIST NO_SYSTEM_PATH)
 	      endif(TCL_REQUIRE_TK)
 	      # Hunt up tclConfig.sh files
-	      FIND_CONFIG_FILES(TCLPATHLIST TCLCONFIG_LIST tclConfig.sh)
+	      find_config_files(TCLPATHLIST TCLCONFIG_LIST tclConfig.sh)
 	      # Hunt up tkConfig.sh files 
-	      FIND_CONFIG_FILES(TKPATHLIST TKCONFIG_LIST tkConfig.sh)
+	      find_config_files(TKPATHLIST TKCONFIG_LIST tkConfig.sh)
 	    endif(NOT APPLE OR NOT TCL_USE_FRAMEWORK_ONLY)
 	  endif(TCL_PREFIX)
 	  set(TCLVALID 0)
-	  RESET_TCL_VARS()
+	  reset_tcl_vars()
 	  foreach(tcl_config_file ${TCLCONFIG_LIST}) 
 	    if(NOT TCLVALID)
-	      RESET_TCL_VARS()
-	      READ_TCLCONFIG_file(${tcl_config_file})
+	      reset_tcl_vars()
+	      read_tclconfig_file(${tcl_config_file})
 	      set(TCLVALID 1)
 	      set(CURRENTTCLVERSION "${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}.${TCL_VERSION_PATCH}")
-	      VALIDATE_VERSION(TCLVALID ${CURRENTTCLVERSION})
+	      validate_version(TCLVALID ${CURRENTTCLVERSION})
 	      if(TCLVALID)
 		get_filename_component(TCL_CONF_PREFIX "${tcl_config_file}" PATH)
 		get_filename_component(TCL_LIBRARY_DIR2 "${TCL_CONF_PREFIX}" PATH)
-		FIND_LIBRARY_PATHS(TCL_LIBRARY_SEARCH_PATHS TCL_PREFIX ${TCL_VERSION_MAJOR} ${TCL_VERSION_MINOR})
+		find_library_paths(TCL_LIBRARY_SEARCH_PATHS TCL_PREFIX ${TCL_VERSION_MAJOR} ${TCL_VERSION_MINOR})
 		set(TCL_LIBRARY_SEARCH_PATHS "${TCL_CONF_PREFIX};${TCL_LIBRARY_DIR2};${TCL_LIBRARY_SEARCH_PATHS}")
 		find_library(TCL_LIBRARY tcl Tcl tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR} tcl${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR} PATHS ${TCL_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
 		find_library(TCL_STUB_LIBRARY tclstub${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR} tclstub${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR} PATHS ${TCL_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
 	      endif(TCLVALID)
-	      VALIDATE_TCL(TCLVALID)
+	      validate_tcl(TCLVALID)
 	      if(TCLVALID)
 		if(TCL_REQUIRE_TK)
 		  set(TKVALID 0)
 		  foreach(tk_config_file ${TKCONFIG_LIST})
 		    if(NOT TKVALID)
-		      RESET_TK_VARS()
-		      READ_TKCONFIG_file(${tk_config_file})
+		      reset_tk_vars()
+		      read_tkconfig_file(${tk_config_file})
 		      set(TKVALID 0)
 		      set(CURRENTTKVERSION "${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}.${TK_VERSION_PATCH}")
 		      set(vtcltkcompare 0)
@@ -952,18 +952,18 @@
 		      if(TKVALID)
 			get_filename_component(TCL_TK_CONF_PREFIX "${tk_config_file}" PATH)
 			get_filename_component(TCL_TK_LIBRARY_DIR2 "${TCL_TK_CONF_PREFIX}" PATH)
-			FIND_LIBRARY_PATHS(TCL_TK_LIBRARY_SEARCH_PATHS TK_PREFIX ${TK_VERSION_MAJOR} ${TK_VERSION_MINOR})
+			find_library_paths(TCL_TK_LIBRARY_SEARCH_PATHS TK_PREFIX ${TK_VERSION_MAJOR} ${TK_VERSION_MINOR})
 			set(TCL_TK_LIBRARY_SEARCH_PATHS "${TCL_TK_CONF_PREFIX};${TCL_TK_LIBRARY_DIR2};${TCL_TK_LIBRARY_SEARCH_PATHS}")
 			find_library(TCL_TK_LIBRARY tk Tk tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR} tk${TK_VERSION_MAJOR}${TK_VERSION_MINOR} PATHS ${TCL_TK_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
 			find_library(TCL_TK_STUB_LIBRARY tkstub tkstub${TK_VERSION_MAJOR}.${TK_VERSION_MINOR} tkstub${TK_VERSION_MAJOR}${TK_VERSION_MINOR} PATHS ${TCL_TK_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
-			VALIDATE_TK(TKVALID)
+			validate_tk(TKVALID)
 		      endif(TKVALID)
 		    endif(NOT TKVALID)
 		  endforeach(tk_config_file ${TKCONFIG_LIST})
 		  if(NOT TKVALID)
 		    set(TCLVALID 0)
-		    RESET_TCL_VARS()
-		    RESET_TK_VARS()
+		    reset_tcl_vars()
+		    reset_tk_vars()
 		  endif(NOT TKVALID)
 		endif(TCL_REQUIRE_TK)
 	      endif(TCLVALID)
@@ -983,29 +983,29 @@
 	      foreach(MINORNUM ${TCL_POSSIBLE_MINOR_VERSIONS})
 		foreach(SPATH ${PATHLIST})
 		  if(NOT TCLVALID)
-		    RESET_TCL_VARS()
+		    reset_tcl_vars()
 		    set(CURRENT_SEARCH_VERSION "${MAJORNUM}.${MINORNUM}")
-		    VALIDATE_VERSION(dosearch ${CURRENT_SEARCH_VERSION})
+		    validate_version(dosearch ${CURRENT_SEARCH_VERSION})
 		    if(dosearch)
-		      FIND_LIBRARY_PATHS(TCL_LIBRARY_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
-		      FIND_PROGRAM_PATHS(TCL_PROGRAM_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		      find_library_paths(TCL_LIBRARY_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		      find_program_paths(TCL_PROGRAM_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
 		      find_program(TCL_TCLSH_EXECUTABLE NAMES tclsh${MAJORNUM}.${MINORNUM} tclsh${MAJORNUM}${MINORNUM} PATHS ${TCL_PROGRAM_SEARCH_PATHS} NO_SYSTEM_PATH)
 		    endif(dosearch)
-		    VALIDATE_TCL(TCLVALID)
+		    validate_tcl(TCLVALID)
 		    if(TCLVALID)
 		      if(TCL_REQUIRE_TK)
 			set(TKVALID 0)
-			RESET_TK_VARS()
+			reset_tk_vars()
 			find_program(TCL_WISH_EXECUTABLE NAMES wish${MAJORNUM}.${MINORNUM} wish${MAJORNUM}${MINORNUM} PATHS ${TCL_PROGRAM_SEARCH_PATHS} NO_SYSTEM_PATH)
-			VALIDATE_TK(TKVALID)
+			validate_tk(TKVALID)
 			if(NOT TKVALID)
 			  set(TCLVALID 0)
-			  RESET_TCL_VARS()
-			  RESET_TK_VARS()
+			  reset_tcl_vars()
+			  reset_tk_vars()
 			endif(NOT TKVALID)	
 		      endif(TCL_REQUIRE_TK)
 		    else(TCLVALID)
-		      RESET_TCL_VARS()
+		      reset_tcl_vars()
 		    endif(TCLVALID)
 		  endif(NOT TCLVALID)
 		endforeach(SPATH ${PATHLIST})
@@ -1023,11 +1023,11 @@
 	  set(TCL_STUB_LIBRARIES ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY})
 	  set(TCL_ROOT_PATH ${TCL_CONF_PREFIX})
 	  set(TCL_VERSION_STRING "${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}.${TCL_VERSION_PATCH}")
-	  FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCL DEFAULT_MSG TCL_LIBRARY ${PACKAGE_HANDLE_VARS})
+	  find_package_handle_standard_args(TCL DEFAULT_MSG TCL_LIBRARY ${PACKAGE_HANDLE_VARS})
 	  if(TCL_REQUIRE_TK)
 	    set(TK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
 	    set(PACKAGE_HANDLE_VARS "${PACKAGE_HANDLE_VARS};TCL_LIBRARY")
-	    FIND_PACKAGE_HANDLE_STANDARD_ARGS(TK DEFAULT_MSG TCL_TK_LIBRARY ${PACKAGE_HANDLE_VARS})
+	    find_package_handle_standard_args(TK DEFAULT_MSG TCL_TK_LIBRARY ${PACKAGE_HANDLE_VARS})
 	  endif(TCL_REQUIRE_TK)
 
 	  foreach(pkgvar ${PACKAGE_HANDLE_VARS})
Index: src/other/tktable/CMake/FindX11.cmake
===================================================================
--- src/other/tktable/CMake/FindX11.cmake	(revision 54114)
+++ src/other/tktable/CMake/FindX11.cmake	(working copy)
@@ -130,16 +130,16 @@
 # 
 #=============================================================================
 
-MACRO(X11_FIND_INCLUDE_PATH component header)
+macro(X11_FIND_INCLUDE_PATH component header)
   find_path(X11_${component}_INCLUDE_PATH ${header} ${X11_INC_SEARCH_PATH} NO_CMAKE_SYSTEM_PATH)
   set(X11_HDR_VARS ${X11_HDR_VARS} X11_${component}_INCLUDE_PATH)
   if(X11_${component}_INCLUDE_PATH)
     set(X11_HDR_PATHS ${X11_HDR_PATHS} ${X11_${component}_INCLUDE_PATH})
     list(REMOVE_DUPLICATES X11_HDR_PATHS)
   endif(X11_${component}_INCLUDE_PATH)
-ENDMACRO(X11_FIND_INCLUDE_PATH)
+endmacro(X11_FIND_INCLUDE_PATH)
 
-MACRO(X11_FIND_LIB_PATH component libname)
+macro(X11_FIND_LIB_PATH component libname)
   find_library(X11_${component}_LIB ${libname} ${X11_LIB_SEARCH_PATH} NO_CMAKE_SYSTEM_PATH)
   set(X11_LIB_VARS ${X11_LIB_VARS} X11_${component}_LIB)
   if(X11_${component}_LIB)
@@ -147,7 +147,7 @@
     set(X11_LIB_PATHS ${X11_LIB_PATHS} ${X11_${component}_DIR})
     list(REMOVE_DUPLICATES X11_LIB_PATHS)
   endif(X11_${component}_LIB)
-ENDMACRO(X11_FIND_LIB_PATH)
+endmacro(X11_FIND_LIB_PATH)
 
 if(UNIX)
   set(X11_FOUND 0)
@@ -208,63 +208,63 @@
   set(X11_LIB_PATHS)
   
   # Find primary X11 headers
-  X11_FIND_INCLUDE_PATH(X11		X11/X.h)
-  X11_FIND_INCLUDE_PATH(Xlib		X11/Xlib.h)
+  x11_find_include_path(X11		X11/X.h)
+  x11_find_include_path(Xlib		X11/Xlib.h)
   # Look for other X11 includes; keep the list sorted by name of the cmake X11_<component>_INCLUDE_PATH
   # variable (component doesn't need to match the include file name).
-  X11_FIND_INCLUDE_PATH(ICE 		X11/ICE/ICE.h)
-  X11_FIND_INCLUDE_PATH(Xaccessrules 	X11/extensions/XKBrules.h)
-  X11_FIND_INCLUDE_PATH(Xaccessstr 	X11/extensions/XKBstr.h)
-  X11_FIND_INCLUDE_PATH(Xau 		X11/Xauth.h)
-  X11_FIND_INCLUDE_PATH(Xcomposite 	X11/extensions/Xcomposite.h)
-  X11_FIND_INCLUDE_PATH(Xcursor 	X11/Xcursor/Xcursor.h)
-  X11_FIND_INCLUDE_PATH(Xdamage 	X11/extensions/Xdamage.h)
-  X11_FIND_INCLUDE_PATH(Xdmcp 		X11/Xdmcp.h)
-  X11_FIND_INCLUDE_PATH(dpms 		X11/extensions/dpms.h)
-  X11_FIND_INCLUDE_PATH(xf86misc 	X11/extensions/xf86misc.h)
-  X11_FIND_INCLUDE_PATH(xf86vmode 	X11/extensions/xf86vmode.h)
-  X11_FIND_INCLUDE_PATH(Xfixes		X11/extensions/Xfixes.h)
-  X11_FIND_INCLUDE_PATH(Xft		X11/Xft/Xft.h)
-  X11_FIND_INCLUDE_PATH(Xi		X11/extensions/XInput.h)
-  X11_FIND_INCLUDE_PATH(Xinerama	X11/extensions/Xinerama.h)
-  X11_FIND_INCLUDE_PATH(Xinput		X11/extensions/XInput.h)
-  X11_FIND_INCLUDE_PATH(Xkb		X11/extensions/XKB.h)
-  X11_FIND_INCLUDE_PATH(Xkblib		X11/XKBlib.h)
-  X11_FIND_INCLUDE_PATH(Xpm		X11/xpm.h)
-  X11_FIND_INCLUDE_PATH(XTest		X11/extensions/XTest.h)
-  X11_FIND_INCLUDE_PATH(XShm		X11/extensions/XShm.h)
-  X11_FIND_INCLUDE_PATH(Xrandr		X11/extensions/Xrandr.h)
-  X11_FIND_INCLUDE_PATH(Xrender		X11/extensions/Xrender.h)
-  X11_FIND_INCLUDE_PATH(Xscreensaver	X11/extensions/scrnsaver.h)
-  X11_FIND_INCLUDE_PATH(Xshape		X11/extensions/shape.h)
-  X11_FIND_INCLUDE_PATH(Xutil		X11/Xutil.h)
-  X11_FIND_INCLUDE_PATH(Xt		X11/Intrinsic.h)
-  X11_FIND_INCLUDE_PATH(Xv		X11/extensions/Xvlib.h)
+  x11_find_include_path(ICE 		X11/ICE/ICE.h)
+  x11_find_include_path(Xaccessrules 	X11/extensions/XKBrules.h)
+  x11_find_include_path(Xaccessstr 	X11/extensions/XKBstr.h)
+  x11_find_include_path(Xau 		X11/Xauth.h)
+  x11_find_include_path(Xcomposite 	X11/extensions/Xcomposite.h)
+  x11_find_include_path(Xcursor 	X11/Xcursor/Xcursor.h)
+  x11_find_include_path(Xdamage 	X11/extensions/Xdamage.h)
+  x11_find_include_path(Xdmcp 		X11/Xdmcp.h)
+  x11_find_include_path(dpms 		X11/extensions/dpms.h)
+  x11_find_include_path(xf86misc 	X11/extensions/xf86misc.h)
+  x11_find_include_path(xf86vmode 	X11/extensions/xf86vmode.h)
+  x11_find_include_path(Xfixes		X11/extensions/Xfixes.h)
+  x11_find_include_path(Xft		X11/Xft/Xft.h)
+  x11_find_include_path(Xi		X11/extensions/XInput.h)
+  x11_find_include_path(Xinerama	X11/extensions/Xinerama.h)
+  x11_find_include_path(Xinput		X11/extensions/XInput.h)
+  x11_find_include_path(Xkb		X11/extensions/XKB.h)
+  x11_find_include_path(Xkblib		X11/XKBlib.h)
+  x11_find_include_path(Xpm		X11/xpm.h)
+  x11_find_include_path(XTest		X11/extensions/XTest.h)
+  x11_find_include_path(XShm		X11/extensions/XShm.h)
+  x11_find_include_path(Xrandr		X11/extensions/Xrandr.h)
+  x11_find_include_path(Xrender		X11/extensions/Xrender.h)
+  x11_find_include_path(Xscreensaver	X11/extensions/scrnsaver.h)
+  x11_find_include_path(Xshape		X11/extensions/shape.h)
+  x11_find_include_path(Xutil		X11/Xutil.h)
+  x11_find_include_path(Xt		X11/Intrinsic.h)
+  x11_find_include_path(Xv		X11/extensions/Xvlib.h)
   
 
   # Find primary X11 library
-  X11_FIND_LIB_PATH(X11			X11)
+  x11_find_lib_path(X11			X11)
   # Find additional X libraries. Keep list sorted by library name.
-  X11_FIND_LIB_PATH(ICE			ICE)
-  X11_FIND_LIB_PATH(SM			SM)
-  X11_FIND_LIB_PATH(Xau			Xau)
-  X11_FIND_LIB_PATH(Xcomposite		Xcomposite)
-  X11_FIND_LIB_PATH(Xcursor		Xcursor)
-  X11_FIND_LIB_PATH(Xdamage		Xdamage)
-  X11_FIND_LIB_PATH(Xdmcp		Xdmcp)
-  X11_FIND_LIB_PATH(Xext		Xext)
-  X11_FIND_LIB_PATH(Xfixes		Xfixes)
-  X11_FIND_LIB_PATH(Xft			Xft)
-  X11_FIND_LIB_PATH(Xi			Xi)
-  X11_FIND_LIB_PATH(Xinerama		Xinerama)
-  X11_FIND_LIB_PATH(Xpm			Xpm)
-  X11_FIND_LIB_PATH(Xrandr		Xrandr)
-  X11_FIND_LIB_PATH(Xrender		Xrender)
-  X11_FIND_LIB_PATH(Xscreensaver	Xss)
-  X11_FIND_LIB_PATH(Xt			Xt)
-  X11_FIND_LIB_PATH(XTest		Xtst)
-  X11_FIND_LIB_PATH(Xv			Xv)
-  X11_FIND_LIB_PATH(Xxf86misc		Xxf86misc)
+  x11_find_lib_path(ICE			ICE)
+  x11_find_lib_path(SM			SM)
+  x11_find_lib_path(Xau			Xau)
+  x11_find_lib_path(Xcomposite		Xcomposite)
+  x11_find_lib_path(Xcursor		Xcursor)
+  x11_find_lib_path(Xdamage		Xdamage)
+  x11_find_lib_path(Xdmcp		Xdmcp)
+  x11_find_lib_path(Xext		Xext)
+  x11_find_lib_path(Xfixes		Xfixes)
+  x11_find_lib_path(Xft			Xft)
+  x11_find_lib_path(Xi			Xi)
+  x11_find_lib_path(Xinerama		Xinerama)
+  x11_find_lib_path(Xpm			Xpm)
+  x11_find_lib_path(Xrandr		Xrandr)
+  x11_find_lib_path(Xrender		Xrender)
+  x11_find_lib_path(Xscreensaver	Xss)
+  x11_find_lib_path(Xt			Xt)
+  x11_find_lib_path(XTest		Xtst)
+  x11_find_lib_path(Xv			Xv)
+  x11_find_lib_path(Xxf86misc		Xxf86misc)
 
   set(X11_LIBRARY_DIR "")
   if(X11_X11_LIB)
@@ -437,69 +437,69 @@
       set(X11_X_EXTRA_LIBS "")
 
       # See if XOpenDisplay in X11 works by itself.
-      CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
+      check_library_exists("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
       if(NOT X11_LIB_X11_SOLO)
         # Find library needed for dnet_ntoa.
-        CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
+        check_library_exists("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
         if(X11_LIB_DNET_HAS_DNET_NTOA)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
         else(X11_LIB_DNET_HAS_DNET_NTOA)
-          CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
+          check_library_exists("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
           if(X11_LIB_DNET_STUB_HAS_DNET_NTOA)
-            SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
+            set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
           endif(X11_LIB_DNET_STUB_HAS_DNET_NTOA)
         endif(X11_LIB_DNET_HAS_DNET_NTOA)
       endif(NOT X11_LIB_X11_SOLO)
 
       # Find library needed for gethostbyname.
-      CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
+      check_function_exists("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
       if(NOT CMAKE_HAVE_GETHOSTBYNAME)
-        CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+        check_library_exists("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
         if(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
         else(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-          CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+          check_library_exists("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
           if(CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
-            SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
+            set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
           endif(CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
         endif(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
       endif(NOT CMAKE_HAVE_GETHOSTBYNAME)
 
       # Find library needed for connect.
-      CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT)
+      check_function_exists("connect" CMAKE_HAVE_CONNECT)
       if(NOT CMAKE_HAVE_CONNECT)
-        CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
+        check_library_exists("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
         if(CMAKE_LIB_SOCKET_HAS_CONNECT)
-          SET (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
+          set (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
         endif(CMAKE_LIB_SOCKET_HAS_CONNECT)
       endif(NOT CMAKE_HAVE_CONNECT)
 
       # Find library needed for remove.
-      CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE)
+      check_function_exists("remove" CMAKE_HAVE_REMOVE)
       if(NOT CMAKE_HAVE_REMOVE)
-        CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
+        check_library_exists("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
         if(CMAKE_LIB_POSIX_HAS_REMOVE)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
         endif(CMAKE_LIB_POSIX_HAS_REMOVE)
       endif(NOT CMAKE_HAVE_REMOVE)
 
       # Find library needed for shmat.
-      CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT)
+      check_function_exists("shmat" CMAKE_HAVE_SHMAT)
       if(NOT CMAKE_HAVE_SHMAT)
-        CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
+        check_library_exists("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
         if(CMAKE_LIB_IPS_HAS_SHMAT)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
         endif(CMAKE_LIB_IPS_HAS_SHMAT)
       endif(NOT CMAKE_HAVE_SHMAT)
     endif($ENV{ISC} MATCHES "^yes$")
 
     if(X11_ICE_FOUND)
-      CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
+      check_library_exists("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
         CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
       if(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
-        SET (X11_X_PRE_LIBS ${X11_ICE_LIB})
+        set (X11_X_PRE_LIBS ${X11_ICE_LIB})
         if(X11_SM_LIB)
-          SET (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
+          set (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
         endif(X11_SM_LIB)
       endif(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
     endif(X11_ICE_FOUND)
@@ -548,7 +548,7 @@
     endif("${LIB_PATH_CNT}" GREATER 1)
 
     include(FindPackageMessage)
-    FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
+    find_package_message(X11 "Found X11: ${X11_X11_LIB}"
       "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
   else(X11_FOUND)
     if(X11_FIND_REQUIRED)
Index: src/other/boost/libs/thread/CMakeLists.txt
===================================================================
--- src/other/boost/libs/thread/CMakeLists.txt	(revision 54114)
+++ src/other/boost/libs/thread/CMakeLists.txt	(working copy)
@@ -6,7 +6,7 @@
 
 if(CMAKE_THREAD_LIBS_INIT)
 
-SET(thread_win32_SRCS
+set(thread_win32_SRCS
 	src/win32/thread.cpp
 	src/win32/tss_dll.cpp
 	src/win32/tss_pe.cpp
@@ -17,11 +17,11 @@
 	src/pthread/once.cpp
 	)
 
-IF(WIN32)
-	SET(thread_SRCS ${thread_win32_SRCS})
-ELSE(WIN32)
-	SET(thread_SRCS ${pthread_SRCS})
-ENDIF(WIN32)
+if(WIN32)
+	set(thread_SRCS ${thread_win32_SRCS})
+else(WIN32)
+	set(thread_SRCS ${pthread_SRCS})
+endif(WIN32)
 
 add_library(boost_threads SHARED ${thread_SRCS})
 target_link_libraries(boost_threads ${CMAKE_THREAD_LIBS_INIT})
Index: src/other/boost/libs/date_time/CMakeLists.txt
===================================================================
--- src/other/boost/libs/date_time/CMakeLists.txt	(revision 54114)
+++ src/other/boost/libs/date_time/CMakeLists.txt	(working copy)
@@ -2,7 +2,7 @@
 	../..
 	)
 
-SET(date_time_SRCS
+set(date_time_SRCS
 	src/gregorian/greg_month.cpp
 	src/gregorian/greg_weekday.cpp
 	src/gregorian/date_generators.cpp
Index: src/other/boost/CMakeLists.txt
===================================================================
--- src/other/boost/CMakeLists.txt	(revision 54114)
+++ src/other/boost/CMakeLists.txt	(working copy)
@@ -1,3 +1,3 @@
-ADD_SUBDIRECTORY(libs/date_time)
-ADD_SUBDIRECTORY(libs/smart_ptr)
-ADD_SUBDIRECTORY(libs/thread)
+add_subdirectory(libs/date_time)
+add_subdirectory(libs/smart_ptr)
+add_subdirectory(libs/thread)
Index: src/other/Eigen/Eigen/src/IterativeLinearSolvers/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/IterativeLinearSolvers/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/IterativeLinearSolvers/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_IterativeLinearSolvers_SRCS "*.h")
+file(GLOB Eigen_IterativeLinearSolvers_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_IterativeLinearSolvers_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/IterativeLinearSolvers COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/PaStiXSupport/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/PaStiXSupport/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/PaStiXSupport/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_PastixSupport_SRCS "*.h")
+file(GLOB Eigen_PastixSupport_SRCS "*.h")
 
-INSTALL(FILES 
+install(FILES 
   ${Eigen_PastixSupport_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/PaStiXSupport COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/SparseCore/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/SparseCore/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/SparseCore/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_SparseCore_SRCS "*.h")
+file(GLOB Eigen_SparseCore_SRCS "*.h")
 
-INSTALL(FILES 
+install(FILES 
   ${Eigen_SparseCore_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseCore COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/Eigen2Support/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Eigen2Support/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Eigen2Support/CMakeLists.txt	(working copy)
@@ -1,8 +1,8 @@
-FILE(GLOB Eigen_Eigen2Support_SRCS "*.h")
+file(GLOB Eigen_Eigen2Support_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_Eigen2Support_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Eigen2Support COMPONENT Devel
   )
 
-ADD_SUBDIRECTORY(Geometry)
\ No newline at end of file
+add_subdirectory(Geometry)
Index: src/other/Eigen/Eigen/src/Eigen2Support/Geometry/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Eigen2Support/Geometry/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Eigen2Support/Geometry/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_Eigen2Support_Geometry_SRCS "*.h")
+file(GLOB Eigen_Eigen2Support_Geometry_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_Eigen2Support_Geometry_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Eigen2Support/Geometry
   )
Index: src/other/Eigen/Eigen/src/Eigenvalues/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Eigenvalues/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Eigenvalues/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_EIGENVALUES_SRCS "*.h")
+file(GLOB Eigen_EIGENVALUES_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_EIGENVALUES_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Eigenvalues COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/MetisSupport/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/MetisSupport/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/MetisSupport/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_MetisSupport_SRCS "*.h")
+file(GLOB Eigen_MetisSupport_SRCS "*.h")
 
-INSTALL(FILES 
+install(FILES 
   ${Eigen_MetisSupport_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/MetisSupport COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/LU/arch/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/LU/arch/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/LU/arch/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_LU_arch_SRCS "*.h")
+file(GLOB Eigen_LU_arch_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_LU_arch_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/LU/arch COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/LU/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/LU/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/LU/CMakeLists.txt	(working copy)
@@ -1,8 +1,8 @@
-FILE(GLOB Eigen_LU_SRCS "*.h")
+file(GLOB Eigen_LU_SRCS "*.h")
 
-INSTALL(FILES 
+install(FILES 
   ${Eigen_LU_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/LU COMPONENT Devel
   )
 
-ADD_SUBDIRECTORY(arch)
+add_subdirectory(arch)
Index: src/other/Eigen/Eigen/src/plugins/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/plugins/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/plugins/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_plugins_SRCS "*.h")
+file(GLOB Eigen_plugins_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_plugins_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/plugins COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/Cholesky/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Cholesky/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Cholesky/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_Cholesky_SRCS "*.h")
+file(GLOB Eigen_Cholesky_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_Cholesky_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Cholesky COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/Householder/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Householder/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Householder/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_Householder_SRCS "*.h")
+file(GLOB Eigen_Householder_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_Householder_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Householder COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/CholmodSupport/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/CholmodSupport/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/CholmodSupport/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_CholmodSupport_SRCS "*.h")
+file(GLOB Eigen_CholmodSupport_SRCS "*.h")
 
-INSTALL(FILES 
+install(FILES 
   ${Eigen_CholmodSupport_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/CholmodSupport COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/QR/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/QR/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/QR/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_QR_SRCS "*.h")
+file(GLOB Eigen_QR_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_QR_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/QR COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/UmfPackSupport/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/UmfPackSupport/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/UmfPackSupport/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_UmfPackSupport_SRCS "*.h")
+file(GLOB Eigen_UmfPackSupport_SRCS "*.h")
 
-INSTALL(FILES 
+install(FILES 
   ${Eigen_UmfPackSupport_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/UmfPackSupport COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/Jacobi/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Jacobi/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Jacobi/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_Jacobi_SRCS "*.h")
+file(GLOB Eigen_Jacobi_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_Jacobi_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Jacobi COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/Core/util/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Core/util/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Core/util/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_Core_util_SRCS "*.h")
+file(GLOB Eigen_Core_util_SRCS "*.h")
 
-INSTALL(FILES 
+install(FILES 
   ${Eigen_Core_util_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/util COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/Core/arch/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Core/arch/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Core/arch/CMakeLists.txt	(working copy)
@@ -1,4 +1,4 @@
-ADD_SUBDIRECTORY(SSE)
-ADD_SUBDIRECTORY(AltiVec)
-ADD_SUBDIRECTORY(NEON)
-ADD_SUBDIRECTORY(Default)
+add_subdirectory(SSE)
+add_subdirectory(AltiVec)
+add_subdirectory(NEON)
+add_subdirectory(Default)
Index: src/other/Eigen/Eigen/src/Core/arch/NEON/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Core/arch/NEON/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Core/arch/NEON/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_Core_arch_NEON_SRCS "*.h")
+file(GLOB Eigen_Core_arch_NEON_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_Core_arch_NEON_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/NEON COMPONENT Devel
 )
Index: src/other/Eigen/Eigen/src/Core/arch/Default/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Core/arch/Default/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Core/arch/Default/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_Core_arch_Default_SRCS "*.h")
+file(GLOB Eigen_Core_arch_Default_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_Core_arch_Default_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/Default COMPONENT Devel
 )
Index: src/other/Eigen/Eigen/src/Core/arch/AltiVec/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Core/arch/AltiVec/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Core/arch/AltiVec/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_Core_arch_AltiVec_SRCS "*.h")
+file(GLOB Eigen_Core_arch_AltiVec_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_Core_arch_AltiVec_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/AltiVec COMPONENT Devel
 )
Index: src/other/Eigen/Eigen/src/Core/arch/SSE/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Core/arch/SSE/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Core/arch/SSE/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_Core_arch_SSE_SRCS "*.h")
+file(GLOB Eigen_Core_arch_SSE_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_Core_arch_SSE_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/SSE COMPONENT Devel
 )
Index: src/other/Eigen/Eigen/src/Core/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Core/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Core/CMakeLists.txt	(working copy)
@@ -1,10 +1,10 @@
-FILE(GLOB Eigen_Core_SRCS "*.h")
+file(GLOB Eigen_Core_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_Core_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core COMPONENT Devel
   )
 
-ADD_SUBDIRECTORY(products)
-ADD_SUBDIRECTORY(util)
-ADD_SUBDIRECTORY(arch)
+add_subdirectory(products)
+add_subdirectory(util)
+add_subdirectory(arch)
Index: src/other/Eigen/Eigen/src/Core/products/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Core/products/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Core/products/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_Core_Product_SRCS "*.h")
+file(GLOB Eigen_Core_Product_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_Core_Product_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/products COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/Geometry/arch/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Geometry/arch/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Geometry/arch/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_Geometry_arch_SRCS "*.h")
+file(GLOB Eigen_Geometry_arch_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_Geometry_arch_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Geometry/arch COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/Geometry/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/Geometry/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/Geometry/CMakeLists.txt	(working copy)
@@ -1,8 +1,8 @@
-FILE(GLOB Eigen_Geometry_SRCS "*.h")
+file(GLOB Eigen_Geometry_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_Geometry_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Geometry COMPONENT Devel
   )
 
-ADD_SUBDIRECTORY(arch)
+add_subdirectory(arch)
Index: src/other/Eigen/Eigen/src/misc/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/misc/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/misc/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_misc_SRCS "*.h")
+file(GLOB Eigen_misc_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_misc_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/misc COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/SVD/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/SVD/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/SVD/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_SVD_SRCS "*.h")
+file(GLOB Eigen_SVD_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_SVD_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SVD COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/SuperLUSupport/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/SuperLUSupport/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/SuperLUSupport/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_SuperLUSupport_SRCS "*.h")
+file(GLOB Eigen_SuperLUSupport_SRCS "*.h")
 
-INSTALL(FILES 
+install(FILES 
   ${Eigen_SuperLUSupport_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SuperLUSupport COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/OrderingMethods/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/OrderingMethods/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/OrderingMethods/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_OrderingMethods_SRCS "*.h")
+file(GLOB Eigen_OrderingMethods_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_OrderingMethods_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/OrderingMethods COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/SparseLU/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/SparseLU/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/SparseLU/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_SparseLU_SRCS "*.h")
+file(GLOB Eigen_SparseLU_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_SparseLU_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseLU COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/PardisoSupport/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/PardisoSupport/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/PardisoSupport/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_PardisoSupport_SRCS "*.h")
+file(GLOB Eigen_PardisoSupport_SRCS "*.h")
 
-INSTALL(FILES 
+install(FILES 
   ${Eigen_PardisoSupport_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/PardisoSupport COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/StlSupport/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/StlSupport/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/StlSupport/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_StlSupport_SRCS "*.h")
+file(GLOB Eigen_StlSupport_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_StlSupport_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/StlSupport COMPONENT Devel
   )
Index: src/other/Eigen/Eigen/src/SparseCholesky/CMakeLists.txt
===================================================================
--- src/other/Eigen/Eigen/src/SparseCholesky/CMakeLists.txt	(revision 54114)
+++ src/other/Eigen/Eigen/src/SparseCholesky/CMakeLists.txt	(working copy)
@@ -1,6 +1,6 @@
-FILE(GLOB Eigen_SparseCholesky_SRCS "*.h")
+file(GLOB Eigen_SparseCholesky_SRCS "*.h")
 
-INSTALL(FILES
+install(FILES
   ${Eigen_SparseCholesky_SRCS}
   DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseCholesky COMPONENT Devel
   )
Index: src/other/osl/shaders/CMakeLists.txt
===================================================================
--- src/other/osl/shaders/CMakeLists.txt	(revision 54114)
+++ src/other/osl/shaders/CMakeLists.txt	(working copy)
@@ -12,31 +12,31 @@
     #message (STATUS "  bin ${CMAKE_CURRENT_BINARY_DIR}")
 
     # Get the filename (from the full path) without the extension
-    GET_FILENAME_COMPONENT( oslsrc_we ${oslsrc} NAME_WE )
+    get_filename_component( oslsrc_we ${oslsrc} NAME_WE )
 
     #message(STATUS "OSL RAW = ${oslsrc_we}")
 
     # Set the destination of the output file (changes .osl by .oso)
-    SET(osofile "${CMAKE_CURRENT_BINARY_DIR}/${oslsrc_we}.oso")
+    set(osofile "${CMAKE_CURRENT_BINARY_DIR}/${oslsrc_we}.oso")
 
-    SET( ${objlist} ${${objlist}} ${osofile} )
+    set( ${objlist} ${${objlist}} ${osofile} )
 
     #message (STATUS "  obj list now ${${objlist}}")
     #message(STATUS "${OSLHOME}/bin/oslc ${oslsrc}")
 
     # Compile the shader with ./oslc
-    ADD_CUSTOM_COMMAND ( OUTPUT ${osofile}
+    add_custom_command ( OUTPUT ${osofile}
 	COMMAND ${OSLHOME}/bin/oslc ${oslsrc}
 	DEPENDS ${${headers}} ${oslsrc} ${CMAKE_CURRENT_SOURCE_DIR}/stdosl.h ${OSLHOME}/bin/oslc
 	WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
 endmacro ()
 
-FILE(GLOB shader_headers "*.h")
-FILE(GLOB shader_source "*.osl")
+file(GLOB shader_headers "*.h")
+file(GLOB shader_source "*.osl")
 
-FOREACH(_shadername ${shader_source})
+foreach(_shadername ${shader_source})
     osl_compile (${_shadername} shader_objs shader_headers)
-ENDFOREACH()
+endforeach()
 
 add_custom_target (shaders ALL
     DEPENDS ${shader_objs}
Index: src/other/osl/CMakeLists.txt
===================================================================
--- src/other/osl/CMakeLists.txt	(revision 54114)
+++ src/other/osl/CMakeLists.txt	(working copy)
@@ -1,3 +1,3 @@
 message("Compiling OSL")
 
-ADD_SUBDIRECTORY(shaders)
+add_subdirectory(shaders)
Index: src/other/incrTcl/itcl/CMakeLists.txt
===================================================================
--- src/other/incrTcl/itcl/CMakeLists.txt	(revision 54114)
+++ src/other/incrTcl/itcl/CMakeLists.txt	(working copy)
@@ -37,39 +37,39 @@
 # *******************************************************************
 
 # Minimum required version of CMake
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-IF(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND CMAKE_POLICY)
+cmake_minimum_required(VERSION 2.8)
+if(COMMAND CMAKE_POLICY)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND CMAKE_POLICY)
 
 # set CMake project name
-PROJECT(ITCL)
+project(ITCL)
 
 # Without Tcl libraries AND sources, we can't build Tk.  Use TCL_SRC_PREFIX
 # and TCL_BIN_PREFIX to identify the location of the Tcl we are to use.
-IF(TCL_SRC_PREFIX AND TCL_BIN_PREFIX)
-  SET(TCL_INCLUDE_DIRS ${TCL_SRC_PREFIX}/generic ${TCL_SRC_PREFIX}/libtommath)
-  IF(WIN32)
-    SET(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${TCL_SRC_PREFIX}/win)
-  ELSE(WIN32)
-    SET(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${TCL_SRC_PREFIX}/unix)
-  ENDIF(WIN32)
+if(TCL_SRC_PREFIX AND TCL_BIN_PREFIX)
+  set(TCL_INCLUDE_DIRS ${TCL_SRC_PREFIX}/generic ${TCL_SRC_PREFIX}/libtommath)
+  if(WIN32)
+    set(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${TCL_SRC_PREFIX}/win)
+  else(WIN32)
+    set(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${TCL_SRC_PREFIX}/unix)
+  endif(WIN32)
   # Locate the TCL libraries.  We allow these to be overridden so that a parent
   # build can use a CMake target instead of an actual library path.
-  IF(NOT TCL_LIBRARY)
+  if(NOT TCL_LIBRARY)
     find_library(TCL_LIBRARY tcl PATHS ${TCL_BIN_PREFIX}/lib)
-  ENDIF(NOT TCL_LIBRARY)
-  IF(NOT TCL_STUB_LIBRARY)
+  endif(NOT TCL_LIBRARY)
+  if(NOT TCL_STUB_LIBRARY)
     find_library(TCL_STUB_LIBRARY tclstub PATHS ${TCL_BIN_PREFIX}/lib)
-  ENDIF(NOT TCL_STUB_LIBRARY)
-  IF(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY)
-    MESSAGE(FATAL_ERROR "Could not find Tcl libraries in ${TCL_BIN_PREFIX} - please specify the parent directory for the libraries in the TCL_BIN_PREFIX variable (e.g. \${TCL_BIN_PREFIX}/lib)")
-  ENDIF(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY)
-ELSE(TCL_SRC_PREFIX and TCL_BIN_PREFIX)
-  MESSAGE(FATAL_ERROR "Please specify the source and library locations of Tcl using the TCL_SRC_PREFIX and TCL_BIN_PREFIX variables.")
-ENDIF(TCL_SRC_PREFIX AND TCL_BIN_PREFIX)
-MARK_AS_ADVANCED(TCL_LIBRARY)
-MARK_AS_ADVANCED(TCL_STUB_LIBRARY)
+  endif(NOT TCL_STUB_LIBRARY)
+  if(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY)
+    message(FATAL_ERROR "Could not find Tcl libraries in ${TCL_BIN_PREFIX} - please specify the parent directory for the libraries in the TCL_BIN_PREFIX variable (e.g. \${TCL_BIN_PREFIX}/lib)")
+  endif(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY)
+else(TCL_SRC_PREFIX and TCL_BIN_PREFIX)
+  message(FATAL_ERROR "Please specify the source and library locations of Tcl using the TCL_SRC_PREFIX and TCL_BIN_PREFIX variables.")
+endif(TCL_SRC_PREFIX AND TCL_BIN_PREFIX)
+mark_as_advanced(TCL_LIBRARY)
+mark_as_advanced(TCL_STUB_LIBRARY)
 
 # build shared libs by default
 set(BUILD_SHARED_LIBS ON)
@@ -78,11 +78,11 @@
 set(BUILD_STATIC_LIBS ON)
 
 # version numbers
-SET(ITCL_VERSION_MAJOR 3)
-SET(ITCL_VERSION_MINOR 4)
-SET(ITCL_PATCH_LEVEL ${ITCL_VERSION_MAJOR}.${ITCL_VERSION_MINOR})
+set(ITCL_VERSION_MAJOR 3)
+set(ITCL_VERSION_MINOR 4)
+set(ITCL_PATCH_LEVEL ${ITCL_VERSION_MAJOR}.${ITCL_VERSION_MINOR})
 
-SET(ITCL_VERSION "${ITCL_VERSION_MAJOR}.${ITCL_VERSION_MINOR}")
+set(ITCL_VERSION "${ITCL_VERSION_MAJOR}.${ITCL_VERSION_MINOR}")
 
 #---------------------------------------------------------------------
 # The following logic is what allows binaries to run successfully in
@@ -90,49 +90,49 @@
 # identifying the necessity of setting CMAKE_INSTALL_NAME_DIR on OSX.
 
 # use, i.e. don't skip the full RPATH for the build tree
-SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
+set(CMAKE_SKIP_BUILD_RPATH  FALSE)
 
 # when building, don't use the install RPATH already
 # (but later on when installing)
-SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
 
 # the RPATH/INSTALL_NAME_DIR to be used when installing
 if (NOT APPLE)
-  SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:\$ORIGIN/../lib")
+  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:\$ORIGIN/../lib")
 endif(NOT APPLE)
-SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
 
 # add the automatically determined parts of the RPATH which point to
 # directories outside the build tree to the install RPATH
-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 
 #----------------------------------------------------------------------------
 # The location in which to install Tcl.  Only do this if CMAKE_INSTALL_PREFIX 
 # hasn't been set already, to try and allow parent builds (if any) some control.
-IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-  IF(NOT WIN32)
-    IF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
-      SET(CMAKE_INSTALL_PREFIX "/usr/local/tcldev-${TCL_VERSION}")
-    ELSE ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
-      SET(CMAKE_INSTALL_PREFIX "/usr")
-    ENDIF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
-  ENDIF(NOT WIN32)
-  SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "TCL install prefix" FORCE)
-  SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 0)
-ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+  if(NOT WIN32)
+    if ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
+      set(CMAKE_INSTALL_PREFIX "/usr/local/tcldev-${TCL_VERSION}")
+    else ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
+      set(CMAKE_INSTALL_PREFIX "/usr")
+    endif ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
+  endif(NOT WIN32)
+  set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "TCL install prefix" FORCE)
+  set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 0)
+endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
 
 #-----------------------------------------------------------------------------
 # Output directories.
 
-IF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-  SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
-ENDIF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-IF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
-  SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
-ENDIF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
-IF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
-  SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
-ENDIF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
+endif(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
+  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
+endif(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
+if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
+endif(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
 
 #----------------------------------------------------------------------------
 # First, get some standard options out of the way - things that are constant
@@ -154,27 +154,27 @@
 #--------------------------------------------------------------------
 add_definitions(-DTCL_THREADS=1)
 
-MACRO(TCL_CHECK_INCLUDE_FILE filename var)
-  CHECK_INCLUDE_FILE(${filename} ${var})
-  IF(${var})
+macro(TCL_CHECK_INCLUDE_FILE filename var)
+  check_include_file(${filename} ${var})
+  if(${var})
     add_definitions(-D${var}=1)
-  ENDIF(${var})
-ENDMACRO(TCL_CHECK_INCLUDE_FILE)
+  endif(${var})
+endmacro(TCL_CHECK_INCLUDE_FILE)
 
-TCL_CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
-TCL_CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
-TCL_CHECK_INCLUDE_FILE(sys/fstatfs.h HAVE_SYS_FSTATFS_H)
-IF(NOT HAVE_SYS_FSTATFS_H)
+tcl_check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+tcl_check_include_file(sys/stat.h HAVE_SYS_STAT_H)
+tcl_check_include_file(sys/fstatfs.h HAVE_SYS_FSTATFS_H)
+if(NOT HAVE_SYS_FSTATFS_H)
   add_definitions(-DNO_FSTATFS=1)
-ENDIF(NOT HAVE_SYS_FSTATFS_H)
-TCL_CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
-TCL_CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-TCL_CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
-TCL_CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
-TCL_CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
+endif(NOT HAVE_SYS_FSTATFS_H)
+tcl_check_include_file(memory.h HAVE_MEMORY_H)
+tcl_check_include_file(strings.h HAVE_STRINGS_H)
+tcl_check_include_file(inttypes.h HAVE_INTTYPES_H)
+tcl_check_include_file(stdint.h HAVE_STDINT_H)
+tcl_check_include_file(unistd.h HAVE_UNISTD_H)
 
 
-SET(ITCL_GENERIC_SRCS
+set(ITCL_GENERIC_SRCS
   generic/itclStubInit.c
   generic/itclStubLib.c
   generic/itcl_bicmds.c
@@ -189,17 +189,17 @@
   generic/itcl_util.c
   )
 
-SET(ITCL_WIN_SRCS
+set(ITCL_WIN_SRCS
   win/dllEntryPoint.c
   )
 
-SET(ITCL_STUB_SRCS
+set(ITCL_STUB_SRCS
   generic/itclStubLib.c
   )
 
 
-SET(ITCL_INCLUDE_DIRS ${ITCL_SOURCE_DIR}/generic ${ITCL_BINARY_DIR}/include)
-MARK_AS_ADVANCED(ITCL_INCLUDE_DIRS)
+set(ITCL_INCLUDE_DIRS ${ITCL_SOURCE_DIR}/generic ${ITCL_BINARY_DIR}/include)
+mark_as_advanced(ITCL_INCLUDE_DIRS)
 
 include_directories(
   ${TCL_INCLUDE_DIRS}
@@ -208,15 +208,15 @@
   ${CMAKE_SOURCE_DIR}/include
   )
 
-IF(WIN32)
+if(WIN32)
   add_library(itcl ${ITCL_GENERIC_SRCS} ${ITCL_WIN_SRCS})
-ELSE(WIN32)
+else(WIN32)
   add_library(itcl ${ITCL_GENERIC_SRCS})
-ENDIF(WIN32)
+endif(WIN32)
 target_link_libraries(itcl ${M_LIBRARY} ${TCL_STUB_LIBRARIES} )
-SET_TARGET_PROPERTIES(itcl PROPERTIES PREFIX "lib")
-SET_TARGET_PROPERTIES(itcl PROPERTIES VERSION ${ITCL_VERSION} SOVERSION ${ITCL_VERSION_MAJOR})
-SET_PROPERTY(TARGET itcl APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
+set_target_properties(itcl PROPERTIES PREFIX "lib")
+set_target_properties(itcl PROPERTIES VERSION ${ITCL_VERSION} SOVERSION ${ITCL_VERSION_MAJOR})
+set_property(TARGET itcl APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
 install(TARGETS itcl 
   RUNTIME DESTINATION ${BIN_DIR}
   LIBRARY DESTINATION ${LIB_DIR}
@@ -227,9 +227,9 @@
   RUNTIME DESTINATION ${BIN_DIR}
   LIBRARY DESTINATION ${LIB_DIR}
   ARCHIVE DESTINATION ${LIB_DIR})
-SET_PROPERTY(TARGET itclstub APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
+set_property(TARGET itclstub APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
 
-TCL_PKGINDEX(itcl Itcl "${ITCL_VERSION_MAJOR}.${ITCL_VERSION_MINOR}")
+tcl_pkgindex(itcl Itcl "${ITCL_VERSION_MAJOR}.${ITCL_VERSION_MINOR}")
 
 if(NOT CMAKE_CONFIGURATION_TYPES)
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/library/itcl.tcl ${CMAKE_BINARY_DIR}/lib/itcl${ITCL_VERSION_MAJOR}.${ITCL_VERSION_MINOR}/itcl.tcl COPYONLY)
@@ -241,7 +241,7 @@
 endif(NOT CMAKE_CONFIGURATION_TYPES)
 install(FILES library/itcl.tcl DESTINATION lib/itcl${ITCL_VERSION_MAJOR}.${ITCL_VERSION_MINOR})
 
-SET(ITCL_HDRS
+set(ITCL_HDRS
   generic/itcl.h
   generic/itclDecls.h
   generic/itclInt.h
Index: src/other/incrTcl/itcl/CMake/CheckCSourceRuns.cmake
===================================================================
--- src/other/incrTcl/itcl/CMake/CheckCSourceRuns.cmake	(revision 54114)
+++ src/other/incrTcl/itcl/CMake/CheckCSourceRuns.cmake	(working copy)
@@ -70,32 +70,32 @@
 # 
 #=============================================================================
 
-MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
-  IF("${VAR}" MATCHES "^${VAR}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS 
+macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
+  if("${VAR}" MATCHES "^${VAR}$")
+    set(MACRO_CHECK_FUNCTION_DEFINITIONS 
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    IF(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
+    if(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
+    else(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    IF(EXISTS "${SOURCE}")
-      SET(CHECK_SRC "${SOURCE}")
-    ELSE(EXISTS "${SOURCE}")
-      FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    if(EXISTS "${SOURCE}")
+      set(CHECK_SRC "${SOURCE}")
+    else(EXISTS "${SOURCE}")
+      file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
         "${SOURCE}\n")
-      SET(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
-    ENDIF(EXISTS "${SOURCE}")
+      set(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
+    endif(EXISTS "${SOURCE}")
     
-    MESSAGE(STATUS "Performing Test ${VAR}")
-    TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
+    message(STATUS "Performing Test ${VAR}")
+    try_run(${VAR}_EXITCODE ${VAR}_COMPILED
       ${CMAKE_BINARY_DIR}
       ${CHECK_SRC}
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -105,33 +105,33 @@
       "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
       COMPILE_OUTPUT_VARIABLE OUTPUT)
     # if it did not compile make the return value fail code of 1
-    IF(NOT ${VAR}_COMPILED)
-      SET(${VAR}_EXITCODE 1)
-    ENDIF(NOT ${VAR}_COMPILED)
+    if(NOT ${VAR}_COMPILED)
+      set(${VAR}_EXITCODE 1)
+    endif(NOT ${VAR}_COMPILED)
     # if the return value was 0 then it worked
-    IF("${${VAR}_EXITCODE}" EQUAL 0)
-      SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
-      MESSAGE(STATUS "Performing Test ${VAR} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+    if("${${VAR}_EXITCODE}" EQUAL 0)
+      set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+      message(STATUS "Performing Test ${VAR} - Success")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
         "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}}\n"
         "Source file was:\n${SOURCE}\n")
-    ELSE("${${VAR}_EXITCODE}" EQUAL 0)
-      IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "${${VAR}_EXITCODE}")
-      ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+    else("${${VAR}_EXITCODE}" EQUAL 0)
+      if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "${${VAR}_EXITCODE}")
+      else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+      endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
 
-      MESSAGE(STATUS "Performing Test ${VAR} - Failed")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      message(STATUS "Performing Test ${VAR} - Failed")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
         "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}_EXITCODE}\n"
         "Source file was:\n${SOURCE}\n")
 
-    ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
-  ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_C_SOURCE_RUNS)
+    endif("${${VAR}_EXITCODE}" EQUAL 0)
+  endif("${VAR}" MATCHES "^${VAR}$")
+endmacro(CHECK_C_SOURCE_RUNS)
 
Index: src/other/incrTcl/itcl/CMake/CheckSystemFunctionality.cmake
===================================================================
--- src/other/incrTcl/itcl/CMake/CheckSystemFunctionality.cmake	(revision 54114)
+++ src/other/incrTcl/itcl/CMake/CheckSystemFunctionality.cmake	(working copy)
@@ -1,35 +1,35 @@
 # Checking compiler flags benefits from some macro logic
 
-INCLUDE(CheckCCompilerFlag)
+include(CheckCCompilerFlag)
 
-MACRO(CHECK_C_FLAG flag)
-  STRING(TOUPPER ${flag} UPPER_FLAG)
-  STRING(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
-  STRING(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
-  IF(${ARGC} LESS 2)
-    CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-  ELSE(${ARGC} LESS 2)
-    IF(NOT ${ARGV1})
-      CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-      IF(${UPPER_FLAG}_COMPILER_FLAG)
-	MESSAGE("- Found ${ARGV1} - setting to -${flag}")
-	SET(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
-      ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-    ENDIF(NOT ${ARGV1})
-  ENDIF(${ARGC} LESS 2)
-  IF(${UPPER_FLAG}_COMPILER_FLAG)
-    SET(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
-  ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-ENDMACRO()
+macro(CHECK_C_FLAG flag)
+  string(TOUPPER ${flag} UPPER_FLAG)
+  string(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
+  string(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
+  if(${ARGC} LESS 2)
+    check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+  else(${ARGC} LESS 2)
+    if(NOT ${ARGV1})
+      check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+      if(${UPPER_FLAG}_COMPILER_FLAG)
+	message("- Found ${ARGV1} - setting to -${flag}")
+	set(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
+      endif(${UPPER_FLAG}_COMPILER_FLAG)
+    endif(NOT ${ARGV1})
+  endif(${ARGC} LESS 2)
+  if(${UPPER_FLAG}_COMPILER_FLAG)
+    set(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
+  endif(${UPPER_FLAG}_COMPILER_FLAG)
+endmacro()
 
-MACRO(CHECK_C_FLAG_GATHER flag FLAGS)
-  STRING(TOUPPER ${flag} UPPER_FLAG)
-  STRING(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
-  CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-  IF(${UPPER_FLAG}_COMPILER_FLAG)
-    SET(${FLAGS} "${${FLAGS}} -${flag}")
-  ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-ENDMACRO()
+macro(CHECK_C_FLAG_GATHER flag FLAGS)
+  string(TOUPPER ${flag} UPPER_FLAG)
+  string(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
+  check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+  if(${UPPER_FLAG}_COMPILER_FLAG)
+    set(${FLAGS} "${${FLAGS}} -${flag}")
+  endif(${UPPER_FLAG}_COMPILER_FLAG)
+endmacro()
 
 
 # Automate putting variables from tests into CFLAGS,
@@ -40,78 +40,78 @@
 # If a CONFIG_CFLAGS variable is defined, they will append
 # an appropriate definition to that variable.
 
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckIncludeFileCXX)
-INCLUDE(CheckTypeSize)
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckStructHasMember)
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(ResolveCompilerPaths)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckTypeSize)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(ResolveCompilerPaths)
 
-MACRO(CONFIG_CHECK_FUNCTION_EXISTS function var)
-  CHECK_FUNCTION_EXISTS(${function} ${var})
-  IF(${var})
+macro(CONFIG_CHECK_FUNCTION_EXISTS function var)
+  check_function_exists(${function} ${var})
+  if(${var})
     add_definitions(-D${var}=1)
-  ENDIF(${var})
-ENDMACRO(CONFIG_CHECK_FUNCTION_EXISTS)
+  endif(${var})
+endmacro(CONFIG_CHECK_FUNCTION_EXISTS)
 
-MACRO(CONFIG_CHECK_INCLUDE_FILE filename var)
-  CHECK_INCLUDE_FILE(${filename} ${var})
-  IF(${var})
+macro(CONFIG_CHECK_INCLUDE_FILE filename var)
+  check_include_file(${filename} ${var})
+  if(${var})
     add_definitions(-D${var}=1)
-  ENDIF(${var})
-ENDMACRO(CONFIG_CHECK_INCLUDE_FILE)
+  endif(${var})
+endmacro(CONFIG_CHECK_INCLUDE_FILE)
 
-MACRO(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
-  CHECK_INCLUDE_FILE(${filename} HAVE_${var})
-  IF(HAVE_${var})
-    SET(HEADER_SRC "
+macro(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
+  check_include_file(${filename} HAVE_${var})
+  if(HAVE_${var})
+    set(HEADER_SRC "
 		#include <${filename}>
 		main(){};
 		")
-    CHECK_C_SOURCE_COMPILES("${HEADER_SRC}" ${var}_USABLE)
-  ENDIF(HAVE_${var})
-  IF(NOT HAVE_${var} OR NOT ${var}_USABLE)
+    check_c_source_compiles("${HEADER_SRC}" ${var}_USABLE)
+  endif(HAVE_${var})
+  if(NOT HAVE_${var} OR NOT ${var}_USABLE)
     add_definitions(-DNO_${var}=1)
-  ENDIF(NOT HAVE_${var} OR NOT ${var}_USABLE)
-ENDMACRO(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
+  endif(NOT HAVE_${var} OR NOT ${var}_USABLE)
+endmacro(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
 
-MACRO(CONFIG_CHECK_INCLUDE_FILE_CXX filename var)
-  CHECK_INCLUDE_FILE_CXX(${filename} ${var})
-  IF(${var})
+macro(CONFIG_CHECK_INCLUDE_FILE_CXX filename var)
+  check_include_file_cxx(${filename} ${var})
+  if(${var})
     add_definitions(-D${var}=1)
-  ENDIF(${var})
-ENDMACRO(CONFIG_CHECK_INCLUDE_FILE_CXX)
+  endif(${var})
+endmacro(CONFIG_CHECK_INCLUDE_FILE_CXX)
 
-MACRO(CONFIG_CHECK_TYPE_SIZE typename var)
-  FOREACH(arg ${ARGN})
-    SET(headers ${headers} ${arg})
-  ENDFOREACH(arg ${ARGN})
-  SET(CHECK_EXTRA_INCLUDE_FILES ${headers})
-  CHECK_TYPE_SIZE(${typename} HAVE_${var}_T)
-  SET(CHECK_EXTRA_INCLUDE_FILES)
-  IF(HAVE_${var}_T)
+macro(CONFIG_CHECK_TYPE_SIZE typename var)
+  foreach(arg ${ARGN})
+    set(headers ${headers} ${arg})
+  endforeach(arg ${ARGN})
+  set(CHECK_EXTRA_INCLUDE_FILES ${headers})
+  check_type_size(${typename} HAVE_${var}_T)
+  set(CHECK_EXTRA_INCLUDE_FILES)
+  if(HAVE_${var}_T)
     add_definitions(-DHAVE_${var}_T=1)
     add_definitions(-DSIZEOF${var}=${HAVE_${var}_T})		
-  ENDIF(HAVE_${var}_T)
-ENDMACRO(CONFIG_CHECK_TYPE_SIZE)
+  endif(HAVE_${var}_T)
+endmacro(CONFIG_CHECK_TYPE_SIZE)
 
-MACRO(CONFIG_CHECK_STRUCT_HAS_MEMBER structname member header var)
-  CHECK_STRUCT_HAS_MEMBER(${structname} ${member} ${header} HAVE_${var})
-  IF(HAVE_${var})
+macro(CONFIG_CHECK_STRUCT_HAS_MEMBER structname member header var)
+  check_struct_has_member(${structname} ${member} ${header} HAVE_${var})
+  if(HAVE_${var})
     add_definitions(-DHAVE_${var}=1)
-  ENDIF(HAVE_${var})
-ENDMACRO(CONFIG_CHECK_STRUCT_HAS_MEMBER)
+  endif(HAVE_${var})
+endmacro(CONFIG_CHECK_STRUCT_HAS_MEMBER)
 
-MACRO(CONFIG_CHECK_LIBRARY targetname lname func)
-  IF(NOT ${targetname}_LIBRARY)
-    CHECK_LIBRARY_EXISTS(${lname} ${func} "" HAVE_${targetname}_${lname})
-    IF(HAVE_${targetname}_${lname})
-      RESOLVE_LIBRARIES(${targetname}_LIBRARY "-l${lname}")
-      SET(${targetname}_LINKOPT "-l${lname}")
-    ENDIF(HAVE_${targetname}_${lname})
-  ENDIF(NOT ${targetname}_LIBRARY)
-ENDMACRO(CONFIG_CHECK_LIBRARY lname func)
+macro(CONFIG_CHECK_LIBRARY targetname lname func)
+  if(NOT ${targetname}_LIBRARY)
+    check_library_exists(${lname} ${func} "" HAVE_${targetname}_${lname})
+    if(HAVE_${targetname}_${lname})
+      resolve_libraries(${targetname}_LIBRARY "-l${lname}")
+      set(${targetname}_LINKOPT "-l${lname}")
+    endif(HAVE_${targetname}_${lname})
+  endif(NOT ${targetname}_LIBRARY)
+endmacro(CONFIG_CHECK_LIBRARY lname func)
 
Index: src/other/incrTcl/itcl/CMake/FindTIMEZONE.cmake
===================================================================
--- src/other/incrTcl/itcl/CMake/FindTIMEZONE.cmake	(revision 54114)
+++ src/other/incrTcl/itcl/CMake/FindTIMEZONE.cmake	(working copy)
@@ -5,16 +5,16 @@
 #
 #=============================================================================
 
-SET(TZ_SEARCH_PATHS
+set(TZ_SEARCH_PATHS
 	/usr/share/zoneinfo
 	/usr/share/lib/zoneinfo
 	/usr/lib/zoneinfo
 	)
-FIND_PATH(TIMEZONE_DATA_DIR UTC PATHS ${TZ_SEARCH_PATHS} NO_DEFAULT_PATH)
-MARK_AS_ADVANCED(TIMEZONE_DATA_DIR)
+find_path(TIMEZONE_DATA_DIR UTC PATHS ${TZ_SEARCH_PATHS} NO_DEFAULT_PATH)
+mark_as_advanced(TIMEZONE_DATA_DIR)
 
 # handle the QUIETLY and REQUIRED arguments and set REGEX_FOUND to TRUE if 
 # all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIMEZONE DEFAULT_MSG TIMEZONE_DATA_DIR)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(TIMEZONE DEFAULT_MSG TIMEZONE_DATA_DIR)
 
Index: src/other/incrTcl/itcl/CMake/ac_std_funcs.cmake
===================================================================
--- src/other/incrTcl/itcl/CMake/ac_std_funcs.cmake	(revision 54114)
+++ src/other/incrTcl/itcl/CMake/ac_std_funcs.cmake	(working copy)
@@ -1,97 +1,97 @@
 # Standard tests and wrappers for CMake functions
 
-INCLUDE(CheckCCompilerFlag)
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckIncludeFileCXX)
-INCLUDE(CheckTypeSize)
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckStructHasMember)
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(ResolveCompilerPaths)
+include(CheckCCompilerFlag)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckTypeSize)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(ResolveCompilerPaths)
 
-SET(CMAKE_TEST_SRCS_DIR "NOTFOUND")
-FOREACH($candidate_dir ${CMAKE_MODULE_PATH})
-	IF(NOT CMAKE_TEST_SRCS_DIR)
-		IF(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
-			SET(CMAKE_TEST_SRCS_DIR ${candidate_dir}/test_sources)
-		ENDIF(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
-	ENDIF(NOT CMAKE_TEST_SRCS_DIR)
-ENDFOREACH($candidate_dir ${CMAKE_MODULE_PATH})
+set(CMAKE_TEST_SRCS_DIR "NOTFOUND")
+foreach($candidate_dir ${CMAKE_MODULE_PATH})
+	if(NOT CMAKE_TEST_SRCS_DIR)
+		if(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
+			set(CMAKE_TEST_SRCS_DIR ${candidate_dir}/test_sources)
+		endif(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
+	endif(NOT CMAKE_TEST_SRCS_DIR)
+endforeach($candidate_dir ${CMAKE_MODULE_PATH})
 
-INCLUDE(CheckPrototypeExists)
-INCLUDE(CheckCSourceRuns)
-INCLUDE(CheckCSourceRuns)
+include(CheckPrototypeExists)
+include(CheckCSourceRuns)
+include(CheckCSourceRuns)
 
-MACRO(CHECK_BASENAME_D)
-	SET(BASENAME_SRC "
+macro(CHECK_BASENAME_D)
+	set(BASENAME_SRC "
 	#include <libgen.h>
 	int main(int argc, char *argv[]) {
 	(void)basename(argv[0]);
 	return 0;
 	}")
-	CHECK_C_SOURCE_RUNS("${BASENAME_SRC}" HAVE_BASENAME)
-	IF(HAVE_BASENAME)
+	check_c_source_runs("${BASENAME_SRC}" HAVE_BASENAME)
+	if(HAVE_BASENAME)
 	  add_definitions(-DHAVE_BASENAME=1)
-	ENDIF(HAVE_BASENAME)
-ENDMACRO(CHECK_BASENAME_D)
+	endif(HAVE_BASENAME)
+endmacro(CHECK_BASENAME_D)
 
-MACRO(CHECK_DIRNAME_D)
-	SET(DIRNAME_SRC "
+macro(CHECK_DIRNAME_D)
+	set(DIRNAME_SRC "
 	#include <libgen.h>
 	int main(int argc, char *argv[]) {
 	(void)dirname(argv[0]);
 	return 0;
 	}")
-	CHECK_C_SOURCE_RUNS("${DIRNAME_SRC}" HAVE_DIRNAME)
-	IF(HAVE_DIRNAME)
+	check_c_source_runs("${DIRNAME_SRC}" HAVE_DIRNAME)
+	if(HAVE_DIRNAME)
 		add_definitions(-DHAVE_DIRNAME=1)
-	ENDIF(HAVE_DIRNAME)
-ENDMACRO(CHECK_DIRNAME_D)
+	endif(HAVE_DIRNAME)
+endmacro(CHECK_DIRNAME_D)
 
 # Based on AC_HEADER_STDC - using the source code for ctype
 # checking found in the generated configure file
-MACRO(CMAKE_HEADER_STDC_D)
-  CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-  IF(HAVE_STDLIB_H)
+macro(CMAKE_HEADER_STDC_D)
+  check_include_file(stdlib.h HAVE_STDLIB_H)
+  if(HAVE_STDLIB_H)
   add_definitions(-DHAVE_STDLIB_H=1)
-  ENDIF(HAVE_STDLIB_H)
-  CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
-  CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-  IF(HAVE_STRING_H)
+  endif(HAVE_STDLIB_H)
+  check_include_file(stdarg.h HAVE_STDARG_H)
+  check_include_file(string.h HAVE_STRING_H)
+  if(HAVE_STRING_H)
   add_definitions(-DHAVE_STRING_H=1)
-  ENDIF(HAVE_STRING_H)
-  CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-  IF(HAVE_STRINGS_H)
+  endif(HAVE_STRING_H)
+  check_include_file(strings.h HAVE_STRINGS_H)
+  if(HAVE_STRINGS_H)
   add_definitions(-DHAVE_STRINGS_H=1)
-  ENDIF(HAVE_STRINGS_H)
-  CHECK_INCLUDE_FILE(float.h HAVE_FLOAT_H)
-  CHECK_PROTOTYPE_EXISTS(memchr string.h HAVE_STRING_H_MEMCHR)
-  CHECK_PROTOTYPE_EXISTS(free stdlib.h HAVE_STDLIB_H_FREE)
-  CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/ctypes_test.c WORKING_CTYPE_MACROS)
-  IF(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
+  endif(HAVE_STRINGS_H)
+  check_include_file(float.h HAVE_FLOAT_H)
+  check_prototype_exists(memchr string.h HAVE_STRING_H_MEMCHR)
+  check_prototype_exists(free stdlib.h HAVE_STDLIB_H_FREE)
+  check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/ctypes_test.c WORKING_CTYPE_MACROS)
+  if(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
 	 add_definitions(-DSTDC_HEADERS=1)
-  ENDIF(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
-ENDMACRO(CMAKE_HEADER_STDC_D)
+  endif(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
+endmacro(CMAKE_HEADER_STDC_D)
 
 # Based on AC_HEADER_SYS_WAIT
-MACRO(CMAKE_HEADER_SYS_WAIT_D)
-  CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/sys_wait_test.c WORKING_SYS_WAIT)
-  IF(WORKING_SYS_WAIT)
+macro(CMAKE_HEADER_SYS_WAIT_D)
+  check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/sys_wait_test.c WORKING_SYS_WAIT)
+  if(WORKING_SYS_WAIT)
 	 add_definitions(-DHAVE_SYS_WAIT_H=1)
-  ENDIF(WORKING_SYS_WAIT)
-ENDMACRO(CMAKE_HEADER_SYS_WAIT_D)
+  endif(WORKING_SYS_WAIT)
+endmacro(CMAKE_HEADER_SYS_WAIT_D)
 
 # Based on AC_FUNC_ALLOCA
-MACRO(CMAKE_ALLOCA_D)
-	CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/alloca_header_test.c WORKING_ALLOCA_H)
-	IF(WORKING_ALLOCA_H)
+macro(CMAKE_ALLOCA_D)
+	check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/alloca_header_test.c WORKING_ALLOCA_H)
+	if(WORKING_ALLOCA_H)
 		add_definitions(-DHAVE_ALLOCA_H=1)
-	ENDIF(WORKING_ALLOCA_H)
-	CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/alloca_test.c WORKING_ALLOCA)
-	IF(WORKING_ALLOCA)
+	endif(WORKING_ALLOCA_H)
+	check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/alloca_test.c WORKING_ALLOCA)
+	if(WORKING_ALLOCA)
 		add_definitions(-DHAVE_ALLOCA=1)
-	ENDIF(WORKING_ALLOCA)
-ENDMACRO(CMAKE_ALLOCA_D)
+	endif(WORKING_ALLOCA)
+endmacro(CMAKE_ALLOCA_D)
 
Index: src/other/incrTcl/itcl/CMake/tcl.cmake
===================================================================
--- src/other/incrTcl/itcl/CMake/tcl.cmake	(revision 54114)
+++ src/other/incrTcl/itcl/CMake/tcl.cmake	(working copy)
@@ -1,99 +1,99 @@
 # CMake version of the tcl.m4 logic, insofar as it maps to CMake and has been
 # needed.
 
-INCLUDE(CheckCCompilerFlag)
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckIncludeFileCXX)
-INCLUDE(CheckTypeSize)
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckStructHasMember)
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(ResolveCompilerPaths)
-INCLUDE(CheckPrototypeExists)
-INCLUDE(CheckCSourceRuns)
-INCLUDE(CheckCSourceRuns)
+include(CheckCCompilerFlag)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckTypeSize)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(ResolveCompilerPaths)
+include(CheckPrototypeExists)
+include(CheckCSourceRuns)
+include(CheckCSourceRuns)
 
-INCLUDE(ac_std_funcs)
+include(ac_std_funcs)
 
-MACRO(ADD_TCL_CFLAG TCL_CFLAG)
+macro(ADD_TCL_CFLAG TCL_CFLAG)
 	add_definitions(-D${TCL_CFLAG}=1)
-ENDMACRO(ADD_TCL_CFLAG)
+endmacro(ADD_TCL_CFLAG)
 
-MACRO(CHECK_C_FLAG flag)
-   STRING(TOUPPER ${flag} UPPER_FLAG)
-   STRING(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
-   STRING(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
-   IF(${ARGC} LESS 2)
-      CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-   ELSE(${ARGC} LESS 2)
-      IF(NOT ${ARGV1})
-         CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-         IF(${UPPER_FLAG}_COMPILER_FLAG)
-            MESSAGE("- Found ${ARGV1} - setting to -${flag}")
-            SET(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
-         ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-      ENDIF(NOT ${ARGV1})
-   ENDIF(${ARGC} LESS 2)
-   IF(${UPPER_FLAG}_COMPILER_FLAG)
-      SET(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
-   ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-ENDMACRO()
+macro(CHECK_C_FLAG flag)
+   string(TOUPPER ${flag} UPPER_FLAG)
+   string(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
+   string(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
+   if(${ARGC} LESS 2)
+      check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+   else(${ARGC} LESS 2)
+      if(NOT ${ARGV1})
+         check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+         if(${UPPER_FLAG}_COMPILER_FLAG)
+            message("- Found ${ARGV1} - setting to -${flag}")
+            set(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
+         endif(${UPPER_FLAG}_COMPILER_FLAG)
+      endif(NOT ${ARGV1})
+   endif(${ARGC} LESS 2)
+   if(${UPPER_FLAG}_COMPILER_FLAG)
+      set(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
+   endif(${UPPER_FLAG}_COMPILER_FLAG)
+endmacro()
 
 # Wrappers for include file checks
-MACRO(TCL_CHECK_INCLUDE_FILE filename var)
-	CHECK_INCLUDE_FILE(${filename} ${var})
-	IF(${var})
+macro(TCL_CHECK_INCLUDE_FILE filename var)
+	check_include_file(${filename} ${var})
+	if(${var})
 		add_definitions(-D${var}=1)
-	ENDIF(${var})
-ENDMACRO(TCL_CHECK_INCLUDE_FILE)
+	endif(${var})
+endmacro(TCL_CHECK_INCLUDE_FILE)
 
-MACRO(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
-	CHECK_INCLUDE_FILE(${filename} HAVE_${var})
-	IF(HAVE_${var})
-		SET(HEADER_SRC "
+macro(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
+	check_include_file(${filename} HAVE_${var})
+	if(HAVE_${var})
+		set(HEADER_SRC "
 #include <${filename}>
 main(){};
 		")
-		CHECK_C_SOURCE_COMPILES("${HEADER_SRC}" ${var}_USABLE)
-	ENDIF(HAVE_${var})
-	IF(NOT HAVE_${var} OR NOT ${var}_USABLE)
+		check_c_source_compiles("${HEADER_SRC}" ${var}_USABLE)
+	endif(HAVE_${var})
+	if(NOT HAVE_${var} OR NOT ${var}_USABLE)
 		add_definitions(-DNO_${var}=1)
-	ELSE(NOT HAVE_${var} OR NOT ${var}_USABLE)
+	else(NOT HAVE_${var} OR NOT ${var}_USABLE)
 		add_definitions(-DHAVE_${var}=1)
-	ENDIF(NOT HAVE_${var} OR NOT ${var}_USABLE)
-ENDMACRO(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
+	endif(NOT HAVE_${var} OR NOT ${var}_USABLE)
+endmacro(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
 
 # Wrapper for function testing
-MACRO(TCL_CHECK_FUNCTION_EXISTS function var)
-	CHECK_FUNCTION_EXISTS(${function} ${var})
-	IF(${var})
+macro(TCL_CHECK_FUNCTION_EXISTS function var)
+	check_function_exists(${function} ${var})
+	if(${var})
 		add_definitions(-D${var}=1)
-	ENDIF(${var})
-ENDMACRO(TCL_CHECK_FUNCTION_EXISTS)
+	endif(${var})
+endmacro(TCL_CHECK_FUNCTION_EXISTS)
 
 # Check sizes (accepts extra headers)
-MACRO(TCL_CHECK_TYPE_SIZE typename var)
-   FOREACH(arg ${ARGN})
-      SET(headers ${headers} ${arg})
-   ENDFOREACH(arg ${ARGN})
-   SET(CHECK_EXTRA_INCLUDE_FILES ${headers})
-   CHECK_TYPE_SIZE(${typename} HAVE_${var}_T)
-   SET(CHECK_EXTRA_INCLUDE_FILES)
-   IF(HAVE_${var}_T)
+macro(TCL_CHECK_TYPE_SIZE typename var)
+   foreach(arg ${ARGN})
+      set(headers ${headers} ${arg})
+   endforeach(arg ${ARGN})
+   set(CHECK_EXTRA_INCLUDE_FILES ${headers})
+   check_type_size(${typename} HAVE_${var}_T)
+   set(CHECK_EXTRA_INCLUDE_FILES)
+   if(HAVE_${var}_T)
       add_definitions(-DHAVE_${var}_T=1)
       add_definitions(-DSIZEOF${var}=${HAVE_${var}_T})
-   ENDIF(HAVE_${var}_T)
-ENDMACRO(TCL_CHECK_TYPE_SIZE)
+   endif(HAVE_${var}_T)
+endmacro(TCL_CHECK_TYPE_SIZE)
 
 # Check for a member of a structure
-MACRO(TCL_CHECK_STRUCT_HAS_MEMBER structname member header var)
-   CHECK_STRUCT_HAS_MEMBER(${structname} ${member} ${header} HAVE_${var})
-   IF(HAVE_${var})
+macro(TCL_CHECK_STRUCT_HAS_MEMBER structname member header var)
+   check_struct_has_member(${structname} ${member} ${header} HAVE_${var})
+   if(HAVE_${var})
       add_definitions(-DHAVE_${var}=1)
-   ENDIF(HAVE_${var})
-ENDMACRO(TCL_CHECK_STRUCT_HAS_MEMBER)
+   endif(HAVE_${var})
+endmacro(TCL_CHECK_STRUCT_HAS_MEMBER)
 
 
 
@@ -153,42 +153,42 @@
 #------------------------------------------------------------------------
 # SC_ENABLE_THREADS
 #------------------------------------------------------------------------
-MACRO(SC_ENABLE_THREADS)
-   FIND_PACKAGE(Threads)
-   IF(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
-		SET(TCL_FOUND_THREADS ON)
-   ELSE(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
-		SET(TCL_FOUND_THREADS OFF)
-   ENDIF(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
-	OPTION(TCL_THREADS "Enable Tcl Thread support" ${TCL_FOUND_THREADS})
-   IF(TCL_THREADS)
-		ADD_TCL_CFLAG(TCL_THREADS)
-		ADD_TCL_CFLAG(USE_THREAD_ALLOC)
-		ADD_TCL_CFLAG(_REENTRANT)
-		ADD_TCL_CFLAG(_THREAD_SAFE)
-	   SET(TCL_THREADS_LIB ${CMAKE_THREAD_LIBS_INIT})
-		IF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
-			ADD_TCL_CFLAG(_POSIX_PTHREAD_SEMANTICS)
-		ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
-		CHECK_FUNCTION_EXISTS(pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-		IF(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-			ADD_TCL_CFLAG(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-		ENDIF(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-		CHECK_FUNCTION_EXISTS(pthread_attr_get_np HAVE_PTHREAD_ATTR_GET_NP)
-		CHECK_FUNCTION_EXISTS(pthread_getattr_np HAVE_PTHREAD_GETATTR_NP)
-		IF(HAVE_PTHREAD_ATTR_GET_NP)
-			ADD_TCL_CFLAG(HAVE_PTHREAD_ATTR_GET_NP)
-		ELSEIF(HAVE_PTHREAD_GETATTR_NP)
-			ADD_TCL_CFLAG(HAVE_PTHREAD_GETATTR_NP)
-		ENDIF(HAVE_PTHREAD_ATTR_GET_NP)
-		IF(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
-			CHECK_FUNCTION_EXISTS(pthread_get_stacksize_np HAVE_PTHREAD_GET_STACKSIZE_NP)
-			IF(HAVE_PTHREAD_GET_STACKSIZE_NP)
-				ADD_TCL_CFLAG(HAVE_PTHREAD_GET_STACKSIZE_NP)
-			ENDIF(HAVE_PTHREAD_GET_STACKSIZE_NP)
-		ENDIF(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
-	ENDIF(TCL_THREADS)
-ENDMACRO(SC_ENABLE_THREADS)
+macro(SC_ENABLE_THREADS)
+   find_package(Threads)
+   if(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
+		set(TCL_FOUND_THREADS ON)
+   else(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
+		set(TCL_FOUND_THREADS OFF)
+   endif(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
+	option(TCL_THREADS "Enable Tcl Thread support" ${TCL_FOUND_THREADS})
+   if(TCL_THREADS)
+		add_tcl_cflag(TCL_THREADS)
+		add_tcl_cflag(USE_THREAD_ALLOC)
+		add_tcl_cflag(_REENTRANT)
+		add_tcl_cflag(_THREAD_SAFE)
+	   set(TCL_THREADS_LIB ${CMAKE_THREAD_LIBS_INIT})
+		if(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+			add_tcl_cflag(_POSIX_PTHREAD_SEMANTICS)
+		endif(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+		check_function_exists(pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+		if(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+			add_tcl_cflag(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+		endif(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+		check_function_exists(pthread_attr_get_np HAVE_PTHREAD_ATTR_GET_NP)
+		check_function_exists(pthread_getattr_np HAVE_PTHREAD_GETATTR_NP)
+		if(HAVE_PTHREAD_ATTR_GET_NP)
+			add_tcl_cflag(HAVE_PTHREAD_ATTR_GET_NP)
+		elseif(HAVE_PTHREAD_GETATTR_NP)
+			add_tcl_cflag(HAVE_PTHREAD_GETATTR_NP)
+		endif(HAVE_PTHREAD_ATTR_GET_NP)
+		if(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
+			check_function_exists(pthread_get_stacksize_np HAVE_PTHREAD_GET_STACKSIZE_NP)
+			if(HAVE_PTHREAD_GET_STACKSIZE_NP)
+				add_tcl_cflag(HAVE_PTHREAD_GET_STACKSIZE_NP)
+			endif(HAVE_PTHREAD_GET_STACKSIZE_NP)
+		endif(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
+	endif(TCL_THREADS)
+endmacro(SC_ENABLE_THREADS)
 
 #------------------------------------------------------------------------
 # SC_ENABLE_SYMBOLS
@@ -199,28 +199,28 @@
 #------------------------------------------------------------------------
 # SC_ENABLE_LANGINFO
 #------------------------------------------------------------------------
-MACRO(SC_ENABLE_LANGINFO)
+macro(SC_ENABLE_LANGINFO)
 	set(TCL_ENABLE_LANGINFO ON CACHE STRING "Trigger use of nl_langinfo if available.")
-	IF(TCL_ENABLE_LANGINFO)
-		CHECK_INCLUDE_FILE(langinfo.h HAVE_LANGINFO)
-		IF(HAVE_LANGINFO)
-			SET(LANGINFO_SRC "
+	if(TCL_ENABLE_LANGINFO)
+		check_include_file(langinfo.h HAVE_LANGINFO)
+		if(HAVE_LANGINFO)
+			set(LANGINFO_SRC "
 			#include <langinfo.h>
 			int main() {
 			nl_langinfo(CODESET);
 			}
 			")
-			CHECK_C_SOURCE_COMPILES("${LANGINFO_SRC}" LANGINFO_COMPILES)
-			IF(LANGINFO_COMPILES)
-				ADD_TCL_CFLAG(HAVE_LANGINFO)
-			ELSE(LANGINFO_COMPILES)
-				SET(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
-			ENDIF(LANGINFO_COMPILES)
-		ELSE(HAVE_LANGINFO)
-			SET(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
-		ENDIF(HAVE_LANGINFO)
-	ENDIF(TCL_ENABLE_LANGINFO)
-ENDMACRO(SC_ENABLE_LANGINFO)
+			check_c_source_compiles("${LANGINFO_SRC}" LANGINFO_COMPILES)
+			if(LANGINFO_COMPILES)
+				add_tcl_cflag(HAVE_LANGINFO)
+			else(LANGINFO_COMPILES)
+				set(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
+			endif(LANGINFO_COMPILES)
+		else(HAVE_LANGINFO)
+			set(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
+		endif(HAVE_LANGINFO)
+	endif(TCL_ENABLE_LANGINFO)
+endmacro(SC_ENABLE_LANGINFO)
 
 #--------------------------------------------------------------------
 # SC_CONFIG_MANPAGES
@@ -245,8 +245,8 @@
 #--------------------------------------------------------------------
 # SC_SERIAL_PORT
 #--------------------------------------------------------------------
-MACRO(SC_SERIAL_PORT)
-	SET(TERMIOS_SRC_1 "
+macro(SC_SERIAL_PORT)
+	set(TERMIOS_SRC_1 "
 #include <termios.h>
 int main() {
 struct termios t;
@@ -258,7 +258,7 @@
 	return 1;
 }
 	")
-	SET(TERMIOS_SRC_2 "
+	set(TERMIOS_SRC_2 "
 #include <termios.h>
 #include <errno.h>
 
@@ -273,7 +273,7 @@
 	return 1;
 }
 	")
-	SET(TERMIO_SRC_1 "
+	set(TERMIO_SRC_1 "
 #include <termio.h>
 int main() {
 struct termio t;
@@ -284,7 +284,7 @@
 	return 1;
 }
    ")
-	SET(TERMIO_SRC_2 "
+	set(TERMIO_SRC_2 "
 #include <termio.h>
 #include <errno.h>
 
@@ -298,7 +298,7 @@
 	return 1;
 }
 	")
-	SET(SGTTY_SRC_1 "
+	set(SGTTY_SRC_1 "
 #include <sgtty.h>
 int main() {
 struct sgttyb t;
@@ -310,7 +310,7 @@
 	return 1;
 }
    ")
-	SET(SGTTY_SRC_2 "
+	set(SGTTY_SRC_2 "
 #include <sgtty.h>
 #include <errno.h>
 
@@ -325,57 +325,57 @@
 	return 1;
 }
 	")
-	CHECK_C_SOURCE_RUNS("${TERMIOS_SRC_1}" HAVE_TERMIOS)
-	IF(NOT HAVE_TERMIOS)
-		CHECK_C_SOURCE_RUNS("${TERMIO_SRC_1}" HAVE_TERMIO)
-	ENDIF(NOT HAVE_TERMIOS)
-	IF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-		CHECK_C_SOURCE_RUNS("${SGTTY_SRC_1}" HAVE_SGTTY)
-	ENDIF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-	IF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
-		CHECK_C_SOURCE_RUNS("${TERMIOS_SRC_2}" HAVE_TERMIOS)
-		IF(NOT HAVE_TERMIOS)
-			CHECK_C_SOURCE_RUNS("${TERMIO_SRC_2}" HAVE_TERMIO)
-		ENDIF(NOT HAVE_TERMIOS)
-		IF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-			CHECK_C_SOURCE_RUNS("${SGTTY_SRC_2}" HAVE_SGTTY)
-		ENDIF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-	ENDIF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
+	check_c_source_runs("${TERMIOS_SRC_1}" HAVE_TERMIOS)
+	if(NOT HAVE_TERMIOS)
+		check_c_source_runs("${TERMIO_SRC_1}" HAVE_TERMIO)
+	endif(NOT HAVE_TERMIOS)
+	if(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+		check_c_source_runs("${SGTTY_SRC_1}" HAVE_SGTTY)
+	endif(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+	if(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
+		check_c_source_runs("${TERMIOS_SRC_2}" HAVE_TERMIOS)
+		if(NOT HAVE_TERMIOS)
+			check_c_source_runs("${TERMIO_SRC_2}" HAVE_TERMIO)
+		endif(NOT HAVE_TERMIOS)
+		if(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+			check_c_source_runs("${SGTTY_SRC_2}" HAVE_SGTTY)
+		endif(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+	endif(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
 
-	IF(HAVE_TERMIOS)
-		ADD_TCL_CFLAG(USE_TERMIOS)
-	ELSE(HAVE_TERMIOS)
-		IF(HAVE_TERMIO)
-		   ADD_TCL_CFLAG(USE_TERMIO)
-		ELSE(HAVE_TERMIO)
-			IF(HAVE_SGTTY)
-				ADD_TCL_CFLAG(USE_SGTTY)
-			ENDIF(HAVE_SGTTY)
-		ENDIF(HAVE_TERMIO)
-	ENDIF(HAVE_TERMIOS)
-ENDMACRO(SC_SERIAL_PORT)
+	if(HAVE_TERMIOS)
+		add_tcl_cflag(USE_TERMIOS)
+	else(HAVE_TERMIOS)
+		if(HAVE_TERMIO)
+		   add_tcl_cflag(USE_TERMIO)
+		else(HAVE_TERMIO)
+			if(HAVE_SGTTY)
+				add_tcl_cflag(USE_SGTTY)
+			endif(HAVE_SGTTY)
+		endif(HAVE_TERMIO)
+	endif(HAVE_TERMIOS)
+endmacro(SC_SERIAL_PORT)
 
 
 #--------------------------------------------------------------------
 # SC_MISSING_POSIX_HEADERS
 #--------------------------------------------------------------------
-MACRO(SC_MISSING_POSIX_HEADERS)
-	TCL_CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
-	IF(NOT HAVE_DIRENT_H)
+macro(SC_MISSING_POSIX_HEADERS)
+	tcl_check_include_file(dirent.h HAVE_DIRENT_H)
+	if(NOT HAVE_DIRENT_H)
 		add_definitions(-DNO_DIRENT_H=1)
-	ENDIF(NOT HAVE_DIRENT_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(float.h FLOAT_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(values.h VALUES_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(limits.h LIMITS_H)
-	TCL_CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-	TCL_CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-	IF(NOT HAVE_STRING_H)
+	endif(NOT HAVE_DIRENT_H)
+	tcl_check_include_file_usability(float.h FLOAT_H)
+	tcl_check_include_file_usability(values.h VALUES_H)
+	tcl_check_include_file_usability(limits.h LIMITS_H)
+	tcl_check_include_file(stdlib.h HAVE_STDLIB_H)
+	tcl_check_include_file(string.h HAVE_STRING_H)
+	if(NOT HAVE_STRING_H)
 		add_definitions(-DNO_STRING_H=1)
-	ENDIF(NOT HAVE_STRING_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(sys/wait.h SYS_WAIT_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(dlfcn.h DLFCN_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(sys/param.h SYS_PARAM_H)
-ENDMACRO(SC_MISSING_POSIX_HEADERS)
+	endif(NOT HAVE_STRING_H)
+	tcl_check_include_file_usability(sys/wait.h SYS_WAIT_H)
+	tcl_check_include_file_usability(dlfcn.h DLFCN_H)
+	tcl_check_include_file_usability(sys/param.h SYS_PARAM_H)
+endmacro(SC_MISSING_POSIX_HEADERS)
 
 
 #--------------------------------------------------------------------
@@ -387,17 +387,17 @@
 #--------------------------------------------------------------------
 # SC_BLOCKING_STYLE
 #--------------------------------------------------------------------
-TCL_CHECK_INCLUDE_FILE(sys/ioctl.h HAVE_SYS_IOCTL_H) 
-TCL_CHECK_INCLUDE_FILE(sys/filio.h HAVE_SYS_FILIO_H)
-IF(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
-	ADD_TCL_CFLAG(USE_FIONBIO)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
-IF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
-	STRING(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
-	IF (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
-		ADD_TCL_CFLAG(USE_FIONBIO)
-	ENDIF (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+tcl_check_include_file(sys/ioctl.h HAVE_SYS_IOCTL_H) 
+tcl_check_include_file(sys/filio.h HAVE_SYS_FILIO_H)
+if(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
+	add_tcl_cflag(USE_FIONBIO)
+endif(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
+if(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+	string(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
+	if (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
+		add_tcl_cflag(USE_FIONBIO)
+	endif (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
+endif(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
 
 #--------------------------------------------------------------------
 # SC_TIME_HANLDER
@@ -408,13 +408,13 @@
 # TODO - tzname testing from AC_STRUCT_TIMEZONE is incomplete
 #
 #--------------------------------------------------------------------
-MACRO(SC_TIME_HANDLER)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(sys/time.h SYS_TIME_H)
-	TCL_CHECK_STRUCT_HAS_MEMBER("struct tm" tm_zone time.h STRUCT_TM_TM_ZONE)
-	IF(HAVE_STRUCT_TM_TM_ZONE)
-		ADD_TCL_CFLAG(HAVE_TM_ZONE)
-	ELSE(HAVE_STRUCT_TM_TM_ZONE)
-		SET(TZNAME_SRC "
+macro(SC_TIME_HANDLER)
+	tcl_check_include_file_usability(sys/time.h SYS_TIME_H)
+	tcl_check_struct_has_member("struct tm" tm_zone time.h STRUCT_TM_TM_ZONE)
+	if(HAVE_STRUCT_TM_TM_ZONE)
+		add_tcl_cflag(HAVE_TM_ZONE)
+	else(HAVE_STRUCT_TM_TM_ZONE)
+		set(TZNAME_SRC "
 #include <time.h>
 int main () {
 #ifndef tzname
@@ -422,17 +422,17 @@
 #endif
 return 0;
 }")
-      CHECK_C_SOURCE_COMPILES("${TZNAME_SRC}" HAVE_TZNAME)
-		IF(HAVE_TZNAME)
-			ADD_TCL_CFLAG(HAVE_DECL_TZNAME)
-		ENDIF(HAVE_TZNAME)
-	ENDIF(HAVE_STRUCT_TM_TM_ZONE)
-	TCL_CHECK_FUNCTION_EXISTS(gmtime_r HAVE_GMTIME_R)
-	TCL_CHECK_FUNCTION_EXISTS(localtime_r HAVE_LOCALTIME_R)
-	TCL_CHECK_FUNCTION_EXISTS(mktime HAVE_MKTIME)
-	TCL_CHECK_STRUCT_HAS_MEMBER("struct tm" tm_tzadj time.h TM_TZADJ)
-	TCL_CHECK_STRUCT_HAS_MEMBER("struct tm" tm_gmtoff time.h TM_GMTOFF)
-	SET(TZONE_SRC_1 "
+      check_c_source_compiles("${TZNAME_SRC}" HAVE_TZNAME)
+		if(HAVE_TZNAME)
+			add_tcl_cflag(HAVE_DECL_TZNAME)
+		endif(HAVE_TZNAME)
+	endif(HAVE_STRUCT_TM_TM_ZONE)
+	tcl_check_function_exists(gmtime_r HAVE_GMTIME_R)
+	tcl_check_function_exists(localtime_r HAVE_LOCALTIME_R)
+	tcl_check_function_exists(mktime HAVE_MKTIME)
+	tcl_check_struct_has_member("struct tm" tm_tzadj time.h TM_TZADJ)
+	tcl_check_struct_has_member("struct tm" tm_gmtoff time.h TM_GMTOFF)
+	set(TZONE_SRC_1 "
 #include <time.h>
 int main () {
 extern long timezone;
@@ -441,11 +441,11 @@
 return 0;
 }
    ")
-	CHECK_C_SOURCE_COMPILES("${TZONE_SRC_1}" HAVE_TIMEZONE_VAR)
-   IF(HAVE_TIMEZONE_VAR)
-		ADD_TCL_CFLAG(HAVE_TIMEZONE_VAR)
-	ELSE(HAVE_TIMEZONE_VAR)
-		SET(TZONE_SRC_2 "
+	check_c_source_compiles("${TZONE_SRC_1}" HAVE_TIMEZONE_VAR)
+   if(HAVE_TIMEZONE_VAR)
+		add_tcl_cflag(HAVE_TIMEZONE_VAR)
+	else(HAVE_TIMEZONE_VAR)
+		set(TZONE_SRC_2 "
 #include <time.h>
 int main() {
 extern time_t timezone;
@@ -454,13 +454,13 @@
 return 0;
 }
       ")
-		CHECK_C_SOURCE_COMPILES("${TZONE_SRC_2}" HAVE_TIMEZONE_VAR)
-		IF(HAVE_TIMEZONE_VAR)
-			ADD_TCL_CFLAG(HAVE_TIMEZONE_VAR)
-		ENDIF(HAVE_TIMEZONE_VAR)
-	ENDIF(HAVE_TIMEZONE_VAR)
-	IF(HAVE_SYS_TIME_H)
-		SET(TIME_WITH_SYS_TIME_SRC "
+		check_c_source_compiles("${TZONE_SRC_2}" HAVE_TIMEZONE_VAR)
+		if(HAVE_TIMEZONE_VAR)
+			add_tcl_cflag(HAVE_TIMEZONE_VAR)
+		endif(HAVE_TIMEZONE_VAR)
+	endif(HAVE_TIMEZONE_VAR)
+	if(HAVE_SYS_TIME_H)
+		set(TIME_WITH_SYS_TIME_SRC "
 #include <sys/time.h>
 #include <time.h>
 int main() {
@@ -470,12 +470,12 @@
 return 0;
 }
       ")
-		CHECK_C_SOURCE_COMPILES("${TIME_WITH_SYS_TIME_SRC}" TIME_WITH_SYS_TIME_WORKS)
-		IF(TIME_WITH_SYS_TIME_WORKS)
+		check_c_source_compiles("${TIME_WITH_SYS_TIME_SRC}" TIME_WITH_SYS_TIME_WORKS)
+		if(TIME_WITH_SYS_TIME_WORKS)
 			add_definitions(-DTIME_WITH_SYS_TIME=1)
-		ENDIF(TIME_WITH_SYS_TIME_WORKS)
-	ENDIF(HAVE_SYS_TIME_H)
-ENDMACRO(SC_TIME_HANDLER)
+		endif(TIME_WITH_SYS_TIME_WORKS)
+	endif(HAVE_SYS_TIME_H)
+endmacro(SC_TIME_HANDLER)
 
 #--------------------------------------------------------------------
 # SC_BUGGY_STRTOD
@@ -487,74 +487,74 @@
 #--------------------------------------------------------------------
 # SC_TCL_LINK_LIBS
 #--------------------------------------------------------------------
-MACRO(SC_TCL_LINK_LIBS)
-	SET(TCL_LINK_LIBS "")
+macro(SC_TCL_LINK_LIBS)
+	set(TCL_LINK_LIBS "")
 
 	# Math libraries 
-	IF(NOT WIN32)
-		CHECK_LIBRARY_EXISTS(m cos "" HAVE_M_LIBRARY)
-		IF(HAVE_M_LIBRARY)
-			RESOLVE_LIBRARIES(M_LIBRARY "-lm")
-		ENDIF(HAVE_M_LIBRARY)
+	if(NOT WIN32)
+		check_library_exists(m cos "" HAVE_M_LIBRARY)
+		if(HAVE_M_LIBRARY)
+			resolve_libraries(M_LIBRARY "-lm")
+		endif(HAVE_M_LIBRARY)
 		#find_library(IEEE_LIB ieee)
 		#MARK_AS_ADVANCED(IEEE_LIB)
 		#IF(IEEE_LIB)
 		#	SET(M_LIBRARY "-lieee ${M_LIBRARY}")
 		#ENDIF(IEEE_LIB)
-		CHECK_LIBRARY_EXISTS(sunmath ieee_flags "" HAVE_SUNMATH_LIBRARY)
-		IF(HAVE_SUNMATH_LIBRARY)
-			SET(M_LIBRARY "-lsunmath ${M_LIBRARY}")
-		ENDIF(HAVE_SUNMATH_LIBRARY)
-	ENDIF(NOT WIN32)
+		check_library_exists(sunmath ieee_flags "" HAVE_SUNMATH_LIBRARY)
+		if(HAVE_SUNMATH_LIBRARY)
+			set(M_LIBRARY "-lsunmath ${M_LIBRARY}")
+		endif(HAVE_SUNMATH_LIBRARY)
+	endif(NOT WIN32)
 
-	IF(NOT INET_LIBRARY AND NOT INET_QUIET)
-		MESSAGE("-- Looking for INET library")
-		RESOLVE_LIBRARIES(INET_LIBRARY "-linet")
-		IF(INET_LIBRARY)
-			MESSAGE("-- Found INET library: ${INET_LIBRARY}")
-		ELSE(INET_LIBRARY)
-			MESSAGE("-- Looking for INET library - not found")
-		ENDIF(INET_LIBRARY)
-		SET(INET_QUIET 1 CACHE STRING "INET quiet")
-		MARK_AS_ADVANCED(INET_QUIET)
-	ENDIF(NOT INET_LIBRARY AND NOT INET_QUIET)
-	IF(TCL_LINK_LIBS)
-		SET(TCL_LINK_LIBS "${TCL_LINK_LIBS};${M_LIBRARY};${INET_LIBRARY}")
-	ELSEIF(TCL_LINK_LIBS)
-		SET(TCL_LINK_LIBS "${M_LIBRARY};${INET_LIBRARY}")
-	ENDIF(TCL_LINK_LIBS)
-	MARK_AS_ADVANCED(TCL_LINK_LIBS)
+	if(NOT INET_LIBRARY AND NOT INET_QUIET)
+		message("-- Looking for INET library")
+		resolve_libraries(INET_LIBRARY "-linet")
+		if(INET_LIBRARY)
+			message("-- Found INET library: ${INET_LIBRARY}")
+		else(INET_LIBRARY)
+			message("-- Looking for INET library - not found")
+		endif(INET_LIBRARY)
+		set(INET_QUIET 1 CACHE STRING "INET quiet")
+		mark_as_advanced(INET_QUIET)
+	endif(NOT INET_LIBRARY AND NOT INET_QUIET)
+	if(TCL_LINK_LIBS)
+		set(TCL_LINK_LIBS "${TCL_LINK_LIBS};${M_LIBRARY};${INET_LIBRARY}")
+	elseif(TCL_LINK_LIBS)
+		set(TCL_LINK_LIBS "${M_LIBRARY};${INET_LIBRARY}")
+	endif(TCL_LINK_LIBS)
+	mark_as_advanced(TCL_LINK_LIBS)
 
-	TCL_CHECK_INCLUDE_FILE_USABILITY(net/errno.h NET_ERRNO_H)
-	CHECK_FUNCTION_EXISTS(connect HAVE_CONNECT)
-	IF(NOT HAVE_CONNECT)
-		CHECK_FUNCTION_EXISTS(setsockopt HAVE_SETSOCKOPT)
-		IF(NOT HAVE_SETSOCKOPT)
-			CHECK_LIBRARY_EXISTS(socket connect "" HAVE_SOCKET_LIBRARY)
-			IF(HAVE_SOCKET_LIBRARY)
-				RESOLVE_LIBRARIES(SOCKET_LIBRARY "-lsocket")
-				IF(TCL_LINK_LIBS)
-					SET(TCL_LINK_LIBS ${TCL_LINK_LIBS};${SOCKET_LIBRARY})
-				ELSE(TCL_LINK_LIBS)
-					SET(TCL_LINK_LIBS ${SOCKET_LIBRARY})
-				ENDIF(TCL_LINK_LIBS)
-			ENDIF(HAVE_SOCKET_LIBRARY)
-		ENDIF(NOT HAVE_SETSOCKOPT)
-	ENDIF(NOT HAVE_CONNECT)
-	CHECK_FUNCTION_EXISTS(gethostbyname HAVE_GETHOSTBYNAME)
-	IF(NOT HAVE_GETHOSTBYNAME)
-		CHECK_LIBRARY_EXISTS(nsl gethostbyname "" HAVE_NSL_LIBRARY)
-		IF(HAVE_NSL_LIBRARY)
-			RESOLVE_LIBRARIES(NSL_LIBRARY "-nsl")
-			IF(TCL_LINK_LIBS)
-				SET(TCL_LINK_LIBS ${TCL_LINK_LIBS};${NSL_LIBRARY})
-			ELSE(TCL_LINK_LIBS)
-				SET(TCL_LINK_LIBS ${NSL_LIBRARY})
-			ENDIF(TCL_LINK_LIBS)
-		ENDIF(HAVE_NSL_LIBRARY)
-	ENDIF(NOT HAVE_GETHOSTBYNAME)
+	tcl_check_include_file_usability(net/errno.h NET_ERRNO_H)
+	check_function_exists(connect HAVE_CONNECT)
+	if(NOT HAVE_CONNECT)
+		check_function_exists(setsockopt HAVE_SETSOCKOPT)
+		if(NOT HAVE_SETSOCKOPT)
+			check_library_exists(socket connect "" HAVE_SOCKET_LIBRARY)
+			if(HAVE_SOCKET_LIBRARY)
+				resolve_libraries(SOCKET_LIBRARY "-lsocket")
+				if(TCL_LINK_LIBS)
+					set(TCL_LINK_LIBS ${TCL_LINK_LIBS};${SOCKET_LIBRARY})
+				else(TCL_LINK_LIBS)
+					set(TCL_LINK_LIBS ${SOCKET_LIBRARY})
+				endif(TCL_LINK_LIBS)
+			endif(HAVE_SOCKET_LIBRARY)
+		endif(NOT HAVE_SETSOCKOPT)
+	endif(NOT HAVE_CONNECT)
+	check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
+	if(NOT HAVE_GETHOSTBYNAME)
+		check_library_exists(nsl gethostbyname "" HAVE_NSL_LIBRARY)
+		if(HAVE_NSL_LIBRARY)
+			resolve_libraries(NSL_LIBRARY "-nsl")
+			if(TCL_LINK_LIBS)
+				set(TCL_LINK_LIBS ${TCL_LINK_LIBS};${NSL_LIBRARY})
+			else(TCL_LINK_LIBS)
+				set(TCL_LINK_LIBS ${NSL_LIBRARY})
+			endif(TCL_LINK_LIBS)
+		endif(HAVE_NSL_LIBRARY)
+	endif(NOT HAVE_GETHOSTBYNAME)
 
-ENDMACRO(SC_TCL_LINK_LIBS)
+endmacro(SC_TCL_LINK_LIBS)
 
 #--------------------------------------------------------------------
 # SC_TCL_EARLY_FLAGS
@@ -567,94 +567,94 @@
 #
 # Detect and set up 64-bit compiling here.  LOTS of TODO here
 #--------------------------------------------------------------------
-MACRO(SC_TCL_64BIT_FLAGS)
-	IF(NOT CMAKE_SIZEOF_VOID_P)
-		MESSAGE(WARNING "CMAKE_SIZEOF_VOID_P is not defined - assuming 32-bit platform")
-		SET(CMAKE_SIZEOF_VOID_P 4)
-	ENDIF(NOT CMAKE_SIZEOF_VOID_P)
-	IF(NOT CMAKE_WORD_SIZE)
-		IF(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
-			SET(CMAKE_WORD_SIZE "64BIT")
-		ELSE(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
-			SET(CMAKE_WORD_SIZE "32BIT")
-		ENDIF(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
-	ENDIF(NOT CMAKE_WORD_SIZE)
-	IF(NOT TCL_ENABLE_64BIT)
-		IF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+macro(SC_TCL_64BIT_FLAGS)
+	if(NOT CMAKE_SIZEOF_VOID_P)
+		message(WARNING "CMAKE_SIZEOF_VOID_P is not defined - assuming 32-bit platform")
+		set(CMAKE_SIZEOF_VOID_P 4)
+	endif(NOT CMAKE_SIZEOF_VOID_P)
+	if(NOT CMAKE_WORD_SIZE)
+		if(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
+			set(CMAKE_WORD_SIZE "64BIT")
+		else(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
+			set(CMAKE_WORD_SIZE "32BIT")
+		endif(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
+	endif(NOT CMAKE_WORD_SIZE)
+	if(NOT TCL_ENABLE_64BIT)
+		if(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT "ON" CACHE STRING "Enable 64-bit support")
-		ELSE(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+		else(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT "OFF" CACHE STRING "Enable 64-bit support")
-		ENDIF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
-	ENDIF(NOT TCL_ENABLE_64BIT)
-	IF(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
-		IF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+		endif(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+	endif(NOT TCL_ENABLE_64BIT)
+	if(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
+		if(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT ON CACHE STRING "Enable 64-bit support")
-		ELSE(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+		else(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT OFF CACHE STRING "Enable 64-bit support")
-		ENDIF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
-	ENDIF(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
+		endif(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+	endif(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
 	set(TCL_ENABLE_64BIT ${TCL_ENABLE_64BIT} CACHE STRING "Enable 64-bit support")
-	IF(TCL_ENABLE_64BIT)
-		IF(NOT 64BIT_FLAG)
-			CHECK_C_FLAG("arch x86_64" 64BIT_FLAG)
-			CHECK_C_FLAG(64 64BIT_FLAG)
-			CHECK_C_FLAG("mabi=64" 64BIT_FLAG)
-			CHECK_C_FLAG(m64 64BIT_FLAG)
-			CHECK_C_FLAG(q64 64BIT_FLAG)
-		ENDIF(NOT 64BIT_FLAG)
-		MARK_AS_ADVANCED(64BIT_FLAG)
-		SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${64BIT_FLAG}")
-		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${64BIT_FLAG}")
-		SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${64BIT_FLAG}")
-		SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${64BIT_FLAG}")
+	if(TCL_ENABLE_64BIT)
+		if(NOT 64BIT_FLAG)
+			check_c_flag("arch x86_64" 64BIT_FLAG)
+			check_c_flag(64 64BIT_FLAG)
+			check_c_flag("mabi=64" 64BIT_FLAG)
+			check_c_flag(m64 64BIT_FLAG)
+			check_c_flag(q64 64BIT_FLAG)
+		endif(NOT 64BIT_FLAG)
+		mark_as_advanced(64BIT_FLAG)
+		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${64BIT_FLAG}")
+		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${64BIT_FLAG}")
+		set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${64BIT_FLAG}")
+		set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${64BIT_FLAG}")
 		add_definitions(-DTCL_CFG_DO64BIT=1)
-	ENDIF(TCL_ENABLE_64BIT)
-	IF(CMAKE_CL_64)
+	endif(TCL_ENABLE_64BIT)
+	if(CMAKE_CL_64)
 		add_definitions(-D_stati64=_stat64)
-	ENDIF(CMAKE_CL_64)
-ENDMACRO(SC_TCL_64BIT_FLAGS)
+	endif(CMAKE_CL_64)
+endmacro(SC_TCL_64BIT_FLAGS)
 
 #--------------------------------------------------------------------
 # SC_TCL_CFG_ENCODING   TIP #59
 #--------------------------------------------------------------------
-MACRO(SC_TCL_CFG_ENCODING)
-	IF(NOT TCL_CFGVAL_ENCODING)
-		IF(WIN32)
-			SET(TCL_CFGVAL_ENCODING "cp1252")
-		ELSE(WIN32)
-			SET(TCL_CFGVAL_ENCODING "iso8859-1")
-		ENDIF(WIN32)
-	ENDIF(NOT TCL_CFGVAL_ENCODING)
+macro(SC_TCL_CFG_ENCODING)
+	if(NOT TCL_CFGVAL_ENCODING)
+		if(WIN32)
+			set(TCL_CFGVAL_ENCODING "cp1252")
+		else(WIN32)
+			set(TCL_CFGVAL_ENCODING "iso8859-1")
+		endif(WIN32)
+	endif(NOT TCL_CFGVAL_ENCODING)
 	add_definitions(-DTCL_CFGVAL_ENCODING="${TCL_CFGVAL_ENCODING}")
-ENDMACRO(SC_TCL_CFG_ENCODING)
+endmacro(SC_TCL_CFG_ENCODING)
 
 
 #--------------------------------------------------------------------
 # SC_TCL_CHECK_BROKEN_FUNC
 #--------------------------------------------------------------------
-MACRO(SC_TCL_CHECK_BROKEN_FUNC)
-	CHECK_FUNCTION_EXISTS(${ARGV0} HAVE_${ARGV0})
-	IF(HAVE_${ARGV0})
-		SET(COMPILE_SRC "
+macro(SC_TCL_CHECK_BROKEN_FUNC)
+	check_function_exists(${ARGV0} HAVE_${ARGV0})
+	if(HAVE_${ARGV0})
+		set(COMPILE_SRC "
 		int main() {
 		${ARGV1}
 		}")
-		CHECK_C_SOURCE_RUNS("${COMPILE_SRC}"  WORKING_${ARGV0})
-		IF(NOT WORKING_${ARGV0})
-			SET(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
-		ENDIF(NOT WORKING_${ARGV0})
-	ELSE(HAVE_${ARGV0})
-		SET(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
-	ENDIF(HAVE_${ARGV0})
-ENDMACRO(SC_TCL_CHECK_BROKEN_FUNC)
+		check_c_source_runs("${COMPILE_SRC}"  WORKING_${ARGV0})
+		if(NOT WORKING_${ARGV0})
+			set(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
+		endif(NOT WORKING_${ARGV0})
+	else(HAVE_${ARGV0})
+		set(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
+	endif(HAVE_${ARGV0})
+endmacro(SC_TCL_CHECK_BROKEN_FUNC)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETHOSTBYADDR_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETHOSTBYADDR_R)
-	TCL_CHECK_FUNCTION_EXISTS(gethostbyaddr_r HAVE_GETHOSTBYADDR_R)
-	IF(HAVE_GETHOSTBYADDR_R)
-		SET(HAVE_GETHOSTBYADDR_R_7_SRC "
+macro(SC_TCL_GETHOSTBYADDR_R)
+	tcl_check_function_exists(gethostbyaddr_r HAVE_GETHOSTBYADDR_R)
+	if(HAVE_GETHOSTBYADDR_R)
+		set(HAVE_GETHOSTBYADDR_R_7_SRC "
 #include <netdb.h>
 int main(){
 char *addr;
@@ -668,11 +668,11 @@
 (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &h_errnop);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYADDR_R_7_SRC}"  HAVE_GETHOSTBYADDR_R_7)
-		IF(HAVE_GETHOSTBYADDR_R_7)
-			ADD_TCL_CFLAG(HAVE_GETHOSTBYADDR_R_7)
-		ELSE(HAVE_GETHOSTBYADDR_R_7)
-			SET(HAVE_GETHOSTBYADDR_R_8_SRC "
+		check_c_source_compiles("${HAVE_GETHOSTBYADDR_R_7_SRC}"  HAVE_GETHOSTBYADDR_R_7)
+		if(HAVE_GETHOSTBYADDR_R_7)
+			add_tcl_cflag(HAVE_GETHOSTBYADDR_R_7)
+		else(HAVE_GETHOSTBYADDR_R_7)
+			set(HAVE_GETHOSTBYADDR_R_8_SRC "
 #include <netdb.h>
 int main(){
 char *addr;
@@ -686,21 +686,21 @@
 (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &resultp, &h_errnop);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYADDR_R_8_SRC}" HAVE_GETHOSTBYADDR_R_8)
-			IF(HAVE_GETHOSTBYADDR_R_8)
-			   ADD_TCL_CFLAG(HAVE_GETHOSTBYADDR_R_8)
-			ENDIF(HAVE_GETHOSTBYADDR_R_8)
-		ENDIF(HAVE_GETHOSTBYADDR_R_7)
-	ENDIF(HAVE_GETHOSTBYADDR_R)
-ENDMACRO(SC_TCL_GETHOSTBYADDR_R)
+			check_c_source_compiles("${HAVE_GETHOSTBYADDR_R_8_SRC}" HAVE_GETHOSTBYADDR_R_8)
+			if(HAVE_GETHOSTBYADDR_R_8)
+			   add_tcl_cflag(HAVE_GETHOSTBYADDR_R_8)
+			endif(HAVE_GETHOSTBYADDR_R_8)
+		endif(HAVE_GETHOSTBYADDR_R_7)
+	endif(HAVE_GETHOSTBYADDR_R)
+endmacro(SC_TCL_GETHOSTBYADDR_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETHOSTBYNAME_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETHOSTBYNAME_R)
-	TCL_CHECK_FUNCTION_EXISTS(gethostbyname_r HAVE_GETHOSTBYNAME_R)
-	IF(HAVE_GETHOSTBYNAME_R)
-		SET(HAVE_GETHOSTBYNAME_R_6_SRC "
+macro(SC_TCL_GETHOSTBYNAME_R)
+	tcl_check_function_exists(gethostbyname_r HAVE_GETHOSTBYNAME_R)
+	if(HAVE_GETHOSTBYNAME_R)
+		set(HAVE_GETHOSTBYNAME_R_6_SRC "
 #include <netdb.h>
 int main(){
 char *name;
@@ -712,11 +712,11 @@
 (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYNAME_R_6_SRC}"  HAVE_GETHOSTBYNAME_R_6)
-		IF(HAVE_GETHOSTBYNAME_R_6)
-			ADD_TCL_CFLAG(HAVE_GETHOSTBYNAME_R_6)
-		ELSE(HAVE_GETHOSTBYNAME_R_6)
-			SET(HAVE_GETHOSTBYNAME_R_5_SRC "
+		check_c_source_compiles("${HAVE_GETHOSTBYNAME_R_6_SRC}"  HAVE_GETHOSTBYNAME_R_6)
+		if(HAVE_GETHOSTBYNAME_R_6)
+			add_tcl_cflag(HAVE_GETHOSTBYNAME_R_6)
+		else(HAVE_GETHOSTBYNAME_R_6)
+			set(HAVE_GETHOSTBYNAME_R_5_SRC "
 #include <netdb.h>
 int main(){
 char *name;
@@ -728,12 +728,12 @@
 (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYNAME_R_5_SRC}"  HAVE_GETHOSTBYNAME_R_5)
+			check_c_source_compiles("${HAVE_GETHOSTBYNAME_R_5_SRC}"  HAVE_GETHOSTBYNAME_R_5)
 
-			IF(HAVE_GETHOSTBYNAME_R_5)
-				ADD_TCL_CFLAG(HAVE_GETHOSTBYNAME_R_5)
-			ELSE(HAVE_GETHOSTBYNAME_R_5)
-				SET(HAVE_GETHOSTBYNAME_R_3_SRC "
+			if(HAVE_GETHOSTBYNAME_R_5)
+				add_tcl_cflag(HAVE_GETHOSTBYNAME_R_5)
+			else(HAVE_GETHOSTBYNAME_R_5)
+				set(HAVE_GETHOSTBYNAME_R_3_SRC "
 #include <netdb.h>
 int main(){
 char *name;
@@ -743,22 +743,22 @@
 (void) gethostbyname_r(name, he, &data);
 return 0;}
 				")
-				CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYNAME_R_3_SRC}" HAVE_GETHOSTBYNAME_R_3)
-				IF(HAVE_GETHOSTBYNAME_R_3)
-					ADD_TCL_CFLAG(HAVE_GETHOSTBYNAME_R_3)
-				ENDIF(HAVE_GETHOSTBYNAME_R_3)
-			ENDIF(HAVE_GETHOSTBYNAME_R_5)
-		ENDIF(HAVE_GETHOSTBYNAME_R_6)
-	ENDIF(HAVE_GETHOSTBYNAME_R)
-ENDMACRO(SC_TCL_GETHOSTBYNAME_R)
+				check_c_source_compiles("${HAVE_GETHOSTBYNAME_R_3_SRC}" HAVE_GETHOSTBYNAME_R_3)
+				if(HAVE_GETHOSTBYNAME_R_3)
+					add_tcl_cflag(HAVE_GETHOSTBYNAME_R_3)
+				endif(HAVE_GETHOSTBYNAME_R_3)
+			endif(HAVE_GETHOSTBYNAME_R_5)
+		endif(HAVE_GETHOSTBYNAME_R_6)
+	endif(HAVE_GETHOSTBYNAME_R)
+endmacro(SC_TCL_GETHOSTBYNAME_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_IPV6
 #--------------------------------------------------------------------
-MACRO(SC_TCL_IPV6)
-	CHECK_FUNCTION_EXISTS(getaddrinfo HAVE_GETADDRINFO)
-	IF(HAVE_GETADDRINFO)
-		SET(GETADDRINFO_SRC "
+macro(SC_TCL_IPV6)
+	check_function_exists(getaddrinfo HAVE_GETADDRINFO)
+	if(HAVE_GETADDRINFO)
+		set(GETADDRINFO_SRC "
 #include <netdb.h>
 int main () {
 const char *name, *port;
@@ -768,20 +768,20 @@
 return 0;
 }
 		")
-		CHECK_C_SOURCE_COMPILES("${GETADDRINFO_SRC}" WORKING_GETADDRINFO)
-		IF(WORKING_GETADDRINFO)
-			ADD_TCL_CFLAG(HAVE_GETADDRINFO)
-		ENDIF(WORKING_GETADDRINFO)
-	ENDIF(HAVE_GETADDRINFO)
-ENDMACRO(SC_TCL_IPV6)
+		check_c_source_compiles("${GETADDRINFO_SRC}" WORKING_GETADDRINFO)
+		if(WORKING_GETADDRINFO)
+			add_tcl_cflag(HAVE_GETADDRINFO)
+		endif(WORKING_GETADDRINFO)
+	endif(HAVE_GETADDRINFO)
+endmacro(SC_TCL_IPV6)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETPWUID_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETPWUID_R)
-	TCL_CHECK_FUNCTION_EXISTS(getpwuid_r HAVE_GETPWUID_R)
-	IF(HAVE_GETPWUID_R)
-		SET(HAVE_GETPWUID_R_5_SRC "
+macro(SC_TCL_GETPWUID_R)
+	tcl_check_function_exists(getpwuid_r HAVE_GETPWUID_R)
+	if(HAVE_GETPWUID_R)
+		set(HAVE_GETPWUID_R_5_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -793,11 +793,11 @@
 (void) getpwuid_r(uid, &pw, buf, buflen, &pwp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETPWUID_R_5_SRC}"  HAVE_GETPWUID_R_5)
-		IF(HAVE_GETPWUID_R_5)
-			ADD_TCL_CFLAG(HAVE_GETPWUID_R_5)
-		ELSE(HAVE_GETPWUID_R_5)
-			SET(HAVE_GETPWUID_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETPWUID_R_5_SRC}"  HAVE_GETPWUID_R_5)
+		if(HAVE_GETPWUID_R_5)
+			add_tcl_cflag(HAVE_GETPWUID_R_5)
+		else(HAVE_GETPWUID_R_5)
+			set(HAVE_GETPWUID_R_4_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -809,21 +809,21 @@
 (void) getpwuid_r(uid, &pw, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETPWUID_R_4_SRC}" HAVE_GETPWUID_R_4)
-			IF(HAVE_GETPWUID_R_4)
-				ADD_TCL_CFLAG(HAVE_GETPWUID_R_4)
-			ENDIF(HAVE_GETPWUID_R_4)
-		ENDIF(HAVE_GETPWUID_R_5)
-	ENDIF(HAVE_GETPWUID_R)
-ENDMACRO(SC_TCL_GETPWUID_R)
+			check_c_source_compiles("${HAVE_GETPWUID_R_4_SRC}" HAVE_GETPWUID_R_4)
+			if(HAVE_GETPWUID_R_4)
+				add_tcl_cflag(HAVE_GETPWUID_R_4)
+			endif(HAVE_GETPWUID_R_4)
+		endif(HAVE_GETPWUID_R_5)
+	endif(HAVE_GETPWUID_R)
+endmacro(SC_TCL_GETPWUID_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETPWNAM_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETPWNAM_R)
-	TCL_CHECK_FUNCTION_EXISTS(getpwnam_r HAVE_GETPWNAM_R)
-	IF(HAVE_GETPWNAM_R)
-		SET(HAVE_GETPWNAM_R_5_SRC "
+macro(SC_TCL_GETPWNAM_R)
+	tcl_check_function_exists(getpwnam_r HAVE_GETPWNAM_R)
+	if(HAVE_GETPWNAM_R)
+		set(HAVE_GETPWNAM_R_5_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -835,11 +835,11 @@
 (void) getpwnam_r(name, &pw, buf, buflen, &pwp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETPWNAM_R_5_SRC}"  HAVE_GETPWNAM_R_5)
-		IF(HAVE_GETPWNAM_R_5)
-			ADD_TCL_CFLAG(HAVE_GETPWNAM_R_5)
-		ELSE(HAVE_GETPWNAM_R_5)
-			SET(HAVE_GETPWNAM_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETPWNAM_R_5_SRC}"  HAVE_GETPWNAM_R_5)
+		if(HAVE_GETPWNAM_R_5)
+			add_tcl_cflag(HAVE_GETPWNAM_R_5)
+		else(HAVE_GETPWNAM_R_5)
+			set(HAVE_GETPWNAM_R_4_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -851,21 +851,21 @@
 (void)getpwnam_r(name, &pw, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETPWNAM_R_4_SRC}" HAVE_GETPWNAM_R_4)
-			IF(HAVE_GETPWNAM_R_4)
-			   ADD_TCL_CFLAG(HAVE_GETPWNAM_R_4)
-			ENDIF(HAVE_GETPWNAM_R_4)
-		ENDIF(HAVE_GETPWNAM_R_5)
-	ENDIF(HAVE_GETPWNAM_R)
-ENDMACRO(SC_TCL_GETPWNAM_R)
+			check_c_source_compiles("${HAVE_GETPWNAM_R_4_SRC}" HAVE_GETPWNAM_R_4)
+			if(HAVE_GETPWNAM_R_4)
+			   add_tcl_cflag(HAVE_GETPWNAM_R_4)
+			endif(HAVE_GETPWNAM_R_4)
+		endif(HAVE_GETPWNAM_R_5)
+	endif(HAVE_GETPWNAM_R)
+endmacro(SC_TCL_GETPWNAM_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETGRGID_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETGRGID_R)
-	TCL_CHECK_FUNCTION_EXISTS(getgrgid_r HAVE_GETGRGID_R)
-	IF(HAVE_GETGRGID_R)
-		SET(HAVE_GETGRGID_R_5_SRC "
+macro(SC_TCL_GETGRGID_R)
+	tcl_check_function_exists(getgrgid_r HAVE_GETGRGID_R)
+	if(HAVE_GETGRGID_R)
+		set(HAVE_GETGRGID_R_5_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -877,11 +877,11 @@
 (void) getgrgid_r(gid, &gr, buf, buflen, &grp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETGRGID_R_5_SRC}"  HAVE_GETGRGID_R_5)
-		IF(HAVE_GETGRGID_R_5)
-			ADD_TCL_CFLAG(HAVE_GETGRGID_R_5)
-		ELSE(HAVE_GETGRGID_R_5)
-			SET(HAVE_GETGRGID_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETGRGID_R_5_SRC}"  HAVE_GETGRGID_R_5)
+		if(HAVE_GETGRGID_R_5)
+			add_tcl_cflag(HAVE_GETGRGID_R_5)
+		else(HAVE_GETGRGID_R_5)
+			set(HAVE_GETGRGID_R_4_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -893,21 +893,21 @@
 (void)getgrgid_r(gid, &gr, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETGRGID_R_4_SRC}" HAVE_GETGRGID_R_4)
-			IF(HAVE_GETGRGID_R_4)
-				ADD_TCL_CFLAG(HAVE_GETGRGID_R_4)
-			ENDIF(HAVE_GETGRGID_R_4)
-		ENDIF(HAVE_GETGRGID_R_5)
-	ENDIF(HAVE_GETGRGID_R)
-ENDMACRO(SC_TCL_GETGRGID_R)
+			check_c_source_compiles("${HAVE_GETGRGID_R_4_SRC}" HAVE_GETGRGID_R_4)
+			if(HAVE_GETGRGID_R_4)
+				add_tcl_cflag(HAVE_GETGRGID_R_4)
+			endif(HAVE_GETGRGID_R_4)
+		endif(HAVE_GETGRGID_R_5)
+	endif(HAVE_GETGRGID_R)
+endmacro(SC_TCL_GETGRGID_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETGRNAM_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETGRNAM_R)
-	TCL_CHECK_FUNCTION_EXISTS(getgrnam_r HAVE_GETGRNAM_R)
-	IF(HAVE_GETGRNAM_R)
-		SET(HAVE_GETGRNAM_R_5_SRC "
+macro(SC_TCL_GETGRNAM_R)
+	tcl_check_function_exists(getgrnam_r HAVE_GETGRNAM_R)
+	if(HAVE_GETGRNAM_R)
+		set(HAVE_GETGRNAM_R_5_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -919,11 +919,11 @@
 (void) getgrnam_r(name, &gr, buf, buflen, &grp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETGRNAM_R_5_SRC}"  HAVE_GETGRNAM_R_5)
-		IF(HAVE_GETGRNAM_R_5)
-			ADD_TCL_CFLAG(HAVE_GETGRNAM_R_5)
-		ELSE(HAVE_GETGRNAM_R_5)
-			SET(HAVE_GETGRNAM_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETGRNAM_R_5_SRC}"  HAVE_GETGRNAM_R_5)
+		if(HAVE_GETGRNAM_R_5)
+			add_tcl_cflag(HAVE_GETGRNAM_R_5)
+		else(HAVE_GETGRNAM_R_5)
+			set(HAVE_GETGRNAM_R_4_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -935,19 +935,19 @@
 (void)getgrnam_r(name, &gr, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETGRNAM_R_4_SRC}" HAVE_GETGRNAM_R_4)
-			IF(HAVE_GETGRNAM_R_4)
-			   ADD_TCL_CFLAG(HAVE_GETGRNAM_R_4)
-			ENDIF(HAVE_GETGRNAM_R_4)
-		ENDIF(HAVE_GETGRNAM_R_5)
-	ENDIF(HAVE_GETGRNAM_R)
-ENDMACRO(SC_TCL_GETGRNAM_R)
+			check_c_source_compiles("${HAVE_GETGRNAM_R_4_SRC}" HAVE_GETGRNAM_R_4)
+			if(HAVE_GETGRNAM_R_4)
+			   add_tcl_cflag(HAVE_GETGRNAM_R_4)
+			endif(HAVE_GETGRNAM_R_4)
+		endif(HAVE_GETGRNAM_R_5)
+	endif(HAVE_GETGRNAM_R)
+endmacro(SC_TCL_GETGRNAM_R)
 
 
 
 
-MACRO(CHECK_FD_SET_IN_TYPES_D)
-	SET(TEST_SRC "
+macro(CHECK_FD_SET_IN_TYPES_D)
+	set(TEST_SRC "
 	#include <sys/types.h>
 	int main ()
 	{
@@ -955,16 +955,16 @@
 	return 0;
 	}
 	")
-	CHECK_C_SOURCE_COMPILES("${TEST_SRC}" FD_SET_IN_TYPES_H)
-ENDMACRO(CHECK_FD_SET_IN_TYPES_D)
+	check_c_source_compiles("${TEST_SRC}" FD_SET_IN_TYPES_H)
+endmacro(CHECK_FD_SET_IN_TYPES_D)
 
-MACRO(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
-	SET(TEST_SRC"
+macro(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
+	set(TEST_SRC"
 	#define MODULE_SCOPE extern __attribute__((__visibility__("hidden")))
 	main(){};
 	")
-	CHECK_C_SOURCE_COMPILES("${TEST_SRC}" COMPILER_SUPPORTS_HIDDEN)
-ENDMACRO(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
+	check_c_source_compiles("${TEST_SRC}" COMPILER_SUPPORTS_HIDDEN)
+endmacro(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
 
 
 
Index: src/other/incrTcl/itcl/CMake/CheckPrototypeExists.cmake
===================================================================
--- src/other/incrTcl/itcl/CMake/CheckPrototypeExists.cmake	(revision 54114)
+++ src/other/incrTcl/itcl/CMake/CheckPrototypeExists.cmake	(working copy)
@@ -57,6 +57,6 @@
   return 0;
 }
 ")
-  CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
+  check_cxx_source_compiles("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
 endmacro(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
 
Index: src/other/incrTcl/itk/CMakeLists.txt
===================================================================
--- src/other/incrTcl/itk/CMakeLists.txt	(revision 54114)
+++ src/other/incrTcl/itk/CMakeLists.txt	(working copy)
@@ -37,65 +37,65 @@
 # *******************************************************************
 
 # Minimum required version of CMake
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-IF(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND CMAKE_POLICY)
+cmake_minimum_required(VERSION 2.8)
+if(COMMAND CMAKE_POLICY)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND CMAKE_POLICY)
 
 # set CMake project name
-PROJECT(ITK)
+project(ITK)
 
 # Without Tcl, Tk and Itcl sources, we can't build Itk.  Use TCL_SRC_PREFIX
 # and TCL_BIN_PREFIX to identify the location of the Tcl we are to use.
-IF(TCL_SRC_PREFIX AND TCL_BIN_PREFIX AND ITCL_SRC_PREFIX AND ITCL_BIN_PREFIX AND TK_SRC_PREFIX AND TK_BIN_PREFIX)
-  SET(TCL_INCLUDE_DIRS ${TCL_SRC_PREFIX}/generic ${TCL_SRC_PREFIX}/libtommath)
-  SET(ITCL_INCLUDE_DIRS ${ITCL_SRC_PREFIX}/generic)
-  SET(TK_INCLUDE_PATH ${TK_SRC_PREFIX}/generic ${TK_SRC_PREFIX}/bitmaps)
-  IF(WIN32)
-    SET(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${TCL_SRC_PREFIX}/win)
-    SET(TK_INCLUDE_PATH ${TK_INCLUDE_PATH} ${TK_SRC_PREFIX}/xlib ${TK_SRC_PREFIX}/win)
-  ELSE(WIN32)
-    SET(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${TCL_SRC_PREFIX}/unix)
-  ENDIF(WIN32)
+if(TCL_SRC_PREFIX AND TCL_BIN_PREFIX AND ITCL_SRC_PREFIX AND ITCL_BIN_PREFIX AND TK_SRC_PREFIX AND TK_BIN_PREFIX)
+  set(TCL_INCLUDE_DIRS ${TCL_SRC_PREFIX}/generic ${TCL_SRC_PREFIX}/libtommath)
+  set(ITCL_INCLUDE_DIRS ${ITCL_SRC_PREFIX}/generic)
+  set(TK_INCLUDE_PATH ${TK_SRC_PREFIX}/generic ${TK_SRC_PREFIX}/bitmaps)
+  if(WIN32)
+    set(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${TCL_SRC_PREFIX}/win)
+    set(TK_INCLUDE_PATH ${TK_INCLUDE_PATH} ${TK_SRC_PREFIX}/xlib ${TK_SRC_PREFIX}/win)
+  else(WIN32)
+    set(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${TCL_SRC_PREFIX}/unix)
+  endif(WIN32)
   # Locate the TCL libraries.  We allow these to be overridden so that a parent
   # build can use a CMake target instead of an actual library path.
-  IF(NOT TCL_LIBRARY)
+  if(NOT TCL_LIBRARY)
     find_library(TCL_LIBRARY tcl PATHS ${TCL_BIN_PREFIX}/lib)
-  ENDIF(NOT TCL_LIBRARY)
-  IF(NOT TCL_STUB_LIBRARY)
+  endif(NOT TCL_LIBRARY)
+  if(NOT TCL_STUB_LIBRARY)
     find_library(TCL_STUB_LIBRARY tclstub PATHS ${TCL_BIN_PREFIX}/lib)
-  ENDIF(NOT TCL_STUB_LIBRARY)
-  IF(NOT ITCL_LIBRARY)
+  endif(NOT TCL_STUB_LIBRARY)
+  if(NOT ITCL_LIBRARY)
     find_library(ITCL_LIBRARY itcl PATHS ${ITCL_BIN_PREFIX}/lib)
-  ENDIF(NOT ITCL_LIBRARY)
-  IF(NOT ITCL_STUB_LIBRARY)
+  endif(NOT ITCL_LIBRARY)
+  if(NOT ITCL_STUB_LIBRARY)
     find_library(ITCL_STUB_LIBRARY itclstub PATHS ${ITCL_BIN_PREFIX}/lib)
-  ENDIF(NOT ITCL_STUB_LIBRARY)
-  IF(NOT TK_LIBRARY)
+  endif(NOT ITCL_STUB_LIBRARY)
+  if(NOT TK_LIBRARY)
     find_library(TK_LIBRARY tcl PATHS ${TK_BIN_PREFIX}/lib)
-  ENDIF(NOT TK_LIBRARY)
-  IF(NOT TK_STUB_LIBRARY)
+  endif(NOT TK_LIBRARY)
+  if(NOT TK_STUB_LIBRARY)
     find_library(TK_STUB_LIBRARY tclstub PATHS ${TK_BIN_PREFIX}/lib)
-  ENDIF(NOT TK_STUB_LIBRARY)
-  IF(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY OR NOT TK_LIBRARY OR NOT TK_STUB_LIBRARY OR NOT ITCL_LIBRARY OR NOT ITCL_STUB_LIBRARY)
-    MESSAGE(FATAL_ERROR "Could not find at least one of Tcl, Itcl or Tk libraries in ${TCL_BIN_PREFIX}, ${ITCL_BIN_PREFIX}, and ${TK_BIN_PREFIX} - please specify the parent directory for the libraries in the TCL_BIN_PREFIX variable (e.g. \${TCL_BIN_PREFIX}/lib)")
-  ENDIF(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY OR NOT TK_LIBRARY OR NOT TK_STUB_LIBRARY OR NOT ITCL_LIBRARY OR NOT ITCL_STUB_LIBRARY)
-ELSE(TCL_SRC_PREFIX AND TCL_BIN_PREFIX AND ITCL_SRC_PREFIX AND ITCL_BIN_PREFIX AND TK_SRC_PREFIX AND TK_BIN_PREFIX)
-  MESSAGE(FATAL_ERROR "Please specify the source and library locations of Tcl, Tk and Itcl using the TCL_SRC_PREFIX, TCL_BIN_PREFIX, TK_SRC_PREFIX, TK_BIN_PREFIX, ITCL_SRC_PREFIX and ITCL_BIN_PREFIX variables.")
-ENDIF(TCL_SRC_PREFIX AND TCL_BIN_PREFIX AND ITCL_SRC_PREFIX AND ITCL_BIN_PREFIX AND TK_SRC_PREFIX AND TK_BIN_PREFIX)
+  endif(NOT TK_STUB_LIBRARY)
+  if(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY OR NOT TK_LIBRARY OR NOT TK_STUB_LIBRARY OR NOT ITCL_LIBRARY OR NOT ITCL_STUB_LIBRARY)
+    message(FATAL_ERROR "Could not find at least one of Tcl, Itcl or Tk libraries in ${TCL_BIN_PREFIX}, ${ITCL_BIN_PREFIX}, and ${TK_BIN_PREFIX} - please specify the parent directory for the libraries in the TCL_BIN_PREFIX variable (e.g. \${TCL_BIN_PREFIX}/lib)")
+  endif(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY OR NOT TK_LIBRARY OR NOT TK_STUB_LIBRARY OR NOT ITCL_LIBRARY OR NOT ITCL_STUB_LIBRARY)
+else(TCL_SRC_PREFIX AND TCL_BIN_PREFIX AND ITCL_SRC_PREFIX AND ITCL_BIN_PREFIX AND TK_SRC_PREFIX AND TK_BIN_PREFIX)
+  message(FATAL_ERROR "Please specify the source and library locations of Tcl, Tk and Itcl using the TCL_SRC_PREFIX, TCL_BIN_PREFIX, TK_SRC_PREFIX, TK_BIN_PREFIX, ITCL_SRC_PREFIX and ITCL_BIN_PREFIX variables.")
+endif(TCL_SRC_PREFIX AND TCL_BIN_PREFIX AND ITCL_SRC_PREFIX AND ITCL_BIN_PREFIX AND TK_SRC_PREFIX AND TK_BIN_PREFIX)
 
 # build shared libs by default
-SET(BUILD_SHARED_LIBS ON)
+set(BUILD_SHARED_LIBS ON)
 
 # build static libs by default
-SET(BUILD_STATIC_LIBS ON)
+set(BUILD_STATIC_LIBS ON)
 
 # version numbers
-SET(ITK_VERSION_MAJOR 3)
-SET(ITK_VERSION_MINOR 4)
-SET(ITK_PATCH_LEVEL "0")
+set(ITK_VERSION_MAJOR 3)
+set(ITK_VERSION_MINOR 4)
+set(ITK_PATCH_LEVEL "0")
 
-SET(ITK_VERSION "${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}")
+set(ITK_VERSION "${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}")
 
 #---------------------------------------------------------------------
 # The following logic is what allows binaries to run successfully in
@@ -103,50 +103,50 @@
 # identifying the necessity of setting CMAKE_INSTALL_NAME_DIR on OSX.
 
 # use, i.e. don't skip the full RPATH for the build tree
-SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
+set(CMAKE_SKIP_BUILD_RPATH  FALSE)
 
 # when building, don't use the install RPATH already
 # (but later on when installing)
-SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
 
 # the RPATH/INSTALL_NAME_DIR to be used when installing
 if (NOT APPLE)
-  SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:\$ORIGIN/../lib")
+  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:\$ORIGIN/../lib")
 endif(NOT APPLE)
-SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
 
 # add the automatically determined parts of the RPATH which point to
 # directories outside the build tree to the install RPATH
-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 
 
 #----------------------------------------------------------------------------
 # The location in which to install Tcl.  Only do this if CMAKE_INSTALL_PREFIX
 # hasn't been set already, to try and allow parent builds (if any) some control.
-IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-  IF(NOT WIN32)
-    IF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
-      SET(CMAKE_INSTALL_PREFIX "/usr/local/tcldev-${TCL_VERSION}")
-    ELSE ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
-      SET(CMAKE_INSTALL_PREFIX "/usr")
-    ENDIF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
-  ENDIF(NOT WIN32)
-  SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "TCL install prefix" FORCE)
-  SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 0)
-ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+  if(NOT WIN32)
+    if ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
+      set(CMAKE_INSTALL_PREFIX "/usr/local/tcldev-${TCL_VERSION}")
+    else ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
+      set(CMAKE_INSTALL_PREFIX "/usr")
+    endif ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
+  endif(NOT WIN32)
+  set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "TCL install prefix" FORCE)
+  set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 0)
+endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
 
 #-----------------------------------------------------------------------------
 # Output directories.
 
-IF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-  SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
-ENDIF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-IF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
-  SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
-ENDIF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
-IF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
-  SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
-ENDIF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
+endif(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
+  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
+endif(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
+if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
+endif(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
 
 #----------------------------------------------------------------------------
 # First, get some standard options out of the way - things that are constant
@@ -168,30 +168,30 @@
 #--------------------------------------------------------------------
 add_definitions(-DTCL_THREADS=1)
 
-MACRO(TCL_CHECK_INCLUDE_FILE filename var)
-  CHECK_INCLUDE_FILE(${filename} ${var})
-  IF(${var})
+macro(TCL_CHECK_INCLUDE_FILE filename var)
+  check_include_file(${filename} ${var})
+  if(${var})
     add_definitions(-D${var}=1)
-  ENDIF(${var})
-ENDMACRO(TCL_CHECK_INCLUDE_FILE)
+  endif(${var})
+endmacro(TCL_CHECK_INCLUDE_FILE)
 
-TCL_CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
-TCL_CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
-TCL_CHECK_INCLUDE_FILE(sys/fstatfs.h HAVE_SYS_FSTATFS_H)
-IF(NOT HAVE_SYS_FSTATFS_H)
+tcl_check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+tcl_check_include_file(sys/stat.h HAVE_SYS_STAT_H)
+tcl_check_include_file(sys/fstatfs.h HAVE_SYS_FSTATFS_H)
+if(NOT HAVE_SYS_FSTATFS_H)
   add_definitions(-DNO_FSTATFS=1)
-ENDIF(NOT HAVE_SYS_FSTATFS_H)
-TCL_CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
-TCL_CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-TCL_CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
-TCL_CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
-TCL_CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
+endif(NOT HAVE_SYS_FSTATFS_H)
+tcl_check_include_file(memory.h HAVE_MEMORY_H)
+tcl_check_include_file(strings.h HAVE_STRINGS_H)
+tcl_check_include_file(inttypes.h HAVE_INTTYPES_H)
+tcl_check_include_file(stdint.h HAVE_STDINT_H)
+tcl_check_include_file(unistd.h HAVE_UNISTD_H)
 
-IF(TK_GRAPHICS_SYSTEM STREQUAL "x11")
+if(TK_GRAPHICS_SYSTEM STREQUAL "x11")
   find_package(X11)
-ENDIF(TK_GRAPHICS_SYSTEM STREQUAL "x11")
+endif(TK_GRAPHICS_SYSTEM STREQUAL "x11")
 
-SET(ITK_GENERIC_SRCS
+set(ITK_GENERIC_SRCS
   generic/itkStubInit.c
   generic/itkStubLib.c
   generic/itk_archetype.c
@@ -200,17 +200,17 @@
   generic/itk_util.c
   )
 
-SET(ITK_WIN_SRCS
+set(ITK_WIN_SRCS
   win/dllEntryPoint.c
   )
 
-SET(ITK_STUB_SRCS
+set(ITK_STUB_SRCS
   generic/itkStubLib.c
   )
 
 
-SET(ITK_INCLUDE_DIRS ${ITK_SOURCE_DIR}/generic ${ITK_BINARY_DIR}/include)
-MARK_AS_ADVANCED(ITK_INCLUDE_DIRS)
+set(ITK_INCLUDE_DIRS ${ITK_SOURCE_DIR}/generic ${ITK_BINARY_DIR}/include)
+mark_as_advanced(ITK_INCLUDE_DIRS)
 
 include_directories(
   ${TCL_INCLUDE_DIRS}
@@ -222,18 +222,18 @@
   ${CMAKE_SOURCE_DIR}/include
   )
 
-IF(WIN32)
+if(WIN32)
   add_library(itk ${ITK_GENERIC_SRCS} ${ITK_WIN_SRCS})
   target_link_libraries(itk ${M_LIBRARY} ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY} ${ITCL_STUB_LIBRARY})
-  SET_PROPERTY(TARGET itk APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
-  SET_PROPERTY(TARGET itk APPEND PROPERTY COMPILE_DEFINITIONS USE_ITCL_STUBS)
-  SET_PROPERTY(TARGET itk APPEND PROPERTY COMPILE_DEFINITIONS USE_TK_STUBS)
-ELSE(WIN32)
+  set_property(TARGET itk APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
+  set_property(TARGET itk APPEND PROPERTY COMPILE_DEFINITIONS USE_ITCL_STUBS)
+  set_property(TARGET itk APPEND PROPERTY COMPILE_DEFINITIONS USE_TK_STUBS)
+else(WIN32)
   add_library(itk ${ITK_GENERIC_SRCS})
   target_link_libraries(itk ${TCL_LIBRARIES} ${ITCL_LIBRARY})
-ENDIF(WIN32)
-SET_TARGET_PROPERTIES(itk PROPERTIES VERSION ${ITK_VERSION} SOVERSION ${ITK_VERSION_MAJOR})
-SET_TARGET_PROPERTIES(itk PROPERTIES PREFIX "lib")
+endif(WIN32)
+set_target_properties(itk PROPERTIES VERSION ${ITK_VERSION} SOVERSION ${ITK_VERSION_MAJOR})
+set_target_properties(itk PROPERTIES PREFIX "lib")
 install(TARGETS itk DESTINATION ${LIB_DIR})
 install(TARGETS itk
   RUNTIME DESTINATION ${BIN_DIR}
@@ -242,17 +242,17 @@
 
 add_library(itkstub STATIC ${ITK_STUB_SRCS})
 target_link_libraries(itkstub ${ITCL_STUB_LIBRARY} ${TCL_STUB_LIBRARIES})
-SET_PROPERTY(TARGET itkstub APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
-SET_PROPERTY(TARGET itkstub APPEND PROPERTY COMPILE_DEFINITIONS USE_ITCL_STUBS)
-SET_PROPERTY(TARGET itkstub APPEND PROPERTY COMPILE_DEFINITIONS USE_TK_STUBS)
+set_property(TARGET itkstub APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
+set_property(TARGET itkstub APPEND PROPERTY COMPILE_DEFINITIONS USE_ITCL_STUBS)
+set_property(TARGET itkstub APPEND PROPERTY COMPILE_DEFINITIONS USE_TK_STUBS)
 install(TARGETS itkstub
   RUNTIME DESTINATION ${BIN_DIR}
   LIBRARY DESTINATION ${LIB_DIR}
   ARCHIVE DESTINATION ${LIB_DIR})
 
-TCL_PKGINDEX(itk Itk "${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}")
+tcl_pkgindex(itk Itk "${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}")
 
-SET(ITK_LIBRARY_FILES
+set(ITK_LIBRARY_FILES
   library/Archetype.itk
   library/Toplevel.itk
   library/Widget.itk
@@ -261,7 +261,7 @@
   )
 install(FILES ${ITK_LIBRARY_FILES} DESTINATION lib/itk${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR})
 
-FOREACH(file ${ITK_LIBRARY_FILES})
+foreach(file ${ITK_LIBRARY_FILES})
   get_filename_component(filename ${file} NAME)
   if(NOT CMAKE_CONFIGURATION_TYPES)
     configure_file(${file} ${CMAKE_BINARY_DIR}/lib/itk${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}/${filename} COPYONLY)
@@ -271,9 +271,9 @@
       configure_file(${file} ${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/lib/itk${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}/${filename} COPYONLY)
     endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
   endif(NOT CMAKE_CONFIGURATION_TYPES)
-ENDFOREACH(file ${ITK_LIBRARY_FILES})
+endforeach(file ${ITK_LIBRARY_FILES})
 
-SET(ITK_HDRS
+set(ITK_HDRS
   generic/itk.h
   generic/itkDecls.h
   )
Index: src/other/incrTcl/itk/CMake/tcl.cmake
===================================================================
--- src/other/incrTcl/itk/CMake/tcl.cmake	(revision 54114)
+++ src/other/incrTcl/itk/CMake/tcl.cmake	(working copy)
@@ -1,99 +1,99 @@
 # CMake version of the tcl.m4 logic, insofar as it maps to CMake and has been
 # needed.
 
-INCLUDE(CheckCCompilerFlag)
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckIncludeFileCXX)
-INCLUDE(CheckTypeSize)
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckStructHasMember)
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(ResolveCompilerPaths)
-INCLUDE(CheckPrototypeExists)
-INCLUDE(CheckCSourceRuns)
-INCLUDE(CheckCSourceRuns)
+include(CheckCCompilerFlag)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckTypeSize)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(ResolveCompilerPaths)
+include(CheckPrototypeExists)
+include(CheckCSourceRuns)
+include(CheckCSourceRuns)
 
-INCLUDE(ac_std_funcs)
+include(ac_std_funcs)
 
-MACRO(ADD_TCL_CFLAG TCL_CFLAG)
+macro(ADD_TCL_CFLAG TCL_CFLAG)
 	add_definitions(-D${TCL_CFLAG}=1)
-ENDMACRO(ADD_TCL_CFLAG)
+endmacro(ADD_TCL_CFLAG)
 
-MACRO(CHECK_C_FLAG flag)
-   STRING(TOUPPER ${flag} UPPER_FLAG)
-   STRING(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
-   STRING(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
-   IF(${ARGC} LESS 2)
-      CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-   ELSE(${ARGC} LESS 2)
-      IF(NOT ${ARGV1})
-         CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-         IF(${UPPER_FLAG}_COMPILER_FLAG)
-            MESSAGE("- Found ${ARGV1} - setting to -${flag}")
-            SET(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
-         ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-      ENDIF(NOT ${ARGV1})
-   ENDIF(${ARGC} LESS 2)
-   IF(${UPPER_FLAG}_COMPILER_FLAG)
-      SET(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
-   ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-ENDMACRO()
+macro(CHECK_C_FLAG flag)
+   string(TOUPPER ${flag} UPPER_FLAG)
+   string(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
+   string(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
+   if(${ARGC} LESS 2)
+      check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+   else(${ARGC} LESS 2)
+      if(NOT ${ARGV1})
+         check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+         if(${UPPER_FLAG}_COMPILER_FLAG)
+            message("- Found ${ARGV1} - setting to -${flag}")
+            set(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
+         endif(${UPPER_FLAG}_COMPILER_FLAG)
+      endif(NOT ${ARGV1})
+   endif(${ARGC} LESS 2)
+   if(${UPPER_FLAG}_COMPILER_FLAG)
+      set(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
+   endif(${UPPER_FLAG}_COMPILER_FLAG)
+endmacro()
 
 # Wrappers for include file checks
-MACRO(TCL_CHECK_INCLUDE_FILE filename var)
-	CHECK_INCLUDE_FILE(${filename} ${var})
-	IF(${var})
+macro(TCL_CHECK_INCLUDE_FILE filename var)
+	check_include_file(${filename} ${var})
+	if(${var})
 		add_definitions(-D${var}=1)
-	ENDIF(${var})
-ENDMACRO(TCL_CHECK_INCLUDE_FILE)
+	endif(${var})
+endmacro(TCL_CHECK_INCLUDE_FILE)
 
-MACRO(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
-	CHECK_INCLUDE_FILE(${filename} HAVE_${var})
-	IF(HAVE_${var})
-		SET(HEADER_SRC "
+macro(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
+	check_include_file(${filename} HAVE_${var})
+	if(HAVE_${var})
+		set(HEADER_SRC "
 #include <${filename}>
 main(){};
 		")
-		CHECK_C_SOURCE_COMPILES("${HEADER_SRC}" ${var}_USABLE)
-	ENDIF(HAVE_${var})
-	IF(NOT HAVE_${var} OR NOT ${var}_USABLE)
+		check_c_source_compiles("${HEADER_SRC}" ${var}_USABLE)
+	endif(HAVE_${var})
+	if(NOT HAVE_${var} OR NOT ${var}_USABLE)
 		add_definitions(-DNO_${var}=1)
-	ELSE(NOT HAVE_${var} OR NOT ${var}_USABLE)
+	else(NOT HAVE_${var} OR NOT ${var}_USABLE)
 		add_definitions(-DHAVE_${var}=1)
-	ENDIF(NOT HAVE_${var} OR NOT ${var}_USABLE)
-ENDMACRO(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
+	endif(NOT HAVE_${var} OR NOT ${var}_USABLE)
+endmacro(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
 
 # Wrapper for function testing
-MACRO(TCL_CHECK_FUNCTION_EXISTS function var)
-	CHECK_FUNCTION_EXISTS(${function} ${var})
-	IF(${var})
+macro(TCL_CHECK_FUNCTION_EXISTS function var)
+	check_function_exists(${function} ${var})
+	if(${var})
 		add_definitions(-D${var}=1)
-	ENDIF(${var})
-ENDMACRO(TCL_CHECK_FUNCTION_EXISTS)
+	endif(${var})
+endmacro(TCL_CHECK_FUNCTION_EXISTS)
 
 # Check sizes (accepts extra headers)
-MACRO(TCL_CHECK_TYPE_SIZE typename var)
-   FOREACH(arg ${ARGN})
-      SET(headers ${headers} ${arg})
-   ENDFOREACH(arg ${ARGN})
-   SET(CHECK_EXTRA_INCLUDE_FILES ${headers})
-   CHECK_TYPE_SIZE(${typename} HAVE_${var}_T)
-   SET(CHECK_EXTRA_INCLUDE_FILES)
-   IF(HAVE_${var}_T)
+macro(TCL_CHECK_TYPE_SIZE typename var)
+   foreach(arg ${ARGN})
+      set(headers ${headers} ${arg})
+   endforeach(arg ${ARGN})
+   set(CHECK_EXTRA_INCLUDE_FILES ${headers})
+   check_type_size(${typename} HAVE_${var}_T)
+   set(CHECK_EXTRA_INCLUDE_FILES)
+   if(HAVE_${var}_T)
       add_definitions(-DHAVE_${var}_T=1)
       add_definitions(-DSIZEOF${var}=${HAVE_${var}_T})
-   ENDIF(HAVE_${var}_T)
-ENDMACRO(TCL_CHECK_TYPE_SIZE)
+   endif(HAVE_${var}_T)
+endmacro(TCL_CHECK_TYPE_SIZE)
 
 # Check for a member of a structure
-MACRO(TCL_CHECK_STRUCT_HAS_MEMBER structname member header var)
-   CHECK_STRUCT_HAS_MEMBER(${structname} ${member} ${header} HAVE_${var})
-   IF(HAVE_${var})
+macro(TCL_CHECK_STRUCT_HAS_MEMBER structname member header var)
+   check_struct_has_member(${structname} ${member} ${header} HAVE_${var})
+   if(HAVE_${var})
       add_definitions(-DHAVE_${var}=1)
-   ENDIF(HAVE_${var})
-ENDMACRO(TCL_CHECK_STRUCT_HAS_MEMBER)
+   endif(HAVE_${var})
+endmacro(TCL_CHECK_STRUCT_HAS_MEMBER)
 
 
 
@@ -153,42 +153,42 @@
 #------------------------------------------------------------------------
 # SC_ENABLE_THREADS
 #------------------------------------------------------------------------
-MACRO(SC_ENABLE_THREADS)
-   FIND_PACKAGE(Threads)
-   IF(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
-		SET(TCL_FOUND_THREADS ON)
-   ELSE(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
-		SET(TCL_FOUND_THREADS OFF)
-   ENDIF(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
-	OPTION(TCL_THREADS "Enable Tcl Thread support" ${TCL_FOUND_THREADS})
-   IF(TCL_THREADS)
-		ADD_TCL_CFLAG(TCL_THREADS)
-		ADD_TCL_CFLAG(USE_THREAD_ALLOC)
-		ADD_TCL_CFLAG(_REENTRANT)
-		ADD_TCL_CFLAG(_THREAD_SAFE)
-	   SET(TCL_THREADS_LIB ${CMAKE_THREAD_LIBS_INIT})
-		IF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
-			ADD_TCL_CFLAG(_POSIX_PTHREAD_SEMANTICS)
-		ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
-		CHECK_FUNCTION_EXISTS(pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-		IF(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-			ADD_TCL_CFLAG(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-		ENDIF(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-		CHECK_FUNCTION_EXISTS(pthread_attr_get_np HAVE_PTHREAD_ATTR_GET_NP)
-		CHECK_FUNCTION_EXISTS(pthread_getattr_np HAVE_PTHREAD_GETATTR_NP)
-		IF(HAVE_PTHREAD_ATTR_GET_NP)
-			ADD_TCL_CFLAG(HAVE_PTHREAD_ATTR_GET_NP)
-		ELSEIF(HAVE_PTHREAD_GETATTR_NP)
-			ADD_TCL_CFLAG(HAVE_PTHREAD_GETATTR_NP)
-		ENDIF(HAVE_PTHREAD_ATTR_GET_NP)
-		IF(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
-			CHECK_FUNCTION_EXISTS(pthread_get_stacksize_np HAVE_PTHREAD_GET_STACKSIZE_NP)
-			IF(HAVE_PTHREAD_GET_STACKSIZE_NP)
-				ADD_TCL_CFLAG(HAVE_PTHREAD_GET_STACKSIZE_NP)
-			ENDIF(HAVE_PTHREAD_GET_STACKSIZE_NP)
-		ENDIF(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
-	ENDIF(TCL_THREADS)
-ENDMACRO(SC_ENABLE_THREADS)
+macro(SC_ENABLE_THREADS)
+   find_package(Threads)
+   if(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
+		set(TCL_FOUND_THREADS ON)
+   else(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
+		set(TCL_FOUND_THREADS OFF)
+   endif(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
+	option(TCL_THREADS "Enable Tcl Thread support" ${TCL_FOUND_THREADS})
+   if(TCL_THREADS)
+		add_tcl_cflag(TCL_THREADS)
+		add_tcl_cflag(USE_THREAD_ALLOC)
+		add_tcl_cflag(_REENTRANT)
+		add_tcl_cflag(_THREAD_SAFE)
+	   set(TCL_THREADS_LIB ${CMAKE_THREAD_LIBS_INIT})
+		if(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+			add_tcl_cflag(_POSIX_PTHREAD_SEMANTICS)
+		endif(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+		check_function_exists(pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+		if(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+			add_tcl_cflag(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+		endif(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+		check_function_exists(pthread_attr_get_np HAVE_PTHREAD_ATTR_GET_NP)
+		check_function_exists(pthread_getattr_np HAVE_PTHREAD_GETATTR_NP)
+		if(HAVE_PTHREAD_ATTR_GET_NP)
+			add_tcl_cflag(HAVE_PTHREAD_ATTR_GET_NP)
+		elseif(HAVE_PTHREAD_GETATTR_NP)
+			add_tcl_cflag(HAVE_PTHREAD_GETATTR_NP)
+		endif(HAVE_PTHREAD_ATTR_GET_NP)
+		if(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
+			check_function_exists(pthread_get_stacksize_np HAVE_PTHREAD_GET_STACKSIZE_NP)
+			if(HAVE_PTHREAD_GET_STACKSIZE_NP)
+				add_tcl_cflag(HAVE_PTHREAD_GET_STACKSIZE_NP)
+			endif(HAVE_PTHREAD_GET_STACKSIZE_NP)
+		endif(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
+	endif(TCL_THREADS)
+endmacro(SC_ENABLE_THREADS)
 
 #------------------------------------------------------------------------
 # SC_ENABLE_SYMBOLS
@@ -199,28 +199,28 @@
 #------------------------------------------------------------------------
 # SC_ENABLE_LANGINFO
 #------------------------------------------------------------------------
-MACRO(SC_ENABLE_LANGINFO)
+macro(SC_ENABLE_LANGINFO)
 	set(TCL_ENABLE_LANGINFO ON CACHE STRING "Trigger use of nl_langinfo if available.")
-	IF(TCL_ENABLE_LANGINFO)
-		CHECK_INCLUDE_FILE(langinfo.h HAVE_LANGINFO)
-		IF(HAVE_LANGINFO)
-			SET(LANGINFO_SRC "
+	if(TCL_ENABLE_LANGINFO)
+		check_include_file(langinfo.h HAVE_LANGINFO)
+		if(HAVE_LANGINFO)
+			set(LANGINFO_SRC "
 			#include <langinfo.h>
 			int main() {
 			nl_langinfo(CODESET);
 			}
 			")
-			CHECK_C_SOURCE_COMPILES("${LANGINFO_SRC}" LANGINFO_COMPILES)
-			IF(LANGINFO_COMPILES)
-				ADD_TCL_CFLAG(HAVE_LANGINFO)
-			ELSE(LANGINFO_COMPILES)
-				SET(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
-			ENDIF(LANGINFO_COMPILES)
-		ELSE(HAVE_LANGINFO)
-			SET(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
-		ENDIF(HAVE_LANGINFO)
-	ENDIF(TCL_ENABLE_LANGINFO)
-ENDMACRO(SC_ENABLE_LANGINFO)
+			check_c_source_compiles("${LANGINFO_SRC}" LANGINFO_COMPILES)
+			if(LANGINFO_COMPILES)
+				add_tcl_cflag(HAVE_LANGINFO)
+			else(LANGINFO_COMPILES)
+				set(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
+			endif(LANGINFO_COMPILES)
+		else(HAVE_LANGINFO)
+			set(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
+		endif(HAVE_LANGINFO)
+	endif(TCL_ENABLE_LANGINFO)
+endmacro(SC_ENABLE_LANGINFO)
 
 #--------------------------------------------------------------------
 # SC_CONFIG_MANPAGES
@@ -245,8 +245,8 @@
 #--------------------------------------------------------------------
 # SC_SERIAL_PORT
 #--------------------------------------------------------------------
-MACRO(SC_SERIAL_PORT)
-	SET(TERMIOS_SRC_1 "
+macro(SC_SERIAL_PORT)
+	set(TERMIOS_SRC_1 "
 #include <termios.h>
 int main() {
 struct termios t;
@@ -258,7 +258,7 @@
 	return 1;
 }
 	")
-	SET(TERMIOS_SRC_2 "
+	set(TERMIOS_SRC_2 "
 #include <termios.h>
 #include <errno.h>
 
@@ -273,7 +273,7 @@
 	return 1;
 }
 	")
-	SET(TERMIO_SRC_1 "
+	set(TERMIO_SRC_1 "
 #include <termio.h>
 int main() {
 struct termio t;
@@ -284,7 +284,7 @@
 	return 1;
 }
    ")
-	SET(TERMIO_SRC_2 "
+	set(TERMIO_SRC_2 "
 #include <termio.h>
 #include <errno.h>
 
@@ -298,7 +298,7 @@
 	return 1;
 }
 	")
-	SET(SGTTY_SRC_1 "
+	set(SGTTY_SRC_1 "
 #include <sgtty.h>
 int main() {
 struct sgttyb t;
@@ -310,7 +310,7 @@
 	return 1;
 }
    ")
-	SET(SGTTY_SRC_2 "
+	set(SGTTY_SRC_2 "
 #include <sgtty.h>
 #include <errno.h>
 
@@ -325,57 +325,57 @@
 	return 1;
 }
 	")
-	CHECK_C_SOURCE_RUNS("${TERMIOS_SRC_1}" HAVE_TERMIOS)
-	IF(NOT HAVE_TERMIOS)
-		CHECK_C_SOURCE_RUNS("${TERMIO_SRC_1}" HAVE_TERMIO)
-	ENDIF(NOT HAVE_TERMIOS)
-	IF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-		CHECK_C_SOURCE_RUNS("${SGTTY_SRC_1}" HAVE_SGTTY)
-	ENDIF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-	IF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
-		CHECK_C_SOURCE_RUNS("${TERMIOS_SRC_2}" HAVE_TERMIOS)
-		IF(NOT HAVE_TERMIOS)
-			CHECK_C_SOURCE_RUNS("${TERMIO_SRC_2}" HAVE_TERMIO)
-		ENDIF(NOT HAVE_TERMIOS)
-		IF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-			CHECK_C_SOURCE_RUNS("${SGTTY_SRC_2}" HAVE_SGTTY)
-		ENDIF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-	ENDIF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
+	check_c_source_runs("${TERMIOS_SRC_1}" HAVE_TERMIOS)
+	if(NOT HAVE_TERMIOS)
+		check_c_source_runs("${TERMIO_SRC_1}" HAVE_TERMIO)
+	endif(NOT HAVE_TERMIOS)
+	if(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+		check_c_source_runs("${SGTTY_SRC_1}" HAVE_SGTTY)
+	endif(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+	if(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
+		check_c_source_runs("${TERMIOS_SRC_2}" HAVE_TERMIOS)
+		if(NOT HAVE_TERMIOS)
+			check_c_source_runs("${TERMIO_SRC_2}" HAVE_TERMIO)
+		endif(NOT HAVE_TERMIOS)
+		if(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+			check_c_source_runs("${SGTTY_SRC_2}" HAVE_SGTTY)
+		endif(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+	endif(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
 
-	IF(HAVE_TERMIOS)
-		ADD_TCL_CFLAG(USE_TERMIOS)
-	ELSE(HAVE_TERMIOS)
-		IF(HAVE_TERMIO)
-		   ADD_TCL_CFLAG(USE_TERMIO)
-		ELSE(HAVE_TERMIO)
-			IF(HAVE_SGTTY)
-				ADD_TCL_CFLAG(USE_SGTTY)
-			ENDIF(HAVE_SGTTY)
-		ENDIF(HAVE_TERMIO)
-	ENDIF(HAVE_TERMIOS)
-ENDMACRO(SC_SERIAL_PORT)
+	if(HAVE_TERMIOS)
+		add_tcl_cflag(USE_TERMIOS)
+	else(HAVE_TERMIOS)
+		if(HAVE_TERMIO)
+		   add_tcl_cflag(USE_TERMIO)
+		else(HAVE_TERMIO)
+			if(HAVE_SGTTY)
+				add_tcl_cflag(USE_SGTTY)
+			endif(HAVE_SGTTY)
+		endif(HAVE_TERMIO)
+	endif(HAVE_TERMIOS)
+endmacro(SC_SERIAL_PORT)
 
 
 #--------------------------------------------------------------------
 # SC_MISSING_POSIX_HEADERS
 #--------------------------------------------------------------------
-MACRO(SC_MISSING_POSIX_HEADERS)
-	TCL_CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
-	IF(NOT HAVE_DIRENT_H)
+macro(SC_MISSING_POSIX_HEADERS)
+	tcl_check_include_file(dirent.h HAVE_DIRENT_H)
+	if(NOT HAVE_DIRENT_H)
 		add_definitions(-DNO_DIRENT_H=1)
-	ENDIF(NOT HAVE_DIRENT_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(float.h FLOAT_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(values.h VALUES_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(limits.h LIMITS_H)
-	TCL_CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-	TCL_CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-	IF(NOT HAVE_STRING_H)
+	endif(NOT HAVE_DIRENT_H)
+	tcl_check_include_file_usability(float.h FLOAT_H)
+	tcl_check_include_file_usability(values.h VALUES_H)
+	tcl_check_include_file_usability(limits.h LIMITS_H)
+	tcl_check_include_file(stdlib.h HAVE_STDLIB_H)
+	tcl_check_include_file(string.h HAVE_STRING_H)
+	if(NOT HAVE_STRING_H)
 		add_definitions(-DNO_STRING_H=1)
-	ENDIF(NOT HAVE_STRING_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(sys/wait.h SYS_WAIT_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(dlfcn.h DLFCN_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(sys/param.h SYS_PARAM_H)
-ENDMACRO(SC_MISSING_POSIX_HEADERS)
+	endif(NOT HAVE_STRING_H)
+	tcl_check_include_file_usability(sys/wait.h SYS_WAIT_H)
+	tcl_check_include_file_usability(dlfcn.h DLFCN_H)
+	tcl_check_include_file_usability(sys/param.h SYS_PARAM_H)
+endmacro(SC_MISSING_POSIX_HEADERS)
 
 
 #--------------------------------------------------------------------
@@ -387,17 +387,17 @@
 #--------------------------------------------------------------------
 # SC_BLOCKING_STYLE
 #--------------------------------------------------------------------
-TCL_CHECK_INCLUDE_FILE(sys/ioctl.h HAVE_SYS_IOCTL_H) 
-TCL_CHECK_INCLUDE_FILE(sys/filio.h HAVE_SYS_FILIO_H)
-IF(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
-	ADD_TCL_CFLAG(USE_FIONBIO)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
-IF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
-	STRING(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
-	IF (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
-		ADD_TCL_CFLAG(USE_FIONBIO)
-	ENDIF (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+tcl_check_include_file(sys/ioctl.h HAVE_SYS_IOCTL_H) 
+tcl_check_include_file(sys/filio.h HAVE_SYS_FILIO_H)
+if(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
+	add_tcl_cflag(USE_FIONBIO)
+endif(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
+if(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+	string(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
+	if (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
+		add_tcl_cflag(USE_FIONBIO)
+	endif (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
+endif(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
 
 #--------------------------------------------------------------------
 # SC_TIME_HANLDER
@@ -408,13 +408,13 @@
 # TODO - tzname testing from AC_STRUCT_TIMEZONE is incomplete
 #
 #--------------------------------------------------------------------
-MACRO(SC_TIME_HANDLER)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(sys/time.h SYS_TIME_H)
-	TCL_CHECK_STRUCT_HAS_MEMBER("struct tm" tm_zone time.h STRUCT_TM_TM_ZONE)
-	IF(HAVE_STRUCT_TM_TM_ZONE)
-		ADD_TCL_CFLAG(HAVE_TM_ZONE)
-	ELSE(HAVE_STRUCT_TM_TM_ZONE)
-		SET(TZNAME_SRC "
+macro(SC_TIME_HANDLER)
+	tcl_check_include_file_usability(sys/time.h SYS_TIME_H)
+	tcl_check_struct_has_member("struct tm" tm_zone time.h STRUCT_TM_TM_ZONE)
+	if(HAVE_STRUCT_TM_TM_ZONE)
+		add_tcl_cflag(HAVE_TM_ZONE)
+	else(HAVE_STRUCT_TM_TM_ZONE)
+		set(TZNAME_SRC "
 #include <time.h>
 int main () {
 #ifndef tzname
@@ -422,17 +422,17 @@
 #endif
 return 0;
 }")
-      CHECK_C_SOURCE_COMPILES("${TZNAME_SRC}" HAVE_TZNAME)
-		IF(HAVE_TZNAME)
-			ADD_TCL_CFLAG(HAVE_DECL_TZNAME)
-		ENDIF(HAVE_TZNAME)
-	ENDIF(HAVE_STRUCT_TM_TM_ZONE)
-	TCL_CHECK_FUNCTION_EXISTS(gmtime_r HAVE_GMTIME_R)
-	TCL_CHECK_FUNCTION_EXISTS(localtime_r HAVE_LOCALTIME_R)
-	TCL_CHECK_FUNCTION_EXISTS(mktime HAVE_MKTIME)
-	TCL_CHECK_STRUCT_HAS_MEMBER("struct tm" tm_tzadj time.h TM_TZADJ)
-	TCL_CHECK_STRUCT_HAS_MEMBER("struct tm" tm_gmtoff time.h TM_GMTOFF)
-	SET(TZONE_SRC_1 "
+      check_c_source_compiles("${TZNAME_SRC}" HAVE_TZNAME)
+		if(HAVE_TZNAME)
+			add_tcl_cflag(HAVE_DECL_TZNAME)
+		endif(HAVE_TZNAME)
+	endif(HAVE_STRUCT_TM_TM_ZONE)
+	tcl_check_function_exists(gmtime_r HAVE_GMTIME_R)
+	tcl_check_function_exists(localtime_r HAVE_LOCALTIME_R)
+	tcl_check_function_exists(mktime HAVE_MKTIME)
+	tcl_check_struct_has_member("struct tm" tm_tzadj time.h TM_TZADJ)
+	tcl_check_struct_has_member("struct tm" tm_gmtoff time.h TM_GMTOFF)
+	set(TZONE_SRC_1 "
 #include <time.h>
 int main () {
 extern long timezone;
@@ -441,11 +441,11 @@
 return 0;
 }
    ")
-	CHECK_C_SOURCE_COMPILES("${TZONE_SRC_1}" HAVE_TIMEZONE_VAR)
-   IF(HAVE_TIMEZONE_VAR)
-		ADD_TCL_CFLAG(HAVE_TIMEZONE_VAR)
-	ELSE(HAVE_TIMEZONE_VAR)
-		SET(TZONE_SRC_2 "
+	check_c_source_compiles("${TZONE_SRC_1}" HAVE_TIMEZONE_VAR)
+   if(HAVE_TIMEZONE_VAR)
+		add_tcl_cflag(HAVE_TIMEZONE_VAR)
+	else(HAVE_TIMEZONE_VAR)
+		set(TZONE_SRC_2 "
 #include <time.h>
 int main() {
 extern time_t timezone;
@@ -454,13 +454,13 @@
 return 0;
 }
       ")
-		CHECK_C_SOURCE_COMPILES("${TZONE_SRC_2}" HAVE_TIMEZONE_VAR)
-		IF(HAVE_TIMEZONE_VAR)
-			ADD_TCL_CFLAG(HAVE_TIMEZONE_VAR)
-		ENDIF(HAVE_TIMEZONE_VAR)
-	ENDIF(HAVE_TIMEZONE_VAR)
-	IF(HAVE_SYS_TIME_H)
-		SET(TIME_WITH_SYS_TIME_SRC "
+		check_c_source_compiles("${TZONE_SRC_2}" HAVE_TIMEZONE_VAR)
+		if(HAVE_TIMEZONE_VAR)
+			add_tcl_cflag(HAVE_TIMEZONE_VAR)
+		endif(HAVE_TIMEZONE_VAR)
+	endif(HAVE_TIMEZONE_VAR)
+	if(HAVE_SYS_TIME_H)
+		set(TIME_WITH_SYS_TIME_SRC "
 #include <sys/time.h>
 #include <time.h>
 int main() {
@@ -470,12 +470,12 @@
 return 0;
 }
       ")
-		CHECK_C_SOURCE_COMPILES("${TIME_WITH_SYS_TIME_SRC}" TIME_WITH_SYS_TIME_WORKS)
-		IF(TIME_WITH_SYS_TIME_WORKS)
+		check_c_source_compiles("${TIME_WITH_SYS_TIME_SRC}" TIME_WITH_SYS_TIME_WORKS)
+		if(TIME_WITH_SYS_TIME_WORKS)
 			add_definitions(-DTIME_WITH_SYS_TIME=1)
-		ENDIF(TIME_WITH_SYS_TIME_WORKS)
-	ENDIF(HAVE_SYS_TIME_H)
-ENDMACRO(SC_TIME_HANDLER)
+		endif(TIME_WITH_SYS_TIME_WORKS)
+	endif(HAVE_SYS_TIME_H)
+endmacro(SC_TIME_HANDLER)
 
 #--------------------------------------------------------------------
 # SC_BUGGY_STRTOD
@@ -487,74 +487,74 @@
 #--------------------------------------------------------------------
 # SC_TCL_LINK_LIBS
 #--------------------------------------------------------------------
-MACRO(SC_TCL_LINK_LIBS)
-	SET(TCL_LINK_LIBS "")
+macro(SC_TCL_LINK_LIBS)
+	set(TCL_LINK_LIBS "")
 
 	# Math libraries 
-	IF(NOT WIN32)
-		CHECK_LIBRARY_EXISTS(m cos "" HAVE_M_LIBRARY)
-		IF(HAVE_M_LIBRARY)
-			RESOLVE_LIBRARIES(M_LIBRARY "-lm")
-		ENDIF(HAVE_M_LIBRARY)
+	if(NOT WIN32)
+		check_library_exists(m cos "" HAVE_M_LIBRARY)
+		if(HAVE_M_LIBRARY)
+			resolve_libraries(M_LIBRARY "-lm")
+		endif(HAVE_M_LIBRARY)
 		#find_library(IEEE_LIB ieee)
 		#MARK_AS_ADVANCED(IEEE_LIB)
 		#IF(IEEE_LIB)
 		#	SET(M_LIBRARY "-lieee ${M_LIBRARY}")
 		#ENDIF(IEEE_LIB)
-		CHECK_LIBRARY_EXISTS(sunmath ieee_flags "" HAVE_SUNMATH_LIBRARY)
-		IF(HAVE_SUNMATH_LIBRARY)
-			SET(M_LIBRARY "-lsunmath ${M_LIBRARY}")
-		ENDIF(HAVE_SUNMATH_LIBRARY)
-	ENDIF(NOT WIN32)
+		check_library_exists(sunmath ieee_flags "" HAVE_SUNMATH_LIBRARY)
+		if(HAVE_SUNMATH_LIBRARY)
+			set(M_LIBRARY "-lsunmath ${M_LIBRARY}")
+		endif(HAVE_SUNMATH_LIBRARY)
+	endif(NOT WIN32)
 
-	IF(NOT INET_LIBRARY AND NOT INET_QUIET)
-		MESSAGE("-- Looking for INET library")
-		RESOLVE_LIBRARIES(INET_LIBRARY "-linet")
-		IF(INET_LIBRARY)
-			MESSAGE("-- Found INET library: ${INET_LIBRARY}")
-		ELSE(INET_LIBRARY)
-			MESSAGE("-- Looking for INET library - not found")
-		ENDIF(INET_LIBRARY)
-		SET(INET_QUIET 1 CACHE STRING "INET quiet")
-		MARK_AS_ADVANCED(INET_QUIET)
-	ENDIF(NOT INET_LIBRARY AND NOT INET_QUIET)
-	IF(TCL_LINK_LIBS)
-		SET(TCL_LINK_LIBS "${TCL_LINK_LIBS};${M_LIBRARY};${INET_LIBRARY}")
-	ELSEIF(TCL_LINK_LIBS)
-		SET(TCL_LINK_LIBS "${M_LIBRARY};${INET_LIBRARY}")
-	ENDIF(TCL_LINK_LIBS)
-	MARK_AS_ADVANCED(TCL_LINK_LIBS)
+	if(NOT INET_LIBRARY AND NOT INET_QUIET)
+		message("-- Looking for INET library")
+		resolve_libraries(INET_LIBRARY "-linet")
+		if(INET_LIBRARY)
+			message("-- Found INET library: ${INET_LIBRARY}")
+		else(INET_LIBRARY)
+			message("-- Looking for INET library - not found")
+		endif(INET_LIBRARY)
+		set(INET_QUIET 1 CACHE STRING "INET quiet")
+		mark_as_advanced(INET_QUIET)
+	endif(NOT INET_LIBRARY AND NOT INET_QUIET)
+	if(TCL_LINK_LIBS)
+		set(TCL_LINK_LIBS "${TCL_LINK_LIBS};${M_LIBRARY};${INET_LIBRARY}")
+	elseif(TCL_LINK_LIBS)
+		set(TCL_LINK_LIBS "${M_LIBRARY};${INET_LIBRARY}")
+	endif(TCL_LINK_LIBS)
+	mark_as_advanced(TCL_LINK_LIBS)
 
-	TCL_CHECK_INCLUDE_FILE_USABILITY(net/errno.h NET_ERRNO_H)
-	CHECK_FUNCTION_EXISTS(connect HAVE_CONNECT)
-	IF(NOT HAVE_CONNECT)
-		CHECK_FUNCTION_EXISTS(setsockopt HAVE_SETSOCKOPT)
-		IF(NOT HAVE_SETSOCKOPT)
-			CHECK_LIBRARY_EXISTS(socket connect "" HAVE_SOCKET_LIBRARY)
-			IF(HAVE_SOCKET_LIBRARY)
-				RESOLVE_LIBRARIES(SOCKET_LIBRARY "-lsocket")
-				IF(TCL_LINK_LIBS)
-					SET(TCL_LINK_LIBS ${TCL_LINK_LIBS};${SOCKET_LIBRARY})
-				ELSE(TCL_LINK_LIBS)
-					SET(TCL_LINK_LIBS ${SOCKET_LIBRARY})
-				ENDIF(TCL_LINK_LIBS)
-			ENDIF(HAVE_SOCKET_LIBRARY)
-		ENDIF(NOT HAVE_SETSOCKOPT)
-	ENDIF(NOT HAVE_CONNECT)
-	CHECK_FUNCTION_EXISTS(gethostbyname HAVE_GETHOSTBYNAME)
-	IF(NOT HAVE_GETHOSTBYNAME)
-		CHECK_LIBRARY_EXISTS(nsl gethostbyname "" HAVE_NSL_LIBRARY)
-		IF(HAVE_NSL_LIBRARY)
-			RESOLVE_LIBRARIES(NSL_LIBRARY "-nsl")
-			IF(TCL_LINK_LIBS)
-				SET(TCL_LINK_LIBS ${TCL_LINK_LIBS};${NSL_LIBRARY})
-			ELSE(TCL_LINK_LIBS)
-				SET(TCL_LINK_LIBS ${NSL_LIBRARY})
-			ENDIF(TCL_LINK_LIBS)
-		ENDIF(HAVE_NSL_LIBRARY)
-	ENDIF(NOT HAVE_GETHOSTBYNAME)
+	tcl_check_include_file_usability(net/errno.h NET_ERRNO_H)
+	check_function_exists(connect HAVE_CONNECT)
+	if(NOT HAVE_CONNECT)
+		check_function_exists(setsockopt HAVE_SETSOCKOPT)
+		if(NOT HAVE_SETSOCKOPT)
+			check_library_exists(socket connect "" HAVE_SOCKET_LIBRARY)
+			if(HAVE_SOCKET_LIBRARY)
+				resolve_libraries(SOCKET_LIBRARY "-lsocket")
+				if(TCL_LINK_LIBS)
+					set(TCL_LINK_LIBS ${TCL_LINK_LIBS};${SOCKET_LIBRARY})
+				else(TCL_LINK_LIBS)
+					set(TCL_LINK_LIBS ${SOCKET_LIBRARY})
+				endif(TCL_LINK_LIBS)
+			endif(HAVE_SOCKET_LIBRARY)
+		endif(NOT HAVE_SETSOCKOPT)
+	endif(NOT HAVE_CONNECT)
+	check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
+	if(NOT HAVE_GETHOSTBYNAME)
+		check_library_exists(nsl gethostbyname "" HAVE_NSL_LIBRARY)
+		if(HAVE_NSL_LIBRARY)
+			resolve_libraries(NSL_LIBRARY "-nsl")
+			if(TCL_LINK_LIBS)
+				set(TCL_LINK_LIBS ${TCL_LINK_LIBS};${NSL_LIBRARY})
+			else(TCL_LINK_LIBS)
+				set(TCL_LINK_LIBS ${NSL_LIBRARY})
+			endif(TCL_LINK_LIBS)
+		endif(HAVE_NSL_LIBRARY)
+	endif(NOT HAVE_GETHOSTBYNAME)
 
-ENDMACRO(SC_TCL_LINK_LIBS)
+endmacro(SC_TCL_LINK_LIBS)
 
 #--------------------------------------------------------------------
 # SC_TCL_EARLY_FLAGS
@@ -567,94 +567,94 @@
 #
 # Detect and set up 64-bit compiling here.  LOTS of TODO here
 #--------------------------------------------------------------------
-MACRO(SC_TCL_64BIT_FLAGS)
-	IF(NOT CMAKE_SIZEOF_VOID_P)
-		MESSAGE(WARNING "CMAKE_SIZEOF_VOID_P is not defined - assuming 32-bit platform")
-		SET(CMAKE_SIZEOF_VOID_P 4)
-	ENDIF(NOT CMAKE_SIZEOF_VOID_P)
-	IF(NOT CMAKE_WORD_SIZE)
-		IF(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
-			SET(CMAKE_WORD_SIZE "64BIT")
-		ELSE(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
-			SET(CMAKE_WORD_SIZE "32BIT")
-		ENDIF(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
-	ENDIF(NOT CMAKE_WORD_SIZE)
-	IF(NOT TCL_ENABLE_64BIT)
-		IF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+macro(SC_TCL_64BIT_FLAGS)
+	if(NOT CMAKE_SIZEOF_VOID_P)
+		message(WARNING "CMAKE_SIZEOF_VOID_P is not defined - assuming 32-bit platform")
+		set(CMAKE_SIZEOF_VOID_P 4)
+	endif(NOT CMAKE_SIZEOF_VOID_P)
+	if(NOT CMAKE_WORD_SIZE)
+		if(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
+			set(CMAKE_WORD_SIZE "64BIT")
+		else(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
+			set(CMAKE_WORD_SIZE "32BIT")
+		endif(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
+	endif(NOT CMAKE_WORD_SIZE)
+	if(NOT TCL_ENABLE_64BIT)
+		if(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT "ON" CACHE STRING "Enable 64-bit support")
-		ELSE(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+		else(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT "OFF" CACHE STRING "Enable 64-bit support")
-		ENDIF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
-	ENDIF(NOT TCL_ENABLE_64BIT)
-	IF(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
-		IF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+		endif(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+	endif(NOT TCL_ENABLE_64BIT)
+	if(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
+		if(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT ON CACHE STRING "Enable 64-bit support")
-		ELSE(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+		else(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT OFF CACHE STRING "Enable 64-bit support")
-		ENDIF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
-	ENDIF(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
+		endif(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+	endif(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
 	set(TCL_ENABLE_64BIT ${TCL_ENABLE_64BIT} CACHE STRING "Enable 64-bit support")
-	IF(TCL_ENABLE_64BIT)
-		IF(NOT 64BIT_FLAG)
-			CHECK_C_FLAG("arch x86_64" 64BIT_FLAG)
-			CHECK_C_FLAG(64 64BIT_FLAG)
-			CHECK_C_FLAG("mabi=64" 64BIT_FLAG)
-			CHECK_C_FLAG(m64 64BIT_FLAG)
-			CHECK_C_FLAG(q64 64BIT_FLAG)
-		ENDIF(NOT 64BIT_FLAG)
-		MARK_AS_ADVANCED(64BIT_FLAG)
-		SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${64BIT_FLAG}")
-		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${64BIT_FLAG}")
-		SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${64BIT_FLAG}")
-		SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${64BIT_FLAG}")
+	if(TCL_ENABLE_64BIT)
+		if(NOT 64BIT_FLAG)
+			check_c_flag("arch x86_64" 64BIT_FLAG)
+			check_c_flag(64 64BIT_FLAG)
+			check_c_flag("mabi=64" 64BIT_FLAG)
+			check_c_flag(m64 64BIT_FLAG)
+			check_c_flag(q64 64BIT_FLAG)
+		endif(NOT 64BIT_FLAG)
+		mark_as_advanced(64BIT_FLAG)
+		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${64BIT_FLAG}")
+		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${64BIT_FLAG}")
+		set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${64BIT_FLAG}")
+		set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${64BIT_FLAG}")
 		add_definitions(-DTCL_CFG_DO64BIT=1)
-	ENDIF(TCL_ENABLE_64BIT)
-	IF(CMAKE_CL_64)
+	endif(TCL_ENABLE_64BIT)
+	if(CMAKE_CL_64)
 		add_definitions(-D_stati64=_stat64)
-	ENDIF(CMAKE_CL_64)
-ENDMACRO(SC_TCL_64BIT_FLAGS)
+	endif(CMAKE_CL_64)
+endmacro(SC_TCL_64BIT_FLAGS)
 
 #--------------------------------------------------------------------
 # SC_TCL_CFG_ENCODING   TIP #59
 #--------------------------------------------------------------------
-MACRO(SC_TCL_CFG_ENCODING)
-	IF(NOT TCL_CFGVAL_ENCODING)
-		IF(WIN32)
-			SET(TCL_CFGVAL_ENCODING "cp1252")
-		ELSE(WIN32)
-			SET(TCL_CFGVAL_ENCODING "iso8859-1")
-		ENDIF(WIN32)
-	ENDIF(NOT TCL_CFGVAL_ENCODING)
+macro(SC_TCL_CFG_ENCODING)
+	if(NOT TCL_CFGVAL_ENCODING)
+		if(WIN32)
+			set(TCL_CFGVAL_ENCODING "cp1252")
+		else(WIN32)
+			set(TCL_CFGVAL_ENCODING "iso8859-1")
+		endif(WIN32)
+	endif(NOT TCL_CFGVAL_ENCODING)
 	add_definitions(-DTCL_CFGVAL_ENCODING="${TCL_CFGVAL_ENCODING}")
-ENDMACRO(SC_TCL_CFG_ENCODING)
+endmacro(SC_TCL_CFG_ENCODING)
 
 
 #--------------------------------------------------------------------
 # SC_TCL_CHECK_BROKEN_FUNC
 #--------------------------------------------------------------------
-MACRO(SC_TCL_CHECK_BROKEN_FUNC)
-	CHECK_FUNCTION_EXISTS(${ARGV0} HAVE_${ARGV0})
-	IF(HAVE_${ARGV0})
-		SET(COMPILE_SRC "
+macro(SC_TCL_CHECK_BROKEN_FUNC)
+	check_function_exists(${ARGV0} HAVE_${ARGV0})
+	if(HAVE_${ARGV0})
+		set(COMPILE_SRC "
 		int main() {
 		${ARGV1}
 		}")
-		CHECK_C_SOURCE_RUNS("${COMPILE_SRC}"  WORKING_${ARGV0})
-		IF(NOT WORKING_${ARGV0})
-			SET(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
-		ENDIF(NOT WORKING_${ARGV0})
-	ELSE(HAVE_${ARGV0})
-		SET(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
-	ENDIF(HAVE_${ARGV0})
-ENDMACRO(SC_TCL_CHECK_BROKEN_FUNC)
+		check_c_source_runs("${COMPILE_SRC}"  WORKING_${ARGV0})
+		if(NOT WORKING_${ARGV0})
+			set(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
+		endif(NOT WORKING_${ARGV0})
+	else(HAVE_${ARGV0})
+		set(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
+	endif(HAVE_${ARGV0})
+endmacro(SC_TCL_CHECK_BROKEN_FUNC)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETHOSTBYADDR_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETHOSTBYADDR_R)
-	TCL_CHECK_FUNCTION_EXISTS(gethostbyaddr_r HAVE_GETHOSTBYADDR_R)
-	IF(HAVE_GETHOSTBYADDR_R)
-		SET(HAVE_GETHOSTBYADDR_R_7_SRC "
+macro(SC_TCL_GETHOSTBYADDR_R)
+	tcl_check_function_exists(gethostbyaddr_r HAVE_GETHOSTBYADDR_R)
+	if(HAVE_GETHOSTBYADDR_R)
+		set(HAVE_GETHOSTBYADDR_R_7_SRC "
 #include <netdb.h>
 int main(){
 char *addr;
@@ -668,11 +668,11 @@
 (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &h_errnop);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYADDR_R_7_SRC}"  HAVE_GETHOSTBYADDR_R_7)
-		IF(HAVE_GETHOSTBYADDR_R_7)
-			ADD_TCL_CFLAG(HAVE_GETHOSTBYADDR_R_7)
-		ELSE(HAVE_GETHOSTBYADDR_R_7)
-			SET(HAVE_GETHOSTBYADDR_R_8_SRC "
+		check_c_source_compiles("${HAVE_GETHOSTBYADDR_R_7_SRC}"  HAVE_GETHOSTBYADDR_R_7)
+		if(HAVE_GETHOSTBYADDR_R_7)
+			add_tcl_cflag(HAVE_GETHOSTBYADDR_R_7)
+		else(HAVE_GETHOSTBYADDR_R_7)
+			set(HAVE_GETHOSTBYADDR_R_8_SRC "
 #include <netdb.h>
 int main(){
 char *addr;
@@ -686,21 +686,21 @@
 (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &resultp, &h_errnop);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYADDR_R_8_SRC}" HAVE_GETHOSTBYADDR_R_8)
-			IF(HAVE_GETHOSTBYADDR_R_8)
-			   ADD_TCL_CFLAG(HAVE_GETHOSTBYADDR_R_8)
-			ENDIF(HAVE_GETHOSTBYADDR_R_8)
-		ENDIF(HAVE_GETHOSTBYADDR_R_7)
-	ENDIF(HAVE_GETHOSTBYADDR_R)
-ENDMACRO(SC_TCL_GETHOSTBYADDR_R)
+			check_c_source_compiles("${HAVE_GETHOSTBYADDR_R_8_SRC}" HAVE_GETHOSTBYADDR_R_8)
+			if(HAVE_GETHOSTBYADDR_R_8)
+			   add_tcl_cflag(HAVE_GETHOSTBYADDR_R_8)
+			endif(HAVE_GETHOSTBYADDR_R_8)
+		endif(HAVE_GETHOSTBYADDR_R_7)
+	endif(HAVE_GETHOSTBYADDR_R)
+endmacro(SC_TCL_GETHOSTBYADDR_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETHOSTBYNAME_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETHOSTBYNAME_R)
-	TCL_CHECK_FUNCTION_EXISTS(gethostbyname_r HAVE_GETHOSTBYNAME_R)
-	IF(HAVE_GETHOSTBYNAME_R)
-		SET(HAVE_GETHOSTBYNAME_R_6_SRC "
+macro(SC_TCL_GETHOSTBYNAME_R)
+	tcl_check_function_exists(gethostbyname_r HAVE_GETHOSTBYNAME_R)
+	if(HAVE_GETHOSTBYNAME_R)
+		set(HAVE_GETHOSTBYNAME_R_6_SRC "
 #include <netdb.h>
 int main(){
 char *name;
@@ -712,11 +712,11 @@
 (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYNAME_R_6_SRC}"  HAVE_GETHOSTBYNAME_R_6)
-		IF(HAVE_GETHOSTBYNAME_R_6)
-			ADD_TCL_CFLAG(HAVE_GETHOSTBYNAME_R_6)
-		ELSE(HAVE_GETHOSTBYNAME_R_6)
-			SET(HAVE_GETHOSTBYNAME_R_5_SRC "
+		check_c_source_compiles("${HAVE_GETHOSTBYNAME_R_6_SRC}"  HAVE_GETHOSTBYNAME_R_6)
+		if(HAVE_GETHOSTBYNAME_R_6)
+			add_tcl_cflag(HAVE_GETHOSTBYNAME_R_6)
+		else(HAVE_GETHOSTBYNAME_R_6)
+			set(HAVE_GETHOSTBYNAME_R_5_SRC "
 #include <netdb.h>
 int main(){
 char *name;
@@ -728,12 +728,12 @@
 (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYNAME_R_5_SRC}"  HAVE_GETHOSTBYNAME_R_5)
+			check_c_source_compiles("${HAVE_GETHOSTBYNAME_R_5_SRC}"  HAVE_GETHOSTBYNAME_R_5)
 
-			IF(HAVE_GETHOSTBYNAME_R_5)
-				ADD_TCL_CFLAG(HAVE_GETHOSTBYNAME_R_5)
-			ELSE(HAVE_GETHOSTBYNAME_R_5)
-				SET(HAVE_GETHOSTBYNAME_R_3_SRC "
+			if(HAVE_GETHOSTBYNAME_R_5)
+				add_tcl_cflag(HAVE_GETHOSTBYNAME_R_5)
+			else(HAVE_GETHOSTBYNAME_R_5)
+				set(HAVE_GETHOSTBYNAME_R_3_SRC "
 #include <netdb.h>
 int main(){
 char *name;
@@ -743,22 +743,22 @@
 (void) gethostbyname_r(name, he, &data);
 return 0;}
 				")
-				CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYNAME_R_3_SRC}" HAVE_GETHOSTBYNAME_R_3)
-				IF(HAVE_GETHOSTBYNAME_R_3)
-					ADD_TCL_CFLAG(HAVE_GETHOSTBYNAME_R_3)
-				ENDIF(HAVE_GETHOSTBYNAME_R_3)
-			ENDIF(HAVE_GETHOSTBYNAME_R_5)
-		ENDIF(HAVE_GETHOSTBYNAME_R_6)
-	ENDIF(HAVE_GETHOSTBYNAME_R)
-ENDMACRO(SC_TCL_GETHOSTBYNAME_R)
+				check_c_source_compiles("${HAVE_GETHOSTBYNAME_R_3_SRC}" HAVE_GETHOSTBYNAME_R_3)
+				if(HAVE_GETHOSTBYNAME_R_3)
+					add_tcl_cflag(HAVE_GETHOSTBYNAME_R_3)
+				endif(HAVE_GETHOSTBYNAME_R_3)
+			endif(HAVE_GETHOSTBYNAME_R_5)
+		endif(HAVE_GETHOSTBYNAME_R_6)
+	endif(HAVE_GETHOSTBYNAME_R)
+endmacro(SC_TCL_GETHOSTBYNAME_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_IPV6
 #--------------------------------------------------------------------
-MACRO(SC_TCL_IPV6)
-	CHECK_FUNCTION_EXISTS(getaddrinfo HAVE_GETADDRINFO)
-	IF(HAVE_GETADDRINFO)
-		SET(GETADDRINFO_SRC "
+macro(SC_TCL_IPV6)
+	check_function_exists(getaddrinfo HAVE_GETADDRINFO)
+	if(HAVE_GETADDRINFO)
+		set(GETADDRINFO_SRC "
 #include <netdb.h>
 int main () {
 const char *name, *port;
@@ -768,20 +768,20 @@
 return 0;
 }
 		")
-		CHECK_C_SOURCE_COMPILES("${GETADDRINFO_SRC}" WORKING_GETADDRINFO)
-		IF(WORKING_GETADDRINFO)
-			ADD_TCL_CFLAG(HAVE_GETADDRINFO)
-		ENDIF(WORKING_GETADDRINFO)
-	ENDIF(HAVE_GETADDRINFO)
-ENDMACRO(SC_TCL_IPV6)
+		check_c_source_compiles("${GETADDRINFO_SRC}" WORKING_GETADDRINFO)
+		if(WORKING_GETADDRINFO)
+			add_tcl_cflag(HAVE_GETADDRINFO)
+		endif(WORKING_GETADDRINFO)
+	endif(HAVE_GETADDRINFO)
+endmacro(SC_TCL_IPV6)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETPWUID_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETPWUID_R)
-	TCL_CHECK_FUNCTION_EXISTS(getpwuid_r HAVE_GETPWUID_R)
-	IF(HAVE_GETPWUID_R)
-		SET(HAVE_GETPWUID_R_5_SRC "
+macro(SC_TCL_GETPWUID_R)
+	tcl_check_function_exists(getpwuid_r HAVE_GETPWUID_R)
+	if(HAVE_GETPWUID_R)
+		set(HAVE_GETPWUID_R_5_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -793,11 +793,11 @@
 (void) getpwuid_r(uid, &pw, buf, buflen, &pwp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETPWUID_R_5_SRC}"  HAVE_GETPWUID_R_5)
-		IF(HAVE_GETPWUID_R_5)
-			ADD_TCL_CFLAG(HAVE_GETPWUID_R_5)
-		ELSE(HAVE_GETPWUID_R_5)
-			SET(HAVE_GETPWUID_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETPWUID_R_5_SRC}"  HAVE_GETPWUID_R_5)
+		if(HAVE_GETPWUID_R_5)
+			add_tcl_cflag(HAVE_GETPWUID_R_5)
+		else(HAVE_GETPWUID_R_5)
+			set(HAVE_GETPWUID_R_4_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -809,21 +809,21 @@
 (void) getpwuid_r(uid, &pw, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETPWUID_R_4_SRC}" HAVE_GETPWUID_R_4)
-			IF(HAVE_GETPWUID_R_4)
-				ADD_TCL_CFLAG(HAVE_GETPWUID_R_4)
-			ENDIF(HAVE_GETPWUID_R_4)
-		ENDIF(HAVE_GETPWUID_R_5)
-	ENDIF(HAVE_GETPWUID_R)
-ENDMACRO(SC_TCL_GETPWUID_R)
+			check_c_source_compiles("${HAVE_GETPWUID_R_4_SRC}" HAVE_GETPWUID_R_4)
+			if(HAVE_GETPWUID_R_4)
+				add_tcl_cflag(HAVE_GETPWUID_R_4)
+			endif(HAVE_GETPWUID_R_4)
+		endif(HAVE_GETPWUID_R_5)
+	endif(HAVE_GETPWUID_R)
+endmacro(SC_TCL_GETPWUID_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETPWNAM_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETPWNAM_R)
-	TCL_CHECK_FUNCTION_EXISTS(getpwnam_r HAVE_GETPWNAM_R)
-	IF(HAVE_GETPWNAM_R)
-		SET(HAVE_GETPWNAM_R_5_SRC "
+macro(SC_TCL_GETPWNAM_R)
+	tcl_check_function_exists(getpwnam_r HAVE_GETPWNAM_R)
+	if(HAVE_GETPWNAM_R)
+		set(HAVE_GETPWNAM_R_5_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -835,11 +835,11 @@
 (void) getpwnam_r(name, &pw, buf, buflen, &pwp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETPWNAM_R_5_SRC}"  HAVE_GETPWNAM_R_5)
-		IF(HAVE_GETPWNAM_R_5)
-			ADD_TCL_CFLAG(HAVE_GETPWNAM_R_5)
-		ELSE(HAVE_GETPWNAM_R_5)
-			SET(HAVE_GETPWNAM_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETPWNAM_R_5_SRC}"  HAVE_GETPWNAM_R_5)
+		if(HAVE_GETPWNAM_R_5)
+			add_tcl_cflag(HAVE_GETPWNAM_R_5)
+		else(HAVE_GETPWNAM_R_5)
+			set(HAVE_GETPWNAM_R_4_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -851,21 +851,21 @@
 (void)getpwnam_r(name, &pw, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETPWNAM_R_4_SRC}" HAVE_GETPWNAM_R_4)
-			IF(HAVE_GETPWNAM_R_4)
-			   ADD_TCL_CFLAG(HAVE_GETPWNAM_R_4)
-			ENDIF(HAVE_GETPWNAM_R_4)
-		ENDIF(HAVE_GETPWNAM_R_5)
-	ENDIF(HAVE_GETPWNAM_R)
-ENDMACRO(SC_TCL_GETPWNAM_R)
+			check_c_source_compiles("${HAVE_GETPWNAM_R_4_SRC}" HAVE_GETPWNAM_R_4)
+			if(HAVE_GETPWNAM_R_4)
+			   add_tcl_cflag(HAVE_GETPWNAM_R_4)
+			endif(HAVE_GETPWNAM_R_4)
+		endif(HAVE_GETPWNAM_R_5)
+	endif(HAVE_GETPWNAM_R)
+endmacro(SC_TCL_GETPWNAM_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETGRGID_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETGRGID_R)
-	TCL_CHECK_FUNCTION_EXISTS(getgrgid_r HAVE_GETGRGID_R)
-	IF(HAVE_GETGRGID_R)
-		SET(HAVE_GETGRGID_R_5_SRC "
+macro(SC_TCL_GETGRGID_R)
+	tcl_check_function_exists(getgrgid_r HAVE_GETGRGID_R)
+	if(HAVE_GETGRGID_R)
+		set(HAVE_GETGRGID_R_5_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -877,11 +877,11 @@
 (void) getgrgid_r(gid, &gr, buf, buflen, &grp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETGRGID_R_5_SRC}"  HAVE_GETGRGID_R_5)
-		IF(HAVE_GETGRGID_R_5)
-			ADD_TCL_CFLAG(HAVE_GETGRGID_R_5)
-		ELSE(HAVE_GETGRGID_R_5)
-			SET(HAVE_GETGRGID_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETGRGID_R_5_SRC}"  HAVE_GETGRGID_R_5)
+		if(HAVE_GETGRGID_R_5)
+			add_tcl_cflag(HAVE_GETGRGID_R_5)
+		else(HAVE_GETGRGID_R_5)
+			set(HAVE_GETGRGID_R_4_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -893,21 +893,21 @@
 (void)getgrgid_r(gid, &gr, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETGRGID_R_4_SRC}" HAVE_GETGRGID_R_4)
-			IF(HAVE_GETGRGID_R_4)
-				ADD_TCL_CFLAG(HAVE_GETGRGID_R_4)
-			ENDIF(HAVE_GETGRGID_R_4)
-		ENDIF(HAVE_GETGRGID_R_5)
-	ENDIF(HAVE_GETGRGID_R)
-ENDMACRO(SC_TCL_GETGRGID_R)
+			check_c_source_compiles("${HAVE_GETGRGID_R_4_SRC}" HAVE_GETGRGID_R_4)
+			if(HAVE_GETGRGID_R_4)
+				add_tcl_cflag(HAVE_GETGRGID_R_4)
+			endif(HAVE_GETGRGID_R_4)
+		endif(HAVE_GETGRGID_R_5)
+	endif(HAVE_GETGRGID_R)
+endmacro(SC_TCL_GETGRGID_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETGRNAM_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETGRNAM_R)
-	TCL_CHECK_FUNCTION_EXISTS(getgrnam_r HAVE_GETGRNAM_R)
-	IF(HAVE_GETGRNAM_R)
-		SET(HAVE_GETGRNAM_R_5_SRC "
+macro(SC_TCL_GETGRNAM_R)
+	tcl_check_function_exists(getgrnam_r HAVE_GETGRNAM_R)
+	if(HAVE_GETGRNAM_R)
+		set(HAVE_GETGRNAM_R_5_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -919,11 +919,11 @@
 (void) getgrnam_r(name, &gr, buf, buflen, &grp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETGRNAM_R_5_SRC}"  HAVE_GETGRNAM_R_5)
-		IF(HAVE_GETGRNAM_R_5)
-			ADD_TCL_CFLAG(HAVE_GETGRNAM_R_5)
-		ELSE(HAVE_GETGRNAM_R_5)
-			SET(HAVE_GETGRNAM_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETGRNAM_R_5_SRC}"  HAVE_GETGRNAM_R_5)
+		if(HAVE_GETGRNAM_R_5)
+			add_tcl_cflag(HAVE_GETGRNAM_R_5)
+		else(HAVE_GETGRNAM_R_5)
+			set(HAVE_GETGRNAM_R_4_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -935,19 +935,19 @@
 (void)getgrnam_r(name, &gr, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETGRNAM_R_4_SRC}" HAVE_GETGRNAM_R_4)
-			IF(HAVE_GETGRNAM_R_4)
-			   ADD_TCL_CFLAG(HAVE_GETGRNAM_R_4)
-			ENDIF(HAVE_GETGRNAM_R_4)
-		ENDIF(HAVE_GETGRNAM_R_5)
-	ENDIF(HAVE_GETGRNAM_R)
-ENDMACRO(SC_TCL_GETGRNAM_R)
+			check_c_source_compiles("${HAVE_GETGRNAM_R_4_SRC}" HAVE_GETGRNAM_R_4)
+			if(HAVE_GETGRNAM_R_4)
+			   add_tcl_cflag(HAVE_GETGRNAM_R_4)
+			endif(HAVE_GETGRNAM_R_4)
+		endif(HAVE_GETGRNAM_R_5)
+	endif(HAVE_GETGRNAM_R)
+endmacro(SC_TCL_GETGRNAM_R)
 
 
 
 
-MACRO(CHECK_FD_SET_IN_TYPES_D)
-	SET(TEST_SRC "
+macro(CHECK_FD_SET_IN_TYPES_D)
+	set(TEST_SRC "
 	#include <sys/types.h>
 	int main ()
 	{
@@ -955,16 +955,16 @@
 	return 0;
 	}
 	")
-	CHECK_C_SOURCE_COMPILES("${TEST_SRC}" FD_SET_IN_TYPES_H)
-ENDMACRO(CHECK_FD_SET_IN_TYPES_D)
+	check_c_source_compiles("${TEST_SRC}" FD_SET_IN_TYPES_H)
+endmacro(CHECK_FD_SET_IN_TYPES_D)
 
-MACRO(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
-	SET(TEST_SRC"
+macro(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
+	set(TEST_SRC"
 	#define MODULE_SCOPE extern __attribute__((__visibility__("hidden")))
 	main(){};
 	")
-	CHECK_C_SOURCE_COMPILES("${TEST_SRC}" COMPILER_SUPPORTS_HIDDEN)
-ENDMACRO(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
+	check_c_source_compiles("${TEST_SRC}" COMPILER_SUPPORTS_HIDDEN)
+endmacro(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
 
 
 
Index: src/other/incrTcl/itk/CMake/CheckPrototypeExists.cmake
===================================================================
--- src/other/incrTcl/itk/CMake/CheckPrototypeExists.cmake	(revision 54114)
+++ src/other/incrTcl/itk/CMake/CheckPrototypeExists.cmake	(working copy)
@@ -57,6 +57,6 @@
   return 0;
 }
 ")
-  CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
+  check_cxx_source_compiles("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
 endmacro(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
 
Index: src/other/incrTcl/itk/CMake/CheckCSourceRuns.cmake
===================================================================
--- src/other/incrTcl/itk/CMake/CheckCSourceRuns.cmake	(revision 54114)
+++ src/other/incrTcl/itk/CMake/CheckCSourceRuns.cmake	(working copy)
@@ -70,32 +70,32 @@
 # 
 #=============================================================================
 
-MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
-  IF("${VAR}" MATCHES "^${VAR}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS 
+macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
+  if("${VAR}" MATCHES "^${VAR}$")
+    set(MACRO_CHECK_FUNCTION_DEFINITIONS 
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    IF(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
+    if(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
+    else(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    IF(EXISTS "${SOURCE}")
-      SET(CHECK_SRC "${SOURCE}")
-    ELSE(EXISTS "${SOURCE}")
-      FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    if(EXISTS "${SOURCE}")
+      set(CHECK_SRC "${SOURCE}")
+    else(EXISTS "${SOURCE}")
+      file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
         "${SOURCE}\n")
-      SET(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
-    ENDIF(EXISTS "${SOURCE}")
+      set(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
+    endif(EXISTS "${SOURCE}")
     
-    MESSAGE(STATUS "Performing Test ${VAR}")
-    TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
+    message(STATUS "Performing Test ${VAR}")
+    try_run(${VAR}_EXITCODE ${VAR}_COMPILED
       ${CMAKE_BINARY_DIR}
       ${CHECK_SRC}
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -105,33 +105,33 @@
       "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
       COMPILE_OUTPUT_VARIABLE OUTPUT)
     # if it did not compile make the return value fail code of 1
-    IF(NOT ${VAR}_COMPILED)
-      SET(${VAR}_EXITCODE 1)
-    ENDIF(NOT ${VAR}_COMPILED)
+    if(NOT ${VAR}_COMPILED)
+      set(${VAR}_EXITCODE 1)
+    endif(NOT ${VAR}_COMPILED)
     # if the return value was 0 then it worked
-    IF("${${VAR}_EXITCODE}" EQUAL 0)
-      SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
-      MESSAGE(STATUS "Performing Test ${VAR} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+    if("${${VAR}_EXITCODE}" EQUAL 0)
+      set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+      message(STATUS "Performing Test ${VAR} - Success")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
         "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}}\n"
         "Source file was:\n${SOURCE}\n")
-    ELSE("${${VAR}_EXITCODE}" EQUAL 0)
-      IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "${${VAR}_EXITCODE}")
-      ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+    else("${${VAR}_EXITCODE}" EQUAL 0)
+      if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "${${VAR}_EXITCODE}")
+      else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+      endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
 
-      MESSAGE(STATUS "Performing Test ${VAR} - Failed")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      message(STATUS "Performing Test ${VAR} - Failed")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
         "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}_EXITCODE}\n"
         "Source file was:\n${SOURCE}\n")
 
-    ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
-  ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_C_SOURCE_RUNS)
+    endif("${${VAR}_EXITCODE}" EQUAL 0)
+  endif("${VAR}" MATCHES "^${VAR}$")
+endmacro(CHECK_C_SOURCE_RUNS)
 
Index: src/other/incrTcl/itk/CMake/FindX11.cmake
===================================================================
--- src/other/incrTcl/itk/CMake/FindX11.cmake	(revision 54114)
+++ src/other/incrTcl/itk/CMake/FindX11.cmake	(working copy)
@@ -130,16 +130,16 @@
 # 
 #=============================================================================
 
-MACRO(X11_FIND_INCLUDE_PATH component header)
+macro(X11_FIND_INCLUDE_PATH component header)
   find_path(X11_${component}_INCLUDE_PATH ${header} ${X11_INC_SEARCH_PATH} NO_CMAKE_SYSTEM_PATH)
   set(X11_HDR_VARS ${X11_HDR_VARS} X11_${component}_INCLUDE_PATH)
   if(X11_${component}_INCLUDE_PATH)
     set(X11_HDR_PATHS ${X11_HDR_PATHS} ${X11_${component}_INCLUDE_PATH})
     list(REMOVE_DUPLICATES X11_HDR_PATHS)
   endif(X11_${component}_INCLUDE_PATH)
-ENDMACRO(X11_FIND_INCLUDE_PATH)
+endmacro(X11_FIND_INCLUDE_PATH)
 
-MACRO(X11_FIND_LIB_PATH component libname)
+macro(X11_FIND_LIB_PATH component libname)
   find_library(X11_${component}_LIB ${libname} ${X11_LIB_SEARCH_PATH} NO_CMAKE_SYSTEM_PATH)
   set(X11_LIB_VARS ${X11_LIB_VARS} X11_${component}_LIB)
   if(X11_${component}_LIB)
@@ -147,7 +147,7 @@
     set(X11_LIB_PATHS ${X11_LIB_PATHS} ${X11_${component}_DIR})
     list(REMOVE_DUPLICATES X11_LIB_PATHS)
   endif(X11_${component}_LIB)
-ENDMACRO(X11_FIND_LIB_PATH)
+endmacro(X11_FIND_LIB_PATH)
 
 if(UNIX)
   set(X11_FOUND 0)
@@ -208,63 +208,63 @@
   set(X11_LIB_PATHS)
   
   # Find primary X11 headers
-  X11_FIND_INCLUDE_PATH(X11		X11/X.h)
-  X11_FIND_INCLUDE_PATH(Xlib		X11/Xlib.h)
+  x11_find_include_path(X11		X11/X.h)
+  x11_find_include_path(Xlib		X11/Xlib.h)
   # Look for other X11 includes; keep the list sorted by name of the cmake X11_<component>_INCLUDE_PATH
   # variable (component doesn't need to match the include file name).
-  X11_FIND_INCLUDE_PATH(ICE 		X11/ICE/ICE.h)
-  X11_FIND_INCLUDE_PATH(Xaccessrules 	X11/extensions/XKBrules.h)
-  X11_FIND_INCLUDE_PATH(Xaccessstr 	X11/extensions/XKBstr.h)
-  X11_FIND_INCLUDE_PATH(Xau 		X11/Xauth.h)
-  X11_FIND_INCLUDE_PATH(Xcomposite 	X11/extensions/Xcomposite.h)
-  X11_FIND_INCLUDE_PATH(Xcursor 	X11/Xcursor/Xcursor.h)
-  X11_FIND_INCLUDE_PATH(Xdamage 	X11/extensions/Xdamage.h)
-  X11_FIND_INCLUDE_PATH(Xdmcp 		X11/Xdmcp.h)
-  X11_FIND_INCLUDE_PATH(dpms 		X11/extensions/dpms.h)
-  X11_FIND_INCLUDE_PATH(xf86misc 	X11/extensions/xf86misc.h)
-  X11_FIND_INCLUDE_PATH(xf86vmode 	X11/extensions/xf86vmode.h)
-  X11_FIND_INCLUDE_PATH(Xfixes		X11/extensions/Xfixes.h)
-  X11_FIND_INCLUDE_PATH(Xft		X11/Xft/Xft.h)
-  X11_FIND_INCLUDE_PATH(Xi		X11/extensions/XInput.h)
-  X11_FIND_INCLUDE_PATH(Xinerama	X11/extensions/Xinerama.h)
-  X11_FIND_INCLUDE_PATH(Xinput		X11/extensions/XInput.h)
-  X11_FIND_INCLUDE_PATH(Xkb		X11/extensions/XKB.h)
-  X11_FIND_INCLUDE_PATH(Xkblib		X11/XKBlib.h)
-  X11_FIND_INCLUDE_PATH(Xpm		X11/xpm.h)
-  X11_FIND_INCLUDE_PATH(XTest		X11/extensions/XTest.h)
-  X11_FIND_INCLUDE_PATH(XShm		X11/extensions/XShm.h)
-  X11_FIND_INCLUDE_PATH(Xrandr		X11/extensions/Xrandr.h)
-  X11_FIND_INCLUDE_PATH(Xrender		X11/extensions/Xrender.h)
-  X11_FIND_INCLUDE_PATH(Xscreensaver	X11/extensions/scrnsaver.h)
-  X11_FIND_INCLUDE_PATH(Xshape		X11/extensions/shape.h)
-  X11_FIND_INCLUDE_PATH(Xutil		X11/Xutil.h)
-  X11_FIND_INCLUDE_PATH(Xt		X11/Intrinsic.h)
-  X11_FIND_INCLUDE_PATH(Xv		X11/extensions/Xvlib.h)
+  x11_find_include_path(ICE 		X11/ICE/ICE.h)
+  x11_find_include_path(Xaccessrules 	X11/extensions/XKBrules.h)
+  x11_find_include_path(Xaccessstr 	X11/extensions/XKBstr.h)
+  x11_find_include_path(Xau 		X11/Xauth.h)
+  x11_find_include_path(Xcomposite 	X11/extensions/Xcomposite.h)
+  x11_find_include_path(Xcursor 	X11/Xcursor/Xcursor.h)
+  x11_find_include_path(Xdamage 	X11/extensions/Xdamage.h)
+  x11_find_include_path(Xdmcp 		X11/Xdmcp.h)
+  x11_find_include_path(dpms 		X11/extensions/dpms.h)
+  x11_find_include_path(xf86misc 	X11/extensions/xf86misc.h)
+  x11_find_include_path(xf86vmode 	X11/extensions/xf86vmode.h)
+  x11_find_include_path(Xfixes		X11/extensions/Xfixes.h)
+  x11_find_include_path(Xft		X11/Xft/Xft.h)
+  x11_find_include_path(Xi		X11/extensions/XInput.h)
+  x11_find_include_path(Xinerama	X11/extensions/Xinerama.h)
+  x11_find_include_path(Xinput		X11/extensions/XInput.h)
+  x11_find_include_path(Xkb		X11/extensions/XKB.h)
+  x11_find_include_path(Xkblib		X11/XKBlib.h)
+  x11_find_include_path(Xpm		X11/xpm.h)
+  x11_find_include_path(XTest		X11/extensions/XTest.h)
+  x11_find_include_path(XShm		X11/extensions/XShm.h)
+  x11_find_include_path(Xrandr		X11/extensions/Xrandr.h)
+  x11_find_include_path(Xrender		X11/extensions/Xrender.h)
+  x11_find_include_path(Xscreensaver	X11/extensions/scrnsaver.h)
+  x11_find_include_path(Xshape		X11/extensions/shape.h)
+  x11_find_include_path(Xutil		X11/Xutil.h)
+  x11_find_include_path(Xt		X11/Intrinsic.h)
+  x11_find_include_path(Xv		X11/extensions/Xvlib.h)
   
 
   # Find primary X11 library
-  X11_FIND_LIB_PATH(X11			X11)
+  x11_find_lib_path(X11			X11)
   # Find additional X libraries. Keep list sorted by library name.
-  X11_FIND_LIB_PATH(ICE			ICE)
-  X11_FIND_LIB_PATH(SM			SM)
-  X11_FIND_LIB_PATH(Xau			Xau)
-  X11_FIND_LIB_PATH(Xcomposite		Xcomposite)
-  X11_FIND_LIB_PATH(Xcursor		Xcursor)
-  X11_FIND_LIB_PATH(Xdamage		Xdamage)
-  X11_FIND_LIB_PATH(Xdmcp		Xdmcp)
-  X11_FIND_LIB_PATH(Xext		Xext)
-  X11_FIND_LIB_PATH(Xfixes		Xfixes)
-  X11_FIND_LIB_PATH(Xft			Xft)
-  X11_FIND_LIB_PATH(Xi			Xi)
-  X11_FIND_LIB_PATH(Xinerama		Xinerama)
-  X11_FIND_LIB_PATH(Xpm			Xpm)
-  X11_FIND_LIB_PATH(Xrandr		Xrandr)
-  X11_FIND_LIB_PATH(Xrender		Xrender)
-  X11_FIND_LIB_PATH(Xscreensaver	Xss)
-  X11_FIND_LIB_PATH(Xt			Xt)
-  X11_FIND_LIB_PATH(XTest		Xtst)
-  X11_FIND_LIB_PATH(Xv			Xv)
-  X11_FIND_LIB_PATH(Xxf86misc		Xxf86misc)
+  x11_find_lib_path(ICE			ICE)
+  x11_find_lib_path(SM			SM)
+  x11_find_lib_path(Xau			Xau)
+  x11_find_lib_path(Xcomposite		Xcomposite)
+  x11_find_lib_path(Xcursor		Xcursor)
+  x11_find_lib_path(Xdamage		Xdamage)
+  x11_find_lib_path(Xdmcp		Xdmcp)
+  x11_find_lib_path(Xext		Xext)
+  x11_find_lib_path(Xfixes		Xfixes)
+  x11_find_lib_path(Xft			Xft)
+  x11_find_lib_path(Xi			Xi)
+  x11_find_lib_path(Xinerama		Xinerama)
+  x11_find_lib_path(Xpm			Xpm)
+  x11_find_lib_path(Xrandr		Xrandr)
+  x11_find_lib_path(Xrender		Xrender)
+  x11_find_lib_path(Xscreensaver	Xss)
+  x11_find_lib_path(Xt			Xt)
+  x11_find_lib_path(XTest		Xtst)
+  x11_find_lib_path(Xv			Xv)
+  x11_find_lib_path(Xxf86misc		Xxf86misc)
 
   set(X11_LIBRARY_DIR "")
   if(X11_X11_LIB)
@@ -437,69 +437,69 @@
       set(X11_X_EXTRA_LIBS "")
 
       # See if XOpenDisplay in X11 works by itself.
-      CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
+      check_library_exists("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
       if(NOT X11_LIB_X11_SOLO)
         # Find library needed for dnet_ntoa.
-        CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
+        check_library_exists("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
         if(X11_LIB_DNET_HAS_DNET_NTOA)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
         else(X11_LIB_DNET_HAS_DNET_NTOA)
-          CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
+          check_library_exists("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
           if(X11_LIB_DNET_STUB_HAS_DNET_NTOA)
-            SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
+            set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
           endif(X11_LIB_DNET_STUB_HAS_DNET_NTOA)
         endif(X11_LIB_DNET_HAS_DNET_NTOA)
       endif(NOT X11_LIB_X11_SOLO)
 
       # Find library needed for gethostbyname.
-      CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
+      check_function_exists("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
       if(NOT CMAKE_HAVE_GETHOSTBYNAME)
-        CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+        check_library_exists("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
         if(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
         else(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-          CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+          check_library_exists("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
           if(CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
-            SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
+            set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
           endif(CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
         endif(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
       endif(NOT CMAKE_HAVE_GETHOSTBYNAME)
 
       # Find library needed for connect.
-      CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT)
+      check_function_exists("connect" CMAKE_HAVE_CONNECT)
       if(NOT CMAKE_HAVE_CONNECT)
-        CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
+        check_library_exists("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
         if(CMAKE_LIB_SOCKET_HAS_CONNECT)
-          SET (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
+          set (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
         endif(CMAKE_LIB_SOCKET_HAS_CONNECT)
       endif(NOT CMAKE_HAVE_CONNECT)
 
       # Find library needed for remove.
-      CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE)
+      check_function_exists("remove" CMAKE_HAVE_REMOVE)
       if(NOT CMAKE_HAVE_REMOVE)
-        CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
+        check_library_exists("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
         if(CMAKE_LIB_POSIX_HAS_REMOVE)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
         endif(CMAKE_LIB_POSIX_HAS_REMOVE)
       endif(NOT CMAKE_HAVE_REMOVE)
 
       # Find library needed for shmat.
-      CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT)
+      check_function_exists("shmat" CMAKE_HAVE_SHMAT)
       if(NOT CMAKE_HAVE_SHMAT)
-        CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
+        check_library_exists("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
         if(CMAKE_LIB_IPS_HAS_SHMAT)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
         endif(CMAKE_LIB_IPS_HAS_SHMAT)
       endif(NOT CMAKE_HAVE_SHMAT)
     endif($ENV{ISC} MATCHES "^yes$")
 
     if(X11_ICE_FOUND)
-      CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
+      check_library_exists("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
         CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
       if(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
-        SET (X11_X_PRE_LIBS ${X11_ICE_LIB})
+        set (X11_X_PRE_LIBS ${X11_ICE_LIB})
         if(X11_SM_LIB)
-          SET (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
+          set (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
         endif(X11_SM_LIB)
       endif(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
     endif(X11_ICE_FOUND)
@@ -548,7 +548,7 @@
     endif("${LIB_PATH_CNT}" GREATER 1)
 
     include(FindPackageMessage)
-    FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
+    find_package_message(X11 "Found X11: ${X11_X11_LIB}"
       "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
   else(X11_FOUND)
     if(X11_FIND_REQUIRED)
Index: src/other/incrTcl/itk/CMake/CheckSystemFunctionality.cmake
===================================================================
--- src/other/incrTcl/itk/CMake/CheckSystemFunctionality.cmake	(revision 54114)
+++ src/other/incrTcl/itk/CMake/CheckSystemFunctionality.cmake	(working copy)
@@ -1,35 +1,35 @@
 # Checking compiler flags benefits from some macro logic
 
-INCLUDE(CheckCCompilerFlag)
+include(CheckCCompilerFlag)
 
-MACRO(CHECK_C_FLAG flag)
-  STRING(TOUPPER ${flag} UPPER_FLAG)
-  STRING(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
-  STRING(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
-  IF(${ARGC} LESS 2)
-    CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-  ELSE(${ARGC} LESS 2)
-    IF(NOT ${ARGV1})
-      CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-      IF(${UPPER_FLAG}_COMPILER_FLAG)
-	MESSAGE("- Found ${ARGV1} - setting to -${flag}")
-	SET(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
-      ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-    ENDIF(NOT ${ARGV1})
-  ENDIF(${ARGC} LESS 2)
-  IF(${UPPER_FLAG}_COMPILER_FLAG)
-    SET(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
-  ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-ENDMACRO()
+macro(CHECK_C_FLAG flag)
+  string(TOUPPER ${flag} UPPER_FLAG)
+  string(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
+  string(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
+  if(${ARGC} LESS 2)
+    check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+  else(${ARGC} LESS 2)
+    if(NOT ${ARGV1})
+      check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+      if(${UPPER_FLAG}_COMPILER_FLAG)
+	message("- Found ${ARGV1} - setting to -${flag}")
+	set(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
+      endif(${UPPER_FLAG}_COMPILER_FLAG)
+    endif(NOT ${ARGV1})
+  endif(${ARGC} LESS 2)
+  if(${UPPER_FLAG}_COMPILER_FLAG)
+    set(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
+  endif(${UPPER_FLAG}_COMPILER_FLAG)
+endmacro()
 
-MACRO(CHECK_C_FLAG_GATHER flag FLAGS)
-  STRING(TOUPPER ${flag} UPPER_FLAG)
-  STRING(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
-  CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-  IF(${UPPER_FLAG}_COMPILER_FLAG)
-    SET(${FLAGS} "${${FLAGS}} -${flag}")
-  ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-ENDMACRO()
+macro(CHECK_C_FLAG_GATHER flag FLAGS)
+  string(TOUPPER ${flag} UPPER_FLAG)
+  string(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
+  check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+  if(${UPPER_FLAG}_COMPILER_FLAG)
+    set(${FLAGS} "${${FLAGS}} -${flag}")
+  endif(${UPPER_FLAG}_COMPILER_FLAG)
+endmacro()
 
 
 # Automate putting variables from tests into CFLAGS,
@@ -40,78 +40,78 @@
 # If a CONFIG_CFLAGS variable is defined, they will append
 # an appropriate definition to that variable.
 
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckIncludeFileCXX)
-INCLUDE(CheckTypeSize)
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckStructHasMember)
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(ResolveCompilerPaths)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckTypeSize)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(ResolveCompilerPaths)
 
-MACRO(CONFIG_CHECK_FUNCTION_EXISTS function var)
-  CHECK_FUNCTION_EXISTS(${function} ${var})
-  IF(${var})
+macro(CONFIG_CHECK_FUNCTION_EXISTS function var)
+  check_function_exists(${function} ${var})
+  if(${var})
     add_definitions(-D${var}=1)
-  ENDIF(${var})
-ENDMACRO(CONFIG_CHECK_FUNCTION_EXISTS)
+  endif(${var})
+endmacro(CONFIG_CHECK_FUNCTION_EXISTS)
 
-MACRO(CONFIG_CHECK_INCLUDE_FILE filename var)
-  CHECK_INCLUDE_FILE(${filename} ${var})
-  IF(${var})
+macro(CONFIG_CHECK_INCLUDE_FILE filename var)
+  check_include_file(${filename} ${var})
+  if(${var})
     add_definitions(-D${var}=1)
-  ENDIF(${var})
-ENDMACRO(CONFIG_CHECK_INCLUDE_FILE)
+  endif(${var})
+endmacro(CONFIG_CHECK_INCLUDE_FILE)
 
-MACRO(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
-  CHECK_INCLUDE_FILE(${filename} HAVE_${var})
-  IF(HAVE_${var})
-    SET(HEADER_SRC "
+macro(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
+  check_include_file(${filename} HAVE_${var})
+  if(HAVE_${var})
+    set(HEADER_SRC "
 		#include <${filename}>
 		main(){};
 		")
-    CHECK_C_SOURCE_COMPILES("${HEADER_SRC}" ${var}_USABLE)
-  ENDIF(HAVE_${var})
-  IF(NOT HAVE_${var} OR NOT ${var}_USABLE)
+    check_c_source_compiles("${HEADER_SRC}" ${var}_USABLE)
+  endif(HAVE_${var})
+  if(NOT HAVE_${var} OR NOT ${var}_USABLE)
     add_definitions(-DNO_${var}=1)
-  ENDIF(NOT HAVE_${var} OR NOT ${var}_USABLE)
-ENDMACRO(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
+  endif(NOT HAVE_${var} OR NOT ${var}_USABLE)
+endmacro(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
 
-MACRO(CONFIG_CHECK_INCLUDE_FILE_CXX filename var)
-  CHECK_INCLUDE_FILE_CXX(${filename} ${var})
-  IF(${var})
+macro(CONFIG_CHECK_INCLUDE_FILE_CXX filename var)
+  check_include_file_cxx(${filename} ${var})
+  if(${var})
     add_definitions(-D${var}=1)
-  ENDIF(${var})
-ENDMACRO(CONFIG_CHECK_INCLUDE_FILE_CXX)
+  endif(${var})
+endmacro(CONFIG_CHECK_INCLUDE_FILE_CXX)
 
-MACRO(CONFIG_CHECK_TYPE_SIZE typename var)
-  FOREACH(arg ${ARGN})
-    SET(headers ${headers} ${arg})
-  ENDFOREACH(arg ${ARGN})
-  SET(CHECK_EXTRA_INCLUDE_FILES ${headers})
-  CHECK_TYPE_SIZE(${typename} HAVE_${var}_T)
-  SET(CHECK_EXTRA_INCLUDE_FILES)
-  IF(HAVE_${var}_T)
+macro(CONFIG_CHECK_TYPE_SIZE typename var)
+  foreach(arg ${ARGN})
+    set(headers ${headers} ${arg})
+  endforeach(arg ${ARGN})
+  set(CHECK_EXTRA_INCLUDE_FILES ${headers})
+  check_type_size(${typename} HAVE_${var}_T)
+  set(CHECK_EXTRA_INCLUDE_FILES)
+  if(HAVE_${var}_T)
     add_definitions(-DHAVE_${var}_T=1)
     add_definitions(-DSIZEOF${var}=${HAVE_${var}_T})		
-  ENDIF(HAVE_${var}_T)
-ENDMACRO(CONFIG_CHECK_TYPE_SIZE)
+  endif(HAVE_${var}_T)
+endmacro(CONFIG_CHECK_TYPE_SIZE)
 
-MACRO(CONFIG_CHECK_STRUCT_HAS_MEMBER structname member header var)
-  CHECK_STRUCT_HAS_MEMBER(${structname} ${member} ${header} HAVE_${var})
-  IF(HAVE_${var})
+macro(CONFIG_CHECK_STRUCT_HAS_MEMBER structname member header var)
+  check_struct_has_member(${structname} ${member} ${header} HAVE_${var})
+  if(HAVE_${var})
     add_definitions(-DHAVE_${var}=1)
-  ENDIF(HAVE_${var})
-ENDMACRO(CONFIG_CHECK_STRUCT_HAS_MEMBER)
+  endif(HAVE_${var})
+endmacro(CONFIG_CHECK_STRUCT_HAS_MEMBER)
 
-MACRO(CONFIG_CHECK_LIBRARY targetname lname func)
-  IF(NOT ${targetname}_LIBRARY)
-    CHECK_LIBRARY_EXISTS(${lname} ${func} "" HAVE_${targetname}_${lname})
-    IF(HAVE_${targetname}_${lname})
-      RESOLVE_LIBRARIES(${targetname}_LIBRARY "-l${lname}")
-      SET(${targetname}_LINKOPT "-l${lname}")
-    ENDIF(HAVE_${targetname}_${lname})
-  ENDIF(NOT ${targetname}_LIBRARY)
-ENDMACRO(CONFIG_CHECK_LIBRARY lname func)
+macro(CONFIG_CHECK_LIBRARY targetname lname func)
+  if(NOT ${targetname}_LIBRARY)
+    check_library_exists(${lname} ${func} "" HAVE_${targetname}_${lname})
+    if(HAVE_${targetname}_${lname})
+      resolve_libraries(${targetname}_LIBRARY "-l${lname}")
+      set(${targetname}_LINKOPT "-l${lname}")
+    endif(HAVE_${targetname}_${lname})
+  endif(NOT ${targetname}_LIBRARY)
+endmacro(CONFIG_CHECK_LIBRARY lname func)
 
Index: src/other/incrTcl/itk/CMake/FindTIMEZONE.cmake
===================================================================
--- src/other/incrTcl/itk/CMake/FindTIMEZONE.cmake	(revision 54114)
+++ src/other/incrTcl/itk/CMake/FindTIMEZONE.cmake	(working copy)
@@ -5,16 +5,16 @@
 #
 #=============================================================================
 
-SET(TZ_SEARCH_PATHS
+set(TZ_SEARCH_PATHS
 	/usr/share/zoneinfo
 	/usr/share/lib/zoneinfo
 	/usr/lib/zoneinfo
 	)
-FIND_PATH(TIMEZONE_DATA_DIR UTC PATHS ${TZ_SEARCH_PATHS} NO_DEFAULT_PATH)
-MARK_AS_ADVANCED(TIMEZONE_DATA_DIR)
+find_path(TIMEZONE_DATA_DIR UTC PATHS ${TZ_SEARCH_PATHS} NO_DEFAULT_PATH)
+mark_as_advanced(TIMEZONE_DATA_DIR)
 
 # handle the QUIETLY and REQUIRED arguments and set REGEX_FOUND to TRUE if 
 # all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIMEZONE DEFAULT_MSG TIMEZONE_DATA_DIR)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(TIMEZONE DEFAULT_MSG TIMEZONE_DATA_DIR)
 
Index: src/other/incrTcl/itk/CMake/ac_std_funcs.cmake
===================================================================
--- src/other/incrTcl/itk/CMake/ac_std_funcs.cmake	(revision 54114)
+++ src/other/incrTcl/itk/CMake/ac_std_funcs.cmake	(working copy)
@@ -1,97 +1,97 @@
 # Standard tests and wrappers for CMake functions
 
-INCLUDE(CheckCCompilerFlag)
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckIncludeFileCXX)
-INCLUDE(CheckTypeSize)
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckStructHasMember)
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(ResolveCompilerPaths)
+include(CheckCCompilerFlag)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckTypeSize)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(ResolveCompilerPaths)
 
-SET(CMAKE_TEST_SRCS_DIR "NOTFOUND")
-FOREACH($candidate_dir ${CMAKE_MODULE_PATH})
-	IF(NOT CMAKE_TEST_SRCS_DIR)
-		IF(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
-			SET(CMAKE_TEST_SRCS_DIR ${candidate_dir}/test_sources)
-		ENDIF(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
-	ENDIF(NOT CMAKE_TEST_SRCS_DIR)
-ENDFOREACH($candidate_dir ${CMAKE_MODULE_PATH})
+set(CMAKE_TEST_SRCS_DIR "NOTFOUND")
+foreach($candidate_dir ${CMAKE_MODULE_PATH})
+	if(NOT CMAKE_TEST_SRCS_DIR)
+		if(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
+			set(CMAKE_TEST_SRCS_DIR ${candidate_dir}/test_sources)
+		endif(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
+	endif(NOT CMAKE_TEST_SRCS_DIR)
+endforeach($candidate_dir ${CMAKE_MODULE_PATH})
 
-INCLUDE(CheckPrototypeExists)
-INCLUDE(CheckCSourceRuns)
-INCLUDE(CheckCSourceRuns)
+include(CheckPrototypeExists)
+include(CheckCSourceRuns)
+include(CheckCSourceRuns)
 
-MACRO(CHECK_BASENAME_D)
-	SET(BASENAME_SRC "
+macro(CHECK_BASENAME_D)
+	set(BASENAME_SRC "
 	#include <libgen.h>
 	int main(int argc, char *argv[]) {
 	(void)basename(argv[0]);
 	return 0;
 	}")
-	CHECK_C_SOURCE_RUNS("${BASENAME_SRC}" HAVE_BASENAME)
-	IF(HAVE_BASENAME)
+	check_c_source_runs("${BASENAME_SRC}" HAVE_BASENAME)
+	if(HAVE_BASENAME)
 	  add_definitions(-DHAVE_BASENAME=1)
-	ENDIF(HAVE_BASENAME)
-ENDMACRO(CHECK_BASENAME_D)
+	endif(HAVE_BASENAME)
+endmacro(CHECK_BASENAME_D)
 
-MACRO(CHECK_DIRNAME_D)
-	SET(DIRNAME_SRC "
+macro(CHECK_DIRNAME_D)
+	set(DIRNAME_SRC "
 	#include <libgen.h>
 	int main(int argc, char *argv[]) {
 	(void)dirname(argv[0]);
 	return 0;
 	}")
-	CHECK_C_SOURCE_RUNS("${DIRNAME_SRC}" HAVE_DIRNAME)
-	IF(HAVE_DIRNAME)
+	check_c_source_runs("${DIRNAME_SRC}" HAVE_DIRNAME)
+	if(HAVE_DIRNAME)
 		add_definitions(-DHAVE_DIRNAME=1)
-	ENDIF(HAVE_DIRNAME)
-ENDMACRO(CHECK_DIRNAME_D)
+	endif(HAVE_DIRNAME)
+endmacro(CHECK_DIRNAME_D)
 
 # Based on AC_HEADER_STDC - using the source code for ctype
 # checking found in the generated configure file
-MACRO(CMAKE_HEADER_STDC_D)
-  CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-  IF(HAVE_STDLIB_H)
+macro(CMAKE_HEADER_STDC_D)
+  check_include_file(stdlib.h HAVE_STDLIB_H)
+  if(HAVE_STDLIB_H)
   add_definitions(-DHAVE_STDLIB_H=1)
-  ENDIF(HAVE_STDLIB_H)
-  CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
-  CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-  IF(HAVE_STRING_H)
+  endif(HAVE_STDLIB_H)
+  check_include_file(stdarg.h HAVE_STDARG_H)
+  check_include_file(string.h HAVE_STRING_H)
+  if(HAVE_STRING_H)
   add_definitions(-DHAVE_STRING_H=1)
-  ENDIF(HAVE_STRING_H)
-  CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-  IF(HAVE_STRINGS_H)
+  endif(HAVE_STRING_H)
+  check_include_file(strings.h HAVE_STRINGS_H)
+  if(HAVE_STRINGS_H)
   add_definitions(-DHAVE_STRINGS_H=1)
-  ENDIF(HAVE_STRINGS_H)
-  CHECK_INCLUDE_FILE(float.h HAVE_FLOAT_H)
-  CHECK_PROTOTYPE_EXISTS(memchr string.h HAVE_STRING_H_MEMCHR)
-  CHECK_PROTOTYPE_EXISTS(free stdlib.h HAVE_STDLIB_H_FREE)
-  CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/ctypes_test.c WORKING_CTYPE_MACROS)
-  IF(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
+  endif(HAVE_STRINGS_H)
+  check_include_file(float.h HAVE_FLOAT_H)
+  check_prototype_exists(memchr string.h HAVE_STRING_H_MEMCHR)
+  check_prototype_exists(free stdlib.h HAVE_STDLIB_H_FREE)
+  check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/ctypes_test.c WORKING_CTYPE_MACROS)
+  if(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
 	 add_definitions(-DSTDC_HEADERS=1)
-  ENDIF(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
-ENDMACRO(CMAKE_HEADER_STDC_D)
+  endif(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
+endmacro(CMAKE_HEADER_STDC_D)
 
 # Based on AC_HEADER_SYS_WAIT
-MACRO(CMAKE_HEADER_SYS_WAIT_D)
-  CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/sys_wait_test.c WORKING_SYS_WAIT)
-  IF(WORKING_SYS_WAIT)
+macro(CMAKE_HEADER_SYS_WAIT_D)
+  check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/sys_wait_test.c WORKING_SYS_WAIT)
+  if(WORKING_SYS_WAIT)
 	 add_definitions(-DHAVE_SYS_WAIT_H=1)
-  ENDIF(WORKING_SYS_WAIT)
-ENDMACRO(CMAKE_HEADER_SYS_WAIT_D)
+  endif(WORKING_SYS_WAIT)
+endmacro(CMAKE_HEADER_SYS_WAIT_D)
 
 # Based on AC_FUNC_ALLOCA
-MACRO(CMAKE_ALLOCA_D)
-	CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/alloca_header_test.c WORKING_ALLOCA_H)
-	IF(WORKING_ALLOCA_H)
+macro(CMAKE_ALLOCA_D)
+	check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/alloca_header_test.c WORKING_ALLOCA_H)
+	if(WORKING_ALLOCA_H)
 		add_definitions(-DHAVE_ALLOCA_H=1)
-	ENDIF(WORKING_ALLOCA_H)
-	CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/alloca_test.c WORKING_ALLOCA)
-	IF(WORKING_ALLOCA)
+	endif(WORKING_ALLOCA_H)
+	check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/alloca_test.c WORKING_ALLOCA)
+	if(WORKING_ALLOCA)
 		add_definitions(-DHAVE_ALLOCA=1)
-	ENDIF(WORKING_ALLOCA)
-ENDMACRO(CMAKE_ALLOCA_D)
+	endif(WORKING_ALLOCA)
+endmacro(CMAKE_ALLOCA_D)
 
Index: src/other/libregex/CMakeLists.txt
===================================================================
--- src/other/libregex/CMakeLists.txt	(revision 54114)
+++ src/other/libregex/CMakeLists.txt	(working copy)
@@ -29,9 +29,9 @@
 	LIBRARY DESTINATION ${LIB_DIR}
 	ARCHIVE DESTINATION ${LIB_DIR})
 
-IF(NOT WIN32)
-  SET_TARGET_PROPERTIES(regex-static PROPERTIES OUTPUT_NAME "regex")
-ENDIF(NOT WIN32)
+if(NOT WIN32)
+  set_target_properties(regex-static PROPERTIES OUTPUT_NAME "regex")
+endif(NOT WIN32)
 if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
   install(FILES ${LIBREGEX_PUBLIC_HDRS} DESTINATION include)
 endif()
Index: src/other/togl/CMake/CheckPrototypeExists.cmake
===================================================================
--- src/other/togl/CMake/CheckPrototypeExists.cmake	(revision 54114)
+++ src/other/togl/CMake/CheckPrototypeExists.cmake	(working copy)
@@ -57,6 +57,6 @@
   return 0;
 }
 ")
-  CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
+  check_cxx_source_compiles("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
 endmacro(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
 
Index: src/other/togl/CMake/FindGL.cmake
===================================================================
--- src/other/togl/CMake/FindGL.cmake	(revision 54114)
+++ src/other/togl/CMake/FindGL.cmake	(working copy)
@@ -187,7 +187,7 @@
     )
 
   if(APPLE)
-    OPTION(OPENGL_USE_AQUA "Require native OSX Framework version of OpenGL." ON)
+    option(OPENGL_USE_AQUA "Require native OSX Framework version of OpenGL." ON)
   endif(APPLE)
 
   if(OPENGL_USE_AQUA)
Index: src/other/togl/CMake/FindTCL.cmake
===================================================================
--- src/other/togl/CMake/FindTCL.cmake	(revision 54114)
+++ src/other/togl/CMake/FindTCL.cmake	(working copy)
@@ -240,13 +240,13 @@
 set(TCL_POSSIBLE_MINOR_VERSIONS 6 5 4 3 2 1 0)
 
 # Create the Tcl/Tk options if not already present
-OPTION(TK_NATIVE_GRAPHICS "Require native Tk graphics." OFF)
-OPTION(TK_X11_GRAPHICS "Require X11 Tk graphics." OFF)
-OPTION(TCL_USE_FRAMEWORK_ONLY "Don't use any Tcl/Tk installation that isn't a Framework." OFF)
-OPTION(TCL_REQUIRE_TK "Look for Tk installation, not just Tcl." ON)
-OPTION(TCL_REQUIRE_THREADS "Reject a Tcl/Tk installation unless threads are enabled." OFF)
-OPTION(TCL_NEED_HEADERS "Don't report a found Tcl/Tk unless headers are present." ON)
-OPTION(TCL_NEED_STUB_LIBS "Don't report a found Tcl/Tk unless the stub libraries are present." ON)
+option(TK_NATIVE_GRAPHICS "Require native Tk graphics." OFF)
+option(TK_X11_GRAPHICS "Require X11 Tk graphics." OFF)
+option(TCL_USE_FRAMEWORK_ONLY "Don't use any Tcl/Tk installation that isn't a Framework." OFF)
+option(TCL_REQUIRE_TK "Look for Tk installation, not just Tcl." ON)
+option(TCL_REQUIRE_THREADS "Reject a Tcl/Tk installation unless threads are enabled." OFF)
+option(TCL_NEED_HEADERS "Don't report a found Tcl/Tk unless headers are present." ON)
+option(TCL_NEED_STUB_LIBS "Don't report a found Tcl/Tk unless the stub libraries are present." ON)
 
 # Sanity check the settings - can't require both Native and X11 if X11 isn't
 # the native windowing system on the platform
@@ -282,7 +282,7 @@
 macro(TK_GRAPHICS_SYSTEM wishcmd resultvar)
   set(${resultvar} "wm-NOTFOUND")
   file(WRITE ${tkwin_scriptfile} ${tkwin_script})
-  EXEC_PROGRAM(${wishcmd} ARGS ${tkwin_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+  exec_program(${wishcmd} ARGS ${tkwin_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
   file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM readresultvar)
   string(REGEX REPLACE "\n" "" "${resultvar}" "${readresultvar}")
 endmacro()
@@ -300,7 +300,7 @@
 macro(TCL_GET_VERSION tclshcmd resultvar)
   set(${resultvar} "NOTFOUND")
   file(WRITE ${tclversion_scriptfile} ${tclversion_script})
-  EXEC_PROGRAM(${tclshcmd} ARGS ${tclversion_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+  exec_program(${tclshcmd} ARGS ${tclversion_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
   file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/TCL_VERSION readresultvar)
   string(REGEX REPLACE "\n" "" "${resultvar}" "${readresultvar}")
 endmacro()
@@ -318,7 +318,7 @@
 	macro(TCL_ISTHREADED tclshcmd resultvar)
 	  set(${resultvar} "NOTFOUND")
 	  file(WRITE ${tclthreaded_scriptfile} ${tclthreaded_script})
-	  EXEC_PROGRAM(${tclshcmd} ARGS ${tclthreaded_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+	  exec_program(${tclshcmd} ARGS ${tclthreaded_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
 	  file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/TCL_THREADED readresultvar)
 	  string(REGEX REPLACE "\n" "" "${resultvar}" "${readresultvar}")
 	endmacro()
@@ -488,10 +488,10 @@
 	      foreach(SPATH ${${pathnames}})
 		set(TCL_CURRENTPATH TCL-NOTFOUND)
 		set(CURRENT_SEARCH_VERSION "${MAJORNUM}.${MINORNUM}")
-		VALIDATE_VERSION(dosearch ${CURRENT_SEARCH_VERSION})
+		validate_version(dosearch ${CURRENT_SEARCH_VERSION})
 		if(dosearch)
-		  FIND_PROGRAM_PATHS(BIN_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
-		  FIND_LIBRARY_PATHS(LIB_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		  find_program_paths(BIN_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		  find_library_paths(LIB_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
 		  foreach(targetbin ${targetbinnames})
 		    if(TCL_CURRENTPATH MATCHES "NOTFOUND$")
 		      find_program(TCL_CURRENTPATH NAMES ${targetbin}${MAJORNUM}.${MINORNUM} ${targetbin}${MAJORNUM}${MINORNUM} PATHS ${BIN_POSSIBLE_PATHS} ${options})
@@ -529,7 +529,7 @@
 	    foreach(MAJORNUM ${TCL_POSSIBLE_MAJOR_VERSIONS})
 	      foreach(MINORNUM ${TCL_POSSIBLE_MINOR_VERSIONS})
 		set(CURRENT_SEARCH_VERSION "${MAJORNUM}.${MINORNUM}")
-		VALIDATE_VERSION(isvalid ${CURRENT_SEARCH_VERSION})
+		validate_version(isvalid ${CURRENT_SEARCH_VERSION})
 		if(isvalid)
 		  foreach(genpath ${CONFIG_SEARCH_PATHS})
 		    set(CONFGENPATHS "${CONFGENPATHS};${genpath}${MAJORNUM}${MINORNUM};${genpath}${MAJORNUM}.${MINORNUM}")
@@ -619,7 +619,7 @@
 	#-----------------------------------------------------------------------------
 
 	macro(READ_TCLCONFIG_FILE tclconffile)
-	  RESET_TCL_VARS()
+	  reset_tcl_vars()
 	  set(TCL_CONF_FILE "")
 	  file(READ ${tclconffile} TCL_CONF_FILE)
 	  string(REGEX REPLACE "\r?\n" ";" ENT "${TCL_CONF_FILE}")
@@ -646,15 +646,15 @@
 		set(TCL_EXE_SUFFIX "")
 	      endif(MSVC)
 	      string(REGEX REPLACE ".*TCL_EXEC_PREFIX='(.+)'.*" "\\1" TCL_TCLSH_EXECUTABLE ${line})
-	      IF (EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      if (EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh")
 	      endif()
 	    endif()
@@ -669,7 +669,7 @@
 
 
 	macro(READ_TKCONFIG_FILE tkconffile)
-	  RESET_TK_VARS()
+	  reset_tk_vars()
 	  set(TK_CONF_FILE "")
 	  file(READ ${tkconffile} TK_CONF_FILE)
 	  string(REGEX REPLACE "\r?\n" ";" ENT "${TK_CONF_FILE}")
@@ -696,15 +696,15 @@
 		set(TK_EXE_SUFFIX "")
 	      endif(MSVC)
 	      string(REGEX REPLACE ".*TK_EXEC_PREFIX='(.+)'.*" "\\1" TCL_WISH_EXECUTABLE ${line})
-	      IF (EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      if (EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish")
 	      endif()
 	    endif()
@@ -723,16 +723,16 @@
 
 	macro(VALIDATE_TCL validvar)
 	  set(${validvar} 1)
-	  VALIDATE_TCL_VARIABLES(${validvar})
+	  validate_tcl_variables(${validvar})
 	  if(TCL_TCLSH_EXECUTABLE)
-	    TCL_GET_VERSION(${TCL_TCLSH_EXECUTABLE} CURRENT_SEARCH_VERSION)
-	    VALIDATE_VERSION(dosearch ${CURRENT_SEARCH_VERSION})
+	    tcl_get_version(${TCL_TCLSH_EXECUTABLE} CURRENT_SEARCH_VERSION)
+	    validate_version(dosearch ${CURRENT_SEARCH_VERSION})
 	    if(NOT dosearch)
 	      set(${validvar} 0)
 	    endif(NOT dosearch)
 	  endif(TCL_TCLSH_EXECUTABLE)
 	  if(TCL_REQUIRE_THREADS AND TCL_TCLSH_EXECUTABLE)
-	    TCL_ISTHREADED(${TCL_TCLSH_EXECUTABLE} TCL_THREADS)
+	    tcl_isthreaded(${TCL_TCLSH_EXECUTABLE} TCL_THREADS)
 	    if(NOT TCL_THREADS)
 	      set(${validvar} 0)
 	    endif(NOT TCL_THREADS)
@@ -741,9 +741,9 @@
 
 	macro(VALIDATE_TK validvar)
 	  set(${validvar} 1)
-	  VALIDATE_TK_VARIABLES(${validvar})
+	  validate_tk_variables(${validvar})
 	  if(TK_NATIVE_GRAPHICS OR TK_X11_GRAPHICS)
-	    TK_GRAPHICS_SYSTEM(${TCL_WISH_EXECUTABLE} TK_SYSTEM_GRAPHICS)
+	    tk_graphics_system(${TCL_WISH_EXECUTABLE} TK_SYSTEM_GRAPHICS)
 	    if(APPLE AND TK_NATIVE_GRAPHICS)
 	      if(NOT ${TK_SYSTEM_GRAPHICS} MATCHES "aqua")
 		set(${validvar} 0)
@@ -852,19 +852,19 @@
 	    set(TCL_PREFIX_LIBDIRS ${TCL_PREFIX_LIBDIRS} ${TCL_LIB_PATH_PARENT}/lib)
 	    set(TCL_PREFIX_LIBDIRS ${TCL_PREFIX_LIBDIRS} ${TCL_LIB_PATH_PARENT})
 	    list(REMOVE_DUPLICATES TCL_PREFIX_LIBDIRS)
-	    FIND_LIBRARY_VERSIONS(tcl TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
+	    find_library_versions(tcl TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
 	    set(FOUND_FILES "${TCL_tcl_LIST}")
-	    FIND_CONFIG_FILES(FOUND_FILES TCLCONFIG_LIST tclConfig.sh)
+	    find_config_files(FOUND_FILES TCLCONFIG_LIST tclConfig.sh)
 	    if(TCL_REQUIRE_TK)
-	      FIND_LIBRARY_VERSIONS(tk TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
+	      find_library_versions(tk TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
 	      set(FOUND_FILES "${TCL_tk_LIST}")
-	      FIND_CONFIG_FILES(FOUND_FILES TKCONFIG_LIST tkConfig.sh)
+	      find_config_files(FOUND_FILES TKCONFIG_LIST tkConfig.sh)
 	    endif(TCL_REQUIRE_TK)
 	  else(TCL_PREFIX)
 	    set(TCLCONFIG_LIST "")
 	    if(APPLE)
 	      include(CMakeFindFrameworks)
-	      CMAKE_FIND_FRAMEWORKS(Tcl)
+	      cmake_find_frameworks(Tcl)
 	      foreach(dir ${Tcl_FRAMEWORKS})
 		set(tclconf "tclConfig.sh-NOTFOUND") 
 		find_file(tclconf tclConfig.sh PATHS ${dir})
@@ -874,7 +874,7 @@
 		endif(NOT tclconf MATCHES "NOTFOUND$")
 	      endforeach(dir ${Tcl_FRAMEWORKS})
 	      if(TCL_REQUIRE_TK)
-		CMAKE_FIND_FRAMEWORKS(Tk)
+		cmake_find_frameworks(Tk)
 		foreach(dir ${Tk_FRAMEWORKS})
 		  set(tkconf "tkConfig.sh-NOTFOUND") 
 		  find_file(tkconf tkConfig.sh PATHS ${dir})
@@ -889,7 +889,7 @@
 	      set(PATHLIST "$ENV{LD_LIBRARY_PATH}:$ENV{DYLD_LIBRARY_PATH}:$ENV{DYLD_FALLBACK_LIBRARY_PATH}:$ENV{PATH}")
 	      set(PATHLIST "${TCL_ADDITIONAL_SEARCH_PATHS}:${PATHLIST}")
 	      if(WIN32)
-		WIN32TCLPATHS(PATHLIST "")
+		win32tclpaths(PATHLIST "")
 	      endif(WIN32)
 	      string(REGEX REPLACE "/s?bin:" ":" PATHLIST "${PATHLIST}")
 	      string(REGEX REPLACE "/s?bin;" ":" PATHLIST "${PATHLIST}")
@@ -906,41 +906,41 @@
 	      endforeach()
 	      set(TCLPATHLIST "${PATHLIST}")
 	      set(TKPATHLIST "${PATHLIST}")
-	      FIND_POSSIBLE_PATHS("tclsh" "tcl" TCLPATHLIST NO_SYSTEM_PATH)
+	      find_possible_paths("tclsh" "tcl" TCLPATHLIST NO_SYSTEM_PATH)
 	      if(TCL_REQUIRE_TK)
-		FIND_POSSIBLE_PATHS("wish" "tk" TKPATHLIST NO_SYSTEM_PATH)
+		find_possible_paths("wish" "tk" TKPATHLIST NO_SYSTEM_PATH)
 	      endif(TCL_REQUIRE_TK)
 	      # Hunt up tclConfig.sh files
-	      FIND_CONFIG_FILES(TCLPATHLIST TCLCONFIG_LIST tclConfig.sh)
+	      find_config_files(TCLPATHLIST TCLCONFIG_LIST tclConfig.sh)
 	      # Hunt up tkConfig.sh files 
-	      FIND_CONFIG_FILES(TKPATHLIST TKCONFIG_LIST tkConfig.sh)
+	      find_config_files(TKPATHLIST TKCONFIG_LIST tkConfig.sh)
 	    endif(NOT APPLE OR NOT TCL_USE_FRAMEWORK_ONLY)
 	  endif(TCL_PREFIX)
 	  set(TCLVALID 0)
-	  RESET_TCL_VARS()
+	  reset_tcl_vars()
 	  foreach(tcl_config_file ${TCLCONFIG_LIST}) 
 	    if(NOT TCLVALID)
-	      RESET_TCL_VARS()
-	      READ_TCLCONFIG_file(${tcl_config_file})
+	      reset_tcl_vars()
+	      read_tclconfig_file(${tcl_config_file})
 	      set(TCLVALID 1)
 	      set(CURRENTTCLVERSION "${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}.${TCL_VERSION_PATCH}")
-	      VALIDATE_VERSION(TCLVALID ${CURRENTTCLVERSION})
+	      validate_version(TCLVALID ${CURRENTTCLVERSION})
 	      if(TCLVALID)
 		get_filename_component(TCL_CONF_PREFIX "${tcl_config_file}" PATH)
 		get_filename_component(TCL_LIBRARY_DIR2 "${TCL_CONF_PREFIX}" PATH)
-		FIND_LIBRARY_PATHS(TCL_LIBRARY_SEARCH_PATHS TCL_PREFIX ${TCL_VERSION_MAJOR} ${TCL_VERSION_MINOR})
+		find_library_paths(TCL_LIBRARY_SEARCH_PATHS TCL_PREFIX ${TCL_VERSION_MAJOR} ${TCL_VERSION_MINOR})
 		set(TCL_LIBRARY_SEARCH_PATHS "${TCL_CONF_PREFIX};${TCL_LIBRARY_DIR2};${TCL_LIBRARY_SEARCH_PATHS}")
 		find_library(TCL_LIBRARY tcl Tcl tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR} tcl${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR} PATHS ${TCL_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
 		find_library(TCL_STUB_LIBRARY tclstub${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR} tclstub${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR} PATHS ${TCL_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
 	      endif(TCLVALID)
-	      VALIDATE_TCL(TCLVALID)
+	      validate_tcl(TCLVALID)
 	      if(TCLVALID)
 		if(TCL_REQUIRE_TK)
 		  set(TKVALID 0)
 		  foreach(tk_config_file ${TKCONFIG_LIST})
 		    if(NOT TKVALID)
-		      RESET_TK_VARS()
-		      READ_TKCONFIG_file(${tk_config_file})
+		      reset_tk_vars()
+		      read_tkconfig_file(${tk_config_file})
 		      set(TKVALID 0)
 		      set(CURRENTTKVERSION "${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}.${TK_VERSION_PATCH}")
 		      set(vtcltkcompare 0)
@@ -952,18 +952,18 @@
 		      if(TKVALID)
 			get_filename_component(TCL_TK_CONF_PREFIX "${tk_config_file}" PATH)
 			get_filename_component(TCL_TK_LIBRARY_DIR2 "${TCL_TK_CONF_PREFIX}" PATH)
-			FIND_LIBRARY_PATHS(TCL_TK_LIBRARY_SEARCH_PATHS TK_PREFIX ${TK_VERSION_MAJOR} ${TK_VERSION_MINOR})
+			find_library_paths(TCL_TK_LIBRARY_SEARCH_PATHS TK_PREFIX ${TK_VERSION_MAJOR} ${TK_VERSION_MINOR})
 			set(TCL_TK_LIBRARY_SEARCH_PATHS "${TCL_TK_CONF_PREFIX};${TCL_TK_LIBRARY_DIR2};${TCL_TK_LIBRARY_SEARCH_PATHS}")
 			find_library(TCL_TK_LIBRARY tk Tk tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR} tk${TK_VERSION_MAJOR}${TK_VERSION_MINOR} PATHS ${TCL_TK_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
 			find_library(TCL_TK_STUB_LIBRARY tkstub tkstub${TK_VERSION_MAJOR}.${TK_VERSION_MINOR} tkstub${TK_VERSION_MAJOR}${TK_VERSION_MINOR} PATHS ${TCL_TK_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
-			VALIDATE_TK(TKVALID)
+			validate_tk(TKVALID)
 		      endif(TKVALID)
 		    endif(NOT TKVALID)
 		  endforeach(tk_config_file ${TKCONFIG_LIST})
 		  if(NOT TKVALID)
 		    set(TCLVALID 0)
-		    RESET_TCL_VARS()
-		    RESET_TK_VARS()
+		    reset_tcl_vars()
+		    reset_tk_vars()
 		  endif(NOT TKVALID)
 		endif(TCL_REQUIRE_TK)
 	      endif(TCLVALID)
@@ -983,29 +983,29 @@
 	      foreach(MINORNUM ${TCL_POSSIBLE_MINOR_VERSIONS})
 		foreach(SPATH ${PATHLIST})
 		  if(NOT TCLVALID)
-		    RESET_TCL_VARS()
+		    reset_tcl_vars()
 		    set(CURRENT_SEARCH_VERSION "${MAJORNUM}.${MINORNUM}")
-		    VALIDATE_VERSION(dosearch ${CURRENT_SEARCH_VERSION})
+		    validate_version(dosearch ${CURRENT_SEARCH_VERSION})
 		    if(dosearch)
-		      FIND_LIBRARY_PATHS(TCL_LIBRARY_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
-		      FIND_PROGRAM_PATHS(TCL_PROGRAM_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		      find_library_paths(TCL_LIBRARY_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		      find_program_paths(TCL_PROGRAM_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
 		      find_program(TCL_TCLSH_EXECUTABLE NAMES tclsh${MAJORNUM}.${MINORNUM} tclsh${MAJORNUM}${MINORNUM} PATHS ${TCL_PROGRAM_SEARCH_PATHS} NO_SYSTEM_PATH)
 		    endif(dosearch)
-		    VALIDATE_TCL(TCLVALID)
+		    validate_tcl(TCLVALID)
 		    if(TCLVALID)
 		      if(TCL_REQUIRE_TK)
 			set(TKVALID 0)
-			RESET_TK_VARS()
+			reset_tk_vars()
 			find_program(TCL_WISH_EXECUTABLE NAMES wish${MAJORNUM}.${MINORNUM} wish${MAJORNUM}${MINORNUM} PATHS ${TCL_PROGRAM_SEARCH_PATHS} NO_SYSTEM_PATH)
-			VALIDATE_TK(TKVALID)
+			validate_tk(TKVALID)
 			if(NOT TKVALID)
 			  set(TCLVALID 0)
-			  RESET_TCL_VARS()
-			  RESET_TK_VARS()
+			  reset_tcl_vars()
+			  reset_tk_vars()
 			endif(NOT TKVALID)	
 		      endif(TCL_REQUIRE_TK)
 		    else(TCLVALID)
-		      RESET_TCL_VARS()
+		      reset_tcl_vars()
 		    endif(TCLVALID)
 		  endif(NOT TCLVALID)
 		endforeach(SPATH ${PATHLIST})
@@ -1023,11 +1023,11 @@
 	  set(TCL_STUB_LIBRARIES ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY})
 	  set(TCL_ROOT_PATH ${TCL_CONF_PREFIX})
 	  set(TCL_VERSION_STRING "${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}.${TCL_VERSION_PATCH}")
-	  FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCL DEFAULT_MSG TCL_LIBRARY ${PACKAGE_HANDLE_VARS})
+	  find_package_handle_standard_args(TCL DEFAULT_MSG TCL_LIBRARY ${PACKAGE_HANDLE_VARS})
 	  if(TCL_REQUIRE_TK)
 	    set(TK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
 	    set(PACKAGE_HANDLE_VARS "${PACKAGE_HANDLE_VARS};TCL_LIBRARY")
-	    FIND_PACKAGE_HANDLE_STANDARD_ARGS(TK DEFAULT_MSG TCL_TK_LIBRARY ${PACKAGE_HANDLE_VARS})
+	    find_package_handle_standard_args(TK DEFAULT_MSG TCL_TK_LIBRARY ${PACKAGE_HANDLE_VARS})
 	  endif(TCL_REQUIRE_TK)
 
 	  foreach(pkgvar ${PACKAGE_HANDLE_VARS})
Index: src/other/togl/CMake/CheckFunctions.cmake
===================================================================
--- src/other/togl/CMake/CheckFunctions.cmake	(revision 54114)
+++ src/other/togl/CMake/CheckFunctions.cmake	(working copy)
@@ -1,22 +1,22 @@
 # Automate putting variables from tests into a config.h.in file,
 # and otherwise wrap check macros in extra logic as needed
 
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckPrototypeExists)
-INCLUDE(CheckCSourceRuns)
+include(CheckIncludeFile)
+include(CheckPrototypeExists)
+include(CheckCSourceRuns)
 # Based on AC_HEADER_STDC - using the source code for ctype
 # checking found in the generated configure file
-MACRO(CMAKE_HEADER_STDC)
-  CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-  CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
-  CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-  CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-  CHECK_INCLUDE_FILE(float.h HAVE_FLOAT_H)
-  CHECK_PROTOTYPE_EXISTS(memchr string.h HAVE_STRING_H_MEMCHR)
-  CHECK_PROTOTYPE_EXISTS(free stdlib.h HAVE_STDLIB_H_FREE)
-  CHECK_C_SOURCE_RUNS(${CMAKE_CURRENT_SOURCE_DIR}/CMake/test_srcs/ctypes_test.c WORKING_CTYPE_MACROS)
-  IF(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
-	  SET(STDC_HEADERS 1)
-  ENDIF(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
-ENDMACRO(CMAKE_HEADER_STDC)
+macro(CMAKE_HEADER_STDC)
+  check_include_file(stdlib.h HAVE_STDLIB_H)
+  check_include_file(stdarg.h HAVE_STDARG_H)
+  check_include_file(string.h HAVE_STRING_H)
+  check_include_file(strings.h HAVE_STRINGS_H)
+  check_include_file(float.h HAVE_FLOAT_H)
+  check_prototype_exists(memchr string.h HAVE_STRING_H_MEMCHR)
+  check_prototype_exists(free stdlib.h HAVE_STDLIB_H_FREE)
+  check_c_source_runs(${CMAKE_CURRENT_SOURCE_DIR}/CMake/test_srcs/ctypes_test.c WORKING_CTYPE_MACROS)
+  if(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
+	  set(STDC_HEADERS 1)
+  endif(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
+endmacro(CMAKE_HEADER_STDC)
 
Index: src/other/togl/CMake/CheckCSourceRuns.cmake
===================================================================
--- src/other/togl/CMake/CheckCSourceRuns.cmake	(revision 54114)
+++ src/other/togl/CMake/CheckCSourceRuns.cmake	(working copy)
@@ -70,32 +70,32 @@
 # 
 #=============================================================================
 
-MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
-  IF("${VAR}" MATCHES "^${VAR}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS 
+macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
+  if("${VAR}" MATCHES "^${VAR}$")
+    set(MACRO_CHECK_FUNCTION_DEFINITIONS 
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    IF(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
+    if(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
+    else(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    IF(EXISTS "${SOURCE}")
-      SET(CHECK_SRC "${SOURCE}")
-    ELSE(EXISTS "${SOURCE}")
-      FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    if(EXISTS "${SOURCE}")
+      set(CHECK_SRC "${SOURCE}")
+    else(EXISTS "${SOURCE}")
+      file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
         "${SOURCE}\n")
-      SET(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
-    ENDIF(EXISTS "${SOURCE}")
+      set(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
+    endif(EXISTS "${SOURCE}")
     
-    MESSAGE(STATUS "Performing Test ${VAR}")
-    TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
+    message(STATUS "Performing Test ${VAR}")
+    try_run(${VAR}_EXITCODE ${VAR}_COMPILED
       ${CMAKE_BINARY_DIR}
       ${CHECK_SRC}
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -105,33 +105,33 @@
       "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
       COMPILE_OUTPUT_VARIABLE OUTPUT)
     # if it did not compile make the return value fail code of 1
-    IF(NOT ${VAR}_COMPILED)
-      SET(${VAR}_EXITCODE 1)
-    ENDIF(NOT ${VAR}_COMPILED)
+    if(NOT ${VAR}_COMPILED)
+      set(${VAR}_EXITCODE 1)
+    endif(NOT ${VAR}_COMPILED)
     # if the return value was 0 then it worked
-    IF("${${VAR}_EXITCODE}" EQUAL 0)
-      SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
-      MESSAGE(STATUS "Performing Test ${VAR} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+    if("${${VAR}_EXITCODE}" EQUAL 0)
+      set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+      message(STATUS "Performing Test ${VAR} - Success")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
         "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}}\n"
         "Source file was:\n${SOURCE}\n")
-    ELSE("${${VAR}_EXITCODE}" EQUAL 0)
-      IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "${${VAR}_EXITCODE}")
-      ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+    else("${${VAR}_EXITCODE}" EQUAL 0)
+      if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "${${VAR}_EXITCODE}")
+      else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+      endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
 
-      MESSAGE(STATUS "Performing Test ${VAR} - Failed")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      message(STATUS "Performing Test ${VAR} - Failed")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
         "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}_EXITCODE}\n"
         "Source file was:\n${SOURCE}\n")
 
-    ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
-  ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_C_SOURCE_RUNS)
+    endif("${${VAR}_EXITCODE}" EQUAL 0)
+  endif("${VAR}" MATCHES "^${VAR}$")
+endmacro(CHECK_C_SOURCE_RUNS)
 
Index: src/other/togl/include/CMakeLists.txt
===================================================================
--- src/other/togl/include/CMakeLists.txt	(revision 54114)
+++ src/other/togl/include/CMakeLists.txt	(working copy)
@@ -1,4 +1,4 @@
-SET(TOGL_HDRS
+set(TOGL_HDRS
 	togl.h
 	${CMAKE_CURRENT_BINARY_DIR}/togl_config.h
 	${CMAKE_CURRENT_BINARY_DIR}/../src/toglDecls.h
Index: src/other/togl/demo/CMakeLists.txt
===================================================================
--- src/other/togl/demo/CMakeLists.txt	(revision 54114)
+++ src/other/togl/demo/CMakeLists.txt	(working copy)
@@ -8,12 +8,12 @@
 	${CMAKE_CURRENT_BINARY_DIR}/../include
 	)
 
-SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-IF(NOT WIN32)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+if(NOT WIN32)
 	add_library(gears SHARED gears.c)
 	target_link_libraries(gears togl)
 	set_target_properties(gears PROPERTIES PREFIX "")
 	if(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
 	  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/gears.tcl ${CMAKE_CURRENT_BINARY_DIR}/gears.tcl COPYONLY)
 	endif(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-ENDIF(NOT WIN32)
+endif(NOT WIN32)
Index: src/other/togl/src/CMakeLists.txt
===================================================================
--- src/other/togl/src/CMakeLists.txt	(revision 54114)
+++ src/other/togl/src/CMakeLists.txt	(working copy)
@@ -17,7 +17,7 @@
 	${CMAKE_CURRENT_SOURCE_DIR}/../include/tcltk/tk${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}
 	)
 
-SET(TOGL_STUB_INIT_TXT "
+set(TOGL_STUB_INIT_TXT "
 /*
  * Togl - a Tk OpenGL widget
  *
@@ -37,7 +37,7 @@
 
 ")
 
-SET(TOGL_DECLS_H_TXT "
+set(TOGL_DECLS_H_TXT "
 #ifndef ToglDecls_H
 #  define ToglDecls_H
 
@@ -57,11 +57,11 @@
 
 ")
 
-FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeTmp/toglstubs)
-FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/toglstubs/toglStubInit.c "${TOGL_STUB_INIT_TXT}")
-FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/toglstubs/toglDecls.h "${TOGL_DECLS_H_TXT}")
+file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeTmp/toglstubs)
+file(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/toglstubs/toglStubInit.c "${TOGL_STUB_INIT_TXT}")
+file(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/toglstubs/toglDecls.h "${TOGL_DECLS_H_TXT}")
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
 	OUTPUT ${CMAKE_BINARY_DIR}/CMakeTmp/toglstubs/STUBSDONE ${CMAKE_CURRENT_BINARY_DIR}/STUBSSYNCED ${CMAKE_CURRENT_BINARY_DIR}/toglStubInit.c ${CMAKE_CURRENT_BINARY_DIR}/toglDecls.h
 	COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_SOURCE_DIR}/../tools/genStubs.tcl ${CMAKE_BINARY_DIR}/CMakeTmp/toglstubs ${CMAKE_CURRENT_SOURCE_DIR}/togl.decls
 	COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/CMakeTmp/toglstubs/toglStubInit.c ${CMAKE_CURRENT_BINARY_DIR}/toglStubInit.c
@@ -71,24 +71,24 @@
 	COMMENT "Generating toglStubInit.c and toglDecls.h"
 )
 
-ADD_CUSTOM_TARGET(togl_stubs_gen ALL
+add_custom_target(togl_stubs_gen ALL
 	DEPENDS ${CMAKE_BINARY_DIR}/CMakeTmp/toglstubs/STUBSDONE
 	DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/STUBSSYNCED
 )
 
 # If we re-run cmake, need to ensure we re-run togl_stubs_gen too
-FILE(REMOVE ${CMAKE_BINARY_DIR}/CMakeTmp/toglstubs/STUBSDONE)
-FILE(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/STUBSSYNCED)
+file(REMOVE ${CMAKE_BINARY_DIR}/CMakeTmp/toglstubs/STUBSDONE)
+file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/STUBSSYNCED)
 
-IF(TOGL_WINDOWINGSYSTEM MATCHES "TOGL_X11")
-	SET(TOGL_XMU_SRCS
+if(TOGL_WINDOWINGSYSTEM MATCHES "TOGL_X11")
+	set(TOGL_XMU_SRCS
 		Xmu/CmapAlloc.c
 		Xmu/CrCmap.c
 		Xmu/DelCmap.c
 		Xmu/LookupCmap.c
 		Xmu/StdCmap.c
 		)
-    SET(TOGL_SRCS
+    set(TOGL_SRCS
         glew/glew.c
         ${TOGL_XMU_SRCS}
         togl.c
@@ -96,35 +96,35 @@
         toglStubLib.c
         ${CMAKE_CURRENT_BINARY_DIR}/toglStubInit.c
         )
-ELSE(TOGL_WINDOWINGSYSTEM MATCHES "TOGL_X11")
-    SET(TOGL_SRCS
+else(TOGL_WINDOWINGSYSTEM MATCHES "TOGL_X11")
+    set(TOGL_SRCS
         ${TOGL_XMU_SRCS}
         togl.c
         toglProcAddr.c
         toglStubLib.c
         ${CMAKE_CURRENT_BINARY_DIR}/toglStubInit.c
         )
-ENDIF(TOGL_WINDOWINGSYSTEM MATCHES "TOGL_X11")
+endif(TOGL_WINDOWINGSYSTEM MATCHES "TOGL_X11")
 
 add_library(togl SHARED ${TOGL_SRCS})
-ADD_DEPENDENCIES(togl togl_stubs_gen)
-IF(WIN32)
+add_dependencies(togl togl_stubs_gen)
+if(WIN32)
 	target_link_libraries(togl ${TCL_STUB_LIBRARIES} ${X11_LIBRARIES} ${OPENGL_LIBRARIES})
-ELSE(WIN32)
+else(WIN32)
 	target_link_libraries(togl ${TCL_LIBRARIES} ${X11_LIBRARIES} ${OPENGL_LIBRARIES})
-ENDIF(WIN32)
+endif(WIN32)
 install(TARGETS togl 
 	RUNTIME DESTINATION ${BIN_DIR}
 	LIBRARY DESTINATION ${LIB_DIR}
 	ARCHIVE DESTINATION ${LIB_DIR})
 
 add_library(toglstub STATIC ${CMAKE_CURRENT_BINARY_DIR}/toglStubInit.c toglStubLib.c)
-ADD_DEPENDENCIES(toglstub togl_stubs_gen)
+add_dependencies(toglstub togl_stubs_gen)
 install(TARGETS toglstub
 	RUNTIME DESTINATION ${BIN_DIR}
 	LIBRARY DESTINATION ${LIB_DIR}
 	ARCHIVE DESTINATION ${LIB_DIR})
-MARK_AS_ADVANCED(TOGL_STUB_LIBRARIES)
+mark_as_advanced(TOGL_STUB_LIBRARIES)
 
 # Create the pkgIndex.tcl file.
-TCL_PKGINDEX(togl ${TOGL_PKGNAME} ${TOGL_PKGVERSION})
+tcl_pkgindex(togl ${TOGL_PKGNAME} ${TOGL_PKGVERSION})
Index: src/other/togl/CMakeLists.txt
===================================================================
--- src/other/togl/CMakeLists.txt	(revision 54114)
+++ src/other/togl/CMakeLists.txt	(working copy)
@@ -1,67 +1,67 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-IF(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND CMAKE_POLICY)
+cmake_minimum_required(VERSION 2.8)
+if(COMMAND CMAKE_POLICY)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND CMAKE_POLICY)
 
-PROJECT(TOGL)
+project(TOGL)
 
-SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${TOGL_SOURCE_DIR}/CMake")
+set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${TOGL_SOURCE_DIR}/CMake")
 
 find_package(X11)
 find_package(GL)
 find_package(TCL)
 
-IF(NOT LIB_DIR)
-  SET(LIB_DIR lib)
-ENDIF(NOT LIB_DIR)
+if(NOT LIB_DIR)
+  set(LIB_DIR lib)
+endif(NOT LIB_DIR)
 
 # If we have only a target and not a full working exec, it's up to
 # a parent CMake system to define TK_SYSTEM_GRAPHICS
-IF(NOT TARGET ${TCL_WISH_EXECUTABLE})
-  IF(NOT TK_GRAPHICS_SYSTEM)
-    TK_GRAPHICS_SYSTEM(${TCL_WISH_EXECUTABLE} TK_SYSTEM_GRAPHICS)
-  ENDIF(NOT TK_GRAPHICS_SYSTEM)
-ENDIF(NOT TARGET ${TCL_WISH_EXECUTABLE})
-IF(TK_SYSTEM_GRAPHICS MATCHES "x11")
-  SET(TOGL_WINDOWINGSYSTEM "TOGL_X11")
-  IF(APPLE)
+if(NOT TARGET ${TCL_WISH_EXECUTABLE})
+  if(NOT TK_GRAPHICS_SYSTEM)
+    tk_graphics_system(${TCL_WISH_EXECUTABLE} TK_SYSTEM_GRAPHICS)
+  endif(NOT TK_GRAPHICS_SYSTEM)
+endif(NOT TARGET ${TCL_WISH_EXECUTABLE})
+if(TK_SYSTEM_GRAPHICS MATCHES "x11")
+  set(TOGL_WINDOWINGSYSTEM "TOGL_X11")
+  if(APPLE)
     add_definitions(-DGLEW_APPLE_GLX)
-  ENDIF(APPLE)
-ENDIF(TK_SYSTEM_GRAPHICS MATCHES "x11")
-IF(TK_SYSTEM_GRAPHICS MATCHES "aqua")
-  SET(TOGL_WINDOWINGSYSTEM "TOGL_AGL")
-ENDIF(TK_SYSTEM_GRAPHICS MATCHES "aqua")
-IF(TK_SYSTEM_GRAPHICS MATCHES "win32")
-  SET(TOGL_WINDOWINGSYSTEM "TOGL_WGL")
-ENDIF(TK_SYSTEM_GRAPHICS MATCHES "win32")
+  endif(APPLE)
+endif(TK_SYSTEM_GRAPHICS MATCHES "x11")
+if(TK_SYSTEM_GRAPHICS MATCHES "aqua")
+  set(TOGL_WINDOWINGSYSTEM "TOGL_AGL")
+endif(TK_SYSTEM_GRAPHICS MATCHES "aqua")
+if(TK_SYSTEM_GRAPHICS MATCHES "win32")
+  set(TOGL_WINDOWINGSYSTEM "TOGL_WGL")
+endif(TK_SYSTEM_GRAPHICS MATCHES "win32")
 # If we can't run Tk for whatever reason, do a
 # best guess
-IF(NOT TK_SYSTEM_GRAPHICS)
-  IF(WIN32)
-    SET(TOGL_WINDOWINGSYSTEM "TOGL_WGL")
-  ELSE(WIN32)
-    SET(TOGL_WINDOWINGSYSTEM "TOGL_X11")
-  ENDIF(WIN32)
-ENDIF(NOT TK_SYSTEM_GRAPHICS)
+if(NOT TK_SYSTEM_GRAPHICS)
+  if(WIN32)
+    set(TOGL_WINDOWINGSYSTEM "TOGL_WGL")
+  else(WIN32)
+    set(TOGL_WINDOWINGSYSTEM "TOGL_X11")
+  endif(WIN32)
+endif(NOT TK_SYSTEM_GRAPHICS)
 
 # System checks
-INCLUDE(CheckFunctions)
-CMAKE_HEADER_STDC()
-CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
-CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
-CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
-CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
-CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
-CHECK_INCLUDE_FILE(stddef.h HAVE_STDDEF_H)
-CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
-CHECK_INCLUDE_FILE(limits.h HAVE_LIMITS_H)
-CHECK_INCLUDE_FILE(sys/param.h HAVE_SYS_PARAM_H)
+include(CheckFunctions)
+cmake_header_stdc()
+check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+check_include_file(sys/stat.h HAVE_SYS_STAT_H)
+check_include_file(stdlib.h HAVE_STDLIB_H)
+check_include_file(memory.h HAVE_MEMORY_H)
+check_include_file(string.h HAVE_STRING_H)
+check_include_file(strings.h HAVE_STRINGS_H)
+check_include_file(inttypes.h HAVE_INTTYPES_H)
+check_include_file(stdint.h HAVE_STDINT_H)
+check_include_file(stddef.h HAVE_STDDEF_H)
+check_include_file(unistd.h HAVE_UNISTD_H)
+check_include_file(limits.h HAVE_LIMITS_H)
+check_include_file(sys/param.h HAVE_SYS_PARAM_H)
 
-OPTION(USE_TCL_STUBS "Use Tcl Stubs" ON)
-OPTION(USE_TK_STUBS "Use Tk Stubs" ON)
+option(USE_TCL_STUBS "Use Tcl Stubs" ON)
+option(USE_TK_STUBS "Use Tk Stubs" ON)
 
 #TODO
 #cmakedefine _LARGEFILE64_SOURCE
@@ -70,9 +70,9 @@
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/togl_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/togl_config.h)
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/config.h)
 
-SET(TOGL_PKGNAME Togl)
-SET(TOGL_PKGVERSION "2.1")
+set(TOGL_PKGNAME Togl)
+set(TOGL_PKGVERSION "2.1")
 
-ADD_SUBDIRECTORY(include)
-ADD_SUBDIRECTORY(src)
-ADD_SUBDIRECTORY(demo)
+add_subdirectory(include)
+add_subdirectory(src)
+add_subdirectory(demo)
Index: src/other/CMakeLists.txt
===================================================================
--- src/other/CMakeLists.txt	(revision 54114)
+++ src/other/CMakeLists.txt	(working copy)
@@ -38,10 +38,10 @@
 # are stored in files in the dlists directory.  Ignore that directory for
 # distcheck
 file(GLOB dlists "*.dist")
-FOREACH(ITEM ${dlists})
+foreach(ITEM ${dlists})
   get_filename_component(dlist ${ITEM} NAME)
-  CMAKEFILES(${dlist})
-ENDFOREACH(ITEM ${dlists})
+  cmakefiles(${dlist})
+endforeach(ITEM ${dlists})
 
 # For lower build levels, some of the third party components are not needed.
 # define some variables we can use for testing.
@@ -76,8 +76,8 @@
 toplevel BRLCAD_BUNDLED_LIBS option and testing first for a system version if
 BRLCAD_BUNDLED_LIBS is also AUTO.
 ")
-THIRD_PARTY(regex libregex "" regex_ALIASES regex_DESCRIPTION)
-BRLCAD_INCLUDE_FILE(regex.h HAVE_REGEX_H)
+third_party(regex libregex "" regex_ALIASES regex_DESCRIPTION)
+brlcad_include_file(regex.h HAVE_REGEX_H)
 
 # Same deal for zlib Library - common requirement, deal with it up front
 set(zlib_ALIASES ENABLE_ZLIB ENABLE_LIBZ)
@@ -87,8 +87,8 @@
 the toplevel BRLCAD_BUNDLED_LIBS option and testing first for a system version if
 BRLCAD_BUNDLED_LIBS is also AUTO.
 ")
-THIRD_PARTY(zlib libz "" zlib_ALIASES zlib_DESCRIPTION)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/libz/CTestTestfile.cmake)
+third_party(zlib libz "" zlib_ALIASES zlib_DESCRIPTION)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/libz/CTestTestfile.cmake)
 
 #-----------------------------------------------------------------------------
 
@@ -142,8 +142,8 @@
 if("${BRLCAD_BUNDLED_LIBS}" STREQUAL "BUNDLED" OR "${BRLCAD_LEMON}" MATCHES "BUNDLED")
   set(LEMON_TEMPLATE "${BRLCAD_SOURCE_DIR}/src/other/lemon/lempar.c")
 endif("${BRLCAD_BUNDLED_LIBS}" STREQUAL "BUNDLED" OR "${BRLCAD_LEMON}" MATCHES "BUNDLED")
-THIRD_PARTY_EXECUTABLE(lemon lemon "BRLCAD_LEVEL2" lemon_ALIASES lemon_DESCRIPTION)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/lemon/Makefile)
+third_party_executable(lemon lemon "BRLCAD_LEVEL2" lemon_ALIASES lemon_DESCRIPTION)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/lemon/Makefile)
 # Unless some parent logic has already defined the macro, we need to
 # load LEMON_Util to be able to define LEMON targets.
 if(NOT COMMAND LEMON_TARGET)
@@ -157,8 +157,8 @@
 toplevel BRLCAD_BUNDLED_LIBS option and testing first for a system version if
 BRLCAD_BUNDLED_LIBS is also AUTO.
 ")
-THIRD_PARTY_EXECUTABLE(re2c re2c "BRLCAD_LEVEL2" re2c_ALIASES re2c_DESCRIPTION)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/re2c/Makefile)
+third_party_executable(re2c re2c "BRLCAD_LEVEL2" re2c_ALIASES re2c_DESCRIPTION)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/re2c/Makefile)
 # Unless some parent logic has already defined the macro, we need to
 # load RE2C_Util to be able to define RE2C targets.
 if(NOT COMMAND RE2C_TARGET)
@@ -171,7 +171,7 @@
 
 # For all BRL-CAD projects, we will use the perplex template in
 # src/other/perplex
-SET(PERPLEX_TEMPLATE "${CMAKE_CURRENT_SOURCE_DIR}/perplex/perplex_template.c" CACHE STRING "Perplex template file" FORCE)
+set(PERPLEX_TEMPLATE "${CMAKE_CURRENT_SOURCE_DIR}/perplex/perplex_template.c" CACHE STRING "Perplex template file" FORCE)
 
 set(perplex_ALIASES ENABLE_PERPLEX)
 set(perplex_DESCRIPTION "
@@ -180,13 +180,13 @@
 toplevel BRLCAD_BUNDLED_LIBS option and testing first for a system version if
 BRLCAD_BUNDLED_LIBS is also AUTO.  perplex requires a working re2c.
 ")
-THIRD_PARTY_EXECUTABLE(perplex perplex "BRLCAD_LEVEL2" perplex_ALIASES perplex_DESCRIPTION NOSYS)
+third_party_executable(perplex perplex "BRLCAD_LEVEL2" perplex_ALIASES perplex_DESCRIPTION NOSYS)
 # Unless some parent logic has already defined the macro, we need to
 # load PERPLEX_Util to be able to define PERPLEX targets.
 if(NOT COMMAND PERPLEX_TARGET)
   include(${BRLCAD_SOURCE_DIR}/misc/CMake/PERPLEX_Util.cmake)
 endif(NOT COMMAND PERPLEX_TARGET)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/perplex/Makefile)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/perplex/Makefile)
 
 # libxml and libxslt tools for DocBook processing.  We build just
 # enough library support to get these two tools working.
@@ -198,7 +198,7 @@
 toplevel BRLCAD_BUNDLED_LIBS option and testing first for a system version if
 BRLCAD_BUNDLED_LIBS is also AUTO.  Depends on BRLCAD_EXTRADOCS.
 ")
-THIRD_PARTY_EXECUTABLE(xsltproc xmltools "BRLCAD_EXTRADOCS;BRLCAD_LEVEL3" xsltproc_ALIASES xsltproc_DESCRIPTION)
+third_party_executable(xsltproc xmltools "BRLCAD_EXTRADOCS;BRLCAD_LEVEL3" xsltproc_ALIASES xsltproc_DESCRIPTION)
 
 # Used only when validating XML for schema compliance
 # (BRLCAD_EXTRADOCS_VALIDATE must be on to use this, although it is compiled
@@ -211,29 +211,29 @@
 toplevel BRLCAD_BUNDLED_LIBS option and testing first for a system version if
 BRLCAD_BUNDLED_LIBS is also AUTO.
 ")
-THIRD_PARTY_EXECUTABLE(xmllint xmltools "BRLCAD_EXTRADOCS_VALIDATE;BRLCAD_LEVEL3" xmllint_ALIASES xmllint_DESCRIPTION)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/xmltools/include)
+third_party_executable(xmllint xmltools "BRLCAD_EXTRADOCS_VALIDATE;BRLCAD_LEVEL3" xmllint_ALIASES xmllint_DESCRIPTION)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/xmltools/include)
 
 #---------------------------------------------------------------------------------
 # Third Party Sources
 #---------------------------------------------------------------------------------
 # Ignore the boost subdir - it's only used for the boost headers and is not
 # compiled
-CMAKEFILES(boost)
+cmakefiles(boost)
 
 # The incrtTcl subdirectory isn't directly referenced, but its subdirectories
 # are used - mark incrTcl as ignored
-CMAKEFILES(incrTcl)
+cmakefiles(incrTcl)
 
 # Ignore the osl subdir
-CMAKEFILES(osl)
+cmakefiles(osl)
 
 # libtermlib Library
 #Only on WIN32 will the combination of the build search tests and
 #libtermlib fail to find a valid term, so set variables accordingly
 if(NOT WIN32)
   set(HAVE_TERMLIB ON CACHE BOOL "Have some termlib" FORCE)
-ELSE(NOT WIN32)
+else(NOT WIN32)
   set(BRLCAD_TERMLIB_BUILD "System" CACHE STRING "Disable libtermlib build on WIN32." FORCE)
   mark_as_advanced(BRLCAD_TERMLIB_BUILD)
   set(HAVE_TERMLIB OFF CACHE BOOL "Have some termlib" FORCE)
@@ -248,7 +248,7 @@
 BRLCAD_BUNDLED_LIBS is also AUTO. (Except when building with Visual Studio,
 where it is disabled. Windows does not support the termlib API.)
 ")
-THIRD_PARTY(termlib libtermlib "HAVE_TERMLIB;BRLCAD_LEVEL2" termlib_ALIASES termlib_DESCRIPTION)
+third_party(termlib libtermlib "HAVE_TERMLIB;BRLCAD_LEVEL2" termlib_ALIASES termlib_DESCRIPTION)
 if(BRLCAD_TERMLIB_BUILD)
   set(HAVE_TERMCAP_H ON CACHE BOOL "src/other termlib is on" FORCE)
   mark_as_advanced(HAVE_TERMCAP_H)
@@ -276,26 +276,26 @@
 AUTO, responsive to the toplevel BRLCAD_BUNDLED_LIBS option and testing
 first for a system version if BRLCAD_BUNDLED_LIBS is also AUTO.
 ")
-THIRD_PARTY(png libpng "BRLCAD_LEVEL2" png_ALIASES png_DESCRIPTION)
+third_party(png libpng "BRLCAD_LEVEL2" png_ALIASES png_DESCRIPTION)
 if(BRLCAD_PNG_BUILD)
   # PNG_LIB_NAME doesn't automatically propagate to toplevel due to scoping of CMake variables -
   # use get_directory_property to recover the value and place it in the CACHE
   get_directory_property(PNG_LIBRARY DIRECTORY libpng DEFINITION PNG_LIB_NAME)
   set(PNG_LIBRARY "${PNG_LIBRARY}" CACHE STRING "libpng name for targets" FORCE)
-ELSE(BRLCAD_PNG_BUILD)
+else(BRLCAD_PNG_BUILD)
   # The PNG CMake file seems to set PNG_PNG_INCLUDE_DIR rather than PNG_INCLUDE_DIR, so
   # a generic macro won't pick up the setting - handle it here
   set(PNG_INCLUDE_DIR ${PNG_PNG_INCLUDE_DIR} CACHE STRING "PNG include directory" FORCE)
 endif(BRLCAD_PNG_BUILD)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/libpng/CTestTestfile.cmake)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/libpng/libpng.pc)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/libpng/libpng-config)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/libpng/libpng${CMAKE_SHARED_LIBRARY_SUFFIX})
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/libpng/libpng${CMAKE_STATIC_LIBRARY_SUFFIX})
-DISTCLEAN(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng.pc)
-DISTCLEAN(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng-config)
-DISTCLEAN(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX})
-DISTCLEAN(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX})
+distclean(${CMAKE_CURRENT_BINARY_DIR}/libpng/CTestTestfile.cmake)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/libpng/libpng.pc)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/libpng/libpng-config)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/libpng/libpng${CMAKE_SHARED_LIBRARY_SUFFIX})
+distclean(${CMAKE_CURRENT_BINARY_DIR}/libpng/libpng${CMAKE_STATIC_LIBRARY_SUFFIX})
+distclean(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng.pc)
+distclean(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng-config)
+distclean(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX})
+distclean(${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX})
 # Other PNG options to mark as advanced
 mark_as_advanced(PNGARG)
 mark_as_advanced(PNG_DEBUG)
@@ -315,7 +315,7 @@
 to the toplevel BRLCAD_BUNDLED_LIBS option and testing first for a system
 version if BRLCAD_BUNDLED_LIBS is also AUTO.
 ")
-THIRD_PARTY(utahrle libutahrle "BRLCAD_LEVEL3" utahrle_ALIASES utahrle_DESCRIPTION NOSYS)
+third_party(utahrle libutahrle "BRLCAD_LEVEL3" utahrle_ALIASES utahrle_DESCRIPTION NOSYS)
 if(BRLCAD_UTAHRLE_BUILD)
   set(UTAHRLE_INCLUDE_DIR "${BRLCAD_SOURCE_DIR}/src/other/libutahrle/include" CACHE STRING "directory with rle.h header" FORCE)
   set(BRLCAD_UTAHRLE_INCLUDE_DIR "${UTAHRLE_INCLUDE_DIR}" CACHE STRING "directory with rle.h header" FORCE)
@@ -331,7 +331,7 @@
   add_subdirectory(URToolkit)
 endif(BRLCAD_LEVEL3)
 include(${CMAKE_CURRENT_SOURCE_DIR}/URToolkit.dist)
-CMAKEFILES_IN_DIR(URToolkit_ignore_files URToolkit)
+cmakefiles_in_dir(URToolkit_ignore_files URToolkit)
 
 # Tcl/Tk presents a number of complexities for BRL-CAD and CMake.  BRL-CAD requires
 # far more knowledge of the details of a Tcl/Tk installation than most programs,
@@ -347,7 +347,7 @@
 
 if(BRLCAD_ENABLE_TK)
   set(TCL_REQUIRE_TK 1)
-ELSE(BRLCAD_ENABLE_TK)
+else(BRLCAD_ENABLE_TK)
   set(TCL_REQUIRE_TK 0)
 endif(BRLCAD_ENABLE_TK)
 
@@ -359,7 +359,7 @@
 a system version if BRLCAD_BUNDLED_LIBS is also AUTO.
 ")
 
-THIRD_PARTY(tcl tcl "" tcl_ALIASES tcl_DESCRIPTION)
+third_party(tcl tcl "" tcl_ALIASES tcl_DESCRIPTION)
 if(BRLCAD_TCL_BUILD)
   # Set the variables ourselves since FindTCL.cmake doesn't know about our build
   set(TCL_SRC_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/tcl)
@@ -378,20 +378,20 @@
   set(TCL_VERSION_MAJOR "${TCL_VERSION_MAJOR}" CACHE STRING "Tcl MAJOR version" FORCE)
   get_directory_property(TCL_VERSION_MINOR DIRECTORY tcl DEFINITION TCL_VERSION_MINOR)
   set(TCL_VERSION_MINOR "${TCL_VERSION_MINOR}" CACHE STRING "Tcl MINOR version" FORCE)
-  CONFIG_H_APPEND(BRLCAD "#define HAVE_TCL_H 1\n")
-  CONFIG_H_APPEND(BRLCAD "#define TCL_SYSTEM_INITTCL_PATH \"\"\n")
+  config_h_append(BRLCAD "#define HAVE_TCL_H 1\n")
+  config_h_append(BRLCAD "#define TCL_SYSTEM_INITTCL_PATH \"\"\n")
   include(${CMAKE_CURRENT_SOURCE_DIR}/tcl.dist)
-  CMAKEFILES_IN_DIR(tcl_ignore_files tcl)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/tcl/doc/Makefile)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/tcl/doc/man1)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/tcl/doc/man3)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/tcl/doc/mann)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/tcl/library/Makefile)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/lib/tcl8)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/lib/tcl8.5)
-ELSE(BRLCAD_TCL_BUILD)
+  cmakefiles_in_dir(tcl_ignore_files tcl)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/tcl/doc/Makefile)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/tcl/doc/man1)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/tcl/doc/man3)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/tcl/doc/mann)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/tcl/library/Makefile)
+  distclean(${CMAKE_BINARY_DIR}/lib/tcl8)
+  distclean(${CMAKE_BINARY_DIR}/lib/tcl8.5)
+else(BRLCAD_TCL_BUILD)
   if(${TCL_TCLSH_EXECUTABLE})
-    BRLCAD_INCLUDE_FILE(tcl.h HAVE_TCL_H)
+    brlcad_include_file(tcl.h HAVE_TCL_H)
     # We're going to need the path to the system init.tcl for btclsh and bwish
     set(inittcl_script "
 set filename \"${CMAKE_BINARY_DIR}/CMakeTmp/tcl_inittcl\"
@@ -402,13 +402,13 @@
 ")
     set(inittcl_scriptfile "${CMAKE_BINARY_DIR}/CMakeTmp/tcl_inittcl.tcl")
     file(WRITE ${inittcl_scriptfile} ${inittcl_script})
-    EXEC_PROGRAM(${TCL_TCLSH_EXECUTABLE} ARGS ${inittcl_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+    exec_program(${TCL_TCLSH_EXECUTABLE} ARGS ${inittcl_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
     file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/tcl_inittcl tcl_inittcl_raw)
-    STRING(REGEX REPLACE "\n" "" tcl_inittcl_paths_1 ${tcl_inittcl_raw})
-    STRING(REGEX REPLACE " " ";" tcl_inittcl_paths ${tcl_inittcl_paths_1})
-    FIND_PATH(tcl_inittcl NAMES init.tcl PATHS ${tcl_inittcl_paths})
+    string(REGEX REPLACE "\n" "" tcl_inittcl_paths_1 ${tcl_inittcl_raw})
+    string(REGEX REPLACE " " ";" tcl_inittcl_paths ${tcl_inittcl_paths_1})
+    find_path(tcl_inittcl NAMES init.tcl PATHS ${tcl_inittcl_paths})
     mark_as_advanced(tcl_inittcl)
-    CONFIG_H_APPEND(BRLCAD "#define TCL_SYSTEM_INITTCL_PATH \"${tcl_inittcl}\"\n")
+    config_h_append(BRLCAD "#define TCL_SYSTEM_INITTCL_PATH \"${tcl_inittcl}\"\n")
   endif(${TCL_TCLSH_EXECUTABLE})
 endif(BRLCAD_TCL_BUILD)
 mark_as_advanced(TCL_COMPILE_DEBUG)
@@ -442,7 +442,7 @@
 set to BUNDLED, local copy is built even if a system version is present.
 This option also depends on BRLCAD_ENABLE_TK being ON.
 ")
-THIRD_PARTY_TCL_PACKAGE(Tk tk "${TCL_TCLSH_EXECUTABLE}" "tcl" "BRLCAD_ENABLE_TK;BRLCAD_LEVEL2" "tk" tk_ALIASES tk_DESCRIPTION)
+third_party_tcl_package(Tk tk "${TCL_TCLSH_EXECUTABLE}" "tcl" "BRLCAD_ENABLE_TK;BRLCAD_LEVEL2" "tk" tk_ALIASES tk_DESCRIPTION)
 if(BRLCAD_TK_BUILD)
   # Set the variables ourselves since FindTCL.cmake doesn't know about our build
   set(TCL_TK_LIBRARY tk CACHE STRING "TCL_TK_LIBRARY" FORCE)
@@ -461,28 +461,28 @@
   set(TK_WISH wish CACHE STRING "Tk shell" FORCE)
   if(WIN32)
     set(TK_SYSTEM_GRAPHICS "win32" CACHE STRING "Tk system graphics" FORCE)
-  ELSEif(APPLE)
+  elseif(APPLE)
     if(OPENGL_USE_AQUA)
       set(TK_SYSTEM_GRAPHICS "aqua" CACHE STRING "Tk system graphics" FORCE)
-    ELSE(OPENGL_USE_AQUA)
+    else(OPENGL_USE_AQUA)
       set(TK_SYSTEM_GRAPHICS "x11" CACHE STRING "Tk system graphics" FORCE)
     endif(OPENGL_USE_AQUA)
-  ELSEif(UNIX)
+  elseif(UNIX)
     set(TK_SYSTEM_GRAPHICS "x11" CACHE STRING "Tk system graphics" FORCE)
   endif(WIN32)
-  CONFIG_H_APPEND(BRLCAD "#define HAVE_TK_H 1\n")
+  config_h_append(BRLCAD "#define HAVE_TK_H 1\n")
   mark_as_advanced(TK-ENABLE_FREETYPE)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/tk/doc/Makefile)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/tk/doc/man1)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/tk/doc/man3)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/tk/doc/mann)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/tk/library/Makefile)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/tk/pkgIndex.tcl)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/lib/tk8.5)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/lib/tk8.5.9)
-ELSE(BRLCAD_TK_BUILD)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/tk/doc/Makefile)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/tk/doc/man1)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/tk/doc/man3)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/tk/doc/mann)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/tk/library/Makefile)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/tk/pkgIndex.tcl)
+  distclean(${CMAKE_BINARY_DIR}/lib/tk8.5)
+  distclean(${CMAKE_BINARY_DIR}/lib/tk8.5.9)
+else(BRLCAD_TK_BUILD)
   if(BRLCAD_ENABLE_TK)
-    BRLCAD_INCLUDE_FILE(tk.h HAVE_TK_H)
+    brlcad_include_file(tk.h HAVE_TK_H)
   endif(BRLCAD_ENABLE_TK)
 endif(BRLCAD_TK_BUILD)
 mark_as_advanced(TK_INCLUDE_PATH)
@@ -495,8 +495,8 @@
 # Now that Tcl/Tk is settled, define the HAVE_TK flag for the config.h file
 if(BRLCAD_ENABLE_TK)
   set(HAVE_TK 1 CACHE STRING "C level Tk flag" FORCE)
-  CONFIG_H_APPEND(BRLCAD "#cmakedefine HAVE_TK\n")
-ELSE(BRLCAD_ENABLE_TK)
+  config_h_append(BRLCAD "#cmakedefine HAVE_TK\n")
+else(BRLCAD_ENABLE_TK)
   set(HAVE_TK 0 CACHE STRING "C level Tk flag" FORCE)
 endif(BRLCAD_ENABLE_TK)
 mark_as_advanced(HAVE_TK)
@@ -512,21 +512,21 @@
 if(WIN32)
   set(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/tcl/generic ${CMAKE_CURRENT_SOURCE_DIR}/tcl/win ${CMAKE_CURRENT_SOURCE_DIR}/tcl/libtommath)
   set(TK_INCLUDE_PATH ${TK_INCLUDE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/tk/generic ${CMAKE_CURRENT_SOURCE_DIR}/tk/xlib ${CMAKE_CURRENT_SOURCE_DIR}/tk/win ${CMAKE_CURRENT_SOURCE_DIR}/tk/bitmaps)
-ELSE(WIN32)
+else(WIN32)
   set(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/tcl/generic ${CMAKE_CURRENT_SOURCE_DIR}/tcl/unix ${CMAKE_CURRENT_SOURCE_DIR}/tcl/libtommath)
   set(TK_INCLUDE_PATH ${TK_INCLUDE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/tk/generic ${CMAKE_CURRENT_SOURCE_DIR}/tk/bitmaps)
 endif(WIN32)
 set(ITCL_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/incrTcl/itcl/generic)
 if(BRLCAD_TCL_BUILD)
   set(TCL_BIN_PREFIX ${CMAKE_BINARY_DIR}/${LIB_DIR})
-ELSE(BRLCAD_TCL_BUILD)
+else(BRLCAD_TCL_BUILD)
   get_filename_component(TCL_BIN_PREFIX ${TCL_LIBRARY} PATH)
 endif(BRLCAD_TCL_BUILD)
 if(BRLCAD_ENABLE_TK)
   if(BRLCAD_TK_BUILD)
     set(TK_BIN_PREFIX ${CMAKE_BINARY_DIR}/${LIB_DIR})
     get_directory_property(TK_X11_INCLUDE_DIRS DIRECTORY tk DEFINITION TK_X11_INCLUDE_DIRS)
-  ELSE(BRLCAD_TK_BUILD)
+  else(BRLCAD_TK_BUILD)
     if(TCL_TK_LIBRARY)
       get_filename_component(TK_BIN_PREFIX ${TCL_TK_LIBRARY} PATH)
     endif(TCL_TK_LIBRARY)
@@ -558,7 +558,7 @@
 a system version if BRLCAD_TCL is set to AUTO or SYSTEM.  If BRLCAD_ITCL is
 set to BUNDLED, local copy is built even if a system version is present.
 ")
-THIRD_PARTY_TCL_PACKAGE(Itcl incrTcl/itcl "${TCL_TCLSH_EXECUTABLE}" "tcl" "BRLCAD_LEVEL2" "itcl" itcl_ALIASES itcl_DESCRIPTION)
+third_party_tcl_package(Itcl incrTcl/itcl "${TCL_TCLSH_EXECUTABLE}" "tcl" "BRLCAD_LEVEL2" "itcl" itcl_ALIASES itcl_DESCRIPTION)
 if(BRLCAD_ITCL_BUILD)
   set(ITCL_LIBRARY itcl CACHE STRING "ITCL_LIBRARY" FORCE)
   set(ITCL_STUB_LIBRARY itclstub CACHE STRING "ITCL_STUB_LIBRARY" FORCE)
@@ -566,9 +566,9 @@
   set(ITCL_INCLUDE_DIRS "${ITCL_INCLUDE_DIRS}" CACHE STRING "Itcl include paths" FORCE)
   set(ITCL_VERSION "3.4" CACHE STRING "ITCL_VERSION" FORCE)
   set(ITCL_BIN_PREFIX ${CMAKE_BINARY_DIR}/${LIB_DIR})
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/incrTcl/itcl/pkgIndex.tcl)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/lib/itcl3.4)
-ELSE(BRLCAD_ITCL_BUILD)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/incrTcl/itcl/pkgIndex.tcl)
+  distclean(${CMAKE_BINARY_DIR}/lib/itcl3.4)
+else(BRLCAD_ITCL_BUILD)
   # We have Itcl package AND Itcl library - we're good.
   set(ITCL_VERSION "${ITCL_PACKAGE_VERSION}" CACHE STRING "ITCL_VERSION" FORCE)
   set(ITCL_LIBRARY ${ITCL_LIBRARY} CACHE STRING "ITCL_LIBRARY" FORCE)
@@ -576,7 +576,7 @@
     get_filename_component(ITCL_BIN_PREFIX ${ITCL_LIBRARY} PATH)
   endif(ITCL_LIBRARY)
 endif(BRLCAD_ITCL_BUILD)
-CONFIG_H_APPEND(BRLCAD "#cmakedefine ITCL_VERSION	\"${ITCL_VERSION}\"\n")
+config_h_append(BRLCAD "#cmakedefine ITCL_VERSION	\"${ITCL_VERSION}\"\n")
 mark_as_advanced(ITCL_LIBRARY)
 mark_as_advanced(ITCL_STUB_LIBRARY)
 mark_as_advanced(ITCL_INCLUDE_DIRS)
@@ -592,14 +592,14 @@
 set to BUNDLED, local copy is built even if a system version is present.  This
 package will be disabled if BRLCAD_ENABLE_TK is OFF.
 ")
-THIRD_PARTY_TCL_PACKAGE(Itk incrTcl/itk "${TCL_WISH_EXECUTABLE}" "tcl;itcl;tk" "BRLCAD_ENABLE_TK;BRLCAD_LEVEL3" "itk" itk_ALIASES itk_DESCRIPTION)
+third_party_tcl_package(Itk incrTcl/itk "${TCL_WISH_EXECUTABLE}" "tcl;itcl;tk" "BRLCAD_ENABLE_TK;BRLCAD_LEVEL3" "itk" itk_ALIASES itk_DESCRIPTION)
 if(BRLCAD_ITK_BUILD)
   # does not handle C library settings.
   set(ITK_LIBRARY itk CACHE STRING "ITK_LIBRARY" FORCE)
   set(ITK_VERSION "3.3" CACHE STRING "ITK_VERSION" FORCE)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/incrTcl/itk/pkgIndex.tcl)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/lib/itk3.4)
-ELSE(BRLCAD_ITK_BUILD)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/incrTcl/itk/pkgIndex.tcl)
+  distclean(${CMAKE_BINARY_DIR}/lib/itk3.4)
+else(BRLCAD_ITK_BUILD)
   # We have Itcl/Itk packages AND Itcl/Itk libraries - we're good.
   set(ITK_VERSION "${ITCL_VERSION}" CACHE STRING "ITK_VERSION" FORCE)
   set(ITK_LIBRARY ${ITK_LIBRARY} CACHE STRING "ITK_LIBRARY" FORCE)
@@ -622,15 +622,15 @@
 package will be disabled if either BRLCAD_ENABLE_OPENGL or BRLCAD_ENABLE_TK
 are OFF.
 ")
-THIRD_PARTY_TCL_PACKAGE(Togl togl "${TCL_WISH_EXECUTABLE}" "tcl;tk" "BRLCAD_ENABLE_TK;BRLCAD_ENABLE_OPENGL;BRLCAD_ENABLE_X11;BRLCAD_LEVEL3" "togl" togl_ALIASES togl_DESCRIPTION)
+third_party_tcl_package(Togl togl "${TCL_WISH_EXECUTABLE}" "tcl;tk" "BRLCAD_ENABLE_TK;BRLCAD_ENABLE_OPENGL;BRLCAD_ENABLE_X11;BRLCAD_LEVEL3" "togl" togl_ALIASES togl_DESCRIPTION)
 if(BRLCAD_TOGL_BUILD)
   set(TOGL_LIBRARIES togl CACHE STRING "TOGL_LIBRARIES" FORCE)
   set(TOGL_STUB_LIBRARIES toglstub CACHE STRING "TOGL_STUB_LIBRARIES" FORCE)
   set(TOGL_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/togl/include;${CMAKE_CURRENT_SOURCE_DIR}/togl/include" CACHE STRING "Togl include path" FORCE)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/togl/pkgIndex.tcl
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/togl/pkgIndex.tcl
     ${CMAKE_CURRENT_BINARY_DIR}/togl/src/pkgIndex.tcl)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/lib/Togl2.1)
-ELSE(BRLCAD_TOGL_BUILD)
+  distclean(${CMAKE_BINARY_DIR}/lib/Togl2.1)
+else(BRLCAD_TOGL_BUILD)
   # No Togl enabled - fix this so a system one has a chance...
   #set(TOGL_LIBRARIES "" CACHE STRING "Tcl/Tk OpenGL disabled" FORCE)
   #set(TOGL_STUB_LIBRARIES "" CACHE STRING "Tcl/Tk OpenGL disabled" FORCE)
@@ -651,15 +651,15 @@
 is set to BUNDLED, local copy is built even if a system version is present.
 This package will be disabled if BRLCAD_ENABLE_TK is OFF.
 ")
-THIRD_PARTY_TCL_PACKAGE(Iwidgets iwidgets "${TCL_WISH_EXECUTABLE}" "tcl;tk;itcl;itk" "BRLCAD_ENABLE_TK;BRLCAD_LEVEL3" "" iwidgets_ALIASES iwidgets_DESCRIPTION)
+third_party_tcl_package(Iwidgets iwidgets "${TCL_WISH_EXECUTABLE}" "tcl;tk;itcl;itk" "BRLCAD_ENABLE_TK;BRLCAD_LEVEL3" "" iwidgets_ALIASES iwidgets_DESCRIPTION)
 if(BRLCAD_IWIDGETS_BUILD)
   set(IWIDGETS_VERSION "4.0.1" CACHE STRING "IWIDGETS_VERSION" FORCE)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/iwidgets/pkgIndex.tcl)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/lib/Iwidgets4.0.1)
-ELSE(BRLCAD_IWIDGETS_BUILD)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/iwidgets/pkgIndex.tcl)
+  distclean(${CMAKE_BINARY_DIR}/lib/Iwidgets4.0.1)
+else(BRLCAD_IWIDGETS_BUILD)
   set(IWIDGETS_VERSION "${IWIDGETS_PACKAGE_VERSION}" CACHE STRING "IWIDGETS_VERSION" FORCE)
 endif(BRLCAD_IWIDGETS_BUILD)
-CONFIG_H_APPEND(BRLCAD "#define IWIDGETS_VERSION \"${IWIDGETS_VERSION}\"\n")
+config_h_append(BRLCAD "#define IWIDGETS_VERSION \"${IWIDGETS_VERSION}\"\n")
 mark_as_advanced(IWIDGETS_VERSION)
 
 set(tkhtml_ALIASES ENABLE_TKHTML)
@@ -671,17 +671,17 @@
 is set to BUNDLED, local copy is built even if a system version is present.
 This package will be disabled if BRLCAD_ENABLE_TK is OFF.
 ")
-THIRD_PARTY_TCL_PACKAGE(Tkhtml tkhtml "${TCL_WISH_EXECUTABLE}" "tcl;tk" "BRLCAD_ENABLE_TK;BRLCAD_LEVEL3" "" tkhtml_ALIASES tkhtml_DESCRIPTION)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/tkhtml/pkgIndex.tcl)
-DISTCLEAN(${CMAKE_BINARY_DIR}/lib/Tkhtml3.0)
+third_party_tcl_package(Tkhtml tkhtml "${TCL_WISH_EXECUTABLE}" "tcl;tk" "BRLCAD_ENABLE_TK;BRLCAD_LEVEL3" "" tkhtml_ALIASES tkhtml_DESCRIPTION)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/tkhtml/pkgIndex.tcl)
+distclean(${CMAKE_BINARY_DIR}/lib/Tkhtml3.0)
 #add_subdirectory(hv3)
 #include(${CMAKE_CURRENT_SOURCE_DIR}/hv3.dist)
 #CMAKEFILES_IN_DIR(hv3_ignore_files hv3)
 #add_subdirectory(sqlite3)
 #include(${CMAKE_CURRENT_SOURCE_DIR}/sqlite3.dist)
 #CMAKEFILES_IN_DIR(sqlite3_ignore_files sqlite3)
-CMAKEFILES(hv3)
-CMAKEFILES(sqlite3)
+cmakefiles(hv3)
+cmakefiles(sqlite3)
 
 set(tkpng_ALIASES ENABLE_TKPNG)
 set(tkpng_DESCRIPTION "
@@ -692,9 +692,9 @@
 is set to BUNDLED, local copy is built even if a system version is present.
 This package will be disabled if BRLCAD_ENABLE_TK is OFF.
 ")
-THIRD_PARTY_TCL_PACKAGE(tkpng tkpng "${TCL_WISH_EXECUTABLE}" "tcl;tk" "BRLCAD_ENABLE_TK;BRLCAD_LEVEL3" "" tkpng_ALIASES tkpng_DESCRIPTION)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/tkpng/pkgIndex.tcl)
-DISTCLEAN(${CMAKE_BINARY_DIR}/lib/tkpng0.8)
+third_party_tcl_package(tkpng tkpng "${TCL_WISH_EXECUTABLE}" "tcl;tk" "BRLCAD_ENABLE_TK;BRLCAD_LEVEL3" "" tkpng_ALIASES tkpng_DESCRIPTION)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/tkpng/pkgIndex.tcl)
+distclean(${CMAKE_BINARY_DIR}/lib/tkpng0.8)
 
 set(tktable_ALIASES ENABLE_TKTABLE)
 set(tktable_DESCRIPTION "
@@ -705,10 +705,10 @@
 is set to BUNDLED, local copy is built even if a system version is present.
 This package will be disabled if BRLCAD_ENABLE_TK is OFF.
 ")
-THIRD_PARTY_TCL_PACKAGE(Tktable tktable "${TCL_WISH_EXECUTABLE}" "tcl;tk" "BRLCAD_ENABLE_TK;BRLCAD_LEVEL3" "" tktable_ALIASES tktable_DESCRIPTION)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/tktable/pkgIndex.tcl)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/tktable/tktable_cfg.h)
-DISTCLEAN(${CMAKE_BINARY_DIR}/lib/Tktable2.10)
+third_party_tcl_package(Tktable tktable "${TCL_WISH_EXECUTABLE}" "tcl;tk" "BRLCAD_ENABLE_TK;BRLCAD_LEVEL3" "" tktable_ALIASES tktable_DESCRIPTION)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/tktable/pkgIndex.tcl)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/tktable/tktable_cfg.h)
+distclean(${CMAKE_BINARY_DIR}/lib/Tktable2.10)
 
 # OpenNURBS Library
 set(opennurbs_ALIASES ENABLE_OPENNURBS)
@@ -718,7 +718,7 @@
 AUTO, responsive to the toplevel BRLCAD_BUNDLED_LIBS option and
 testing first for a system version if BRLCAD_BUNDLED_LIBS is also AUTO.
 ")
-THIRD_PARTY(openNURBS openNURBS "" opennurbs_ALIASES opennurbs_DESCRIPTION NOSYS)
+third_party(openNURBS openNURBS "" opennurbs_ALIASES opennurbs_DESCRIPTION NOSYS)
 
 if(NOT MSVC)
   set(NOT_MSVC 1)
@@ -740,14 +740,14 @@
 AUTO, responsive to the toplevel BRLCAD_BUNDLED_LIBS option and testing
 first for a system version if BRLCAD_BUNDLED_LIBS is also AUTO.
 ")
-THIRD_PARTY(scl step "LEMON_EXECUTABLE;PERPLEX_EXECUTABLE;BRLCAD_LEVEL3"  scl_ALIASES scl_DESCRIPTION NOSYS)
+third_party(scl step "LEMON_EXECUTABLE;PERPLEX_EXECUTABLE;BRLCAD_LEVEL3"  scl_ALIASES scl_DESCRIPTION NOSYS)
 if(BRLCAD_SCL_BUILD)
   set(FEDEX_PLUS_EXEC fedex_plus CACHE STRING "Fedex plus executable" FORCE)
   set(FEDEX_PLUS_EXECUTABLE_TARGET fedex_plus CACHE STRING "Fedex plus executable target" FORCE)
   mark_as_advanced(FEDEX_PLUS_EXEC)
   mark_as_advanced(FEDEX_PLUS_EXECUTABLE_TARGET)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/step/include/scl_cf.h.in)
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/step/scl_version_string.h.txt)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/step/include/scl_cf.h.in)
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/step/scl_version_string.h.txt)
 endif(BRLCAD_SCL_BUILD)
 mark_as_advanced(SCL_BUILD_TYPE)
 mark_as_advanced(SCL_GENERATE_LEXER_PARSER)
@@ -763,14 +763,14 @@
 if(BRLCAD_LEVEL2)
   add_subdirectory(clipper)
   include(${CMAKE_CURRENT_SOURCE_DIR}/clipper.dist)
-  CMAKEFILES_IN_DIR(clipper_ignore_files clipper)
-  DISTCLEAN(${CMAKE_CURRENT_SOURCE_DIR}/clipper/Makefile)
+  cmakefiles_in_dir(clipper_ignore_files clipper)
+  distclean(${CMAKE_CURRENT_SOURCE_DIR}/clipper/Makefile)
   set(CLIPPER_LIBRARY "clipper" CACHE STRING "Clipper library" FORCE)
   set(CLIPPER_INCLUDE_DIR "${BRLCAD_SOURCE_DIR}/src/other/clipper" CACHE STRING "Directory containing clipper header" FORCE)
   mark_as_advanced(CLIPPER_LIBRARY)
   mark_as_advanced(CLIPPER_INCLUDE_DIR)
 else(BRLCAD_LEVEL2)
-  CMAKEFILES(clipper)
+  cmakefiles(clipper)
 endif(BRLCAD_LEVEL2)
 
 
@@ -783,7 +783,7 @@
 if(BRLCAD_LEVEL2)
   find_package(Bullet)
   if(BULLET_FOUND)
-    CONFIG_H_APPEND(BRLCAD "#define HAVE_BULLET 1\n")
+    config_h_append(BRLCAD "#define HAVE_BULLET 1\n")
   endif(BULLET_FOUND)
   # Let the rest of the package know the results
   set(BULLET_LIBRARIES "${BULLET_LIBRARIES}" CACHE STRING "Bullet libs" FORCE) 
@@ -800,7 +800,7 @@
 if(BRLCAD_LEVEL2)
   find_package(ADAPTAGRAMS)
   if(ADAPTAGRAMS_FOUND)
-    CONFIG_H_APPEND(BRLCAD "#define HAVE_ADAPTAGRAMS 1\n")
+    config_h_append(BRLCAD "#define HAVE_ADAPTAGRAMS 1\n")
   endif(ADAPTAGRAMS_FOUND)
   set(ADAPTAGRAMS_LIBRARIES "${ADAPTAGRAMS_LIBRARIES}" CACHE STRING "Adaptagrams libs" FORCE) 
   set(ADAPTAGRAMS_FOUND "${ADAPTAGRAMS_FOUND}" CACHE BOOL "Adaptagrams status" FORCE) 
@@ -811,7 +811,7 @@
 # to build (I think?)
 add_subdirectory(tnt)
 set(TNT_INCLUDE_DIR "${BRLCAD_SOURCE_DIR}/src/other/tnt" CACHE STRING "Directory containing tnt headers" FORCE)
-CMAKEFILES(tnt)
+cmakefiles(tnt)
 mark_as_advanced(TNT_INCLUDE_DIR)
 
 # Eigen is used for advanced linear algebra functionality
@@ -820,7 +820,7 @@
 #
 # TODO - replace jama/tnt with Eigen
 #
-CMAKEFILES(Eigen)
+cmakefiles(Eigen)
 
 # jove editor - technically this isn't a library,
 # but traditionally it's grouped into the "enable-all"
@@ -832,21 +832,21 @@
   if(NOT WIN32)
     add_subdirectory(jove)
     include(${CMAKE_CURRENT_SOURCE_DIR}/jove.dist)
-    CMAKEFILES_IN_DIR(jove_ignore_files jove)
-  ELSE(NOT WIN32)
-    MESSAGE("jove was requested, but does not build on Windows - disabling")
+    cmakefiles_in_dir(jove_ignore_files jove)
+  else(NOT WIN32)
+    message("jove was requested, but does not build on Windows - disabling")
     set(BRLCAD_ENABLE_JOVE OFF CACHE BOOL "jove disabled on WIN32" FORCE)
-    CMAKEFILES(jove)
+    cmakefiles(jove)
   endif(NOT WIN32)
-ELSE(BRLCAD_ENABLE_JOVE)
-  CMAKEFILES(jove)
+else(BRLCAD_ENABLE_JOVE)
+  cmakefiles(jove)
 endif(BRLCAD_ENABLE_JOVE)
 
 if(BRLCAD_ENABLE_OSL)
   add_subdirectory(osl)
 endif(BRLCAD_ENABLE_OSL)
 
-CMAKEFILES(Makefile.am)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/other/tk/CMakeLists.txt
===================================================================
--- src/other/tk/CMakeLists.txt	(revision 54114)
+++ src/other/tk/CMakeLists.txt	(working copy)
@@ -37,39 +37,39 @@
 # *******************************************************************
 
 # Minimum required version of CMake
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-IF(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND CMAKE_POLICY)
+cmake_minimum_required(VERSION 2.8)
+if(COMMAND CMAKE_POLICY)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND CMAKE_POLICY)
 
 # set CMake project name
-PROJECT(TK)
+project(TK)
 
 # Without Tcl libraries AND sources, we can't build Tk.  Use TCL_SRC_PREFIX
 # and TCL_BIN_PREFIX to identify the location of the Tcl we are to use.
-IF(TCL_SRC_PREFIX AND TCL_BIN_PREFIX)
-  SET(TCL_INCLUDE_DIRS ${TCL_SRC_PREFIX}/generic ${TCL_SRC_PREFIX}/libtommath)
-  IF(WIN32)
-    SET(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${TCL_SRC_PREFIX}/win)
-  ELSE(WIN32)
-    SET(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${TCL_SRC_PREFIX}/unix)
-  ENDIF(WIN32)
+if(TCL_SRC_PREFIX AND TCL_BIN_PREFIX)
+  set(TCL_INCLUDE_DIRS ${TCL_SRC_PREFIX}/generic ${TCL_SRC_PREFIX}/libtommath)
+  if(WIN32)
+    set(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${TCL_SRC_PREFIX}/win)
+  else(WIN32)
+    set(TCL_INCLUDE_DIRS ${TCL_INCLUDE_DIRS} ${TCL_SRC_PREFIX}/unix)
+  endif(WIN32)
   # Locate the TCL libraries.  We allow these to be overridden so that a parent
   # build can use a CMake target instead of an actual library path.
-  IF(NOT TCL_LIBRARY)
+  if(NOT TCL_LIBRARY)
     find_library(TCL_LIBRARY tcl PATHS ${TCL_BIN_PREFIX}/lib)
-  ENDIF(NOT TCL_LIBRARY)
-  IF(NOT TCL_STUB_LIBRARY)
+  endif(NOT TCL_LIBRARY)
+  if(NOT TCL_STUB_LIBRARY)
     find_library(TCL_STUB_LIBRARY tclstub PATHS ${TCL_BIN_PREFIX}/lib)
-  ENDIF(NOT TCL_STUB_LIBRARY)
-  IF(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY)
-    MESSAGE(FATAL_ERROR "Could not find Tcl libraries in ${TCL_BIN_PREFIX} - please specify the parent directory for the libraries in the TCL_BIN_PREFIX variable (e.g. \${TCL_BIN_PREFIX}/lib)")
-  ENDIF(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY)
-ELSE(TCL_SRC_PREFIX and TCL_BIN_PREFIX)
-  MESSAGE(FATAL_ERROR "Please specify the source and library locations of Tcl using the TCL_SRC_PREFIX and TCL_BIN_PREFIX variables.")
-ENDIF(TCL_SRC_PREFIX AND TCL_BIN_PREFIX)
-MARK_AS_ADVANCED(TCL_LIBRARY)
-MARK_AS_ADVANCED(TCL_STUB_LIBRARY)
+  endif(NOT TCL_STUB_LIBRARY)
+  if(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY)
+    message(FATAL_ERROR "Could not find Tcl libraries in ${TCL_BIN_PREFIX} - please specify the parent directory for the libraries in the TCL_BIN_PREFIX variable (e.g. \${TCL_BIN_PREFIX}/lib)")
+  endif(NOT TCL_LIBRARY OR NOT TCL_STUB_LIBRARY)
+else(TCL_SRC_PREFIX and TCL_BIN_PREFIX)
+  message(FATAL_ERROR "Please specify the source and library locations of Tcl using the TCL_SRC_PREFIX and TCL_BIN_PREFIX variables.")
+endif(TCL_SRC_PREFIX AND TCL_BIN_PREFIX)
+mark_as_advanced(TCL_LIBRARY)
+mark_as_advanced(TCL_STUB_LIBRARY)
 
 # build shared libs by default
 set(BUILD_SHARED_LIBS ON)
@@ -78,16 +78,16 @@
 set(BUILD_STATIC_LIBS ON)
 
 # version numbers
-SET(TK_VERSION_MAJOR 8)
-SET(TK_VERSION_MINOR 5)
-SET(TK_PATCH_LEVEL 8.5.9)
+set(TK_VERSION_MAJOR 8)
+set(TK_VERSION_MINOR 5)
+set(TK_PATCH_LEVEL 8.5.9)
 
-SET(TK_VERSION "${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}")
+set(TK_VERSION "${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}")
 
 # For Windows, we need the Resource Compiler language
-IF(WIN32)
-  ENABLE_LANGUAGE(RC)
-ENDIF(WIN32)
+if(WIN32)
+  enable_language(RC)
+endif(WIN32)
 
 #---------------------------------------------------------------------
 # The following logic is what allows binaries to run successfully in
@@ -95,71 +95,71 @@
 # identifying the necessity of setting CMAKE_INSTALL_NAME_DIR on OSX.
 
 # use, i.e. don't skip the full RPATH for the build tree
-SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
+set(CMAKE_SKIP_BUILD_RPATH  FALSE)
 
 # when building, don't use the install RPATH already
 # (but later on when installing)
-SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
 
 # the RPATH/INSTALL_NAME_DIR to be used when installing
 if (NOT APPLE)
-  SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:\$ORIGIN/../lib")
+  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:\$ORIGIN/../lib")
 endif(NOT APPLE)
-SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
 
 # add the automatically determined parts of the RPATH which point to
 # directories outside the build tree to the install RPATH
-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 
 #----------------------------------------------------------------------------
 # The location in which to install Tcl.  Only do this if CMAKE_INSTALL_PREFIX 
 # hasn't been set already, to try and allow parent builds (if any) some control.
-IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-  IF(NOT WIN32)
-    IF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
-      SET(CMAKE_INSTALL_PREFIX "/usr/local/tcldev-${TCL_VERSION}")
-    ELSE ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
-      SET(CMAKE_INSTALL_PREFIX "/usr")
-    ENDIF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
-  ENDIF(NOT WIN32)
-  SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "TCL install prefix" FORCE)
-  SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 0)
-ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+  if(NOT WIN32)
+    if ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
+      set(CMAKE_INSTALL_PREFIX "/usr/local/tcldev-${TCL_VERSION}")
+    else ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
+      set(CMAKE_INSTALL_PREFIX "/usr")
+    endif ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
+  endif(NOT WIN32)
+  set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "TCL install prefix" FORCE)
+  set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 0)
+endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
 
 #-----------------------------------------------------------------------------
 # Output directories.
 
-IF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-  SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
-ENDIF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-IF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
-  SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
-ENDIF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
-IF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
-  SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
-ENDIF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
+endif(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
+  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
+endif(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
+if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
+endif(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
 
 #-----------------------------------------------------------------------------
 # Set CMake module path
-SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${TK_SOURCE_DIR}/CMake")
+set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${TK_SOURCE_DIR}/CMake")
 
 #-----------------------------------------------------------------------------
 # Check if the compiler supports pipe - if so, use it
-INCLUDE(CheckCCompilerFlag)
-CHECK_C_COMPILER_FLAG(-pipe PIPE_COMPILER_FLAG)
-IF(PIPE_COMPILER_FLAG)
-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe")
-ENDIF(PIPE_COMPILER_FLAG)
+include(CheckCCompilerFlag)
+check_c_compiler_flag(-pipe PIPE_COMPILER_FLAG)
+if(PIPE_COMPILER_FLAG)
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe")
+endif(PIPE_COMPILER_FLAG)
 
 #-----------------------------------------------------------------------------
 # Tcl/Tk's normal build system uses autotools macros, referred to as the
 # TEA system.  An attempt to duplicate the required functionality from
 # TEA is found in tcl.cmake
-INCLUDE(${TK_SOURCE_DIR}/CMake/tcl.cmake)
+include(${TK_SOURCE_DIR}/CMake/tcl.cmake)
 
 #-----------------------------------------------------------------------------
 # Our replacement for SC_CONFIG_MANPAGES
-ADD_SUBDIRECTORY(doc)
+add_subdirectory(doc)
 
 #----------------------------------------------------------------------------
 # First, get some standard options out of the way - things that are constant
@@ -175,65 +175,65 @@
 
 # First, get some standard settings out of the way
 # Assume we have STDC_HEADERS until we meet a situation where we don't
-ADD_TCL_CFLAG(STDC_HEADERS)
+add_tcl_cflag(STDC_HEADERS)
 # Get the SHLIB extension from CMake
 add_definitions(-DTCL_SHLIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}")
 
 #----------------------------------------------------------------------------
 # Define some platform specific flags
 
-IF(WIN32)
+if(WIN32)
   add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -Ot -Oi -fp:strict -Gs -GS -GL -MD -DBUILD_tk -BUILD_ttk -DSUPPORT_CONFIG_EMBEDDED -DHAVE_UXTHEME_H=1)
-ENDIF(WIN32)
+endif(WIN32)
 
-IF(APPLE)
+if(APPLE)
   add_definitions(-DMAC_OSX_TCL=1)
-  INCLUDE(CMakeFindFrameworks)
-  CMAKE_FIND_FRAMEWORKS(CoreFoundation)
-  IF(CoreFoundation_FRAMEWORKS)
-    SET(CoreFoundation_LIBRARIES "-framework CoreFoundation")
+  include(CMakeFindFrameworks)
+  cmake_find_frameworks(CoreFoundation)
+  if(CoreFoundation_FRAMEWORKS)
+    set(CoreFoundation_LIBRARIES "-framework CoreFoundation")
     add_definitions(-DHAVE_COREFOUNDATION=1)	 
-  ENDIF(CoreFoundation_FRAMEWORKS)
-  CMAKE_FIND_FRAMEWORKS(IOKit)
-  IF(IOKit_FRAMEWORKS)
-    SET(IOKit_LIBRARIES "-framework IOKit")
+  endif(CoreFoundation_FRAMEWORKS)
+  cmake_find_frameworks(IOKit)
+  if(IOKit_FRAMEWORKS)
+    set(IOKit_LIBRARIES "-framework IOKit")
     add_definitions(-DHAVE_COREFOUNDATION=1)	 
-  ENDIF(IOKit_FRAMEWORKS)
-ENDIF(APPLE)
+  endif(IOKit_FRAMEWORKS)
+endif(APPLE)
 #----------------------------------------------------------------------------
 
 #------------------------------------------------------------------------
 # Threads support
 #------------------------------------------------------------------------
-SC_ENABLE_THREADS()
+sc_enable_threads()
 
 #------------------------------------------------------------------------
 # Call the LINK_LIBS macro to get M_LIBRARY properly defined (TEA
 # doesn't do this, needs looking into...)
 #------------------------------------------------------------------------
-SC_TCL_LINK_LIBS()
+sc_tcl_link_libs()
 
 #----------------------------------------------------------------------------
 # 64-bit support - unlike TEA, we enable by default if the platform looks
 # like it's 64-bit.  Can be overridden by specifying CMAKE_WORD_SIZE=32BIT
 #----------------------------------------------------------------------------
-SC_TCL_64BIT_FLAGS()
+sc_tcl_64bit_flags()
 
 #--------------------------------------------------------------------
 #       Check endianness because we can optimize some operations
 #--------------------------------------------------------------------
-IF(NOT MSVC)
-  INCLUDE(TestBigEndian)
-  TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
-  IF(WORDS_BIGENDIAN)
+if(NOT MSVC)
+  include(TestBigEndian)
+  test_big_endian(WORDS_BIGENDIAN)
+  if(WORDS_BIGENDIAN)
     add_definitions(-DWORDS_BIGENDIAN=1)
-  ENDIF(WORDS_BIGENDIAN)
-ENDIF(NOT MSVC)
+  endif(WORDS_BIGENDIAN)
+endif(NOT MSVC)
 
 #------------------------------------------------------------------------------
 #       Find out all about time handling differences.
 #------------------------------------------------------------------------------
-SC_TIME_HANDLER()
+sc_time_handler()
 
 #TODO SC_BUGGY_STRTOD - Solaris 2.4 only?  Do we still care?
 
@@ -241,21 +241,21 @@
 #       Check for various typedefs and provide substitutes if
 #       they don't exist.
 #--------------------------------------------------------------------
-TCL_CHECK_TYPE_SIZE(mode_t MODE)
-TCL_CHECK_TYPE_SIZE(pid_t PID)
-TCL_CHECK_TYPE_SIZE(size_t SIZE)
-TCL_CHECK_TYPE_SIZE(uid_t UID)
+tcl_check_type_size(mode_t MODE)
+tcl_check_type_size(pid_t PID)
+tcl_check_type_size(size_t SIZE)
+tcl_check_type_size(uid_t UID)
 # The following tests may need to be more elaborate to function properly
-TCL_CHECK_TYPE_SIZE(socklen_t SOCKLEN sys/types.h sys/socket.h)
-TCL_CHECK_TYPE_SIZE(intptr_t INTPTR)
-TCL_CHECK_TYPE_SIZE(uintptr_t UINTPTR)
+tcl_check_type_size(socklen_t SOCKLEN sys/types.h sys/socket.h)
+tcl_check_type_size(intptr_t INTPTR)
+tcl_check_type_size(uintptr_t UINTPTR)
 
-IF(NOT HAVE_OPENDIR)
-  ADD_TCL_CFLAG(USE_DIRENT2_H)
-ENDIF(NOT HAVE_OPENDIR)
+if(NOT HAVE_OPENDIR)
+  add_tcl_cflag(USE_DIRENT2_H)
+endif(NOT HAVE_OPENDIR)
 
 # The union wait test was for HP-UX - do we still need this?
-SET(UNION_WAIT_SRC "
+set(UNION_WAIT_SRC "
 #include <sys/types.h>
 #include <sys/wait.h>
 int
@@ -263,15 +263,15 @@
 {
 
 union wait x;
-WIFEXITED(x);           /* Generates compiler error if WIFEXITED
+wifexited(x);           /* Generates compiler error if WIFEXITED
                          * uses an int. */
 return 0;
 }
 ")
-CHECK_C_SOURCE_RUNS("${UNION_WAIT_SRC}" HAVE_UNION_WAIT)
-IF(NOT HAVE_UNION_WAIT)
-  ADD_TCL_CFLAG(NO_UNION_WAIT)
-ENDIF(NOT HAVE_UNION_WAIT)
+check_c_source_runs("${UNION_WAIT_SRC}" HAVE_UNION_WAIT)
+if(NOT HAVE_UNION_WAIT)
+  add_tcl_cflag(NO_UNION_WAIT)
+endif(NOT HAVE_UNION_WAIT)
 
 #--------------------------------------------------------------------
 #       On Mac OS X, we can build either with X11 or with Aqua
@@ -280,57 +280,57 @@
 #       We support enabling only the new Cocoa backend, not the 
 #       older Carbon code
 #--------------------------------------------------------------------
-IF(NOT WIN32)
-  IF(APPLE)
-    OPTION(TK_ENABLE_AQUA "Build Tk using the Aqua windowing system" OFF)
-    IF(TK_ENABLE_AQUA)
-      SET(TK_SYSTEM_GRAPHICS aqua)
+if(NOT WIN32)
+  if(APPLE)
+    option(TK_ENABLE_AQUA "Build Tk using the Aqua windowing system" OFF)
+    if(TK_ENABLE_AQUA)
+      set(TK_SYSTEM_GRAPHICS aqua)
       add_definitions(-DMAC_OSX_TK=1)
       add_definitions(-D_DARWIN_C_SOURCE=1)
-      SET(X11_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/xlib")
+      set(X11_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/xlib")
       find_library(COCOA_FRAMEWORK Cocoa)	
-      MARK_AS_ADVANCED(COCOA_FRAMEWORK)
+      mark_as_advanced(COCOA_FRAMEWORK)
       find_library(CARBON_FRAMEWORK Carbon)
-      MARK_AS_ADVANCED(CARBON_FRAMEWORK)
-      SET(OPENGL_USE_AQUA ON CACHE BOOL "Building Aqua Tk" FORCE)
-    ELSE(TK_ENABLE_AQUA)
+      mark_as_advanced(CARBON_FRAMEWORK)
+      set(OPENGL_USE_AQUA ON CACHE BOOL "Building Aqua Tk" FORCE)
+    else(TK_ENABLE_AQUA)
       find_package(X11)
-      SET(TK_SYSTEM_GRAPHICS x11)
-      SET(OPENGL_USE_AQUA OFF CACHE BOOL "Building X11 Tk" FORCE)
-    ENDIF(TK_ENABLE_AQUA)
-  ELSE(APPLE)
+      set(TK_SYSTEM_GRAPHICS x11)
+      set(OPENGL_USE_AQUA OFF CACHE BOOL "Building X11 Tk" FORCE)
+    endif(TK_ENABLE_AQUA)
+  else(APPLE)
     find_package(X11)
-    SET(TK_SYSTEM_GRAPHICS x11)
-  ENDIF(APPLE)
-ELSE(NOT WIN32)
-  SET(TK_SYSTEM_GRAPHICS win32)
-ENDIF(NOT WIN32)
+    set(TK_SYSTEM_GRAPHICS x11)
+  endif(APPLE)
+else(NOT WIN32)
+  set(TK_SYSTEM_GRAPHICS win32)
+endif(NOT WIN32)
 
 #--------------------------------------------------------------------
 # Check whether the header and library for the XScreenSaver
 # extension are available, and set HAVE_XSS if so.
 # XScreenSaver is needed for Tk_GetUserInactiveTime().
 #--------------------------------------------------------------------
-INCLUDE(CMakeDependentOption)
-CMAKE_DEPENDENT_OPTION(TK_ENABLE_XSS "Use XScreenSaver" ON "TK_SYSTEM_GRAPHICS STREQUAL x11;${X11_Xscreensaver_LIB}" OFF)
+include(CMakeDependentOption)
+cmake_dependent_option(TK_ENABLE_XSS "Use XScreenSaver" ON "TK_SYSTEM_GRAPHICS STREQUAL x11;${X11_Xscreensaver_LIB}" OFF)
 
 #--------------------------------------------------------------------
 #       Check for freetype / fontconfig / Xft support.
 #--------------------------------------------------------------------
-IF(NOT WIN32)
+if(NOT WIN32)
   find_package(Freetype)
   find_package(Fontconfig)
-  IF(NOT FREETYPE_FOUND)
-    SET(FREETYPE_LIBRARIES "")
-  ENDIF(NOT FREETYPE_FOUND)
-ENDIF(NOT WIN32)
-CMAKE_DEPENDENT_OPTION(TK_ENABLE_XFT "Use freetype/fontconfig/xft" ON "TK_SYSTEM_GRAPHICS STREQUAL x11;FREETYPE_FOUND;FONTCONFIG_FOUND;X11_Xft_FOUND" OFF)
+  if(NOT FREETYPE_FOUND)
+    set(FREETYPE_LIBRARIES "")
+  endif(NOT FREETYPE_FOUND)
+endif(NOT WIN32)
+cmake_dependent_option(TK_ENABLE_XFT "Use freetype/fontconfig/xft" ON "TK_SYSTEM_GRAPHICS STREQUAL x11;FREETYPE_FOUND;FONTCONFIG_FOUND;X11_Xft_FOUND" OFF)
 
 #----------------------------------------------------------------------------
 # signed/unsigned char - does the Tcl code still need this? See
 # http://lists.gnu.org/archive/html/autoconf/2008-06/msg00054.html
 #----------------------------------------------------------------------------
-SET(unsigned_char_srcs "
+set(unsigned_char_srcs "
 int
 main ()
 {
@@ -339,11 +339,11 @@
    return 0;
 }
 ")
-CHECK_C_SOURCE_RUNS("${unsigned_char_srcs}" CHAR_IS_UNSIGNED)
-IF(CHAR_IS_UNSIGNED)
-  ADD_TCL_CFLAG(__CHAR_UNSIGNED__)
-ENDIF(CHAR_IS_UNSIGNED)
-SET(signed_char_srcs "
+check_c_source_runs("${unsigned_char_srcs}" CHAR_IS_UNSIGNED)
+if(CHAR_IS_UNSIGNED)
+  add_tcl_cflag(__CHAR_UNSIGNED__)
+endif(CHAR_IS_UNSIGNED)
+set(signed_char_srcs "
 int
 main ()
 {
@@ -352,41 +352,41 @@
    return 0;
 }
 ")
-CHECK_C_SOURCE_COMPILES("${signed_char_srcs}" HAVE_SIGNED_CHAR)
-IF(HAVE_SIGNED_CHAR)
-  ADD_TCL_CFLAG(HAVE_SIGNED_CHAR)
-ENDIF(HAVE_SIGNED_CHAR)
+check_c_source_compiles("${signed_char_srcs}" HAVE_SIGNED_CHAR)
+if(HAVE_SIGNED_CHAR)
+  add_tcl_cflag(HAVE_SIGNED_CHAR)
+endif(HAVE_SIGNED_CHAR)
 
 
 
-TCL_CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
-TCL_CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
-TCL_CHECK_INCLUDE_FILE(sys/fstatfs.h HAVE_SYS_FSTATFS_H)
-IF(NOT HAVE_SYS_FSTATFS_H)
+tcl_check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+tcl_check_include_file(sys/stat.h HAVE_SYS_STAT_H)
+tcl_check_include_file(sys/fstatfs.h HAVE_SYS_FSTATFS_H)
+if(NOT HAVE_SYS_FSTATFS_H)
   add_definitions(-DNO_FSTATFS=1)
-ENDIF(NOT HAVE_SYS_FSTATFS_H)
-TCL_CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
-TCL_CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-TCL_CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
-TCL_CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
-TCL_CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
+endif(NOT HAVE_SYS_FSTATFS_H)
+tcl_check_include_file(memory.h HAVE_MEMORY_H)
+tcl_check_include_file(strings.h HAVE_STRINGS_H)
+tcl_check_include_file(inttypes.h HAVE_INTTYPES_H)
+tcl_check_include_file(stdint.h HAVE_STDINT_H)
+tcl_check_include_file(unistd.h HAVE_UNISTD_H)
 
-IF(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
-  TCL_CHECK_FUNCTION_EXISTS(getattrlist HAVE_GETATTRLIST)
-  TCL_CHECK_INCLUDE_FILE(copyfile.h HAVE_COPYFILE_H)
-  TCL_CHECK_FUNCTION_EXISTS(copyfile HAVE_COPYFILE)
-  IF(${CoreFoundation_LIBRARIES})
-    TCL_CHECK_INCLUDE_FILE(libkern/OSAtomic.h HAVE_LIBKERN_OSATOMIC_H)
-    TCL_CHECK_FUNCTION_EXISTS(OSSpinLockLock HAVE_OSSPINLOCKLOCK)
-    TCL_CHECK_FUNCTION_EXISTS(pthread_atfork HAVE_PTHREAD_ATFORK)
-  ENDIF(${CoreFoundation_LIBRARIES})
-  ADD_TCL_CFLAG(USE_VFORK)
+if(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
+  tcl_check_function_exists(getattrlist HAVE_GETATTRLIST)
+  tcl_check_include_file(copyfile.h HAVE_COPYFILE_H)
+  tcl_check_function_exists(copyfile HAVE_COPYFILE)
+  if(${CoreFoundation_LIBRARIES})
+    tcl_check_include_file(libkern/OSAtomic.h HAVE_LIBKERN_OSATOMIC_H)
+    tcl_check_function_exists(OSSpinLockLock HAVE_OSSPINLOCKLOCK)
+    tcl_check_function_exists(pthread_atfork HAVE_PTHREAD_ATFORK)
+  endif(${CoreFoundation_LIBRARIES})
+  add_tcl_cflag(USE_VFORK)
   add_definitions(-DTCL_DEFAULT_ENCODING="utf-8")
-  ADD_TCL_CFLAG(TCL_LOAD_FROM_MEMORY)
-  ADD_TCL_CFLAG(TCL_WIDE_CLICKS)
-  TCL_CHECK_INCLUDE_FILE_USABILITY(AvailabilityMacros.h HAVE_AVAILABILITYMACROS_H)
-  IF(HAVE_AVAILABILITYMACROS_H)
-    SET(WEAK_IMPORT_SRCS "
+  add_tcl_cflag(TCL_LOAD_FROM_MEMORY)
+  add_tcl_cflag(TCL_WIDE_CLICKS)
+  tcl_check_include_file_usability(AvailabilityMacros.h HAVE_AVAILABILITYMACROS_H)
+  if(HAVE_AVAILABILITYMACROS_H)
+    set(WEAK_IMPORT_SRCS "
 #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
 #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020
 #error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1020
@@ -400,11 +400,11 @@
 return 0;
 }
 		")
-    CHECK_C_SOURCE_COMPILES("${WEAK_IMPORT_SRCS}" WEAK_IMPORT_WORKING)
-    IF(WEAK_IMPORT_WORKING)
-      ADD_TCL_CFLAG(HAVE_WEAK_IMPORT)
-    ENDIF(WEAK_IMPORT_WORKING)
-    SET(SUSV3_SRCS "
+    check_c_source_compiles("${WEAK_IMPORT_SRCS}" WEAK_IMPORT_WORKING)
+    if(WEAK_IMPORT_WORKING)
+      add_tcl_cflag(HAVE_WEAK_IMPORT)
+    endif(WEAK_IMPORT_WORKING)
+    set(SUSV3_SRCS "
 #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
 #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050
 #error __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050
@@ -417,17 +417,17 @@
 
 int main ()	{return 0;}
 		")
-    CHECK_C_SOURCE_COMPILES("${SUSV3_SRCS}" SUSV3_WORKING)
-    IF(SUSV3_WORKING)
-      ADD_TCL_CFLAG(_DARWIN_C_SOURCE)
-    ENDIF(SUSV3_WORKING)
+    check_c_source_compiles("${SUSV3_SRCS}" SUSV3_WORKING)
+    if(SUSV3_WORKING)
+      add_tcl_cflag(_DARWIN_C_SOURCE)
+    endif(SUSV3_WORKING)
 
-  ENDIF(HAVE_AVAILABILITYMACROS_H)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
+  endif(HAVE_AVAILABILITYMACROS_H)
+endif(${CMAKE_SYSTEM_NAME} MATCHES "^Darwin$")
 
-ADD_SUBDIRECTORY(library)
+add_subdirectory(library)
 
-SET(TK_GENERIC_SRCS
+set(TK_GENERIC_SRCS
   generic/tk3d.c
   generic/tkArgv.c
   generic/tkAtom.c
@@ -499,13 +499,13 @@
   generic/tkWindow.c
   )
 
-SET(TK_HDRS
+set(TK_HDRS
   generic/tk.h
   generic/tkDecls.h
   generic/tkPlatDecls.h
   )
 
-SET(TTK_SRCS
+set(TTK_SRCS
   generic/ttk/ttkBlink.c
   generic/ttk/ttkButton.c
   generic/ttk/ttkCache.c
@@ -539,17 +539,17 @@
   generic/ttk/ttkWidget.c
   )
 
-SET(TK_STUB_SRCS
+set(TK_STUB_SRCS
   generic/tkStubInit.c
   generic/tkStubLib.c
   )
 
-SET(TTK_STUB_SRCS
+set(TTK_STUB_SRCS
   generic/ttk/ttkStubInit.c
   generic/ttk/ttkStubLib.c
   )
 
-SET(TK_X11_SRCS
+set(TK_X11_SRCS
   unix/tkUnix.c
   unix/tkUnix3d.c
   unix/tkUnixButton.c
@@ -572,13 +572,13 @@
   unix/tkUnixXId.c
   )
 
-IF(TK_ENABLE_XFT)
-  SET(TK_X11_SRCS ${TK_X11_SRCS} unix/tkUnixRFont.c)
-ELSE(TK_ENABLE_XFT)
-  SET(TK_X11_SRCS ${TK_X11_SRCS} unix/tkUnixFont.c)
-ENDIF(TK_ENABLE_XFT)
+if(TK_ENABLE_XFT)
+  set(TK_X11_SRCS ${TK_X11_SRCS} unix/tkUnixRFont.c)
+else(TK_ENABLE_XFT)
+  set(TK_X11_SRCS ${TK_X11_SRCS} unix/tkUnixFont.c)
+endif(TK_ENABLE_XFT)
 
-SET(TK_AQUA_SRCS
+set(TK_AQUA_SRCS
   macosx/tkMacOSXBitmap.c
   macosx/tkMacOSXButton.c
   macosx/tkMacOSXClipboard.c
@@ -623,7 +623,7 @@
   generic/ttk/ttkMacOSXTheme.c
   )
 
-SET(TK_WIN_SRCS
+set(TK_WIN_SRCS
   xlib/xcolors.c
   xlib/xdraw.c
   xlib/xgc.c
@@ -667,49 +667,49 @@
   win/ttkWinXPTheme.c
   )
 
-SET(TK_SRCS ${TK_GENERIC_SRCS} ${TTK_SRCS})
+set(TK_SRCS ${TK_GENERIC_SRCS} ${TTK_SRCS})
 
-IF(WIN32)
-  SET(TK_SRCS ${TK_SRCS} ${TK_WIN_SRCS})
-ELSE(WIN32)
-  IF(TK_ENABLE_AQUA)
-    SET(TK_SRCS ${TK_SRCS} ${TK_AQUA_SRCS})
-  ELSE(TK_ENABLE_AQUA)
-    SET(TK_SRCS ${TK_SRCS} ${TK_X11_SRCS})
-  ENDIF(TK_ENABLE_AQUA)
-ENDIF(WIN32)
+if(WIN32)
+  set(TK_SRCS ${TK_SRCS} ${TK_WIN_SRCS})
+else(WIN32)
+  if(TK_ENABLE_AQUA)
+    set(TK_SRCS ${TK_SRCS} ${TK_AQUA_SRCS})
+  else(TK_ENABLE_AQUA)
+    set(TK_SRCS ${TK_SRCS} ${TK_X11_SRCS})
+  endif(TK_ENABLE_AQUA)
+endif(WIN32)
 
-SET(TK_INCLUDE_PATH ${TK_SOURCE_DIR}/generic ${TK_SOURCE_DIR}/bitmaps ${TK_BINARY_DIR}/include)
-IF(WIN32)
-  SET(TK_INCLUDE_PATH ${TK_INCLUDE_PATH} ${TK_SOURCE_DIR}/win ${TK_SOURCE_DIR}/xlib ${TK_SOURCE_DIR}/xlib/X11)
-ELSE(WIN32)
-  SET(TK_INCLUDE_PATH ${TK_INCLUDE_PATH} ${TK_SOURCE_DIR}/unix)
-  IF(APPLE)
-    SET(TK_INCLUDE_PATH ${TK_INCLUDE_PATH} ${TK_SOURCE_DIR}/macosx)
-    IF(TK_ENABLE_AQUA)
-      SET(TK_INCLUDE_PATH ${TK_INCLUDE_PATH} ${X11_INCLUDE_DIR})
-    ENDIF(TK_ENABLE_AQUA)
-  ENDIF(APPLE)
-ENDIF(WIN32)
+set(TK_INCLUDE_PATH ${TK_SOURCE_DIR}/generic ${TK_SOURCE_DIR}/bitmaps ${TK_BINARY_DIR}/include)
+if(WIN32)
+  set(TK_INCLUDE_PATH ${TK_INCLUDE_PATH} ${TK_SOURCE_DIR}/win ${TK_SOURCE_DIR}/xlib ${TK_SOURCE_DIR}/xlib/X11)
+else(WIN32)
+  set(TK_INCLUDE_PATH ${TK_INCLUDE_PATH} ${TK_SOURCE_DIR}/unix)
+  if(APPLE)
+    set(TK_INCLUDE_PATH ${TK_INCLUDE_PATH} ${TK_SOURCE_DIR}/macosx)
+    if(TK_ENABLE_AQUA)
+      set(TK_INCLUDE_PATH ${TK_INCLUDE_PATH} ${X11_INCLUDE_DIR})
+    endif(TK_ENABLE_AQUA)
+  endif(APPLE)
+endif(WIN32)
 
-IF(NOT WIN32)
-  SET(WISH_SRCS unix/tkAppInit.c)
-ELSE(NOT WIN32)
-  SET(WISH_SRCS win/winMain.c)# win/rc/wish.rc)
-ENDIF(NOT WIN32)
+if(NOT WIN32)
+  set(WISH_SRCS unix/tkAppInit.c)
+else(NOT WIN32)
+  set(WISH_SRCS win/winMain.c)# win/rc/wish.rc)
+endif(NOT WIN32)
 
-IF(X11_INCLUDE_DIR)
-  SET(TK_X11_INCLUDE_DIRS ${TK_X11_INCLUDE_DIRS} ${X11_INCLUDE_DIR})
-ENDIF(X11_INCLUDE_DIR)
-IF(X11_Xft_INCLUDE_PATH)
-  SET(TK_X11_INCLUDE_DIRS ${TK_X11_INCLUDE_DIRS} ${X11_Xft_INCLUDE_PATH})
-ENDIF(X11_Xft_INCLUDE_PATH)
-IF(X11_Xrender_INCLUDE_PATH)
-  SET(TK_X11_INCLUDE_DIRS ${TK_X11_INCLUDE_DIRS} ${X11_Xrender_INCLUDE_PATH})
-ENDIF(X11_Xrender_INCLUDE_PATH)
-IF(X11_Xscreensaver_INCLUDE_PATH)
-  SET(TK_X11_INCLUDE_DIRS ${TK_X11_INCLUDE_DIRS} ${X11_Xscreensaver_INCLUDE_PATH})
-ENDIF(X11_Xscreensaver_INCLUDE_PATH)
+if(X11_INCLUDE_DIR)
+  set(TK_X11_INCLUDE_DIRS ${TK_X11_INCLUDE_DIRS} ${X11_INCLUDE_DIR})
+endif(X11_INCLUDE_DIR)
+if(X11_Xft_INCLUDE_PATH)
+  set(TK_X11_INCLUDE_DIRS ${TK_X11_INCLUDE_DIRS} ${X11_Xft_INCLUDE_PATH})
+endif(X11_Xft_INCLUDE_PATH)
+if(X11_Xrender_INCLUDE_PATH)
+  set(TK_X11_INCLUDE_DIRS ${TK_X11_INCLUDE_DIRS} ${X11_Xrender_INCLUDE_PATH})
+endif(X11_Xrender_INCLUDE_PATH)
+if(X11_Xscreensaver_INCLUDE_PATH)
+  set(TK_X11_INCLUDE_DIRS ${TK_X11_INCLUDE_DIRS} ${X11_Xscreensaver_INCLUDE_PATH})
+endif(X11_Xscreensaver_INCLUDE_PATH)
 
 include_directories(
   ${TCL_INCLUDE_DIRS}	
@@ -718,84 +718,84 @@
   ${FREETYPE_INCLUDE_DIRS}
   )
 
-SET(X11_TK_LIBS ${X11_X11_LIB} ${X11_Xext_LIB})
-IF(TK_ENABLE_XSS)
-  IF(X11_Xscreensaver_LIB)
-    SET(X11_TK_LIBS ${X11_TK_LIBS} ${X11_Xscreensaver_LIB})
-  ENDIF(X11_Xscreensaver_LIB)
-ENDIF(TK_ENABLE_XSS)
-IF(X11_Xft_LIB)
-  SET(X11_TK_LIBS ${X11_TK_LIBS} ${X11_Xft_LIB})
-ENDIF(X11_Xft_LIB)
-IF(X11_Xrender_LIB)
-  SET(X11_TK_LIBS ${X11_TK_LIBS} ${X11_Xrender_LIB})
-ENDIF(X11_Xrender_LIB)
+set(X11_TK_LIBS ${X11_X11_LIB} ${X11_Xext_LIB})
+if(TK_ENABLE_XSS)
+  if(X11_Xscreensaver_LIB)
+    set(X11_TK_LIBS ${X11_TK_LIBS} ${X11_Xscreensaver_LIB})
+  endif(X11_Xscreensaver_LIB)
+endif(TK_ENABLE_XSS)
+if(X11_Xft_LIB)
+  set(X11_TK_LIBS ${X11_TK_LIBS} ${X11_Xft_LIB})
+endif(X11_Xft_LIB)
+if(X11_Xrender_LIB)
+  set(X11_TK_LIBS ${X11_TK_LIBS} ${X11_Xrender_LIB})
+endif(X11_Xrender_LIB)
 
-IF(NOT LIB_DIR)
-  SET(LIB_DIR lib)
-ENDIF(NOT LIB_DIR)
+if(NOT LIB_DIR)
+  set(LIB_DIR lib)
+endif(NOT LIB_DIR)
 
-IF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-  SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_DIR})
-ENDIF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_DIR})
+endif(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
 
 add_library(tkstub STATIC ${TK_STUB_SRCS} ${TTK_STUB_SRCS})
-SET_TARGET_PROPERTIES(tkstub PROPERTIES COMPILE_FLAGS "-fPIC")
+set_target_properties(tkstub PROPERTIES COMPILE_FLAGS "-fPIC")
 install(TARGETS tkstub 
 	RUNTIME DESTINATION ${BIN_DIR}
 	LIBRARY DESTINATION ${LIB_DIR}
 	ARCHIVE DESTINATION ${LIB_DIR})
-SET_PROPERTY(TARGET tkstub APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
+set_property(TARGET tkstub APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
 
 add_library(tk ${TK_SRCS})
-IF(WIN32)
+if(WIN32)
   target_link_libraries(tk tkstub ${TCL_STUB_LIBRARY} ${TCL_THREADS_LIB} ${X11_TK_LIBS} ${FREETYPE_LIBRARIES} ${FONTCONFIG_LIBRARIES})
-ELSE(WIN32)
+else(WIN32)
   target_link_libraries(tk tkstub ${TCL_STUB_LIBRARY} ${TCL_THREADS_LIB} ${CoreFoundation_LIBRARIES} ${CARBON_FRAMEWORK} ${COCOA_FRAMEWORK} ${IOKit_LIBRARIES} ${X11_TK_LIBS} ${FREETYPE_LIBRARIES} ${FONTCONFIG_LIBRARIES})
-ENDIF(WIN32)
+endif(WIN32)
 install(TARGETS tk
 	RUNTIME DESTINATION ${BIN_DIR}
 	LIBRARY DESTINATION ${LIB_DIR}
 	ARCHIVE DESTINATION ${LIB_DIR})
-SET_TARGET_PROPERTIES(tk PROPERTIES VERSION ${TK_VERSION} SOVERSION ${TK_VERSION_MAJOR}.${TK_VERSION_MINOR})
-SET_PROPERTY(TARGET tk APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
-IF(TK_ENABLE_AQUA)
-  SET_PROPERTY(TARGET tk APPEND PROPERTY COMPILE_FLAGS "-std=gnu99 -x objective-c -fobjc-gc")
-ENDIF(TK_ENABLE_AQUA)
+set_target_properties(tk PROPERTIES VERSION ${TK_VERSION} SOVERSION ${TK_VERSION_MAJOR}.${TK_VERSION_MINOR})
+set_property(TARGET tk APPEND PROPERTY COMPILE_DEFINITIONS USE_TCL_STUBS)
+if(TK_ENABLE_AQUA)
+  set_property(TARGET tk APPEND PROPERTY COMPILE_FLAGS "-std=gnu99 -x objective-c -fobjc-gc")
+endif(TK_ENABLE_AQUA)
 
-TCL_PKGINDEX(tk Tk ${TK_PATCH_LEVEL})
+tcl_pkgindex(tk Tk ${TK_PATCH_LEVEL})
 
 install(FILES ${TK_HDRS} DESTINATION include)
 
-IF(WIN32)
+if(WIN32)
   add_executable(wish WIN32 ${WISH_SRCS})
   target_link_libraries(wish tcl tk imm32.lib comctl32.lib)
-ELSE(WIN32)
+else(WIN32)
   add_executable(wish ${WISH_SRCS})
   target_link_libraries(wish ${TCL_LIBRARY} tk ${CoreFoundation_LIBRARIES} ${CARBON_FRAMEWORK} ${COCOA_FRAMEWORK} ${IOKit_LIBRARIES} ${TCL_THREADS_LIB} ${M_LIBRARY} ${X11_TK_LIBS} ${FREETYPE_LIBRARIES} ${FONTCONFIG_LIBRARIES})
-  IF(TK_ENABLE_AQUA)
-    SET_PROPERTY(TARGET wish APPEND PROPERTY COMPILE_FLAGS "-std=gnu99 -x objective-c -fobjc-gc")
-  ENDIF(TK_ENABLE_AQUA)
-ENDIF(WIN32)
-SET_TARGET_PROPERTIES(wish PROPERTIES VERSION ${TK_VERSION_MAJOR}.${TK_VERSION_MINOR})
+  if(TK_ENABLE_AQUA)
+    set_property(TARGET wish APPEND PROPERTY COMPILE_FLAGS "-std=gnu99 -x objective-c -fobjc-gc")
+  endif(TK_ENABLE_AQUA)
+endif(WIN32)
+set_target_properties(wish PROPERTIES VERSION ${TK_VERSION_MAJOR}.${TK_VERSION_MINOR})
 install(TARGETS wish DESTINATION bin)
 
 if(CMAKE_CONFIGURATION_TYPES)
    foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
      string(TOUPPER "${CFG_TYPE}" CFG_TYPE_UPPER)
-     FILE(COPY generic/prolog.ps DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}}/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR})
+     file(COPY generic/prolog.ps DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}}/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR})
    endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
 else(CMAKE_CONFIGURATION_TYPES)
-   FILE(COPY generic/prolog.ps DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR})
+   file(COPY generic/prolog.ps DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR})
 endif(CMAKE_CONFIGURATION_TYPES)
 
-INSTALL(FILES generic/prolog.ps DESTINATION lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR})
+install(FILES generic/prolog.ps DESTINATION lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR})
 
-IF(NOT WIN32)
-  FILE(COPY unix/tkAppInit.c DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/tk${TK_PATCH_LEVEL})
+if(NOT WIN32)
+  file(COPY unix/tkAppInit.c DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/tk${TK_PATCH_LEVEL})
   foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
     string(TOUPPER "${CFG_TYPE}" CFG_TYPE_UPPER)
-    FILE(COPY unix/tkAppInit.c DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}}/tk${TK_PATCH_LEVEL})
+    file(COPY unix/tkAppInit.c DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}}/tk${TK_PATCH_LEVEL})
   endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
-  INSTALL(FILES unix/tkAppInit.c DESTINATION lib/tk${TK_PATCH_LEVEL})
-ENDIF(NOT WIN32)
+  install(FILES unix/tkAppInit.c DESTINATION lib/tk${TK_PATCH_LEVEL})
+endif(NOT WIN32)
Index: src/other/tk/CMake/CheckCSourceRuns.cmake
===================================================================
--- src/other/tk/CMake/CheckCSourceRuns.cmake	(revision 54114)
+++ src/other/tk/CMake/CheckCSourceRuns.cmake	(working copy)
@@ -70,32 +70,32 @@
 # 
 #=============================================================================
 
-MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
-  IF("${VAR}" MATCHES "^${VAR}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS 
+macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
+  if("${VAR}" MATCHES "^${VAR}$")
+    set(MACRO_CHECK_FUNCTION_DEFINITIONS 
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    IF(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
+    if(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
+    else(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    IF(EXISTS "${SOURCE}")
-      SET(CHECK_SRC "${SOURCE}")
-    ELSE(EXISTS "${SOURCE}")
-      FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    if(EXISTS "${SOURCE}")
+      set(CHECK_SRC "${SOURCE}")
+    else(EXISTS "${SOURCE}")
+      file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
         "${SOURCE}\n")
-      SET(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
-    ENDIF(EXISTS "${SOURCE}")
+      set(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
+    endif(EXISTS "${SOURCE}")
     
-    MESSAGE(STATUS "Performing Test ${VAR}")
-    TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
+    message(STATUS "Performing Test ${VAR}")
+    try_run(${VAR}_EXITCODE ${VAR}_COMPILED
       ${CMAKE_BINARY_DIR}
       ${CHECK_SRC}
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -105,33 +105,33 @@
       "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
       COMPILE_OUTPUT_VARIABLE OUTPUT)
     # if it did not compile make the return value fail code of 1
-    IF(NOT ${VAR}_COMPILED)
-      SET(${VAR}_EXITCODE 1)
-    ENDIF(NOT ${VAR}_COMPILED)
+    if(NOT ${VAR}_COMPILED)
+      set(${VAR}_EXITCODE 1)
+    endif(NOT ${VAR}_COMPILED)
     # if the return value was 0 then it worked
-    IF("${${VAR}_EXITCODE}" EQUAL 0)
-      SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
-      MESSAGE(STATUS "Performing Test ${VAR} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
+    if("${${VAR}_EXITCODE}" EQUAL 0)
+      set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+      message(STATUS "Performing Test ${VAR} - Success")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
         "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}}\n"
         "Source file was:\n${SOURCE}\n")
-    ELSE("${${VAR}_EXITCODE}" EQUAL 0)
-      IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "${${VAR}_EXITCODE}")
-      ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+    else("${${VAR}_EXITCODE}" EQUAL 0)
+      if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "${${VAR}_EXITCODE}")
+      else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+      endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
 
-      MESSAGE(STATUS "Performing Test ${VAR} - Failed")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
+      message(STATUS "Performing Test ${VAR} - Failed")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
         "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}_EXITCODE}\n"
         "Source file was:\n${SOURCE}\n")
 
-    ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
-  ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_C_SOURCE_RUNS)
+    endif("${${VAR}_EXITCODE}" EQUAL 0)
+  endif("${VAR}" MATCHES "^${VAR}$")
+endmacro(CHECK_C_SOURCE_RUNS)
 
Index: src/other/tk/CMake/FindX11.cmake
===================================================================
--- src/other/tk/CMake/FindX11.cmake	(revision 54114)
+++ src/other/tk/CMake/FindX11.cmake	(working copy)
@@ -130,16 +130,16 @@
 # 
 #=============================================================================
 
-MACRO(X11_FIND_INCLUDE_PATH component header)
+macro(X11_FIND_INCLUDE_PATH component header)
   find_path(X11_${component}_INCLUDE_PATH ${header} ${X11_INC_SEARCH_PATH} NO_CMAKE_SYSTEM_PATH)
   set(X11_HDR_VARS ${X11_HDR_VARS} X11_${component}_INCLUDE_PATH)
   if(X11_${component}_INCLUDE_PATH)
     set(X11_HDR_PATHS ${X11_HDR_PATHS} ${X11_${component}_INCLUDE_PATH})
     list(REMOVE_DUPLICATES X11_HDR_PATHS)
   endif(X11_${component}_INCLUDE_PATH)
-ENDMACRO(X11_FIND_INCLUDE_PATH)
+endmacro(X11_FIND_INCLUDE_PATH)
 
-MACRO(X11_FIND_LIB_PATH component libname)
+macro(X11_FIND_LIB_PATH component libname)
   find_library(X11_${component}_LIB ${libname} ${X11_LIB_SEARCH_PATH} NO_CMAKE_SYSTEM_PATH)
   set(X11_LIB_VARS ${X11_LIB_VARS} X11_${component}_LIB)
   if(X11_${component}_LIB)
@@ -147,7 +147,7 @@
     set(X11_LIB_PATHS ${X11_LIB_PATHS} ${X11_${component}_DIR})
     list(REMOVE_DUPLICATES X11_LIB_PATHS)
   endif(X11_${component}_LIB)
-ENDMACRO(X11_FIND_LIB_PATH)
+endmacro(X11_FIND_LIB_PATH)
 
 if(UNIX)
   set(X11_FOUND 0)
@@ -208,63 +208,63 @@
   set(X11_LIB_PATHS)
   
   # Find primary X11 headers
-  X11_FIND_INCLUDE_PATH(X11		X11/X.h)
-  X11_FIND_INCLUDE_PATH(Xlib		X11/Xlib.h)
+  x11_find_include_path(X11		X11/X.h)
+  x11_find_include_path(Xlib		X11/Xlib.h)
   # Look for other X11 includes; keep the list sorted by name of the cmake X11_<component>_INCLUDE_PATH
   # variable (component doesn't need to match the include file name).
-  X11_FIND_INCLUDE_PATH(ICE 		X11/ICE/ICE.h)
-  X11_FIND_INCLUDE_PATH(Xaccessrules 	X11/extensions/XKBrules.h)
-  X11_FIND_INCLUDE_PATH(Xaccessstr 	X11/extensions/XKBstr.h)
-  X11_FIND_INCLUDE_PATH(Xau 		X11/Xauth.h)
-  X11_FIND_INCLUDE_PATH(Xcomposite 	X11/extensions/Xcomposite.h)
-  X11_FIND_INCLUDE_PATH(Xcursor 	X11/Xcursor/Xcursor.h)
-  X11_FIND_INCLUDE_PATH(Xdamage 	X11/extensions/Xdamage.h)
-  X11_FIND_INCLUDE_PATH(Xdmcp 		X11/Xdmcp.h)
-  X11_FIND_INCLUDE_PATH(dpms 		X11/extensions/dpms.h)
-  X11_FIND_INCLUDE_PATH(xf86misc 	X11/extensions/xf86misc.h)
-  X11_FIND_INCLUDE_PATH(xf86vmode 	X11/extensions/xf86vmode.h)
-  X11_FIND_INCLUDE_PATH(Xfixes		X11/extensions/Xfixes.h)
-  X11_FIND_INCLUDE_PATH(Xft		X11/Xft/Xft.h)
-  X11_FIND_INCLUDE_PATH(Xi		X11/extensions/XInput.h)
-  X11_FIND_INCLUDE_PATH(Xinerama	X11/extensions/Xinerama.h)
-  X11_FIND_INCLUDE_PATH(Xinput		X11/extensions/XInput.h)
-  X11_FIND_INCLUDE_PATH(Xkb		X11/extensions/XKB.h)
-  X11_FIND_INCLUDE_PATH(Xkblib		X11/XKBlib.h)
-  X11_FIND_INCLUDE_PATH(Xpm		X11/xpm.h)
-  X11_FIND_INCLUDE_PATH(XTest		X11/extensions/XTest.h)
-  X11_FIND_INCLUDE_PATH(XShm		X11/extensions/XShm.h)
-  X11_FIND_INCLUDE_PATH(Xrandr		X11/extensions/Xrandr.h)
-  X11_FIND_INCLUDE_PATH(Xrender		X11/extensions/Xrender.h)
-  X11_FIND_INCLUDE_PATH(Xscreensaver	X11/extensions/scrnsaver.h)
-  X11_FIND_INCLUDE_PATH(Xshape		X11/extensions/shape.h)
-  X11_FIND_INCLUDE_PATH(Xutil		X11/Xutil.h)
-  X11_FIND_INCLUDE_PATH(Xt		X11/Intrinsic.h)
-  X11_FIND_INCLUDE_PATH(Xv		X11/extensions/Xvlib.h)
+  x11_find_include_path(ICE 		X11/ICE/ICE.h)
+  x11_find_include_path(Xaccessrules 	X11/extensions/XKBrules.h)
+  x11_find_include_path(Xaccessstr 	X11/extensions/XKBstr.h)
+  x11_find_include_path(Xau 		X11/Xauth.h)
+  x11_find_include_path(Xcomposite 	X11/extensions/Xcomposite.h)
+  x11_find_include_path(Xcursor 	X11/Xcursor/Xcursor.h)
+  x11_find_include_path(Xdamage 	X11/extensions/Xdamage.h)
+  x11_find_include_path(Xdmcp 		X11/Xdmcp.h)
+  x11_find_include_path(dpms 		X11/extensions/dpms.h)
+  x11_find_include_path(xf86misc 	X11/extensions/xf86misc.h)
+  x11_find_include_path(xf86vmode 	X11/extensions/xf86vmode.h)
+  x11_find_include_path(Xfixes		X11/extensions/Xfixes.h)
+  x11_find_include_path(Xft		X11/Xft/Xft.h)
+  x11_find_include_path(Xi		X11/extensions/XInput.h)
+  x11_find_include_path(Xinerama	X11/extensions/Xinerama.h)
+  x11_find_include_path(Xinput		X11/extensions/XInput.h)
+  x11_find_include_path(Xkb		X11/extensions/XKB.h)
+  x11_find_include_path(Xkblib		X11/XKBlib.h)
+  x11_find_include_path(Xpm		X11/xpm.h)
+  x11_find_include_path(XTest		X11/extensions/XTest.h)
+  x11_find_include_path(XShm		X11/extensions/XShm.h)
+  x11_find_include_path(Xrandr		X11/extensions/Xrandr.h)
+  x11_find_include_path(Xrender		X11/extensions/Xrender.h)
+  x11_find_include_path(Xscreensaver	X11/extensions/scrnsaver.h)
+  x11_find_include_path(Xshape		X11/extensions/shape.h)
+  x11_find_include_path(Xutil		X11/Xutil.h)
+  x11_find_include_path(Xt		X11/Intrinsic.h)
+  x11_find_include_path(Xv		X11/extensions/Xvlib.h)
   
 
   # Find primary X11 library
-  X11_FIND_LIB_PATH(X11			X11)
+  x11_find_lib_path(X11			X11)
   # Find additional X libraries. Keep list sorted by library name.
-  X11_FIND_LIB_PATH(ICE			ICE)
-  X11_FIND_LIB_PATH(SM			SM)
-  X11_FIND_LIB_PATH(Xau			Xau)
-  X11_FIND_LIB_PATH(Xcomposite		Xcomposite)
-  X11_FIND_LIB_PATH(Xcursor		Xcursor)
-  X11_FIND_LIB_PATH(Xdamage		Xdamage)
-  X11_FIND_LIB_PATH(Xdmcp		Xdmcp)
-  X11_FIND_LIB_PATH(Xext		Xext)
-  X11_FIND_LIB_PATH(Xfixes		Xfixes)
-  X11_FIND_LIB_PATH(Xft			Xft)
-  X11_FIND_LIB_PATH(Xi			Xi)
-  X11_FIND_LIB_PATH(Xinerama		Xinerama)
-  X11_FIND_LIB_PATH(Xpm			Xpm)
-  X11_FIND_LIB_PATH(Xrandr		Xrandr)
-  X11_FIND_LIB_PATH(Xrender		Xrender)
-  X11_FIND_LIB_PATH(Xscreensaver	Xss)
-  X11_FIND_LIB_PATH(Xt			Xt)
-  X11_FIND_LIB_PATH(XTest		Xtst)
-  X11_FIND_LIB_PATH(Xv			Xv)
-  X11_FIND_LIB_PATH(Xxf86misc		Xxf86misc)
+  x11_find_lib_path(ICE			ICE)
+  x11_find_lib_path(SM			SM)
+  x11_find_lib_path(Xau			Xau)
+  x11_find_lib_path(Xcomposite		Xcomposite)
+  x11_find_lib_path(Xcursor		Xcursor)
+  x11_find_lib_path(Xdamage		Xdamage)
+  x11_find_lib_path(Xdmcp		Xdmcp)
+  x11_find_lib_path(Xext		Xext)
+  x11_find_lib_path(Xfixes		Xfixes)
+  x11_find_lib_path(Xft			Xft)
+  x11_find_lib_path(Xi			Xi)
+  x11_find_lib_path(Xinerama		Xinerama)
+  x11_find_lib_path(Xpm			Xpm)
+  x11_find_lib_path(Xrandr		Xrandr)
+  x11_find_lib_path(Xrender		Xrender)
+  x11_find_lib_path(Xscreensaver	Xss)
+  x11_find_lib_path(Xt			Xt)
+  x11_find_lib_path(XTest		Xtst)
+  x11_find_lib_path(Xv			Xv)
+  x11_find_lib_path(Xxf86misc		Xxf86misc)
 
   set(X11_LIBRARY_DIR "")
   if(X11_X11_LIB)
@@ -437,69 +437,69 @@
       set(X11_X_EXTRA_LIBS "")
 
       # See if XOpenDisplay in X11 works by itself.
-      CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
+      check_library_exists("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
       if(NOT X11_LIB_X11_SOLO)
         # Find library needed for dnet_ntoa.
-        CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
+        check_library_exists("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
         if(X11_LIB_DNET_HAS_DNET_NTOA)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
         else(X11_LIB_DNET_HAS_DNET_NTOA)
-          CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
+          check_library_exists("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
           if(X11_LIB_DNET_STUB_HAS_DNET_NTOA)
-            SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
+            set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
           endif(X11_LIB_DNET_STUB_HAS_DNET_NTOA)
         endif(X11_LIB_DNET_HAS_DNET_NTOA)
       endif(NOT X11_LIB_X11_SOLO)
 
       # Find library needed for gethostbyname.
-      CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
+      check_function_exists("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
       if(NOT CMAKE_HAVE_GETHOSTBYNAME)
-        CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+        check_library_exists("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
         if(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
         else(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-          CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+          check_library_exists("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
           if(CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
-            SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
+            set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
           endif(CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
         endif(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
       endif(NOT CMAKE_HAVE_GETHOSTBYNAME)
 
       # Find library needed for connect.
-      CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT)
+      check_function_exists("connect" CMAKE_HAVE_CONNECT)
       if(NOT CMAKE_HAVE_CONNECT)
-        CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
+        check_library_exists("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
         if(CMAKE_LIB_SOCKET_HAS_CONNECT)
-          SET (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
+          set (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
         endif(CMAKE_LIB_SOCKET_HAS_CONNECT)
       endif(NOT CMAKE_HAVE_CONNECT)
 
       # Find library needed for remove.
-      CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE)
+      check_function_exists("remove" CMAKE_HAVE_REMOVE)
       if(NOT CMAKE_HAVE_REMOVE)
-        CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
+        check_library_exists("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
         if(CMAKE_LIB_POSIX_HAS_REMOVE)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
         endif(CMAKE_LIB_POSIX_HAS_REMOVE)
       endif(NOT CMAKE_HAVE_REMOVE)
 
       # Find library needed for shmat.
-      CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT)
+      check_function_exists("shmat" CMAKE_HAVE_SHMAT)
       if(NOT CMAKE_HAVE_SHMAT)
-        CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
+        check_library_exists("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
         if(CMAKE_LIB_IPS_HAS_SHMAT)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
         endif(CMAKE_LIB_IPS_HAS_SHMAT)
       endif(NOT CMAKE_HAVE_SHMAT)
     endif($ENV{ISC} MATCHES "^yes$")
 
     if(X11_ICE_FOUND)
-      CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
+      check_library_exists("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
         CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
       if(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
-        SET (X11_X_PRE_LIBS ${X11_ICE_LIB})
+        set (X11_X_PRE_LIBS ${X11_ICE_LIB})
         if(X11_SM_LIB)
-          SET (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
+          set (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
         endif(X11_SM_LIB)
       endif(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
     endif(X11_ICE_FOUND)
@@ -548,7 +548,7 @@
     endif("${LIB_PATH_CNT}" GREATER 1)
 
     include(FindPackageMessage)
-    FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
+    find_package_message(X11 "Found X11: ${X11_X11_LIB}"
       "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
   else(X11_FOUND)
     if(X11_FIND_REQUIRED)
Index: src/other/tk/CMake/CheckSystemFunctionality.cmake
===================================================================
--- src/other/tk/CMake/CheckSystemFunctionality.cmake	(revision 54114)
+++ src/other/tk/CMake/CheckSystemFunctionality.cmake	(working copy)
@@ -1,35 +1,35 @@
 # Checking compiler flags benefits from some macro logic
 
-INCLUDE(CheckCCompilerFlag)
+include(CheckCCompilerFlag)
 
-MACRO(CHECK_C_FLAG flag)
-  STRING(TOUPPER ${flag} UPPER_FLAG)
-  STRING(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
-  STRING(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
-  IF(${ARGC} LESS 2)
-    CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-  ELSE(${ARGC} LESS 2)
-    IF(NOT ${ARGV1})
-      CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-      IF(${UPPER_FLAG}_COMPILER_FLAG)
-	MESSAGE("- Found ${ARGV1} - setting to -${flag}")
-	SET(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
-      ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-    ENDIF(NOT ${ARGV1})
-  ENDIF(${ARGC} LESS 2)
-  IF(${UPPER_FLAG}_COMPILER_FLAG)
-    SET(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
-  ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-ENDMACRO()
+macro(CHECK_C_FLAG flag)
+  string(TOUPPER ${flag} UPPER_FLAG)
+  string(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
+  string(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
+  if(${ARGC} LESS 2)
+    check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+  else(${ARGC} LESS 2)
+    if(NOT ${ARGV1})
+      check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+      if(${UPPER_FLAG}_COMPILER_FLAG)
+	message("- Found ${ARGV1} - setting to -${flag}")
+	set(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
+      endif(${UPPER_FLAG}_COMPILER_FLAG)
+    endif(NOT ${ARGV1})
+  endif(${ARGC} LESS 2)
+  if(${UPPER_FLAG}_COMPILER_FLAG)
+    set(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
+  endif(${UPPER_FLAG}_COMPILER_FLAG)
+endmacro()
 
-MACRO(CHECK_C_FLAG_GATHER flag FLAGS)
-  STRING(TOUPPER ${flag} UPPER_FLAG)
-  STRING(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
-  CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-  IF(${UPPER_FLAG}_COMPILER_FLAG)
-    SET(${FLAGS} "${${FLAGS}} -${flag}")
-  ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-ENDMACRO()
+macro(CHECK_C_FLAG_GATHER flag FLAGS)
+  string(TOUPPER ${flag} UPPER_FLAG)
+  string(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
+  check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+  if(${UPPER_FLAG}_COMPILER_FLAG)
+    set(${FLAGS} "${${FLAGS}} -${flag}")
+  endif(${UPPER_FLAG}_COMPILER_FLAG)
+endmacro()
 
 
 # Automate putting variables from tests into CFLAGS,
@@ -40,78 +40,78 @@
 # If a CONFIG_CFLAGS variable is defined, they will append
 # an appropriate definition to that variable.
 
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckIncludeFileCXX)
-INCLUDE(CheckTypeSize)
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckStructHasMember)
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(ResolveCompilerPaths)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckTypeSize)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(ResolveCompilerPaths)
 
-MACRO(CONFIG_CHECK_FUNCTION_EXISTS function var)
-  CHECK_FUNCTION_EXISTS(${function} ${var})
-  IF(${var})
+macro(CONFIG_CHECK_FUNCTION_EXISTS function var)
+  check_function_exists(${function} ${var})
+  if(${var})
     add_definitions(-D${var}=1)
-  ENDIF(${var})
-ENDMACRO(CONFIG_CHECK_FUNCTION_EXISTS)
+  endif(${var})
+endmacro(CONFIG_CHECK_FUNCTION_EXISTS)
 
-MACRO(CONFIG_CHECK_INCLUDE_FILE filename var)
-  CHECK_INCLUDE_FILE(${filename} ${var})
-  IF(${var})
+macro(CONFIG_CHECK_INCLUDE_FILE filename var)
+  check_include_file(${filename} ${var})
+  if(${var})
     add_definitions(-D${var}=1)
-  ENDIF(${var})
-ENDMACRO(CONFIG_CHECK_INCLUDE_FILE)
+  endif(${var})
+endmacro(CONFIG_CHECK_INCLUDE_FILE)
 
-MACRO(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
-  CHECK_INCLUDE_FILE(${filename} HAVE_${var})
-  IF(HAVE_${var})
-    SET(HEADER_SRC "
+macro(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
+  check_include_file(${filename} HAVE_${var})
+  if(HAVE_${var})
+    set(HEADER_SRC "
 		#include <${filename}>
 		main(){};
 		")
-    CHECK_C_SOURCE_COMPILES("${HEADER_SRC}" ${var}_USABLE)
-  ENDIF(HAVE_${var})
-  IF(NOT HAVE_${var} OR NOT ${var}_USABLE)
+    check_c_source_compiles("${HEADER_SRC}" ${var}_USABLE)
+  endif(HAVE_${var})
+  if(NOT HAVE_${var} OR NOT ${var}_USABLE)
     add_definitions(-DNO_${var}=1)
-  ENDIF(NOT HAVE_${var} OR NOT ${var}_USABLE)
-ENDMACRO(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
+  endif(NOT HAVE_${var} OR NOT ${var}_USABLE)
+endmacro(CONFIG_CHECK_INCLUDE_FILE_USABILITY filename var)
 
-MACRO(CONFIG_CHECK_INCLUDE_FILE_CXX filename var)
-  CHECK_INCLUDE_FILE_CXX(${filename} ${var})
-  IF(${var})
+macro(CONFIG_CHECK_INCLUDE_FILE_CXX filename var)
+  check_include_file_cxx(${filename} ${var})
+  if(${var})
     add_definitions(-D${var}=1)
-  ENDIF(${var})
-ENDMACRO(CONFIG_CHECK_INCLUDE_FILE_CXX)
+  endif(${var})
+endmacro(CONFIG_CHECK_INCLUDE_FILE_CXX)
 
-MACRO(CONFIG_CHECK_TYPE_SIZE typename var)
-  FOREACH(arg ${ARGN})
-    SET(headers ${headers} ${arg})
-  ENDFOREACH(arg ${ARGN})
-  SET(CHECK_EXTRA_INCLUDE_FILES ${headers})
-  CHECK_TYPE_SIZE(${typename} HAVE_${var}_T)
-  SET(CHECK_EXTRA_INCLUDE_FILES)
-  IF(HAVE_${var}_T)
+macro(CONFIG_CHECK_TYPE_SIZE typename var)
+  foreach(arg ${ARGN})
+    set(headers ${headers} ${arg})
+  endforeach(arg ${ARGN})
+  set(CHECK_EXTRA_INCLUDE_FILES ${headers})
+  check_type_size(${typename} HAVE_${var}_T)
+  set(CHECK_EXTRA_INCLUDE_FILES)
+  if(HAVE_${var}_T)
     add_definitions(-DHAVE_${var}_T=1)
     add_definitions(-DSIZEOF${var}=${HAVE_${var}_T})		
-  ENDIF(HAVE_${var}_T)
-ENDMACRO(CONFIG_CHECK_TYPE_SIZE)
+  endif(HAVE_${var}_T)
+endmacro(CONFIG_CHECK_TYPE_SIZE)
 
-MACRO(CONFIG_CHECK_STRUCT_HAS_MEMBER structname member header var)
-  CHECK_STRUCT_HAS_MEMBER(${structname} ${member} ${header} HAVE_${var})
-  IF(HAVE_${var})
+macro(CONFIG_CHECK_STRUCT_HAS_MEMBER structname member header var)
+  check_struct_has_member(${structname} ${member} ${header} HAVE_${var})
+  if(HAVE_${var})
     add_definitions(-DHAVE_${var}=1)
-  ENDIF(HAVE_${var})
-ENDMACRO(CONFIG_CHECK_STRUCT_HAS_MEMBER)
+  endif(HAVE_${var})
+endmacro(CONFIG_CHECK_STRUCT_HAS_MEMBER)
 
-MACRO(CONFIG_CHECK_LIBRARY targetname lname func)
-  IF(NOT ${targetname}_LIBRARY)
-    CHECK_LIBRARY_EXISTS(${lname} ${func} "" HAVE_${targetname}_${lname})
-    IF(HAVE_${targetname}_${lname})
-      RESOLVE_LIBRARIES(${targetname}_LIBRARY "-l${lname}")
-      SET(${targetname}_LINKOPT "-l${lname}")
-    ENDIF(HAVE_${targetname}_${lname})
-  ENDIF(NOT ${targetname}_LIBRARY)
-ENDMACRO(CONFIG_CHECK_LIBRARY lname func)
+macro(CONFIG_CHECK_LIBRARY targetname lname func)
+  if(NOT ${targetname}_LIBRARY)
+    check_library_exists(${lname} ${func} "" HAVE_${targetname}_${lname})
+    if(HAVE_${targetname}_${lname})
+      resolve_libraries(${targetname}_LIBRARY "-l${lname}")
+      set(${targetname}_LINKOPT "-l${lname}")
+    endif(HAVE_${targetname}_${lname})
+  endif(NOT ${targetname}_LIBRARY)
+endmacro(CONFIG_CHECK_LIBRARY lname func)
 
Index: src/other/tk/CMake/FindTIMEZONE.cmake
===================================================================
--- src/other/tk/CMake/FindTIMEZONE.cmake	(revision 54114)
+++ src/other/tk/CMake/FindTIMEZONE.cmake	(working copy)
@@ -5,16 +5,16 @@
 #
 #=============================================================================
 
-SET(TZ_SEARCH_PATHS
+set(TZ_SEARCH_PATHS
 	/usr/share/zoneinfo
 	/usr/share/lib/zoneinfo
 	/usr/lib/zoneinfo
 	)
-FIND_PATH(TIMEZONE_DATA_DIR UTC PATHS ${TZ_SEARCH_PATHS} NO_DEFAULT_PATH)
-MARK_AS_ADVANCED(TIMEZONE_DATA_DIR)
+find_path(TIMEZONE_DATA_DIR UTC PATHS ${TZ_SEARCH_PATHS} NO_DEFAULT_PATH)
+mark_as_advanced(TIMEZONE_DATA_DIR)
 
 # handle the QUIETLY and REQUIRED arguments and set REGEX_FOUND to TRUE if 
 # all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIMEZONE DEFAULT_MSG TIMEZONE_DATA_DIR)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(TIMEZONE DEFAULT_MSG TIMEZONE_DATA_DIR)
 
Index: src/other/tk/CMake/ac_std_funcs.cmake
===================================================================
--- src/other/tk/CMake/ac_std_funcs.cmake	(revision 54114)
+++ src/other/tk/CMake/ac_std_funcs.cmake	(working copy)
@@ -1,97 +1,97 @@
 # Standard tests and wrappers for CMake functions
 
-INCLUDE(CheckCCompilerFlag)
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckIncludeFileCXX)
-INCLUDE(CheckTypeSize)
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckStructHasMember)
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(ResolveCompilerPaths)
+include(CheckCCompilerFlag)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckTypeSize)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(ResolveCompilerPaths)
 
-SET(CMAKE_TEST_SRCS_DIR "NOTFOUND")
-FOREACH($candidate_dir ${CMAKE_MODULE_PATH})
-	IF(NOT CMAKE_TEST_SRCS_DIR)
-		IF(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
-			SET(CMAKE_TEST_SRCS_DIR ${candidate_dir}/test_sources)
-		ENDIF(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
-	ENDIF(NOT CMAKE_TEST_SRCS_DIR)
-ENDFOREACH($candidate_dir ${CMAKE_MODULE_PATH})
+set(CMAKE_TEST_SRCS_DIR "NOTFOUND")
+foreach($candidate_dir ${CMAKE_MODULE_PATH})
+	if(NOT CMAKE_TEST_SRCS_DIR)
+		if(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
+			set(CMAKE_TEST_SRCS_DIR ${candidate_dir}/test_sources)
+		endif(EXISTS "${candidate_dir}/test_sources" AND IS_DIRECTORY "${candidate_dir}/test_sources")
+	endif(NOT CMAKE_TEST_SRCS_DIR)
+endforeach($candidate_dir ${CMAKE_MODULE_PATH})
 
-INCLUDE(CheckPrototypeExists)
-INCLUDE(CheckCSourceRuns)
-INCLUDE(CheckCSourceRuns)
+include(CheckPrototypeExists)
+include(CheckCSourceRuns)
+include(CheckCSourceRuns)
 
-MACRO(CHECK_BASENAME_D)
-	SET(BASENAME_SRC "
+macro(CHECK_BASENAME_D)
+	set(BASENAME_SRC "
 	#include <libgen.h>
 	int main(int argc, char *argv[]) {
 	(void)basename(argv[0]);
 	return 0;
 	}")
-	CHECK_C_SOURCE_RUNS("${BASENAME_SRC}" HAVE_BASENAME)
-	IF(HAVE_BASENAME)
+	check_c_source_runs("${BASENAME_SRC}" HAVE_BASENAME)
+	if(HAVE_BASENAME)
 	  add_definitions(-DHAVE_BASENAME=1)
-	ENDIF(HAVE_BASENAME)
-ENDMACRO(CHECK_BASENAME_D)
+	endif(HAVE_BASENAME)
+endmacro(CHECK_BASENAME_D)
 
-MACRO(CHECK_DIRNAME_D)
-	SET(DIRNAME_SRC "
+macro(CHECK_DIRNAME_D)
+	set(DIRNAME_SRC "
 	#include <libgen.h>
 	int main(int argc, char *argv[]) {
 	(void)dirname(argv[0]);
 	return 0;
 	}")
-	CHECK_C_SOURCE_RUNS("${DIRNAME_SRC}" HAVE_DIRNAME)
-	IF(HAVE_DIRNAME)
+	check_c_source_runs("${DIRNAME_SRC}" HAVE_DIRNAME)
+	if(HAVE_DIRNAME)
 		add_definitions(-DHAVE_DIRNAME=1)
-	ENDIF(HAVE_DIRNAME)
-ENDMACRO(CHECK_DIRNAME_D)
+	endif(HAVE_DIRNAME)
+endmacro(CHECK_DIRNAME_D)
 
 # Based on AC_HEADER_STDC - using the source code for ctype
 # checking found in the generated configure file
-MACRO(CMAKE_HEADER_STDC_D)
-  CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-  IF(HAVE_STDLIB_H)
+macro(CMAKE_HEADER_STDC_D)
+  check_include_file(stdlib.h HAVE_STDLIB_H)
+  if(HAVE_STDLIB_H)
   add_definitions(-DHAVE_STDLIB_H=1)
-  ENDIF(HAVE_STDLIB_H)
-  CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
-  CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-  IF(HAVE_STRING_H)
+  endif(HAVE_STDLIB_H)
+  check_include_file(stdarg.h HAVE_STDARG_H)
+  check_include_file(string.h HAVE_STRING_H)
+  if(HAVE_STRING_H)
   add_definitions(-DHAVE_STRING_H=1)
-  ENDIF(HAVE_STRING_H)
-  CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-  IF(HAVE_STRINGS_H)
+  endif(HAVE_STRING_H)
+  check_include_file(strings.h HAVE_STRINGS_H)
+  if(HAVE_STRINGS_H)
   add_definitions(-DHAVE_STRINGS_H=1)
-  ENDIF(HAVE_STRINGS_H)
-  CHECK_INCLUDE_FILE(float.h HAVE_FLOAT_H)
-  CHECK_PROTOTYPE_EXISTS(memchr string.h HAVE_STRING_H_MEMCHR)
-  CHECK_PROTOTYPE_EXISTS(free stdlib.h HAVE_STDLIB_H_FREE)
-  CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/ctypes_test.c WORKING_CTYPE_MACROS)
-  IF(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
+  endif(HAVE_STRINGS_H)
+  check_include_file(float.h HAVE_FLOAT_H)
+  check_prototype_exists(memchr string.h HAVE_STRING_H_MEMCHR)
+  check_prototype_exists(free stdlib.h HAVE_STDLIB_H_FREE)
+  check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/ctypes_test.c WORKING_CTYPE_MACROS)
+  if(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
 	 add_definitions(-DSTDC_HEADERS=1)
-  ENDIF(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
-ENDMACRO(CMAKE_HEADER_STDC_D)
+  endif(HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H AND WORKING_CTYPE_MACROS)
+endmacro(CMAKE_HEADER_STDC_D)
 
 # Based on AC_HEADER_SYS_WAIT
-MACRO(CMAKE_HEADER_SYS_WAIT_D)
-  CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/sys_wait_test.c WORKING_SYS_WAIT)
-  IF(WORKING_SYS_WAIT)
+macro(CMAKE_HEADER_SYS_WAIT_D)
+  check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/sys_wait_test.c WORKING_SYS_WAIT)
+  if(WORKING_SYS_WAIT)
 	 add_definitions(-DHAVE_SYS_WAIT_H=1)
-  ENDIF(WORKING_SYS_WAIT)
-ENDMACRO(CMAKE_HEADER_SYS_WAIT_D)
+  endif(WORKING_SYS_WAIT)
+endmacro(CMAKE_HEADER_SYS_WAIT_D)
 
 # Based on AC_FUNC_ALLOCA
-MACRO(CMAKE_ALLOCA_D)
-	CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/alloca_header_test.c WORKING_ALLOCA_H)
-	IF(WORKING_ALLOCA_H)
+macro(CMAKE_ALLOCA_D)
+	check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/alloca_header_test.c WORKING_ALLOCA_H)
+	if(WORKING_ALLOCA_H)
 		add_definitions(-DHAVE_ALLOCA_H=1)
-	ENDIF(WORKING_ALLOCA_H)
-	CHECK_C_SOURCE_RUNS(${CMAKE_TEST_SRCS_DIR}/alloca_test.c WORKING_ALLOCA)
-	IF(WORKING_ALLOCA)
+	endif(WORKING_ALLOCA_H)
+	check_c_source_runs(${CMAKE_TEST_SRCS_DIR}/alloca_test.c WORKING_ALLOCA)
+	if(WORKING_ALLOCA)
 		add_definitions(-DHAVE_ALLOCA=1)
-	ENDIF(WORKING_ALLOCA)
-ENDMACRO(CMAKE_ALLOCA_D)
+	endif(WORKING_ALLOCA)
+endmacro(CMAKE_ALLOCA_D)
 
Index: src/other/tk/CMake/FindFontconfig.cmake
===================================================================
--- src/other/tk/CMake/FindFontconfig.cmake	(revision 54114)
+++ src/other/tk/CMake/FindFontconfig.cmake	(working copy)
@@ -62,7 +62,7 @@
   )
 
   include(FindPackageHandleStandardArgs)
-  FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR )
+  find_package_handle_standard_args(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR )
   
   mark_as_advanced(FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR)
 
Index: src/other/tk/CMake/tcl.cmake
===================================================================
--- src/other/tk/CMake/tcl.cmake	(revision 54114)
+++ src/other/tk/CMake/tcl.cmake	(working copy)
@@ -1,99 +1,99 @@
 # CMake version of the tcl.m4 logic, insofar as it maps to CMake and has been
 # needed.
 
-INCLUDE(CheckCCompilerFlag)
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(CheckIncludeFileCXX)
-INCLUDE(CheckTypeSize)
-INCLUDE(CheckLibraryExists)
-INCLUDE(CheckStructHasMember)
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(ResolveCompilerPaths)
-INCLUDE(CheckPrototypeExists)
-INCLUDE(CheckCSourceRuns)
-INCLUDE(CheckCSourceRuns)
+include(CheckCCompilerFlag)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckTypeSize)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckCSourceCompiles)
+include(ResolveCompilerPaths)
+include(CheckPrototypeExists)
+include(CheckCSourceRuns)
+include(CheckCSourceRuns)
 
-INCLUDE(ac_std_funcs)
+include(ac_std_funcs)
 
-MACRO(ADD_TCL_CFLAG TCL_CFLAG)
+macro(ADD_TCL_CFLAG TCL_CFLAG)
 	add_definitions(-D${TCL_CFLAG}=1)
-ENDMACRO(ADD_TCL_CFLAG)
+endmacro(ADD_TCL_CFLAG)
 
-MACRO(CHECK_C_FLAG flag)
-   STRING(TOUPPER ${flag} UPPER_FLAG)
-   STRING(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
-   STRING(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
-   IF(${ARGC} LESS 2)
-      CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-   ELSE(${ARGC} LESS 2)
-      IF(NOT ${ARGV1})
-         CHECK_C_COMPILER_FLAG(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
-         IF(${UPPER_FLAG}_COMPILER_FLAG)
-            MESSAGE("- Found ${ARGV1} - setting to -${flag}")
-            SET(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
-         ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-      ENDIF(NOT ${ARGV1})
-   ENDIF(${ARGC} LESS 2)
-   IF(${UPPER_FLAG}_COMPILER_FLAG)
-      SET(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
-   ENDIF(${UPPER_FLAG}_COMPILER_FLAG)
-ENDMACRO()
+macro(CHECK_C_FLAG flag)
+   string(TOUPPER ${flag} UPPER_FLAG)
+   string(REGEX REPLACE " " "_" UPPER_FLAG ${UPPER_FLAG})
+   string(REGEX REPLACE "=" "_" UPPER_FLAG ${UPPER_FLAG})
+   if(${ARGC} LESS 2)
+      check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+   else(${ARGC} LESS 2)
+      if(NOT ${ARGV1})
+         check_c_compiler_flag(-${flag} ${UPPER_FLAG}_COMPILER_FLAG)
+         if(${UPPER_FLAG}_COMPILER_FLAG)
+            message("- Found ${ARGV1} - setting to -${flag}")
+            set(${ARGV1} "-${flag}" CACHE STRING "${ARGV1}" FORCE)
+         endif(${UPPER_FLAG}_COMPILER_FLAG)
+      endif(NOT ${ARGV1})
+   endif(${ARGC} LESS 2)
+   if(${UPPER_FLAG}_COMPILER_FLAG)
+      set(${UPPER_FLAG}_COMPILER_FLAG "-${flag}")
+   endif(${UPPER_FLAG}_COMPILER_FLAG)
+endmacro()
 
 # Wrappers for include file checks
-MACRO(TCL_CHECK_INCLUDE_FILE filename var)
-	CHECK_INCLUDE_FILE(${filename} ${var})
-	IF(${var})
+macro(TCL_CHECK_INCLUDE_FILE filename var)
+	check_include_file(${filename} ${var})
+	if(${var})
 		add_definitions(-D${var}=1)
-	ENDIF(${var})
-ENDMACRO(TCL_CHECK_INCLUDE_FILE)
+	endif(${var})
+endmacro(TCL_CHECK_INCLUDE_FILE)
 
-MACRO(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
-	CHECK_INCLUDE_FILE(${filename} HAVE_${var})
-	IF(HAVE_${var})
-		SET(HEADER_SRC "
+macro(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
+	check_include_file(${filename} HAVE_${var})
+	if(HAVE_${var})
+		set(HEADER_SRC "
 #include <${filename}>
 main(){};
 		")
-		CHECK_C_SOURCE_COMPILES("${HEADER_SRC}" ${var}_USABLE)
-	ENDIF(HAVE_${var})
-	IF(NOT HAVE_${var} OR NOT ${var}_USABLE)
+		check_c_source_compiles("${HEADER_SRC}" ${var}_USABLE)
+	endif(HAVE_${var})
+	if(NOT HAVE_${var} OR NOT ${var}_USABLE)
 		add_definitions(-DNO_${var}=1)
-	ELSE(NOT HAVE_${var} OR NOT ${var}_USABLE)
+	else(NOT HAVE_${var} OR NOT ${var}_USABLE)
 		add_definitions(-DHAVE_${var}=1)
-	ENDIF(NOT HAVE_${var} OR NOT ${var}_USABLE)
-ENDMACRO(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
+	endif(NOT HAVE_${var} OR NOT ${var}_USABLE)
+endmacro(TCL_CHECK_INCLUDE_FILE_USABILITY filename var)
 
 # Wrapper for function testing
-MACRO(TCL_CHECK_FUNCTION_EXISTS function var)
-	CHECK_FUNCTION_EXISTS(${function} ${var})
-	IF(${var})
+macro(TCL_CHECK_FUNCTION_EXISTS function var)
+	check_function_exists(${function} ${var})
+	if(${var})
 		add_definitions(-D${var}=1)
-	ENDIF(${var})
-ENDMACRO(TCL_CHECK_FUNCTION_EXISTS)
+	endif(${var})
+endmacro(TCL_CHECK_FUNCTION_EXISTS)
 
 # Check sizes (accepts extra headers)
-MACRO(TCL_CHECK_TYPE_SIZE typename var)
-   FOREACH(arg ${ARGN})
-      SET(headers ${headers} ${arg})
-   ENDFOREACH(arg ${ARGN})
-   SET(CHECK_EXTRA_INCLUDE_FILES ${headers})
-   CHECK_TYPE_SIZE(${typename} HAVE_${var}_T)
-   SET(CHECK_EXTRA_INCLUDE_FILES)
-   IF(HAVE_${var}_T)
+macro(TCL_CHECK_TYPE_SIZE typename var)
+   foreach(arg ${ARGN})
+      set(headers ${headers} ${arg})
+   endforeach(arg ${ARGN})
+   set(CHECK_EXTRA_INCLUDE_FILES ${headers})
+   check_type_size(${typename} HAVE_${var}_T)
+   set(CHECK_EXTRA_INCLUDE_FILES)
+   if(HAVE_${var}_T)
       add_definitions(-DHAVE_${var}_T=1)
       add_definitions(-DSIZEOF${var}=${HAVE_${var}_T})
-   ENDIF(HAVE_${var}_T)
-ENDMACRO(TCL_CHECK_TYPE_SIZE)
+   endif(HAVE_${var}_T)
+endmacro(TCL_CHECK_TYPE_SIZE)
 
 # Check for a member of a structure
-MACRO(TCL_CHECK_STRUCT_HAS_MEMBER structname member header var)
-   CHECK_STRUCT_HAS_MEMBER(${structname} ${member} ${header} HAVE_${var})
-   IF(HAVE_${var})
+macro(TCL_CHECK_STRUCT_HAS_MEMBER structname member header var)
+   check_struct_has_member(${structname} ${member} ${header} HAVE_${var})
+   if(HAVE_${var})
       add_definitions(-DHAVE_${var}=1)
-   ENDIF(HAVE_${var})
-ENDMACRO(TCL_CHECK_STRUCT_HAS_MEMBER)
+   endif(HAVE_${var})
+endmacro(TCL_CHECK_STRUCT_HAS_MEMBER)
 
 
 
@@ -153,42 +153,42 @@
 #------------------------------------------------------------------------
 # SC_ENABLE_THREADS
 #------------------------------------------------------------------------
-MACRO(SC_ENABLE_THREADS)
-   FIND_PACKAGE(Threads)
-   IF(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
-		SET(TCL_FOUND_THREADS ON)
-   ELSE(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
-		SET(TCL_FOUND_THREADS OFF)
-   ENDIF(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
-	OPTION(TCL_THREADS "Enable Tcl Thread support" ${TCL_FOUND_THREADS})
-   IF(TCL_THREADS)
-		ADD_TCL_CFLAG(TCL_THREADS)
-		ADD_TCL_CFLAG(USE_THREAD_ALLOC)
-		ADD_TCL_CFLAG(_REENTRANT)
-		ADD_TCL_CFLAG(_THREAD_SAFE)
-	   SET(TCL_THREADS_LIB ${CMAKE_THREAD_LIBS_INIT})
-		IF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
-			ADD_TCL_CFLAG(_POSIX_PTHREAD_SEMANTICS)
-		ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
-		CHECK_FUNCTION_EXISTS(pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-		IF(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-			ADD_TCL_CFLAG(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-		ENDIF(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
-		CHECK_FUNCTION_EXISTS(pthread_attr_get_np HAVE_PTHREAD_ATTR_GET_NP)
-		CHECK_FUNCTION_EXISTS(pthread_getattr_np HAVE_PTHREAD_GETATTR_NP)
-		IF(HAVE_PTHREAD_ATTR_GET_NP)
-			ADD_TCL_CFLAG(HAVE_PTHREAD_ATTR_GET_NP)
-		ELSEIF(HAVE_PTHREAD_GETATTR_NP)
-			ADD_TCL_CFLAG(HAVE_PTHREAD_GETATTR_NP)
-		ENDIF(HAVE_PTHREAD_ATTR_GET_NP)
-		IF(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
-			CHECK_FUNCTION_EXISTS(pthread_get_stacksize_np HAVE_PTHREAD_GET_STACKSIZE_NP)
-			IF(HAVE_PTHREAD_GET_STACKSIZE_NP)
-				ADD_TCL_CFLAG(HAVE_PTHREAD_GET_STACKSIZE_NP)
-			ENDIF(HAVE_PTHREAD_GET_STACKSIZE_NP)
-		ENDIF(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
-	ENDIF(TCL_THREADS)
-ENDMACRO(SC_ENABLE_THREADS)
+macro(SC_ENABLE_THREADS)
+   find_package(Threads)
+   if(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
+		set(TCL_FOUND_THREADS ON)
+   else(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
+		set(TCL_FOUND_THREADS OFF)
+   endif(NOT ${CMAKE_THREAD_LIBS_INIT} STREQUAL "")
+	option(TCL_THREADS "Enable Tcl Thread support" ${TCL_FOUND_THREADS})
+   if(TCL_THREADS)
+		add_tcl_cflag(TCL_THREADS)
+		add_tcl_cflag(USE_THREAD_ALLOC)
+		add_tcl_cflag(_REENTRANT)
+		add_tcl_cflag(_THREAD_SAFE)
+	   set(TCL_THREADS_LIB ${CMAKE_THREAD_LIBS_INIT})
+		if(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+			add_tcl_cflag(_POSIX_PTHREAD_SEMANTICS)
+		endif(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+		check_function_exists(pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+		if(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+			add_tcl_cflag(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+		endif(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
+		check_function_exists(pthread_attr_get_np HAVE_PTHREAD_ATTR_GET_NP)
+		check_function_exists(pthread_getattr_np HAVE_PTHREAD_GETATTR_NP)
+		if(HAVE_PTHREAD_ATTR_GET_NP)
+			add_tcl_cflag(HAVE_PTHREAD_ATTR_GET_NP)
+		elseif(HAVE_PTHREAD_GETATTR_NP)
+			add_tcl_cflag(HAVE_PTHREAD_GETATTR_NP)
+		endif(HAVE_PTHREAD_ATTR_GET_NP)
+		if(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
+			check_function_exists(pthread_get_stacksize_np HAVE_PTHREAD_GET_STACKSIZE_NP)
+			if(HAVE_PTHREAD_GET_STACKSIZE_NP)
+				add_tcl_cflag(HAVE_PTHREAD_GET_STACKSIZE_NP)
+			endif(HAVE_PTHREAD_GET_STACKSIZE_NP)
+		endif(NOT HAVE_PTHREAD_ATTR_GET_NP AND NOT HAVE_PTHREAD_GETATTR_NP)
+	endif(TCL_THREADS)
+endmacro(SC_ENABLE_THREADS)
 
 #------------------------------------------------------------------------
 # SC_ENABLE_SYMBOLS
@@ -199,28 +199,28 @@
 #------------------------------------------------------------------------
 # SC_ENABLE_LANGINFO
 #------------------------------------------------------------------------
-MACRO(SC_ENABLE_LANGINFO)
+macro(SC_ENABLE_LANGINFO)
 	set(TCL_ENABLE_LANGINFO ON CACHE STRING "Trigger use of nl_langinfo if available.")
-	IF(TCL_ENABLE_LANGINFO)
-		CHECK_INCLUDE_FILE(langinfo.h HAVE_LANGINFO)
-		IF(HAVE_LANGINFO)
-			SET(LANGINFO_SRC "
+	if(TCL_ENABLE_LANGINFO)
+		check_include_file(langinfo.h HAVE_LANGINFO)
+		if(HAVE_LANGINFO)
+			set(LANGINFO_SRC "
 			#include <langinfo.h>
 			int main() {
 			nl_langinfo(CODESET);
 			}
 			")
-			CHECK_C_SOURCE_COMPILES("${LANGINFO_SRC}" LANGINFO_COMPILES)
-			IF(LANGINFO_COMPILES)
-				ADD_TCL_CFLAG(HAVE_LANGINFO)
-			ELSE(LANGINFO_COMPILES)
-				SET(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
-			ENDIF(LANGINFO_COMPILES)
-		ELSE(HAVE_LANGINFO)
-			SET(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
-		ENDIF(HAVE_LANGINFO)
-	ENDIF(TCL_ENABLE_LANGINFO)
-ENDMACRO(SC_ENABLE_LANGINFO)
+			check_c_source_compiles("${LANGINFO_SRC}" LANGINFO_COMPILES)
+			if(LANGINFO_COMPILES)
+				add_tcl_cflag(HAVE_LANGINFO)
+			else(LANGINFO_COMPILES)
+				set(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
+			endif(LANGINFO_COMPILES)
+		else(HAVE_LANGINFO)
+			set(TCL_ENABLE_LANGINFO OFF CACHE STRING "Langinfo not available" FORCE)
+		endif(HAVE_LANGINFO)
+	endif(TCL_ENABLE_LANGINFO)
+endmacro(SC_ENABLE_LANGINFO)
 
 #--------------------------------------------------------------------
 # SC_CONFIG_MANPAGES
@@ -245,8 +245,8 @@
 #--------------------------------------------------------------------
 # SC_SERIAL_PORT
 #--------------------------------------------------------------------
-MACRO(SC_SERIAL_PORT)
-	SET(TERMIOS_SRC_1 "
+macro(SC_SERIAL_PORT)
+	set(TERMIOS_SRC_1 "
 #include <termios.h>
 int main() {
 struct termios t;
@@ -258,7 +258,7 @@
 	return 1;
 }
 	")
-	SET(TERMIOS_SRC_2 "
+	set(TERMIOS_SRC_2 "
 #include <termios.h>
 #include <errno.h>
 
@@ -273,7 +273,7 @@
 	return 1;
 }
 	")
-	SET(TERMIO_SRC_1 "
+	set(TERMIO_SRC_1 "
 #include <termio.h>
 int main() {
 struct termio t;
@@ -284,7 +284,7 @@
 	return 1;
 }
    ")
-	SET(TERMIO_SRC_2 "
+	set(TERMIO_SRC_2 "
 #include <termio.h>
 #include <errno.h>
 
@@ -298,7 +298,7 @@
 	return 1;
 }
 	")
-	SET(SGTTY_SRC_1 "
+	set(SGTTY_SRC_1 "
 #include <sgtty.h>
 int main() {
 struct sgttyb t;
@@ -310,7 +310,7 @@
 	return 1;
 }
    ")
-	SET(SGTTY_SRC_2 "
+	set(SGTTY_SRC_2 "
 #include <sgtty.h>
 #include <errno.h>
 
@@ -325,57 +325,57 @@
 	return 1;
 }
 	")
-	CHECK_C_SOURCE_RUNS("${TERMIOS_SRC_1}" HAVE_TERMIOS)
-	IF(NOT HAVE_TERMIOS)
-		CHECK_C_SOURCE_RUNS("${TERMIO_SRC_1}" HAVE_TERMIO)
-	ENDIF(NOT HAVE_TERMIOS)
-	IF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-		CHECK_C_SOURCE_RUNS("${SGTTY_SRC_1}" HAVE_SGTTY)
-	ENDIF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-	IF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
-		CHECK_C_SOURCE_RUNS("${TERMIOS_SRC_2}" HAVE_TERMIOS)
-		IF(NOT HAVE_TERMIOS)
-			CHECK_C_SOURCE_RUNS("${TERMIO_SRC_2}" HAVE_TERMIO)
-		ENDIF(NOT HAVE_TERMIOS)
-		IF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-			CHECK_C_SOURCE_RUNS("${SGTTY_SRC_2}" HAVE_SGTTY)
-		ENDIF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
-	ENDIF(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
+	check_c_source_runs("${TERMIOS_SRC_1}" HAVE_TERMIOS)
+	if(NOT HAVE_TERMIOS)
+		check_c_source_runs("${TERMIO_SRC_1}" HAVE_TERMIO)
+	endif(NOT HAVE_TERMIOS)
+	if(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+		check_c_source_runs("${SGTTY_SRC_1}" HAVE_SGTTY)
+	endif(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+	if(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
+		check_c_source_runs("${TERMIOS_SRC_2}" HAVE_TERMIOS)
+		if(NOT HAVE_TERMIOS)
+			check_c_source_runs("${TERMIO_SRC_2}" HAVE_TERMIO)
+		endif(NOT HAVE_TERMIOS)
+		if(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+			check_c_source_runs("${SGTTY_SRC_2}" HAVE_SGTTY)
+		endif(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS)
+	endif(NOT HAVE_TERMIO AND NOT HAVE_TERMIOS AND NOT HAVE_SGTTY)
 
-	IF(HAVE_TERMIOS)
-		ADD_TCL_CFLAG(USE_TERMIOS)
-	ELSE(HAVE_TERMIOS)
-		IF(HAVE_TERMIO)
-		   ADD_TCL_CFLAG(USE_TERMIO)
-		ELSE(HAVE_TERMIO)
-			IF(HAVE_SGTTY)
-				ADD_TCL_CFLAG(USE_SGTTY)
-			ENDIF(HAVE_SGTTY)
-		ENDIF(HAVE_TERMIO)
-	ENDIF(HAVE_TERMIOS)
-ENDMACRO(SC_SERIAL_PORT)
+	if(HAVE_TERMIOS)
+		add_tcl_cflag(USE_TERMIOS)
+	else(HAVE_TERMIOS)
+		if(HAVE_TERMIO)
+		   add_tcl_cflag(USE_TERMIO)
+		else(HAVE_TERMIO)
+			if(HAVE_SGTTY)
+				add_tcl_cflag(USE_SGTTY)
+			endif(HAVE_SGTTY)
+		endif(HAVE_TERMIO)
+	endif(HAVE_TERMIOS)
+endmacro(SC_SERIAL_PORT)
 
 
 #--------------------------------------------------------------------
 # SC_MISSING_POSIX_HEADERS
 #--------------------------------------------------------------------
-MACRO(SC_MISSING_POSIX_HEADERS)
-	TCL_CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
-	IF(NOT HAVE_DIRENT_H)
+macro(SC_MISSING_POSIX_HEADERS)
+	tcl_check_include_file(dirent.h HAVE_DIRENT_H)
+	if(NOT HAVE_DIRENT_H)
 		add_definitions(-DNO_DIRENT_H=1)
-	ENDIF(NOT HAVE_DIRENT_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(float.h FLOAT_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(values.h VALUES_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(limits.h LIMITS_H)
-	TCL_CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-	TCL_CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-	IF(NOT HAVE_STRING_H)
+	endif(NOT HAVE_DIRENT_H)
+	tcl_check_include_file_usability(float.h FLOAT_H)
+	tcl_check_include_file_usability(values.h VALUES_H)
+	tcl_check_include_file_usability(limits.h LIMITS_H)
+	tcl_check_include_file(stdlib.h HAVE_STDLIB_H)
+	tcl_check_include_file(string.h HAVE_STRING_H)
+	if(NOT HAVE_STRING_H)
 		add_definitions(-DNO_STRING_H=1)
-	ENDIF(NOT HAVE_STRING_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(sys/wait.h SYS_WAIT_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(dlfcn.h DLFCN_H)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(sys/param.h SYS_PARAM_H)
-ENDMACRO(SC_MISSING_POSIX_HEADERS)
+	endif(NOT HAVE_STRING_H)
+	tcl_check_include_file_usability(sys/wait.h SYS_WAIT_H)
+	tcl_check_include_file_usability(dlfcn.h DLFCN_H)
+	tcl_check_include_file_usability(sys/param.h SYS_PARAM_H)
+endmacro(SC_MISSING_POSIX_HEADERS)
 
 
 #--------------------------------------------------------------------
@@ -387,17 +387,17 @@
 #--------------------------------------------------------------------
 # SC_BLOCKING_STYLE
 #--------------------------------------------------------------------
-TCL_CHECK_INCLUDE_FILE(sys/ioctl.h HAVE_SYS_IOCTL_H) 
-TCL_CHECK_INCLUDE_FILE(sys/filio.h HAVE_SYS_FILIO_H)
-IF(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
-	ADD_TCL_CFLAG(USE_FIONBIO)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
-IF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
-	STRING(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
-	IF (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
-		ADD_TCL_CFLAG(USE_FIONBIO)
-	ENDIF (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
-ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+tcl_check_include_file(sys/ioctl.h HAVE_SYS_IOCTL_H) 
+tcl_check_include_file(sys/filio.h HAVE_SYS_FILIO_H)
+if(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
+	add_tcl_cflag(USE_FIONBIO)
+endif(${CMAKE_SYSTEM_NAME} MATCHES "^OSF.*")
+if(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
+	string(REGEX REPLACE "\\..*" "" CMAKE_SYSTEM_MAJOR_VERSION ${CMAKE_SYSTEM_VERSION})
+	if (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
+		add_tcl_cflag(USE_FIONBIO)
+	endif (${CMAKE_SYSTEM_MAJOR_VERSION} LESS 5)
+endif(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$")
 
 #--------------------------------------------------------------------
 # SC_TIME_HANLDER
@@ -408,13 +408,13 @@
 # TODO - tzname testing from AC_STRUCT_TIMEZONE is incomplete
 #
 #--------------------------------------------------------------------
-MACRO(SC_TIME_HANDLER)
-	TCL_CHECK_INCLUDE_FILE_USABILITY(sys/time.h SYS_TIME_H)
-	TCL_CHECK_STRUCT_HAS_MEMBER("struct tm" tm_zone time.h STRUCT_TM_TM_ZONE)
-	IF(HAVE_STRUCT_TM_TM_ZONE)
-		ADD_TCL_CFLAG(HAVE_TM_ZONE)
-	ELSE(HAVE_STRUCT_TM_TM_ZONE)
-		SET(TZNAME_SRC "
+macro(SC_TIME_HANDLER)
+	tcl_check_include_file_usability(sys/time.h SYS_TIME_H)
+	tcl_check_struct_has_member("struct tm" tm_zone time.h STRUCT_TM_TM_ZONE)
+	if(HAVE_STRUCT_TM_TM_ZONE)
+		add_tcl_cflag(HAVE_TM_ZONE)
+	else(HAVE_STRUCT_TM_TM_ZONE)
+		set(TZNAME_SRC "
 #include <time.h>
 int main () {
 #ifndef tzname
@@ -422,17 +422,17 @@
 #endif
 return 0;
 }")
-      CHECK_C_SOURCE_COMPILES("${TZNAME_SRC}" HAVE_TZNAME)
-		IF(HAVE_TZNAME)
-			ADD_TCL_CFLAG(HAVE_DECL_TZNAME)
-		ENDIF(HAVE_TZNAME)
-	ENDIF(HAVE_STRUCT_TM_TM_ZONE)
-	TCL_CHECK_FUNCTION_EXISTS(gmtime_r HAVE_GMTIME_R)
-	TCL_CHECK_FUNCTION_EXISTS(localtime_r HAVE_LOCALTIME_R)
-	TCL_CHECK_FUNCTION_EXISTS(mktime HAVE_MKTIME)
-	TCL_CHECK_STRUCT_HAS_MEMBER("struct tm" tm_tzadj time.h TM_TZADJ)
-	TCL_CHECK_STRUCT_HAS_MEMBER("struct tm" tm_gmtoff time.h TM_GMTOFF)
-	SET(TZONE_SRC_1 "
+      check_c_source_compiles("${TZNAME_SRC}" HAVE_TZNAME)
+		if(HAVE_TZNAME)
+			add_tcl_cflag(HAVE_DECL_TZNAME)
+		endif(HAVE_TZNAME)
+	endif(HAVE_STRUCT_TM_TM_ZONE)
+	tcl_check_function_exists(gmtime_r HAVE_GMTIME_R)
+	tcl_check_function_exists(localtime_r HAVE_LOCALTIME_R)
+	tcl_check_function_exists(mktime HAVE_MKTIME)
+	tcl_check_struct_has_member("struct tm" tm_tzadj time.h TM_TZADJ)
+	tcl_check_struct_has_member("struct tm" tm_gmtoff time.h TM_GMTOFF)
+	set(TZONE_SRC_1 "
 #include <time.h>
 int main () {
 extern long timezone;
@@ -441,11 +441,11 @@
 return 0;
 }
    ")
-	CHECK_C_SOURCE_COMPILES("${TZONE_SRC_1}" HAVE_TIMEZONE_VAR)
-   IF(HAVE_TIMEZONE_VAR)
-		ADD_TCL_CFLAG(HAVE_TIMEZONE_VAR)
-	ELSE(HAVE_TIMEZONE_VAR)
-		SET(TZONE_SRC_2 "
+	check_c_source_compiles("${TZONE_SRC_1}" HAVE_TIMEZONE_VAR)
+   if(HAVE_TIMEZONE_VAR)
+		add_tcl_cflag(HAVE_TIMEZONE_VAR)
+	else(HAVE_TIMEZONE_VAR)
+		set(TZONE_SRC_2 "
 #include <time.h>
 int main() {
 extern time_t timezone;
@@ -454,13 +454,13 @@
 return 0;
 }
       ")
-		CHECK_C_SOURCE_COMPILES("${TZONE_SRC_2}" HAVE_TIMEZONE_VAR)
-		IF(HAVE_TIMEZONE_VAR)
-			ADD_TCL_CFLAG(HAVE_TIMEZONE_VAR)
-		ENDIF(HAVE_TIMEZONE_VAR)
-	ENDIF(HAVE_TIMEZONE_VAR)
-	IF(HAVE_SYS_TIME_H)
-		SET(TIME_WITH_SYS_TIME_SRC "
+		check_c_source_compiles("${TZONE_SRC_2}" HAVE_TIMEZONE_VAR)
+		if(HAVE_TIMEZONE_VAR)
+			add_tcl_cflag(HAVE_TIMEZONE_VAR)
+		endif(HAVE_TIMEZONE_VAR)
+	endif(HAVE_TIMEZONE_VAR)
+	if(HAVE_SYS_TIME_H)
+		set(TIME_WITH_SYS_TIME_SRC "
 #include <sys/time.h>
 #include <time.h>
 int main() {
@@ -470,12 +470,12 @@
 return 0;
 }
       ")
-		CHECK_C_SOURCE_COMPILES("${TIME_WITH_SYS_TIME_SRC}" TIME_WITH_SYS_TIME_WORKS)
-		IF(TIME_WITH_SYS_TIME_WORKS)
+		check_c_source_compiles("${TIME_WITH_SYS_TIME_SRC}" TIME_WITH_SYS_TIME_WORKS)
+		if(TIME_WITH_SYS_TIME_WORKS)
 			add_definitions(-DTIME_WITH_SYS_TIME=1)
-		ENDIF(TIME_WITH_SYS_TIME_WORKS)
-	ENDIF(HAVE_SYS_TIME_H)
-ENDMACRO(SC_TIME_HANDLER)
+		endif(TIME_WITH_SYS_TIME_WORKS)
+	endif(HAVE_SYS_TIME_H)
+endmacro(SC_TIME_HANDLER)
 
 #--------------------------------------------------------------------
 # SC_BUGGY_STRTOD
@@ -487,74 +487,74 @@
 #--------------------------------------------------------------------
 # SC_TCL_LINK_LIBS
 #--------------------------------------------------------------------
-MACRO(SC_TCL_LINK_LIBS)
-	SET(TCL_LINK_LIBS "")
+macro(SC_TCL_LINK_LIBS)
+	set(TCL_LINK_LIBS "")
 
 	# Math libraries 
-	IF(NOT WIN32)
-		CHECK_LIBRARY_EXISTS(m cos "" HAVE_M_LIBRARY)
-		IF(HAVE_M_LIBRARY)
-			RESOLVE_LIBRARIES(M_LIBRARY "-lm")
-		ENDIF(HAVE_M_LIBRARY)
+	if(NOT WIN32)
+		check_library_exists(m cos "" HAVE_M_LIBRARY)
+		if(HAVE_M_LIBRARY)
+			resolve_libraries(M_LIBRARY "-lm")
+		endif(HAVE_M_LIBRARY)
 		#find_library(IEEE_LIB ieee)
 		#MARK_AS_ADVANCED(IEEE_LIB)
 		#IF(IEEE_LIB)
 		#	SET(M_LIBRARY "-lieee ${M_LIBRARY}")
 		#ENDIF(IEEE_LIB)
-		CHECK_LIBRARY_EXISTS(sunmath ieee_flags "" HAVE_SUNMATH_LIBRARY)
-		IF(HAVE_SUNMATH_LIBRARY)
-			SET(M_LIBRARY "-lsunmath ${M_LIBRARY}")
-		ENDIF(HAVE_SUNMATH_LIBRARY)
-	ENDIF(NOT WIN32)
+		check_library_exists(sunmath ieee_flags "" HAVE_SUNMATH_LIBRARY)
+		if(HAVE_SUNMATH_LIBRARY)
+			set(M_LIBRARY "-lsunmath ${M_LIBRARY}")
+		endif(HAVE_SUNMATH_LIBRARY)
+	endif(NOT WIN32)
 
-	IF(NOT INET_LIBRARY AND NOT INET_QUIET)
-		MESSAGE("-- Looking for INET library")
-		RESOLVE_LIBRARIES(INET_LIBRARY "-linet")
-		IF(INET_LIBRARY)
-			MESSAGE("-- Found INET library: ${INET_LIBRARY}")
-		ELSE(INET_LIBRARY)
-			MESSAGE("-- Looking for INET library - not found")
-		ENDIF(INET_LIBRARY)
-		SET(INET_QUIET 1 CACHE STRING "INET quiet")
-		MARK_AS_ADVANCED(INET_QUIET)
-	ENDIF(NOT INET_LIBRARY AND NOT INET_QUIET)
-	IF(TCL_LINK_LIBS)
-		SET(TCL_LINK_LIBS "${TCL_LINK_LIBS};${M_LIBRARY};${INET_LIBRARY}")
-	ELSEIF(TCL_LINK_LIBS)
-		SET(TCL_LINK_LIBS "${M_LIBRARY};${INET_LIBRARY}")
-	ENDIF(TCL_LINK_LIBS)
-	MARK_AS_ADVANCED(TCL_LINK_LIBS)
+	if(NOT INET_LIBRARY AND NOT INET_QUIET)
+		message("-- Looking for INET library")
+		resolve_libraries(INET_LIBRARY "-linet")
+		if(INET_LIBRARY)
+			message("-- Found INET library: ${INET_LIBRARY}")
+		else(INET_LIBRARY)
+			message("-- Looking for INET library - not found")
+		endif(INET_LIBRARY)
+		set(INET_QUIET 1 CACHE STRING "INET quiet")
+		mark_as_advanced(INET_QUIET)
+	endif(NOT INET_LIBRARY AND NOT INET_QUIET)
+	if(TCL_LINK_LIBS)
+		set(TCL_LINK_LIBS "${TCL_LINK_LIBS};${M_LIBRARY};${INET_LIBRARY}")
+	elseif(TCL_LINK_LIBS)
+		set(TCL_LINK_LIBS "${M_LIBRARY};${INET_LIBRARY}")
+	endif(TCL_LINK_LIBS)
+	mark_as_advanced(TCL_LINK_LIBS)
 
-	TCL_CHECK_INCLUDE_FILE_USABILITY(net/errno.h NET_ERRNO_H)
-	CHECK_FUNCTION_EXISTS(connect HAVE_CONNECT)
-	IF(NOT HAVE_CONNECT)
-		CHECK_FUNCTION_EXISTS(setsockopt HAVE_SETSOCKOPT)
-		IF(NOT HAVE_SETSOCKOPT)
-			CHECK_LIBRARY_EXISTS(socket connect "" HAVE_SOCKET_LIBRARY)
-			IF(HAVE_SOCKET_LIBRARY)
-				RESOLVE_LIBRARIES(SOCKET_LIBRARY "-lsocket")
-				IF(TCL_LINK_LIBS)
-					SET(TCL_LINK_LIBS ${TCL_LINK_LIBS};${SOCKET_LIBRARY})
-				ELSE(TCL_LINK_LIBS)
-					SET(TCL_LINK_LIBS ${SOCKET_LIBRARY})
-				ENDIF(TCL_LINK_LIBS)
-			ENDIF(HAVE_SOCKET_LIBRARY)
-		ENDIF(NOT HAVE_SETSOCKOPT)
-	ENDIF(NOT HAVE_CONNECT)
-	CHECK_FUNCTION_EXISTS(gethostbyname HAVE_GETHOSTBYNAME)
-	IF(NOT HAVE_GETHOSTBYNAME)
-		CHECK_LIBRARY_EXISTS(nsl gethostbyname "" HAVE_NSL_LIBRARY)
-		IF(HAVE_NSL_LIBRARY)
-			RESOLVE_LIBRARIES(NSL_LIBRARY "-nsl")
-			IF(TCL_LINK_LIBS)
-				SET(TCL_LINK_LIBS ${TCL_LINK_LIBS};${NSL_LIBRARY})
-			ELSE(TCL_LINK_LIBS)
-				SET(TCL_LINK_LIBS ${NSL_LIBRARY})
-			ENDIF(TCL_LINK_LIBS)
-		ENDIF(HAVE_NSL_LIBRARY)
-	ENDIF(NOT HAVE_GETHOSTBYNAME)
+	tcl_check_include_file_usability(net/errno.h NET_ERRNO_H)
+	check_function_exists(connect HAVE_CONNECT)
+	if(NOT HAVE_CONNECT)
+		check_function_exists(setsockopt HAVE_SETSOCKOPT)
+		if(NOT HAVE_SETSOCKOPT)
+			check_library_exists(socket connect "" HAVE_SOCKET_LIBRARY)
+			if(HAVE_SOCKET_LIBRARY)
+				resolve_libraries(SOCKET_LIBRARY "-lsocket")
+				if(TCL_LINK_LIBS)
+					set(TCL_LINK_LIBS ${TCL_LINK_LIBS};${SOCKET_LIBRARY})
+				else(TCL_LINK_LIBS)
+					set(TCL_LINK_LIBS ${SOCKET_LIBRARY})
+				endif(TCL_LINK_LIBS)
+			endif(HAVE_SOCKET_LIBRARY)
+		endif(NOT HAVE_SETSOCKOPT)
+	endif(NOT HAVE_CONNECT)
+	check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
+	if(NOT HAVE_GETHOSTBYNAME)
+		check_library_exists(nsl gethostbyname "" HAVE_NSL_LIBRARY)
+		if(HAVE_NSL_LIBRARY)
+			resolve_libraries(NSL_LIBRARY "-nsl")
+			if(TCL_LINK_LIBS)
+				set(TCL_LINK_LIBS ${TCL_LINK_LIBS};${NSL_LIBRARY})
+			else(TCL_LINK_LIBS)
+				set(TCL_LINK_LIBS ${NSL_LIBRARY})
+			endif(TCL_LINK_LIBS)
+		endif(HAVE_NSL_LIBRARY)
+	endif(NOT HAVE_GETHOSTBYNAME)
 
-ENDMACRO(SC_TCL_LINK_LIBS)
+endmacro(SC_TCL_LINK_LIBS)
 
 #--------------------------------------------------------------------
 # SC_TCL_EARLY_FLAGS
@@ -567,94 +567,94 @@
 #
 # Detect and set up 64-bit compiling here.  LOTS of TODO here
 #--------------------------------------------------------------------
-MACRO(SC_TCL_64BIT_FLAGS)
-	IF(NOT CMAKE_SIZEOF_VOID_P)
-		MESSAGE(WARNING "CMAKE_SIZEOF_VOID_P is not defined - assuming 32-bit platform")
-		SET(CMAKE_SIZEOF_VOID_P 4)
-	ENDIF(NOT CMAKE_SIZEOF_VOID_P)
-	IF(NOT CMAKE_WORD_SIZE)
-		IF(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
-			SET(CMAKE_WORD_SIZE "64BIT")
-		ELSE(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
-			SET(CMAKE_WORD_SIZE "32BIT")
-		ENDIF(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
-	ENDIF(NOT CMAKE_WORD_SIZE)
-	IF(NOT TCL_ENABLE_64BIT)
-		IF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+macro(SC_TCL_64BIT_FLAGS)
+	if(NOT CMAKE_SIZEOF_VOID_P)
+		message(WARNING "CMAKE_SIZEOF_VOID_P is not defined - assuming 32-bit platform")
+		set(CMAKE_SIZEOF_VOID_P 4)
+	endif(NOT CMAKE_SIZEOF_VOID_P)
+	if(NOT CMAKE_WORD_SIZE)
+		if(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
+			set(CMAKE_WORD_SIZE "64BIT")
+		else(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
+			set(CMAKE_WORD_SIZE "32BIT")
+		endif(${CMAKE_SIZEOF_VOID_P} MATCHES "^8$")
+	endif(NOT CMAKE_WORD_SIZE)
+	if(NOT TCL_ENABLE_64BIT)
+		if(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT "ON" CACHE STRING "Enable 64-bit support")
-		ELSE(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+		else(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT "OFF" CACHE STRING "Enable 64-bit support")
-		ENDIF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
-	ENDIF(NOT TCL_ENABLE_64BIT)
-	IF(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
-		IF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+		endif(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+	endif(NOT TCL_ENABLE_64BIT)
+	if(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
+		if(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT ON CACHE STRING "Enable 64-bit support")
-		ELSE(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+		else(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 			set(TCL_ENABLE_64BIT OFF CACHE STRING "Enable 64-bit support")
-		ENDIF(${CMAKE_WORD_SIZE} MATCHES "64BIT")
-	ENDIF(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
+		endif(${CMAKE_WORD_SIZE} MATCHES "64BIT")
+	endif(NOT ${TCL_ENABLE_64BIT} MATCHES "OFF")
 	set(TCL_ENABLE_64BIT ${TCL_ENABLE_64BIT} CACHE STRING "Enable 64-bit support")
-	IF(TCL_ENABLE_64BIT)
-		IF(NOT 64BIT_FLAG)
-			CHECK_C_FLAG("arch x86_64" 64BIT_FLAG)
-			CHECK_C_FLAG(64 64BIT_FLAG)
-			CHECK_C_FLAG("mabi=64" 64BIT_FLAG)
-			CHECK_C_FLAG(m64 64BIT_FLAG)
-			CHECK_C_FLAG(q64 64BIT_FLAG)
-		ENDIF(NOT 64BIT_FLAG)
-		MARK_AS_ADVANCED(64BIT_FLAG)
-		SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${64BIT_FLAG}")
-		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${64BIT_FLAG}")
-		SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${64BIT_FLAG}")
-		SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${64BIT_FLAG}")
+	if(TCL_ENABLE_64BIT)
+		if(NOT 64BIT_FLAG)
+			check_c_flag("arch x86_64" 64BIT_FLAG)
+			check_c_flag(64 64BIT_FLAG)
+			check_c_flag("mabi=64" 64BIT_FLAG)
+			check_c_flag(m64 64BIT_FLAG)
+			check_c_flag(q64 64BIT_FLAG)
+		endif(NOT 64BIT_FLAG)
+		mark_as_advanced(64BIT_FLAG)
+		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${64BIT_FLAG}")
+		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${64BIT_FLAG}")
+		set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${64BIT_FLAG}")
+		set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${64BIT_FLAG}")
 		add_definitions(-DTCL_CFG_DO64BIT=1)
-	ENDIF(TCL_ENABLE_64BIT)
-	IF(CMAKE_CL_64)
+	endif(TCL_ENABLE_64BIT)
+	if(CMAKE_CL_64)
 		add_definitions(-D_stati64=_stat64)
-	ENDIF(CMAKE_CL_64)
-ENDMACRO(SC_TCL_64BIT_FLAGS)
+	endif(CMAKE_CL_64)
+endmacro(SC_TCL_64BIT_FLAGS)
 
 #--------------------------------------------------------------------
 # SC_TCL_CFG_ENCODING   TIP #59
 #--------------------------------------------------------------------
-MACRO(SC_TCL_CFG_ENCODING)
-	IF(NOT TCL_CFGVAL_ENCODING)
-		IF(WIN32)
-			SET(TCL_CFGVAL_ENCODING "cp1252")
-		ELSE(WIN32)
-			SET(TCL_CFGVAL_ENCODING "iso8859-1")
-		ENDIF(WIN32)
-	ENDIF(NOT TCL_CFGVAL_ENCODING)
+macro(SC_TCL_CFG_ENCODING)
+	if(NOT TCL_CFGVAL_ENCODING)
+		if(WIN32)
+			set(TCL_CFGVAL_ENCODING "cp1252")
+		else(WIN32)
+			set(TCL_CFGVAL_ENCODING "iso8859-1")
+		endif(WIN32)
+	endif(NOT TCL_CFGVAL_ENCODING)
 	add_definitions(-DTCL_CFGVAL_ENCODING="${TCL_CFGVAL_ENCODING}")
-ENDMACRO(SC_TCL_CFG_ENCODING)
+endmacro(SC_TCL_CFG_ENCODING)
 
 
 #--------------------------------------------------------------------
 # SC_TCL_CHECK_BROKEN_FUNC
 #--------------------------------------------------------------------
-MACRO(SC_TCL_CHECK_BROKEN_FUNC)
-	CHECK_FUNCTION_EXISTS(${ARGV0} HAVE_${ARGV0})
-	IF(HAVE_${ARGV0})
-		SET(COMPILE_SRC "
+macro(SC_TCL_CHECK_BROKEN_FUNC)
+	check_function_exists(${ARGV0} HAVE_${ARGV0})
+	if(HAVE_${ARGV0})
+		set(COMPILE_SRC "
 		int main() {
 		${ARGV1}
 		}")
-		CHECK_C_SOURCE_RUNS("${COMPILE_SRC}"  WORKING_${ARGV0})
-		IF(NOT WORKING_${ARGV0})
-			SET(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
-		ENDIF(NOT WORKING_${ARGV0})
-	ELSE(HAVE_${ARGV0})
-		SET(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
-	ENDIF(HAVE_${ARGV0})
-ENDMACRO(SC_TCL_CHECK_BROKEN_FUNC)
+		check_c_source_runs("${COMPILE_SRC}"  WORKING_${ARGV0})
+		if(NOT WORKING_${ARGV0})
+			set(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
+		endif(NOT WORKING_${ARGV0})
+	else(HAVE_${ARGV0})
+		set(COMPAT_SRCS ${COMPAT_SRCS} compat/${ARGV0}.c CACHE STRING "Compatibility srcs" FORCE)
+	endif(HAVE_${ARGV0})
+endmacro(SC_TCL_CHECK_BROKEN_FUNC)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETHOSTBYADDR_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETHOSTBYADDR_R)
-	TCL_CHECK_FUNCTION_EXISTS(gethostbyaddr_r HAVE_GETHOSTBYADDR_R)
-	IF(HAVE_GETHOSTBYADDR_R)
-		SET(HAVE_GETHOSTBYADDR_R_7_SRC "
+macro(SC_TCL_GETHOSTBYADDR_R)
+	tcl_check_function_exists(gethostbyaddr_r HAVE_GETHOSTBYADDR_R)
+	if(HAVE_GETHOSTBYADDR_R)
+		set(HAVE_GETHOSTBYADDR_R_7_SRC "
 #include <netdb.h>
 int main(){
 char *addr;
@@ -668,11 +668,11 @@
 (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &h_errnop);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYADDR_R_7_SRC}"  HAVE_GETHOSTBYADDR_R_7)
-		IF(HAVE_GETHOSTBYADDR_R_7)
-			ADD_TCL_CFLAG(HAVE_GETHOSTBYADDR_R_7)
-		ELSE(HAVE_GETHOSTBYADDR_R_7)
-			SET(HAVE_GETHOSTBYADDR_R_8_SRC "
+		check_c_source_compiles("${HAVE_GETHOSTBYADDR_R_7_SRC}"  HAVE_GETHOSTBYADDR_R_7)
+		if(HAVE_GETHOSTBYADDR_R_7)
+			add_tcl_cflag(HAVE_GETHOSTBYADDR_R_7)
+		else(HAVE_GETHOSTBYADDR_R_7)
+			set(HAVE_GETHOSTBYADDR_R_8_SRC "
 #include <netdb.h>
 int main(){
 char *addr;
@@ -686,21 +686,21 @@
 (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, &resultp, &h_errnop);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYADDR_R_8_SRC}" HAVE_GETHOSTBYADDR_R_8)
-			IF(HAVE_GETHOSTBYADDR_R_8)
-			   ADD_TCL_CFLAG(HAVE_GETHOSTBYADDR_R_8)
-			ENDIF(HAVE_GETHOSTBYADDR_R_8)
-		ENDIF(HAVE_GETHOSTBYADDR_R_7)
-	ENDIF(HAVE_GETHOSTBYADDR_R)
-ENDMACRO(SC_TCL_GETHOSTBYADDR_R)
+			check_c_source_compiles("${HAVE_GETHOSTBYADDR_R_8_SRC}" HAVE_GETHOSTBYADDR_R_8)
+			if(HAVE_GETHOSTBYADDR_R_8)
+			   add_tcl_cflag(HAVE_GETHOSTBYADDR_R_8)
+			endif(HAVE_GETHOSTBYADDR_R_8)
+		endif(HAVE_GETHOSTBYADDR_R_7)
+	endif(HAVE_GETHOSTBYADDR_R)
+endmacro(SC_TCL_GETHOSTBYADDR_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETHOSTBYNAME_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETHOSTBYNAME_R)
-	TCL_CHECK_FUNCTION_EXISTS(gethostbyname_r HAVE_GETHOSTBYNAME_R)
-	IF(HAVE_GETHOSTBYNAME_R)
-		SET(HAVE_GETHOSTBYNAME_R_6_SRC "
+macro(SC_TCL_GETHOSTBYNAME_R)
+	tcl_check_function_exists(gethostbyname_r HAVE_GETHOSTBYNAME_R)
+	if(HAVE_GETHOSTBYNAME_R)
+		set(HAVE_GETHOSTBYNAME_R_6_SRC "
 #include <netdb.h>
 int main(){
 char *name;
@@ -712,11 +712,11 @@
 (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYNAME_R_6_SRC}"  HAVE_GETHOSTBYNAME_R_6)
-		IF(HAVE_GETHOSTBYNAME_R_6)
-			ADD_TCL_CFLAG(HAVE_GETHOSTBYNAME_R_6)
-		ELSE(HAVE_GETHOSTBYNAME_R_6)
-			SET(HAVE_GETHOSTBYNAME_R_5_SRC "
+		check_c_source_compiles("${HAVE_GETHOSTBYNAME_R_6_SRC}"  HAVE_GETHOSTBYNAME_R_6)
+		if(HAVE_GETHOSTBYNAME_R_6)
+			add_tcl_cflag(HAVE_GETHOSTBYNAME_R_6)
+		else(HAVE_GETHOSTBYNAME_R_6)
+			set(HAVE_GETHOSTBYNAME_R_5_SRC "
 #include <netdb.h>
 int main(){
 char *name;
@@ -728,12 +728,12 @@
 (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYNAME_R_5_SRC}"  HAVE_GETHOSTBYNAME_R_5)
+			check_c_source_compiles("${HAVE_GETHOSTBYNAME_R_5_SRC}"  HAVE_GETHOSTBYNAME_R_5)
 
-			IF(HAVE_GETHOSTBYNAME_R_5)
-				ADD_TCL_CFLAG(HAVE_GETHOSTBYNAME_R_5)
-			ELSE(HAVE_GETHOSTBYNAME_R_5)
-				SET(HAVE_GETHOSTBYNAME_R_3_SRC "
+			if(HAVE_GETHOSTBYNAME_R_5)
+				add_tcl_cflag(HAVE_GETHOSTBYNAME_R_5)
+			else(HAVE_GETHOSTBYNAME_R_5)
+				set(HAVE_GETHOSTBYNAME_R_3_SRC "
 #include <netdb.h>
 int main(){
 char *name;
@@ -743,22 +743,22 @@
 (void) gethostbyname_r(name, he, &data);
 return 0;}
 				")
-				CHECK_C_SOURCE_COMPILES("${HAVE_GETHOSTBYNAME_R_3_SRC}" HAVE_GETHOSTBYNAME_R_3)
-				IF(HAVE_GETHOSTBYNAME_R_3)
-					ADD_TCL_CFLAG(HAVE_GETHOSTBYNAME_R_3)
-				ENDIF(HAVE_GETHOSTBYNAME_R_3)
-			ENDIF(HAVE_GETHOSTBYNAME_R_5)
-		ENDIF(HAVE_GETHOSTBYNAME_R_6)
-	ENDIF(HAVE_GETHOSTBYNAME_R)
-ENDMACRO(SC_TCL_GETHOSTBYNAME_R)
+				check_c_source_compiles("${HAVE_GETHOSTBYNAME_R_3_SRC}" HAVE_GETHOSTBYNAME_R_3)
+				if(HAVE_GETHOSTBYNAME_R_3)
+					add_tcl_cflag(HAVE_GETHOSTBYNAME_R_3)
+				endif(HAVE_GETHOSTBYNAME_R_3)
+			endif(HAVE_GETHOSTBYNAME_R_5)
+		endif(HAVE_GETHOSTBYNAME_R_6)
+	endif(HAVE_GETHOSTBYNAME_R)
+endmacro(SC_TCL_GETHOSTBYNAME_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_IPV6
 #--------------------------------------------------------------------
-MACRO(SC_TCL_IPV6)
-	CHECK_FUNCTION_EXISTS(getaddrinfo HAVE_GETADDRINFO)
-	IF(HAVE_GETADDRINFO)
-		SET(GETADDRINFO_SRC "
+macro(SC_TCL_IPV6)
+	check_function_exists(getaddrinfo HAVE_GETADDRINFO)
+	if(HAVE_GETADDRINFO)
+		set(GETADDRINFO_SRC "
 #include <netdb.h>
 int main () {
 const char *name, *port;
@@ -768,20 +768,20 @@
 return 0;
 }
 		")
-		CHECK_C_SOURCE_COMPILES("${GETADDRINFO_SRC}" WORKING_GETADDRINFO)
-		IF(WORKING_GETADDRINFO)
-			ADD_TCL_CFLAG(HAVE_GETADDRINFO)
-		ENDIF(WORKING_GETADDRINFO)
-	ENDIF(HAVE_GETADDRINFO)
-ENDMACRO(SC_TCL_IPV6)
+		check_c_source_compiles("${GETADDRINFO_SRC}" WORKING_GETADDRINFO)
+		if(WORKING_GETADDRINFO)
+			add_tcl_cflag(HAVE_GETADDRINFO)
+		endif(WORKING_GETADDRINFO)
+	endif(HAVE_GETADDRINFO)
+endmacro(SC_TCL_IPV6)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETPWUID_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETPWUID_R)
-	TCL_CHECK_FUNCTION_EXISTS(getpwuid_r HAVE_GETPWUID_R)
-	IF(HAVE_GETPWUID_R)
-		SET(HAVE_GETPWUID_R_5_SRC "
+macro(SC_TCL_GETPWUID_R)
+	tcl_check_function_exists(getpwuid_r HAVE_GETPWUID_R)
+	if(HAVE_GETPWUID_R)
+		set(HAVE_GETPWUID_R_5_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -793,11 +793,11 @@
 (void) getpwuid_r(uid, &pw, buf, buflen, &pwp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETPWUID_R_5_SRC}"  HAVE_GETPWUID_R_5)
-		IF(HAVE_GETPWUID_R_5)
-			ADD_TCL_CFLAG(HAVE_GETPWUID_R_5)
-		ELSE(HAVE_GETPWUID_R_5)
-			SET(HAVE_GETPWUID_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETPWUID_R_5_SRC}"  HAVE_GETPWUID_R_5)
+		if(HAVE_GETPWUID_R_5)
+			add_tcl_cflag(HAVE_GETPWUID_R_5)
+		else(HAVE_GETPWUID_R_5)
+			set(HAVE_GETPWUID_R_4_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -809,21 +809,21 @@
 (void) getpwuid_r(uid, &pw, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETPWUID_R_4_SRC}" HAVE_GETPWUID_R_4)
-			IF(HAVE_GETPWUID_R_4)
-				ADD_TCL_CFLAG(HAVE_GETPWUID_R_4)
-			ENDIF(HAVE_GETPWUID_R_4)
-		ENDIF(HAVE_GETPWUID_R_5)
-	ENDIF(HAVE_GETPWUID_R)
-ENDMACRO(SC_TCL_GETPWUID_R)
+			check_c_source_compiles("${HAVE_GETPWUID_R_4_SRC}" HAVE_GETPWUID_R_4)
+			if(HAVE_GETPWUID_R_4)
+				add_tcl_cflag(HAVE_GETPWUID_R_4)
+			endif(HAVE_GETPWUID_R_4)
+		endif(HAVE_GETPWUID_R_5)
+	endif(HAVE_GETPWUID_R)
+endmacro(SC_TCL_GETPWUID_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETPWNAM_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETPWNAM_R)
-	TCL_CHECK_FUNCTION_EXISTS(getpwnam_r HAVE_GETPWNAM_R)
-	IF(HAVE_GETPWNAM_R)
-		SET(HAVE_GETPWNAM_R_5_SRC "
+macro(SC_TCL_GETPWNAM_R)
+	tcl_check_function_exists(getpwnam_r HAVE_GETPWNAM_R)
+	if(HAVE_GETPWNAM_R)
+		set(HAVE_GETPWNAM_R_5_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -835,11 +835,11 @@
 (void) getpwnam_r(name, &pw, buf, buflen, &pwp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETPWNAM_R_5_SRC}"  HAVE_GETPWNAM_R_5)
-		IF(HAVE_GETPWNAM_R_5)
-			ADD_TCL_CFLAG(HAVE_GETPWNAM_R_5)
-		ELSE(HAVE_GETPWNAM_R_5)
-			SET(HAVE_GETPWNAM_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETPWNAM_R_5_SRC}"  HAVE_GETPWNAM_R_5)
+		if(HAVE_GETPWNAM_R_5)
+			add_tcl_cflag(HAVE_GETPWNAM_R_5)
+		else(HAVE_GETPWNAM_R_5)
+			set(HAVE_GETPWNAM_R_4_SRC "
 #include <sys/types.h>
 #include <pwd.h>
 int main(){
@@ -851,21 +851,21 @@
 (void)getpwnam_r(name, &pw, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETPWNAM_R_4_SRC}" HAVE_GETPWNAM_R_4)
-			IF(HAVE_GETPWNAM_R_4)
-			   ADD_TCL_CFLAG(HAVE_GETPWNAM_R_4)
-			ENDIF(HAVE_GETPWNAM_R_4)
-		ENDIF(HAVE_GETPWNAM_R_5)
-	ENDIF(HAVE_GETPWNAM_R)
-ENDMACRO(SC_TCL_GETPWNAM_R)
+			check_c_source_compiles("${HAVE_GETPWNAM_R_4_SRC}" HAVE_GETPWNAM_R_4)
+			if(HAVE_GETPWNAM_R_4)
+			   add_tcl_cflag(HAVE_GETPWNAM_R_4)
+			endif(HAVE_GETPWNAM_R_4)
+		endif(HAVE_GETPWNAM_R_5)
+	endif(HAVE_GETPWNAM_R)
+endmacro(SC_TCL_GETPWNAM_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETGRGID_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETGRGID_R)
-	TCL_CHECK_FUNCTION_EXISTS(getgrgid_r HAVE_GETGRGID_R)
-	IF(HAVE_GETGRGID_R)
-		SET(HAVE_GETGRGID_R_5_SRC "
+macro(SC_TCL_GETGRGID_R)
+	tcl_check_function_exists(getgrgid_r HAVE_GETGRGID_R)
+	if(HAVE_GETGRGID_R)
+		set(HAVE_GETGRGID_R_5_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -877,11 +877,11 @@
 (void) getgrgid_r(gid, &gr, buf, buflen, &grp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETGRGID_R_5_SRC}"  HAVE_GETGRGID_R_5)
-		IF(HAVE_GETGRGID_R_5)
-			ADD_TCL_CFLAG(HAVE_GETGRGID_R_5)
-		ELSE(HAVE_GETGRGID_R_5)
-			SET(HAVE_GETGRGID_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETGRGID_R_5_SRC}"  HAVE_GETGRGID_R_5)
+		if(HAVE_GETGRGID_R_5)
+			add_tcl_cflag(HAVE_GETGRGID_R_5)
+		else(HAVE_GETGRGID_R_5)
+			set(HAVE_GETGRGID_R_4_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -893,21 +893,21 @@
 (void)getgrgid_r(gid, &gr, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETGRGID_R_4_SRC}" HAVE_GETGRGID_R_4)
-			IF(HAVE_GETGRGID_R_4)
-				ADD_TCL_CFLAG(HAVE_GETGRGID_R_4)
-			ENDIF(HAVE_GETGRGID_R_4)
-		ENDIF(HAVE_GETGRGID_R_5)
-	ENDIF(HAVE_GETGRGID_R)
-ENDMACRO(SC_TCL_GETGRGID_R)
+			check_c_source_compiles("${HAVE_GETGRGID_R_4_SRC}" HAVE_GETGRGID_R_4)
+			if(HAVE_GETGRGID_R_4)
+				add_tcl_cflag(HAVE_GETGRGID_R_4)
+			endif(HAVE_GETGRGID_R_4)
+		endif(HAVE_GETGRGID_R_5)
+	endif(HAVE_GETGRGID_R)
+endmacro(SC_TCL_GETGRGID_R)
 
 #--------------------------------------------------------------------
 # SC_TCL_GETGRNAM_R
 #--------------------------------------------------------------------
-MACRO(SC_TCL_GETGRNAM_R)
-	TCL_CHECK_FUNCTION_EXISTS(getgrnam_r HAVE_GETGRNAM_R)
-	IF(HAVE_GETGRNAM_R)
-		SET(HAVE_GETGRNAM_R_5_SRC "
+macro(SC_TCL_GETGRNAM_R)
+	tcl_check_function_exists(getgrnam_r HAVE_GETGRNAM_R)
+	if(HAVE_GETGRNAM_R)
+		set(HAVE_GETGRNAM_R_5_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -919,11 +919,11 @@
 (void) getgrnam_r(name, &gr, buf, buflen, &grp);
 return 0;}
 		")
-		CHECK_C_SOURCE_COMPILES("${HAVE_GETGRNAM_R_5_SRC}"  HAVE_GETGRNAM_R_5)
-		IF(HAVE_GETGRNAM_R_5)
-			ADD_TCL_CFLAG(HAVE_GETGRNAM_R_5)
-		ELSE(HAVE_GETGRNAM_R_5)
-			SET(HAVE_GETGRNAM_R_4_SRC "
+		check_c_source_compiles("${HAVE_GETGRNAM_R_5_SRC}"  HAVE_GETGRNAM_R_5)
+		if(HAVE_GETGRNAM_R_5)
+			add_tcl_cflag(HAVE_GETGRNAM_R_5)
+		else(HAVE_GETGRNAM_R_5)
+			set(HAVE_GETGRNAM_R_4_SRC "
 #include <sys/types.h>
 #include <grp.h>
 int main(){
@@ -935,19 +935,19 @@
 (void)getgrnam_r(name, &gr, buf, buflen);
 return 0;}
 			")
-			CHECK_C_SOURCE_COMPILES("${HAVE_GETGRNAM_R_4_SRC}" HAVE_GETGRNAM_R_4)
-			IF(HAVE_GETGRNAM_R_4)
-			   ADD_TCL_CFLAG(HAVE_GETGRNAM_R_4)
-			ENDIF(HAVE_GETGRNAM_R_4)
-		ENDIF(HAVE_GETGRNAM_R_5)
-	ENDIF(HAVE_GETGRNAM_R)
-ENDMACRO(SC_TCL_GETGRNAM_R)
+			check_c_source_compiles("${HAVE_GETGRNAM_R_4_SRC}" HAVE_GETGRNAM_R_4)
+			if(HAVE_GETGRNAM_R_4)
+			   add_tcl_cflag(HAVE_GETGRNAM_R_4)
+			endif(HAVE_GETGRNAM_R_4)
+		endif(HAVE_GETGRNAM_R_5)
+	endif(HAVE_GETGRNAM_R)
+endmacro(SC_TCL_GETGRNAM_R)
 
 
 
 
-MACRO(CHECK_FD_SET_IN_TYPES_D)
-	SET(TEST_SRC "
+macro(CHECK_FD_SET_IN_TYPES_D)
+	set(TEST_SRC "
 	#include <sys/types.h>
 	int main ()
 	{
@@ -955,16 +955,16 @@
 	return 0;
 	}
 	")
-	CHECK_C_SOURCE_COMPILES("${TEST_SRC}" FD_SET_IN_TYPES_H)
-ENDMACRO(CHECK_FD_SET_IN_TYPES_D)
+	check_c_source_compiles("${TEST_SRC}" FD_SET_IN_TYPES_H)
+endmacro(CHECK_FD_SET_IN_TYPES_D)
 
-MACRO(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
-	SET(TEST_SRC"
+macro(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
+	set(TEST_SRC"
 	#define MODULE_SCOPE extern __attribute__((__visibility__("hidden")))
 	main(){};
 	")
-	CHECK_C_SOURCE_COMPILES("${TEST_SRC}" COMPILER_SUPPORTS_HIDDEN)
-ENDMACRO(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
+	check_c_source_compiles("${TEST_SRC}" COMPILER_SUPPORTS_HIDDEN)
+endmacro(CHECK_COMPILER_SUPPORTS_HIDDEN_D)
 
 
 
Index: src/other/tk/CMake/CheckPrototypeExists.cmake
===================================================================
--- src/other/tk/CMake/CheckPrototypeExists.cmake	(revision 54114)
+++ src/other/tk/CMake/CheckPrototypeExists.cmake	(working copy)
@@ -57,6 +57,6 @@
   return 0;
 }
 ")
-  CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
+  check_cxx_source_compiles("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
 endmacro(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
 
Index: src/other/tk/library/CMakeLists.txt
===================================================================
--- src/other/tk/library/CMakeLists.txt	(revision 54114)
+++ src/other/tk/library/CMakeLists.txt	(working copy)
@@ -1,5 +1,5 @@
-MACRO(TK_SCRIPTS_BUILD files destination)
-  FOREACH(file ${${files}})
+macro(TK_SCRIPTS_BUILD files destination)
+  foreach(file ${${files}})
     get_filename_component(filename ${file} NAME)
     if(NOT CMAKE_CONFIGURATION_TYPES)
       configure_file(${file} ${CMAKE_BINARY_DIR}/${destination}/${filename} COPYONLY)
@@ -9,10 +9,10 @@
         configure_file(${file} ${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/${destination}/${filename} COPYONLY)
       endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
     endif(NOT CMAKE_CONFIGURATION_TYPES)
-  ENDFOREACH(file ${${files}})
-ENDMACRO(TK_SCRIPTS_BUILD)
+  endforeach(file ${${files}})
+endmacro(TK_SCRIPTS_BUILD)
 
-SET(TK_LIBRARY_FILES
+set(TK_LIBRARY_FILES
   bgerror.tcl
   button.tcl
   choosedir.tcl
@@ -43,9 +43,9 @@
   tclIndex
   )
 install(FILES ${TK_LIBRARY_FILES} DESTINATION lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR})
-TK_SCRIPTS_BUILD(TK_LIBRARY_FILES lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR})
+tk_scripts_build(TK_LIBRARY_FILES lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR})
 
-SET(TK_LIBRARY_IMAGE_FILES
+set(TK_LIBRARY_IMAGE_FILES
   images/README
   images/logo.eps
   images/logo100.gif
@@ -61,9 +61,9 @@
   images/tai-ku.gif
   )
 install(FILES ${TK_LIBRARY_IMAGE_FILES} DESTINATION lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/images)
-TK_SCRIPTS_BUILD(TK_LIBRARY_IMAGE_FILES lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/images)
+tk_scripts_build(TK_LIBRARY_IMAGE_FILES lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/images)
 
-SET(TK_LIBRARY_MSG_FILES
+set(TK_LIBRARY_MSG_FILES
   msgs/cs.msg
   msgs/da.msg
   msgs/de.msg
@@ -82,9 +82,9 @@
   msgs/sv.msg
   )
 install(FILES ${TK_LIBRARY_MSG_FILES} DESTINATION lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/msgs)
-TK_SCRIPTS_BUILD(TK_LIBRARY_MSG_FILES lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/msgs)
+tk_scripts_build(TK_LIBRARY_MSG_FILES lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/msgs)
 
-SET(TTK_LIBRARY_FILES
+set(TTK_LIBRARY_FILES
   ttk/altTheme.tcl
   ttk/aquaTheme.tcl
   ttk/button.tcl
@@ -111,9 +111,9 @@
   ttk/xpTheme.tcl
   )
 install(FILES ${TTK_LIBRARY_FILES} DESTINATION lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/ttk)
-TK_SCRIPTS_BUILD(TTK_LIBRARY_FILES lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/ttk)
+tk_scripts_build(TTK_LIBRARY_FILES lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/ttk)
 
-SET(TK_DEMO_PROGS
+set(TK_DEMO_PROGS
   demos/browse
   demos/hello
   demos/ixset
@@ -123,10 +123,10 @@
   demos/timer
   demos/widget
   )
-INSTALL(PROGRAMS ${TK_DEMO_PROGS} DESTINATION lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/demos)
-TK_SCRIPTS_BUILD(TK_DEMO_PROGS lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/demos)
+install(PROGRAMS ${TK_DEMO_PROGS} DESTINATION lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/demos)
+tk_scripts_build(TK_DEMO_PROGS lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/demos)
 
-SET(TK_DEMO_FILES
+set(TK_DEMO_FILES
   demos/README
   demos/anilabel.tcl
   demos/aniwave.tcl
@@ -192,10 +192,10 @@
   demos/unicodeout.tcl
   demos/vscale.tcl
   )
-INSTALL(FILES ${TK_DEMO_FILES} DESTINATION lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/demos)
-TK_SCRIPTS_BUILD(TK_DEMO_FILES lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/demos)
+install(FILES ${TK_DEMO_FILES} DESTINATION lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/demos)
+tk_scripts_build(TK_DEMO_FILES lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/demos)
 
-SET(TK_DEMO_IMAGES
+set(TK_DEMO_IMAGES
   demos/images/earth.gif
   demos/images/earthris.gif
   demos/images/face.xbm
@@ -208,5 +208,5 @@
   demos/images/tcllogo.gif
   demos/images/teapot.ppm
   )
-INSTALL(FILES ${TK_DEMO_IMAGES} DESTINATION lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/demos/images)
-TK_SCRIPTS_BUILD(TK_DEMO_IMAGES lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/demos/images)
+install(FILES ${TK_DEMO_IMAGES} DESTINATION lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/demos/images)
+tk_scripts_build(TK_DEMO_IMAGES lib/tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}/demos/images)
Index: src/other/tk/doc/CMakeLists.txt
===================================================================
--- src/other/tk/doc/CMakeLists.txt	(revision 54114)
+++ src/other/tk/doc/CMakeLists.txt	(working copy)
@@ -1,31 +1,31 @@
-IF(NOT MAN_DIR)
-	SET(MAN_DIR "man")
-ENDIF(NOT MAN_DIR)
+if(NOT MAN_DIR)
+	set(MAN_DIR "man")
+endif(NOT MAN_DIR)
 
-FIND_PROGRAM(SH_EXEC NAMES sh dash bash DOC "path to shell executable")
-FIND_PROGRAM(SED_EXEC NAMES sed DOC "path to sed executable")
-MARK_AS_ADVANCED(SH_EXEC)
-MARK_AS_ADVANCED(SED_EXEC)
+find_program(SH_EXEC NAMES sh dash bash DOC "path to shell executable")
+find_program(SED_EXEC NAMES sed DOC "path to sed executable")
+mark_as_advanced(SH_EXEC)
+mark_as_advanced(SED_EXEC)
 
-FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man1)
-FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man3)
-FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mann)
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man1)
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man3)
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mann)
 
-IF(SED_EXEC AND SH_EXEC AND NOT TKMAN_GENERATED)
-	MESSAGE("Generating Tk man pages...")
+if(SED_EXEC AND SH_EXEC AND NOT TKMAN_GENERATED)
+	message("Generating Tk man pages...")
 
-	SET(tk_MAN1
+	set(tk_MAN1
 		wish.1
 		)
-	FOREACH(manfile ${tk_MAN1})
-		EXEC_PROGRAM(${SH_EXEC} ARGS
+	foreach(manfile ${tk_MAN1})
+		exec_program(${SH_EXEC} ARGS
 			${CMAKE_CURRENT_SOURCE_DIR}/../unix/installManPage
 			${CMAKE_CURRENT_SOURCE_DIR}/${manfile}
 			${CMAKE_CURRENT_BINARY_DIR}/man1
 			OUTPUT_VARIABLE MAN1_SH)
-	ENDFOREACH(manfile ${tk_MAN1})
+	endforeach(manfile ${tk_MAN1})
 
-	SET(tk_MAN3
+	set(tk_MAN3
 		3DBorder.3
 		AddOption.3
 		BindTable.3
@@ -114,15 +114,15 @@
 		ttk_Geometry.3
 		ttk_Theme.3
 		)
-	FOREACH(manfile ${tk_MAN3})
-		EXEC_PROGRAM(${SH_EXEC} ARGS
+	foreach(manfile ${tk_MAN3})
+		exec_program(${SH_EXEC} ARGS
 			${CMAKE_CURRENT_SOURCE_DIR}/../unix/installManPage
 			${CMAKE_CURRENT_SOURCE_DIR}/${manfile}
 			${CMAKE_CURRENT_BINARY_DIR}/man3
 			OUTPUT_VARIABLE MAN3_SH)
-	ENDFOREACH(manfile ${tk_MAN3})
+	endforeach(manfile ${tk_MAN3})
 
-	SET(tk_MANN
+	set(tk_MANN
 		bell.n
 		bind.n
 		bindtags.n
@@ -207,20 +207,20 @@
 		winfo.n
 		wm.n
 		)
-	FOREACH(manfile ${tk_MANN})
-		EXEC_PROGRAM(${SH_EXEC} ARGS
+	foreach(manfile ${tk_MANN})
+		exec_program(${SH_EXEC} ARGS
 			${CMAKE_CURRENT_SOURCE_DIR}/../unix/installManPage
 			${CMAKE_CURRENT_SOURCE_DIR}/${manfile}
 			${CMAKE_CURRENT_BINARY_DIR}/mann
 			OUTPUT_VARIABLE MANN_SH)
-	ENDFOREACH(manfile ${tk_MANN})
-	SET(TKMAN_GENERATED 1 CACHE BOOL "Flag signifying Tk man pages are generated" FORCE)
-	MARK_AS_ADVANCED(TKMAN_GENERATED)
+	endforeach(manfile ${tk_MANN})
+	set(TKMAN_GENERATED 1 CACHE BOOL "Flag signifying Tk man pages are generated" FORCE)
+	mark_as_advanced(TKMAN_GENERATED)
 
-ENDIF(SED_EXEC AND SH_EXEC AND NOT TKMAN_GENERATED)
+endif(SED_EXEC AND SH_EXEC AND NOT TKMAN_GENERATED)
 
-IF(TKMAN_GENERATED)
-	FILE(GLOB TK_MAN1 "${CMAKE_CURRENT_BINARY_DIR}/man1/*")
+if(TKMAN_GENERATED)
+	file(GLOB TK_MAN1 "${CMAKE_CURRENT_BINARY_DIR}/man1/*")
         foreach(man ${TK_MAN1})
 			 set_source_files_properties(${man} PROPERTIES GENERATED TRUE)
           get_filename_component(tkman1 ${man} NAME)
@@ -233,9 +233,9 @@
             endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
           endif (NOT CMAKE_CONFIGURATION_TYPES)
         endforeach(man ${TK_MAN1})
-	INSTALL(FILES ${TK_MAN1} DESTINATION ${MAN_DIR}/man1)
+	install(FILES ${TK_MAN1} DESTINATION ${MAN_DIR}/man1)
 
-	FILE(GLOB TK_MAN3 "${CMAKE_CURRENT_BINARY_DIR}/man3/*")
+	file(GLOB TK_MAN3 "${CMAKE_CURRENT_BINARY_DIR}/man3/*")
         foreach(man ${TK_MAN3})
 			 set_source_files_properties(${man} PROPERTIES GENERATED TRUE)
           get_filename_component(tkman3 ${man} NAME)
@@ -248,9 +248,9 @@
             endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
           endif (NOT CMAKE_CONFIGURATION_TYPES)
         endforeach(man ${TK_MAN3})
-	INSTALL(FILES ${TK_MAN3} DESTINATION ${MAN_DIR}/man3)
+	install(FILES ${TK_MAN3} DESTINATION ${MAN_DIR}/man3)
 
-	FILE(GLOB TK_MANN "${CMAKE_CURRENT_BINARY_DIR}/mann/*")
+	file(GLOB TK_MANN "${CMAKE_CURRENT_BINARY_DIR}/mann/*")
         foreach(man ${TK_MANN})
 			 set_source_files_properties(${man} PROPERTIES GENERATED TRUE)
           get_filename_component(tkmann ${man} NAME)
@@ -263,5 +263,5 @@
             endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
           endif (NOT CMAKE_CONFIGURATION_TYPES)
         endforeach(man ${TK_MANN})
-	INSTALL(FILES ${TK_MANN} DESTINATION ${MAN_DIR}/mann)
-ENDIF(TKMAN_GENERATED)
+	install(FILES ${TK_MANN} DESTINATION ${MAN_DIR}/mann)
+endif(TKMAN_GENERATED)
Index: src/other/perplex/CMakeLists.txt
===================================================================
--- src/other/perplex/CMakeLists.txt	(revision 54114)
+++ src/other/perplex/CMakeLists.txt	(working copy)
@@ -34,14 +34,14 @@
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 ###
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-IF(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND CMAKE_POLICY)
+cmake_minimum_required(VERSION 2.8)
+if(COMMAND CMAKE_POLICY)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND CMAKE_POLICY)
 
-PROJECT(PERPLEX)
+project(PERPLEX)
 
-INCLUDE_DIRECTORIES(
+include_directories(
   ${CMAKE_CURRENT_BINARY_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}
   )
@@ -53,8 +53,8 @@
   set(CMAKE_MODULE_PATH "${PERPLEX_CMAKE_DIR};${CMAKE_MODULE_PATH}")
 endif(PERPLEX_IS_SUBBUILD)
 
-FIND_PACKAGE(LEMON)
-FIND_PACKAGE(RE2C)
+find_package(LEMON)
+find_package(RE2C)
 
 if(NOT LEMON_EXECUTABLE OR NOT RE2C_EXECUTABLE)
   message(FATAL_ERROR "Perplex requires the LEMON Parser Generator and the re2c scanner generator.")
@@ -67,9 +67,9 @@
   include(${PERPLEX_CMAKE_DIR}/RE2C_Util.cmake)
 endif(NOT COMMAND RE2C_TARGET)
 
-RE2C_TARGET(PERPLEX scanner.re ${CMAKE_CURRENT_BINARY_DIR}/scanner.c COMPILE_FLAGS "-c")
-LEMON_TARGET(PERPLEX parser.y parser.c parser.h)
-ADD_RE2C_LEMON_DEPENDENCY(PERPLEX PERPLEX)
+re2c_target(PERPLEX scanner.re ${CMAKE_CURRENT_BINARY_DIR}/scanner.c COMPILE_FLAGS "-c")
+lemon_target(PERPLEX parser.y parser.c parser.h)
+add_re2c_lemon_dependency(PERPLEX PERPLEX)
 
 set(perplex_sources
   ${LEMON_PERPLEX_OUTPUT_SOURCE}
Index: src/other/perplex/CMake/RE2C_Util.cmake
===================================================================
--- src/other/perplex/CMake/RE2C_Util.cmake	(revision 54114)
+++ src/other/perplex/CMake/RE2C_Util.cmake	(working copy)
@@ -77,7 +77,7 @@
     if(${ARGC} EQUAL 5)
       if("${ARGV3}" STREQUAL "COMPILE_FLAGS")
 	set(RE2C_EXECUTABLE_opts  "${ARGV4}")
-	SEPARATE_ARGUMENTS(RE2C_EXECUTABLE_opts)
+	separate_arguments(RE2C_EXECUTABLE_opts)
       else()
 	message(SEND_ERROR ${RE2C_TARGET_usage})
       endif()
Index: src/other/perplex/CMake/FindLEMON.cmake
===================================================================
--- src/other/perplex/CMake/FindLEMON.cmake	(revision 54114)
+++ src/other/perplex/CMake/FindLEMON.cmake	(working copy)
@@ -60,7 +60,7 @@
   endif(lemon_path)
 endif(LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LEMON DEFAULT_MSG LEMON_EXECUTABLE LEMON_TEMPLATE)
+find_package_handle_standard_args(LEMON DEFAULT_MSG LEMON_EXECUTABLE LEMON_TEMPLATE)
 mark_as_advanced(LEMON_TEMPLATE)
 
 #============================================================
Index: src/other/perplex/CMake/FindRE2C.cmake
===================================================================
--- src/other/perplex/CMake/FindRE2C.cmake	(revision 54114)
+++ src/other/perplex/CMake/FindRE2C.cmake	(working copy)
@@ -7,4 +7,4 @@
 mark_as_advanced(RE2C_EXECUTABLE)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(RE2C DEFAULT_MSG RE2C_EXECUTABLE)
+find_package_handle_standard_args(RE2C DEFAULT_MSG RE2C_EXECUTABLE)
Index: src/other/xmltools/libexslt/CMakeLists.txt
===================================================================
--- src/other/xmltools/libexslt/CMakeLists.txt	(revision 54114)
+++ src/other/xmltools/libexslt/CMakeLists.txt	(working copy)
@@ -1,13 +1,13 @@
 
-SET(VERSION "0.8.15")
-SET(LIBEXSLT_VERSION_NUMBER 815)
-SET(LIBEXSLT_VERSION_EXTRA "-BRLCAD")
-SET(WITH_CRYPTO 0)
+set(VERSION "0.8.15")
+set(LIBEXSLT_VERSION_NUMBER 815)
+set(LIBEXSLT_VERSION_EXTRA "-BRLCAD")
+set(WITH_CRYPTO 0)
 
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/exsltconfig.h.in
   ${CMAKE_CURRENT_BINARY_DIR}/../include/libexslt/exsltconfig.h)
 
-SET(libexslt_srcs
+set(libexslt_srcs
   src/common.c
   src/crypto.c
   src/date.c
Index: src/other/xmltools/libxml/CMakeLists.txt
===================================================================
--- src/other/xmltools/libxml/CMakeLists.txt	(revision 54114)
+++ src/other/xmltools/libxml/CMakeLists.txt	(working copy)
@@ -1,93 +1,93 @@
-FIND_PACKAGE(ZLIB)
-IF(ZLIB_LIBRARY)
-  SET(HAVE_ZLIB 1)
-  SET(HAVE_ZLIB_H 1)
+find_package(ZLIB)
+if(ZLIB_LIBRARY)
+  set(HAVE_ZLIB 1)
+  set(HAVE_ZLIB_H 1)
   include_directories(${ZLIB_INCLUDE_DIR})
-ELSE(ZLIB_LIBRARY)
-  SET(ZLIB_LIBRARY "")
-  SET(ZLIB_INCLUDE_DIR "")
-ENDIF(ZLIB_LIBRARY)
-FIND_PACKAGE(Threads)
-INCLUDE(CheckIncludeFile)
-IF(CMAKE_THREAD_LIBS_INIT)
-  CHECK_INCLUDE_FILE(pthread.h HAVE_PTHREAD_H)
+else(ZLIB_LIBRARY)
+  set(ZLIB_LIBRARY "")
+  set(ZLIB_INCLUDE_DIR "")
+endif(ZLIB_LIBRARY)
+find_package(Threads)
+include(CheckIncludeFile)
+if(CMAKE_THREAD_LIBS_INIT)
+  check_include_file(pthread.h HAVE_PTHREAD_H)
   add_definitions(-DLIBXML_THREAD_ENABLED)
-ENDIF(CMAKE_THREAD_LIBS_INIT)
-IF(CMAKE_USE_PTHREADS_INIT)
-  SET(HAVE_LIBPTHREAD 1)
-ENDIF(CMAKE_USE_PTHREADS_INIT)
+endif(CMAKE_THREAD_LIBS_INIT)
+if(CMAKE_USE_PTHREADS_INIT)
+  set(HAVE_LIBPTHREAD 1)
+endif(CMAKE_USE_PTHREADS_INIT)
 
-CHECK_INCLUDE_FILE(ansidecl.h HAVE_ANSIDECL_H)
-CHECK_INCLUDE_FILE(arpa/inet.h HAVE_ARPA_INET_H)
-CHECK_INCLUDE_FILE(arpa/nameser.h HAVE_ARPA_NAMESER_H)
-CHECK_INCLUDE_FILE(ctype.h HAVE_CTYPE_H)
-CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
-CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
-CHECK_INCLUDE_FILE(dl.h HAVE_DL_H)
-CHECK_INCLUDE_FILE(errno.h HAVE_ERRNO_H)
-CHECK_INCLUDE_FILE(fcntl.h HAVE_FCNTL_H)
-CHECK_INCLUDE_FILE(float.h HAVE_FLOAT_H)
-CHECK_INCLUDE_FILE(fp_class.h HAVE_FP_CLASS_H)
-CHECK_INCLUDE_FILE(ieeefp.h HAVE_IEEEFP_H)
-CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
-CHECK_INCLUDE_FILE(inttypes.h.h HAVE_INTTYPES_H_H)
-CHECK_INCLUDE_FILE(limits.h HAVE_LIMITS_H)
-CHECK_INCLUDE_FILE(malloc.h HAVE_MALLOC_H)
-CHECK_INCLUDE_FILE(math.h HAVE_MATH_H)
-CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
-CHECK_INCLUDE_FILE(nan.h HAVE_NAN_H)
-CHECK_INCLUDE_FILE(ndir.h HAVE_NDIR_H)
-CHECK_INCLUDE_FILE(netdb.h HAVE_NETDB_H)
-CHECK_INCLUDE_FILE(netinet/in.h HAVE_NETINET_IN_H)
-CHECK_INCLUDE_FILE(poll.h HAVE_POLL_H)
-CHECK_INCLUDE_FILE(resolv.h HAVE_RESOLV_H)
-CHECK_INCLUDE_FILE(signal.h HAVE_SIGNAL_H)
-CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
-CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
-CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
+check_include_file(ansidecl.h HAVE_ANSIDECL_H)
+check_include_file(arpa/inet.h HAVE_ARPA_INET_H)
+check_include_file(arpa/nameser.h HAVE_ARPA_NAMESER_H)
+check_include_file(ctype.h HAVE_CTYPE_H)
+check_include_file(dirent.h HAVE_DIRENT_H)
+check_include_file(dlfcn.h HAVE_DLFCN_H)
+check_include_file(dl.h HAVE_DL_H)
+check_include_file(errno.h HAVE_ERRNO_H)
+check_include_file(fcntl.h HAVE_FCNTL_H)
+check_include_file(float.h HAVE_FLOAT_H)
+check_include_file(fp_class.h HAVE_FP_CLASS_H)
+check_include_file(ieeefp.h HAVE_IEEEFP_H)
+check_include_file(inttypes.h HAVE_INTTYPES_H)
+check_include_file(inttypes.h.h HAVE_INTTYPES_H_H)
+check_include_file(limits.h HAVE_LIMITS_H)
+check_include_file(malloc.h HAVE_MALLOC_H)
+check_include_file(math.h HAVE_MATH_H)
+check_include_file(memory.h HAVE_MEMORY_H)
+check_include_file(nan.h HAVE_NAN_H)
+check_include_file(ndir.h HAVE_NDIR_H)
+check_include_file(netdb.h HAVE_NETDB_H)
+check_include_file(netinet/in.h HAVE_NETINET_IN_H)
+check_include_file(poll.h HAVE_POLL_H)
+check_include_file(resolv.h HAVE_RESOLV_H)
+check_include_file(signal.h HAVE_SIGNAL_H)
+check_include_file(stdarg.h HAVE_STDARG_H)
+check_include_file(stdint.h HAVE_STDINT_H)
+check_include_file(stdlib.h HAVE_STDLIB_H)
+check_include_file(strings.h HAVE_STRINGS_H)
+check_include_file(string.h HAVE_STRING_H)
 #CHECK_INCLUDE_FILE(sys/dir.h HAVE_SYS_DIR_H)
-CHECK_INCLUDE_FILE(sys/mman.h HAVE_SYS_MMAN_H)
-CHECK_INCLUDE_FILE(sys/ndir.h HAVE_SYS_NDIR_H)
-CHECK_INCLUDE_FILE(sys/select.h HAVE_SYS_SELECT_H)
-CHECK_INCLUDE_FILE(sys/socket.h HAVE_SYS_SOCKET_H)
-CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
-CHECK_INCLUDE_FILE(sys/timeb.h HAVE_SYS_TIMEB_H)
-CHECK_INCLUDE_FILE(sys/time.h HAVE_SYS_TIME_H)
-CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
-CHECK_INCLUDE_FILE(time.h HAVE_TIME_H)
-CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
+check_include_file(sys/mman.h HAVE_SYS_MMAN_H)
+check_include_file(sys/ndir.h HAVE_SYS_NDIR_H)
+check_include_file(sys/select.h HAVE_SYS_SELECT_H)
+check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
+check_include_file(sys/stat.h HAVE_SYS_STAT_H)
+check_include_file(sys/timeb.h HAVE_SYS_TIMEB_H)
+check_include_file(sys/time.h HAVE_SYS_TIME_H)
+check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+check_include_file(time.h HAVE_TIME_H)
+check_include_file(unistd.h HAVE_UNISTD_H)
 
-INCLUDE(CheckFunctionExists)
-CHECK_FUNCTION_EXISTS(finite HAVE_FINITE)
-CHECK_FUNCTION_EXISTS(printf HAVE_PRINTF)
-CHECK_FUNCTION_EXISTS(fprintf HAVE_FPRINTF)
-CHECK_FUNCTION_EXISTS(sprintf HAVE_SPRINTF)
-CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
-CHECK_FUNCTION_EXISTS(vfprintf HAVE_VFPRINTF)
-CHECK_FUNCTION_EXISTS(vsnprintf HAVE_VSNPRINTF)
-CHECK_FUNCTION_EXISTS(vsprintf HAVE_VSPRINTF)
-CHECK_FUNCTION_EXISTS(ftime HAVE_FTIME)
-CHECK_FUNCTION_EXISTS(getaddrinfo HAVE_GETADDRINFO)
-CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
-CHECK_FUNCTION_EXISTS(isinf HAVE_ISINF)
-CHECK_FUNCTION_EXISTS(isnan HAVE_ISNAN)
-CHECK_FUNCTION_EXISTS(localtime HAVE_LOCALTIME)
-CHECK_FUNCTION_EXISTS(signal HAVE_SIGNAL)
-CHECK_FUNCTION_EXISTS(sscanf HAVE_SSCANF)
-IF(NOT MSVC)
-  CHECK_FUNCTION_EXISTS(stat HAVE_STAT)
-ELSE(NOT MSVC)
-  SET(HAVE_STAT 0)
-ENDIF(NOT MSVC)
-CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP)
-CHECK_FUNCTION_EXISTS(strndup HAVE_STRNDUP)
-CHECK_FUNCTION_EXISTS(strerror HAVE_STRERROR)
-CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME)
+include(CheckFunctionExists)
+check_function_exists(finite HAVE_FINITE)
+check_function_exists(printf HAVE_PRINTF)
+check_function_exists(fprintf HAVE_FPRINTF)
+check_function_exists(sprintf HAVE_SPRINTF)
+check_function_exists(snprintf HAVE_SNPRINTF)
+check_function_exists(vfprintf HAVE_VFPRINTF)
+check_function_exists(vsnprintf HAVE_VSNPRINTF)
+check_function_exists(vsprintf HAVE_VSPRINTF)
+check_function_exists(ftime HAVE_FTIME)
+check_function_exists(getaddrinfo HAVE_GETADDRINFO)
+check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
+check_function_exists(isinf HAVE_ISINF)
+check_function_exists(isnan HAVE_ISNAN)
+check_function_exists(localtime HAVE_LOCALTIME)
+check_function_exists(signal HAVE_SIGNAL)
+check_function_exists(sscanf HAVE_SSCANF)
+if(NOT MSVC)
+  check_function_exists(stat HAVE_STAT)
+else(NOT MSVC)
+  set(HAVE_STAT 0)
+endif(NOT MSVC)
+check_function_exists(strdup HAVE_STRDUP)
+check_function_exists(strndup HAVE_STRNDUP)
+check_function_exists(strerror HAVE_STRERROR)
+check_function_exists(strftime HAVE_STRFTIME)
 
-INCLUDE(CheckCSourceCompiles)
-SET(va_copy_srcs "
+include(CheckCSourceCompiles)
+set(va_copy_srcs "
 #include <stdarg.h> 
 va_list ap1,ap2; 
 int main () { 
@@ -95,77 +95,77 @@
    return 0; 
 }
 ")
-CHECK_C_SOURCE_COMPILES("${va_copy_srcs}" HAVE_VA_COPY)
+check_c_source_compiles("${va_copy_srcs}" HAVE_VA_COPY)
 
-CHECK_FUNCTION_EXISTS(__va_copy HAVE___VA_COPY)
+check_function_exists(__va_copy HAVE___VA_COPY)
 
-INCLUDE(CheckLibraryExists)
-INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/../CMake/ResolveCompilerPaths.cmake)
-CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_STD_DLOPEN)
-IF(HAVE_STD_DLOPEN)
-  RESOLVE_LIBRARIES(DL_LIBRARY "-ldl")
-  SET(HAVE_DLOPEN 1)
-ELSE(HAVE_STD_DLOPEN)
-  CHECK_LIBRARY_EXISTS(c dlopen "" HAVE_C_DLOPEN)
-  IF(HAVE_C_DLOPEN)
-    RESOLVE_LIBRARIES(DL_LIBRARY "-lc")
-    SET(HAVE_DLOPEN 1)
-  ENDIF(HAVE_C_DLOPEN)
-ENDIF(HAVE_STD_DLOPEN)
+include(CheckLibraryExists)
+include(${CMAKE_CURRENT_SOURCE_DIR}/../CMake/ResolveCompilerPaths.cmake)
+check_library_exists(dl dlopen "" HAVE_STD_DLOPEN)
+if(HAVE_STD_DLOPEN)
+  resolve_libraries(DL_LIBRARY "-ldl")
+  set(HAVE_DLOPEN 1)
+else(HAVE_STD_DLOPEN)
+  check_library_exists(c dlopen "" HAVE_C_DLOPEN)
+  if(HAVE_C_DLOPEN)
+    resolve_libraries(DL_LIBRARY "-lc")
+    set(HAVE_DLOPEN 1)
+  endif(HAVE_C_DLOPEN)
+endif(HAVE_STD_DLOPEN)
 
 
-CHECK_LIBRARY_EXISTS(m pow "" HAVE_MATH_LIB)
-IF(HAVE_MATH_LIB)
-  RESOLVE_LIBRARIES(M_LIBRARY "-lm")
-ENDIF(HAVE_MATH_LIB)
+check_library_exists(m pow "" HAVE_MATH_LIB)
+if(HAVE_MATH_LIB)
+  resolve_libraries(M_LIBRARY "-lm")
+endif(HAVE_MATH_LIB)
 
-SET(WITH_TRIO 0)
-IF(CMAKE_THREAD_LIBS_INIT OR MSVC)
-  SET(WITH_THREADS 1)
-ELSE(CMAKE_THREAD_LIBS_INIT OR MSVC)
-  SET(WITH_THREADS 0)
-ENDIF(CMAKE_THREAD_LIBS_INIT OR MSVC)
-SET(WITH_TREE 1)
-SET(WITH_OUTPUT 1)
-SET(WITH_PUSH 1)
-SET(WITH_READER 1)
-SET(WITH_PATTERN 1)
-SET(WITH_WRITER 1)
-SET(WITH_SAX1 1)
-SET(WITH_FTP 0)
-SET(WITH_HTTP 0)
-SET(WITH_VALID 1)
-SET(WITH_HTML 1)
-SET(WITH_LEGACY 1)
-SET(WITH_C14N 1)
-SET(WITH_CATALOG 1)
-SET(WITH_DOCB 1)
-SET(WITH_XPATH 1)
-SET(WITH_XPTR 1)
-SET(WITH_XINCLUDE 1)
-SET(WITH_ICONV 0)
-SET(WITH_ICU 0)
-SET(WITH_ISO8859X 1)
-SET(WITH_DEBUG 1)
-SET(WITH_MEM_DEBUG 0)
-SET(WITH_RUN_DEBUG 0)
-SET(WITH_REGEXPS 1)
-SET(WITH_SCHEMAS 1)
-SET(WITH_SCHEMATRON 1)
-SET(WITH_MODULES 0)
-SET(WITH_ZLIB 1)
+set(WITH_TRIO 0)
+if(CMAKE_THREAD_LIBS_INIT OR MSVC)
+  set(WITH_THREADS 1)
+else(CMAKE_THREAD_LIBS_INIT OR MSVC)
+  set(WITH_THREADS 0)
+endif(CMAKE_THREAD_LIBS_INIT OR MSVC)
+set(WITH_TREE 1)
+set(WITH_OUTPUT 1)
+set(WITH_PUSH 1)
+set(WITH_READER 1)
+set(WITH_PATTERN 1)
+set(WITH_WRITER 1)
+set(WITH_SAX1 1)
+set(WITH_FTP 0)
+set(WITH_HTTP 0)
+set(WITH_VALID 1)
+set(WITH_HTML 1)
+set(WITH_LEGACY 1)
+set(WITH_C14N 1)
+set(WITH_CATALOG 1)
+set(WITH_DOCB 1)
+set(WITH_XPATH 1)
+set(WITH_XPTR 1)
+set(WITH_XINCLUDE 1)
+set(WITH_ICONV 0)
+set(WITH_ICU 0)
+set(WITH_ISO8859X 1)
+set(WITH_DEBUG 1)
+set(WITH_MEM_DEBUG 0)
+set(WITH_RUN_DEBUG 0)
+set(WITH_REGEXPS 1)
+set(WITH_SCHEMAS 1)
+set(WITH_SCHEMATRON 1)
+set(WITH_MODULES 0)
+set(WITH_ZLIB 1)
 
-SET(LIBXML_VERSION "2.7.8")
-SET(LIBXML_VERSION_NUMBER "20708")
-SET(LIBXML_VERSION_EXTRA "-BRLCAD")
+set(LIBXML_VERSION "2.7.8")
+set(LIBXML_VERSION_NUMBER "20708")
+set(LIBXML_VERSION_EXTRA "-BRLCAD")
 
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/libxml/xmlversion.h.in
   ${CMAKE_CURRENT_BINARY_DIR}/../include/libxml/xmlversion.h)
 
-IF(WIN32)
+if(WIN32)
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/libxml/xmlwin32version.h.in
     ${CMAKE_CURRENT_BINARY_DIR}/../include/libxml/xmlwin32version.h)
-ENDIF(WIN32)
+endif(WIN32)
 
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
   ${CMAKE_CURRENT_BINARY_DIR}/../include/libxml/config.h)
@@ -179,18 +179,18 @@
   /usr/local/include
   )
 
-IF(WITH_TRIO)
-  SET(trio_srcs
+if(WITH_TRIO)
+  set(trio_srcs
     src/trio.c
     src/triostr.c
     )
-ELSE(WITH_TRIO)
-  SET(trio_srcs
+else(WITH_TRIO)
+  set(trio_srcs
     src/trionan.c
     )
-ENDIF(WITH_TRIO)
+endif(WITH_TRIO)
 
-SET(libxml_srcs
+set(libxml_srcs
   src/DOCBparser.c
   src/HTMLparser.c
   src/HTMLtree.c
Index: src/other/xmltools/CMakeLists.txt
===================================================================
--- src/other/xmltools/CMakeLists.txt	(revision 54114)
+++ src/other/xmltools/CMakeLists.txt	(working copy)
@@ -1,30 +1,30 @@
 # Minimum required version of CMake
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-IF(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND CMAKE_POLICY)
+cmake_minimum_required(VERSION 2.8)
+if(COMMAND CMAKE_POLICY)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND CMAKE_POLICY)
 
 # Set CMake project name
-PROJECT(XSLTPROC)
+project(XSLTPROC)
 
-INCLUDE(CheckIncludeFile)
-CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-CHECK_INCLUDE_FILE(sys/time.h HAVE_SYS_TIME_H)
-CHECK_INCLUDE_FILE(time.h HAVE_TIME_H)
-CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
-CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
-CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
+include(CheckIncludeFile)
+check_include_file(string.h HAVE_STRING_H)
+check_include_file(sys/time.h HAVE_SYS_TIME_H)
+check_include_file(time.h HAVE_TIME_H)
+check_include_file(sys/stat.h HAVE_SYS_STAT_H)
+check_include_file(unistd.h HAVE_UNISTD_H)
+check_include_file(stdlib.h HAVE_STDLIB_H)
+check_include_file(stdarg.h HAVE_STDARG_H)
 
-IF(WIN32)
+if(WIN32)
   add_definitions(-DWIN32 -D_WINDOWS -D_MBCS -DW3 -D_REENTRANT -D_DEBUG)
   add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
   add_definitions(-DNOLIBTOOL -DHAVE_WIN32_THREADS -DHAVE_COMPILER_TLS)
-ENDIF(WIN32)
+endif(WIN32)
 
-ADD_SUBDIRECTORY(libxml)
-ADD_SUBDIRECTORY(libxslt)
-ADD_SUBDIRECTORY(libexslt)
+add_subdirectory(libxml)
+add_subdirectory(libxslt)
+add_subdirectory(libexslt)
 
 include_directories(
   ${CMAKE_CURRENT_SOURCE_DIR}/libxml/include
Index: src/other/xmltools/libxslt/CMakeLists.txt
===================================================================
--- src/other/xmltools/libxslt/CMakeLists.txt	(revision 54114)
+++ src/other/xmltools/libxslt/CMakeLists.txt	(working copy)
@@ -1,79 +1,79 @@
-FIND_PACKAGE(Threads)
-INCLUDE(CheckIncludeFile)
-IF(CMAKE_THREAD_LIBS_INIT)
-  CHECK_INCLUDE_FILE(pthread.h HAVE_PTHREAD_H)
+find_package(Threads)
+include(CheckIncludeFile)
+if(CMAKE_THREAD_LIBS_INIT)
+  check_include_file(pthread.h HAVE_PTHREAD_H)
   add_definitions(-DLIBXML_THREAD_ENABLED)
-ENDIF(CMAKE_THREAD_LIBS_INIT)
-IF(CMAKE_USE_PTHREADS_INIT)
-  SET(HAVE_LIBPTHREAD 1)
-ENDIF(CMAKE_USE_PTHREADS_INIT)
+endif(CMAKE_THREAD_LIBS_INIT)
+if(CMAKE_USE_PTHREADS_INIT)
+  set(HAVE_LIBPTHREAD 1)
+endif(CMAKE_USE_PTHREADS_INIT)
 
-CHECK_INCLUDE_FILE(ansidecl.h HAVE_ANSIDECL_H)
-CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
-CHECK_INCLUDE_FILE(float.h HAVE_FLOAT_H)
-CHECK_INCLUDE_FILE(fp_class.h HAVE_FP_CLASS_H)
-CHECK_INCLUDE_FILE(ieeefp.h HAVE_IEEEFP_H)
-CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
-CHECK_INCLUDE_FILE(locale.h HAVE_LOCALE_H)
-CHECK_INCLUDE_FILE(math.h HAVE_MATH_H)
-CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
-CHECK_INCLUDE_FILE(nan.h HAVE_NAN_H)
-CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
-CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
-CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
-CHECK_INCLUDE_FILE(sys/select.h HAVE_SYS_SELECT_H)
-CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
-CHECK_INCLUDE_FILE(sys/timeb.h HAVE_SYS_TIMEB_H)
-CHECK_INCLUDE_FILE(sys/time.h HAVE_SYS_TIME_H)
-CHECK_INCLUDE_FILE(time.h HAVE_TIME_H)
-CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
-CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
-CHECK_INCLUDE_FILE(xlocale.h HAVE_XLOCALE_H)
+check_include_file(ansidecl.h HAVE_ANSIDECL_H)
+check_include_file(dlfcn.h HAVE_DLFCN_H)
+check_include_file(float.h HAVE_FLOAT_H)
+check_include_file(fp_class.h HAVE_FP_CLASS_H)
+check_include_file(ieeefp.h HAVE_IEEEFP_H)
+check_include_file(inttypes.h HAVE_INTTYPES_H)
+check_include_file(locale.h HAVE_LOCALE_H)
+check_include_file(math.h HAVE_MATH_H)
+check_include_file(memory.h HAVE_MEMORY_H)
+check_include_file(nan.h HAVE_NAN_H)
+check_include_file(stdarg.h HAVE_STDARG_H)
+check_include_file(stdint.h HAVE_STDINT_H)
+check_include_file(stdlib.h HAVE_STDLIB_H)
+check_include_file(strings.h HAVE_STRINGS_H)
+check_include_file(string.h HAVE_STRING_H)
+check_include_file(sys/select.h HAVE_SYS_SELECT_H)
+check_include_file(sys/stat.h HAVE_SYS_STAT_H)
+check_include_file(sys/timeb.h HAVE_SYS_TIMEB_H)
+check_include_file(sys/time.h HAVE_SYS_TIME_H)
+check_include_file(time.h HAVE_TIME_H)
+check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+check_include_file(unistd.h HAVE_UNISTD_H)
+check_include_file(xlocale.h HAVE_XLOCALE_H)
 
-INCLUDE(CheckFunctionExists)
-CHECK_FUNCTION_EXISTS(asctime HAVE_ASCTIME)
-CHECK_FUNCTION_EXISTS(clock_gettime HAVE_CLOCK_GETTIME)
-CHECK_FUNCTION_EXISTS(printf HAVE_PRINTF)
-CHECK_FUNCTION_EXISTS(fprintf HAVE_FPRINTF)
-CHECK_FUNCTION_EXISTS(sprintf HAVE_SPRINTF)
-CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
-CHECK_FUNCTION_EXISTS(vfprintf HAVE_VFPRINTF)
-CHECK_FUNCTION_EXISTS(vsprintf HAVE_VSPRINTF)
-CHECK_FUNCTION_EXISTS(vsnprintf HAVE_VSNPRINTF)
-CHECK_FUNCTION_EXISTS(ftime HAVE_FTIME)
-CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
-CHECK_FUNCTION_EXISTS(gmtime_r HAVE_GMTIME_R)
-CHECK_FUNCTION_EXISTS(localtime HAVE_LOCALTIME)
-CHECK_FUNCTION_EXISTS(localtime_r HAVE_LOCALTIME_R)
-CHECK_FUNCTION_EXISTS(mktime HAVE_MKTIME)
-CHECK_FUNCTION_EXISTS(sscanf HAVE_SSCANF)
-CHECK_FUNCTION_EXISTS(stat HAVE_STAT)
-CHECK_FUNCTION_EXISTS(time HAVE_TIME)
+include(CheckFunctionExists)
+check_function_exists(asctime HAVE_ASCTIME)
+check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
+check_function_exists(printf HAVE_PRINTF)
+check_function_exists(fprintf HAVE_FPRINTF)
+check_function_exists(sprintf HAVE_SPRINTF)
+check_function_exists(snprintf HAVE_SNPRINTF)
+check_function_exists(vfprintf HAVE_VFPRINTF)
+check_function_exists(vsprintf HAVE_VSPRINTF)
+check_function_exists(vsnprintf HAVE_VSNPRINTF)
+check_function_exists(ftime HAVE_FTIME)
+check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
+check_function_exists(gmtime_r HAVE_GMTIME_R)
+check_function_exists(localtime HAVE_LOCALTIME)
+check_function_exists(localtime_r HAVE_LOCALTIME_R)
+check_function_exists(mktime HAVE_MKTIME)
+check_function_exists(sscanf HAVE_SSCANF)
+check_function_exists(stat HAVE_STAT)
+check_function_exists(time HAVE_TIME)
 
-SET(WITH_XSLT_DEBUG 1)
-SET(WITH_MEM_DEBUG 0)
-SET(WITH_TRIO 0)
-SET(WITH_DEBUGGER 1)
-SET(WITH_MODULES 0)
-IF(NOT WIN32)
-  SET(LIBXSLT_DEFAULT_PLUGINS_PATH "${CMAKE_INSTALL_PREFIX}/lib/libxslt-plugins")
-ENDIF(NOT WIN32)
-IF(HAVE_XLOCALE_H)
-  SET(XSLT_LOCALE_XLOCALE 1)
-ELSE(HAVE_XLOCALE_H)
-  SET(XSLT_LOCALE_XLOCALE 0)
-ENDIF(HAVE_XLOCALE_H)
-IF(WIN32)
-  SET(XSLT_LOCALE_WINAPI 1)
-ELSE(WIN32)
-  SET(XSLT_LOCALE_WINAPI 0)
-ENDIF(WIN32)
+set(WITH_XSLT_DEBUG 1)
+set(WITH_MEM_DEBUG 0)
+set(WITH_TRIO 0)
+set(WITH_DEBUGGER 1)
+set(WITH_MODULES 0)
+if(NOT WIN32)
+  set(LIBXSLT_DEFAULT_PLUGINS_PATH "${CMAKE_INSTALL_PREFIX}/lib/libxslt-plugins")
+endif(NOT WIN32)
+if(HAVE_XLOCALE_H)
+  set(XSLT_LOCALE_XLOCALE 1)
+else(HAVE_XLOCALE_H)
+  set(XSLT_LOCALE_XLOCALE 0)
+endif(HAVE_XLOCALE_H)
+if(WIN32)
+  set(XSLT_LOCALE_WINAPI 1)
+else(WIN32)
+  set(XSLT_LOCALE_WINAPI 0)
+endif(WIN32)
 
-SET(VERSION "1.1.26")
-SET(LIBXSLT_VERSION_NUMBER 10126)
-SET(LIBXSLT_VERSION_EXTRA "-BRLCAD")
+set(VERSION "1.1.26")
+set(LIBXSLT_VERSION_NUMBER 10126)
+set(LIBXSLT_VERSION_EXTRA "-BRLCAD")
 
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
   ${CMAKE_CURRENT_BINARY_DIR}/../include/libxslt/config.h)
@@ -81,7 +81,7 @@
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/xsltconfig.h.in
   ${CMAKE_CURRENT_BINARY_DIR}/../include/libxslt/xsltconfig.h)
 
-SET(libxslt_srcs
+set(libxslt_srcs
   src/attributes.c
   src/attrvt.c
   src/documents.c
Index: src/other/tkpng/CMakeLists.txt
===================================================================
--- src/other/tkpng/CMakeLists.txt	(revision 54114)
+++ src/other/tkpng/CMakeLists.txt	(working copy)
@@ -1,13 +1,13 @@
 # Minimum required version of CMake
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-IF(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND CMAKE_POLICY)
+cmake_minimum_required(VERSION 2.8)
+if(COMMAND CMAKE_POLICY)
+  cmake_policy(SET CMP0003 NEW)
+endif(COMMAND CMAKE_POLICY)
 
 # set CMake project name
-PROJECT(TKPNG)
+project(TKPNG)
 
-SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/CMake")
+set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/CMake")
 
 find_package(ZLIB)
 find_package(TCL)
@@ -22,21 +22,21 @@
   ${X11_INCLUDE_DIR}
   )
 
-SET(TKPNG_PKGNAME tkpng)
-SET(TKPNG_PKGVERSION "0.8")
+set(TKPNG_PKGNAME tkpng)
+set(TKPNG_PKGVERSION "0.8")
 
-SET(TKPNG_SRCS
+set(TKPNG_SRCS
   generic/tkImgPNG.c
   generic/tkImgPNGInit.c
   )
 
 add_library(tkpng SHARED ${TKPNG_SRCS})
 target_link_libraries(tkpng ${TCL_LIBRARY} ${TCL_TK_LIBRARY} ${ZLIB_LIBRARY} ${X11_LIBRARIES})
-SET_TARGET_PROPERTIES(tkpng PROPERTIES VERSION ${TKPNG_PKGVERSION})
+set_target_properties(tkpng PROPERTIES VERSION ${TKPNG_PKGVERSION})
 install(TARGETS tkpng 
 	RUNTIME DESTINATION ${BIN_DIR}
 	LIBRARY DESTINATION ${LIB_DIR}
 	ARCHIVE DESTINATION ${LIB_DIR})
 
 # Create the pkgIndex.tcl file.
-TCL_PKGINDEX(tkpng ${TKPNG_PKGNAME} ${TKPNG_PKGVERSION})
+tcl_pkgindex(tkpng ${TKPNG_PKGNAME} ${TKPNG_PKGVERSION})
Index: src/other/tkpng/CMake/FindZLIB.cmake
===================================================================
--- src/other/tkpng/CMake/FindZLIB.cmake	(revision 54114)
+++ src/other/tkpng/CMake/FindZLIB.cmake	(working copy)
@@ -23,31 +23,31 @@
 # (To distributed this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
+find_path(ZLIB_INCLUDE_DIR zlib.h
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]/include"
 )
 
-SET(ZLIB_NAMES z zlib zdll)
-FIND_LIBRARY(ZLIB_LIBRARY
+set(ZLIB_NAMES z zlib zdll)
+find_library(ZLIB_LIBRARY
     NAMES
         ${ZLIB_NAMES}
     PATHS
         "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]/lib"
 )
-MARK_AS_ADVANCED(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
+mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
 
-IF (ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
-    FILE(READ "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H)
-    STRING(REGEX REPLACE ".*#define ZLIB_VERSION \"([0-9]+)\\.([0-9]+)\\.([0-9]+)\".*" "\\1.\\2.\\3" ZLIB_VERSION_STRING "${ZLIB_H}")
-ENDIF()
+if (ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
+    file(READ "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H)
+    string(REGEX REPLACE ".*#define ZLIB_VERSION \"([0-9]+)\\.([0-9]+)\\.([0-9]+)\".*" "\\1.\\2.\\3" ZLIB_VERSION_STRING "${ZLIB_H}")
+endif()
 
 # handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if 
 # all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_INCLUDE_DIR ZLIB_LIBRARY)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(ZLIB DEFAULT_MSG ZLIB_INCLUDE_DIR ZLIB_LIBRARY)
 
-IF (ZLIB_FOUND)
-    SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
-    SET(ZLIB_LIBRARIES    ${ZLIB_LIBRARY})
-ENDIF()
+if (ZLIB_FOUND)
+    set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
+    set(ZLIB_LIBRARIES    ${ZLIB_LIBRARY})
+endif()
 
Index: src/other/tkpng/CMake/FindTCL.cmake
===================================================================
--- src/other/tkpng/CMake/FindTCL.cmake	(revision 54114)
+++ src/other/tkpng/CMake/FindTCL.cmake	(working copy)
@@ -240,13 +240,13 @@
 set(TCL_POSSIBLE_MINOR_VERSIONS 6 5 4 3 2 1 0)
 
 # Create the Tcl/Tk options if not already present
-OPTION(TK_NATIVE_GRAPHICS "Require native Tk graphics." OFF)
-OPTION(TK_X11_GRAPHICS "Require X11 Tk graphics." OFF)
-OPTION(TCL_USE_FRAMEWORK_ONLY "Don't use any Tcl/Tk installation that isn't a Framework." OFF)
-OPTION(TCL_REQUIRE_TK "Look for Tk installation, not just Tcl." ON)
-OPTION(TCL_REQUIRE_THREADS "Reject a Tcl/Tk installation unless threads are enabled." OFF)
-OPTION(TCL_NEED_HEADERS "Don't report a found Tcl/Tk unless headers are present." ON)
-OPTION(TCL_NEED_STUB_LIBS "Don't report a found Tcl/Tk unless the stub libraries are present." ON)
+option(TK_NATIVE_GRAPHICS "Require native Tk graphics." OFF)
+option(TK_X11_GRAPHICS "Require X11 Tk graphics." OFF)
+option(TCL_USE_FRAMEWORK_ONLY "Don't use any Tcl/Tk installation that isn't a Framework." OFF)
+option(TCL_REQUIRE_TK "Look for Tk installation, not just Tcl." ON)
+option(TCL_REQUIRE_THREADS "Reject a Tcl/Tk installation unless threads are enabled." OFF)
+option(TCL_NEED_HEADERS "Don't report a found Tcl/Tk unless headers are present." ON)
+option(TCL_NEED_STUB_LIBS "Don't report a found Tcl/Tk unless the stub libraries are present." ON)
 
 # Sanity check the settings - can't require both Native and X11 if X11 isn't
 # the native windowing system on the platform
@@ -282,7 +282,7 @@
 macro(TK_GRAPHICS_SYSTEM wishcmd resultvar)
   set(${resultvar} "wm-NOTFOUND")
   file(WRITE ${tkwin_scriptfile} ${tkwin_script})
-  EXEC_PROGRAM(${wishcmd} ARGS ${tkwin_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+  exec_program(${wishcmd} ARGS ${tkwin_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
   file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM readresultvar)
   string(REGEX REPLACE "\n" "" "${resultvar}" "${readresultvar}")
 endmacro()
@@ -300,7 +300,7 @@
 macro(TCL_GET_VERSION tclshcmd resultvar)
   set(${resultvar} "NOTFOUND")
   file(WRITE ${tclversion_scriptfile} ${tclversion_script})
-  EXEC_PROGRAM(${tclshcmd} ARGS ${tclversion_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+  exec_program(${tclshcmd} ARGS ${tclversion_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
   file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/TCL_VERSION readresultvar)
   string(REGEX REPLACE "\n" "" "${resultvar}" "${readresultvar}")
 endmacro()
@@ -318,7 +318,7 @@
 	macro(TCL_ISTHREADED tclshcmd resultvar)
 	  set(${resultvar} "NOTFOUND")
 	  file(WRITE ${tclthreaded_scriptfile} ${tclthreaded_script})
-	  EXEC_PROGRAM(${tclshcmd} ARGS ${tclthreaded_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+	  exec_program(${tclshcmd} ARGS ${tclthreaded_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
 	  file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/TCL_THREADED readresultvar)
 	  string(REGEX REPLACE "\n" "" "${resultvar}" "${readresultvar}")
 	endmacro()
@@ -488,10 +488,10 @@
 	      foreach(SPATH ${${pathnames}})
 		set(TCL_CURRENTPATH TCL-NOTFOUND)
 		set(CURRENT_SEARCH_VERSION "${MAJORNUM}.${MINORNUM}")
-		VALIDATE_VERSION(dosearch ${CURRENT_SEARCH_VERSION})
+		validate_version(dosearch ${CURRENT_SEARCH_VERSION})
 		if(dosearch)
-		  FIND_PROGRAM_PATHS(BIN_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
-		  FIND_LIBRARY_PATHS(LIB_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		  find_program_paths(BIN_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		  find_library_paths(LIB_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
 		  foreach(targetbin ${targetbinnames})
 		    if(TCL_CURRENTPATH MATCHES "NOTFOUND$")
 		      find_program(TCL_CURRENTPATH NAMES ${targetbin}${MAJORNUM}.${MINORNUM} ${targetbin}${MAJORNUM}${MINORNUM} PATHS ${BIN_POSSIBLE_PATHS} ${options})
@@ -529,7 +529,7 @@
 	    foreach(MAJORNUM ${TCL_POSSIBLE_MAJOR_VERSIONS})
 	      foreach(MINORNUM ${TCL_POSSIBLE_MINOR_VERSIONS})
 		set(CURRENT_SEARCH_VERSION "${MAJORNUM}.${MINORNUM}")
-		VALIDATE_VERSION(isvalid ${CURRENT_SEARCH_VERSION})
+		validate_version(isvalid ${CURRENT_SEARCH_VERSION})
 		if(isvalid)
 		  foreach(genpath ${CONFIG_SEARCH_PATHS})
 		    set(CONFGENPATHS "${CONFGENPATHS};${genpath}${MAJORNUM}${MINORNUM};${genpath}${MAJORNUM}.${MINORNUM}")
@@ -619,7 +619,7 @@
 	#-----------------------------------------------------------------------------
 
 	macro(READ_TCLCONFIG_FILE tclconffile)
-	  RESET_TCL_VARS()
+	  reset_tcl_vars()
 	  set(TCL_CONF_FILE "")
 	  file(READ ${tclconffile} TCL_CONF_FILE)
 	  string(REGEX REPLACE "\r?\n" ";" ENT "${TCL_CONF_FILE}")
@@ -646,15 +646,15 @@
 		set(TCL_EXE_SUFFIX "")
 	      endif(MSVC)
 	      string(REGEX REPLACE ".*TCL_EXEC_PREFIX='(.+)'.*" "\\1" TCL_TCLSH_EXECUTABLE ${line})
-	      IF (EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      if (EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh")
 	      endif()
 	    endif()
@@ -669,7 +669,7 @@
 
 
 	macro(READ_TKCONFIG_FILE tkconffile)
-	  RESET_TK_VARS()
+	  reset_tk_vars()
 	  set(TK_CONF_FILE "")
 	  file(READ ${tkconffile} TK_CONF_FILE)
 	  string(REGEX REPLACE "\r?\n" ";" ENT "${TK_CONF_FILE}")
@@ -696,15 +696,15 @@
 		set(TK_EXE_SUFFIX "")
 	      endif(MSVC)
 	      string(REGEX REPLACE ".*TK_EXEC_PREFIX='(.+)'.*" "\\1" TCL_WISH_EXECUTABLE ${line})
-	      IF (EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      if (EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish")
 	      endif()
 	    endif()
@@ -723,16 +723,16 @@
 
 	macro(VALIDATE_TCL validvar)
 	  set(${validvar} 1)
-	  VALIDATE_TCL_VARIABLES(${validvar})
+	  validate_tcl_variables(${validvar})
 	  if(TCL_TCLSH_EXECUTABLE)
-	    TCL_GET_VERSION(${TCL_TCLSH_EXECUTABLE} CURRENT_SEARCH_VERSION)
-	    VALIDATE_VERSION(dosearch ${CURRENT_SEARCH_VERSION})
+	    tcl_get_version(${TCL_TCLSH_EXECUTABLE} CURRENT_SEARCH_VERSION)
+	    validate_version(dosearch ${CURRENT_SEARCH_VERSION})
 	    if(NOT dosearch)
 	      set(${validvar} 0)
 	    endif(NOT dosearch)
 	  endif(TCL_TCLSH_EXECUTABLE)
 	  if(TCL_REQUIRE_THREADS AND TCL_TCLSH_EXECUTABLE)
-	    TCL_ISTHREADED(${TCL_TCLSH_EXECUTABLE} TCL_THREADS)
+	    tcl_isthreaded(${TCL_TCLSH_EXECUTABLE} TCL_THREADS)
 	    if(NOT TCL_THREADS)
 	      set(${validvar} 0)
 	    endif(NOT TCL_THREADS)
@@ -741,9 +741,9 @@
 
 	macro(VALIDATE_TK validvar)
 	  set(${validvar} 1)
-	  VALIDATE_TK_VARIABLES(${validvar})
+	  validate_tk_variables(${validvar})
 	  if(TK_NATIVE_GRAPHICS OR TK_X11_GRAPHICS)
-	    TK_GRAPHICS_SYSTEM(${TCL_WISH_EXECUTABLE} TK_SYSTEM_GRAPHICS)
+	    tk_graphics_system(${TCL_WISH_EXECUTABLE} TK_SYSTEM_GRAPHICS)
 	    if(APPLE AND TK_NATIVE_GRAPHICS)
 	      if(NOT ${TK_SYSTEM_GRAPHICS} MATCHES "aqua")
 		set(${validvar} 0)
@@ -852,19 +852,19 @@
 	    set(TCL_PREFIX_LIBDIRS ${TCL_PREFIX_LIBDIRS} ${TCL_LIB_PATH_PARENT}/lib)
 	    set(TCL_PREFIX_LIBDIRS ${TCL_PREFIX_LIBDIRS} ${TCL_LIB_PATH_PARENT})
 	    list(REMOVE_DUPLICATES TCL_PREFIX_LIBDIRS)
-	    FIND_LIBRARY_VERSIONS(tcl TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
+	    find_library_versions(tcl TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
 	    set(FOUND_FILES "${TCL_tcl_LIST}")
-	    FIND_CONFIG_FILES(FOUND_FILES TCLCONFIG_LIST tclConfig.sh)
+	    find_config_files(FOUND_FILES TCLCONFIG_LIST tclConfig.sh)
 	    if(TCL_REQUIRE_TK)
-	      FIND_LIBRARY_VERSIONS(tk TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
+	      find_library_versions(tk TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
 	      set(FOUND_FILES "${TCL_tk_LIST}")
-	      FIND_CONFIG_FILES(FOUND_FILES TKCONFIG_LIST tkConfig.sh)
+	      find_config_files(FOUND_FILES TKCONFIG_LIST tkConfig.sh)
 	    endif(TCL_REQUIRE_TK)
 	  else(TCL_PREFIX)
 	    set(TCLCONFIG_LIST "")
 	    if(APPLE)
 	      include(CMakeFindFrameworks)
-	      CMAKE_FIND_FRAMEWORKS(Tcl)
+	      cmake_find_frameworks(Tcl)
 	      foreach(dir ${Tcl_FRAMEWORKS})
 		set(tclconf "tclConfig.sh-NOTFOUND") 
 		find_file(tclconf tclConfig.sh PATHS ${dir})
@@ -874,7 +874,7 @@
 		endif(NOT tclconf MATCHES "NOTFOUND$")
 	      endforeach(dir ${Tcl_FRAMEWORKS})
 	      if(TCL_REQUIRE_TK)
-		CMAKE_FIND_FRAMEWORKS(Tk)
+		cmake_find_frameworks(Tk)
 		foreach(dir ${Tk_FRAMEWORKS})
 		  set(tkconf "tkConfig.sh-NOTFOUND") 
 		  find_file(tkconf tkConfig.sh PATHS ${dir})
@@ -889,7 +889,7 @@
 	      set(PATHLIST "$ENV{LD_LIBRARY_PATH}:$ENV{DYLD_LIBRARY_PATH}:$ENV{DYLD_FALLBACK_LIBRARY_PATH}:$ENV{PATH}")
 	      set(PATHLIST "${TCL_ADDITIONAL_SEARCH_PATHS}:${PATHLIST}")
 	      if(WIN32)
-		WIN32TCLPATHS(PATHLIST "")
+		win32tclpaths(PATHLIST "")
 	      endif(WIN32)
 	      string(REGEX REPLACE "/s?bin:" ":" PATHLIST "${PATHLIST}")
 	      string(REGEX REPLACE "/s?bin;" ":" PATHLIST "${PATHLIST}")
@@ -906,41 +906,41 @@
 	      endforeach()
 	      set(TCLPATHLIST "${PATHLIST}")
 	      set(TKPATHLIST "${PATHLIST}")
-	      FIND_POSSIBLE_PATHS("tclsh" "tcl" TCLPATHLIST NO_SYSTEM_PATH)
+	      find_possible_paths("tclsh" "tcl" TCLPATHLIST NO_SYSTEM_PATH)
 	      if(TCL_REQUIRE_TK)
-		FIND_POSSIBLE_PATHS("wish" "tk" TKPATHLIST NO_SYSTEM_PATH)
+		find_possible_paths("wish" "tk" TKPATHLIST NO_SYSTEM_PATH)
 	      endif(TCL_REQUIRE_TK)
 	      # Hunt up tclConfig.sh files
-	      FIND_CONFIG_FILES(TCLPATHLIST TCLCONFIG_LIST tclConfig.sh)
+	      find_config_files(TCLPATHLIST TCLCONFIG_LIST tclConfig.sh)
 	      # Hunt up tkConfig.sh files 
-	      FIND_CONFIG_FILES(TKPATHLIST TKCONFIG_LIST tkConfig.sh)
+	      find_config_files(TKPATHLIST TKCONFIG_LIST tkConfig.sh)
 	    endif(NOT APPLE OR NOT TCL_USE_FRAMEWORK_ONLY)
 	  endif(TCL_PREFIX)
 	  set(TCLVALID 0)
-	  RESET_TCL_VARS()
+	  reset_tcl_vars()
 	  foreach(tcl_config_file ${TCLCONFIG_LIST}) 
 	    if(NOT TCLVALID)
-	      RESET_TCL_VARS()
-	      READ_TCLCONFIG_file(${tcl_config_file})
+	      reset_tcl_vars()
+	      read_tclconfig_file(${tcl_config_file})
 	      set(TCLVALID 1)
 	      set(CURRENTTCLVERSION "${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}.${TCL_VERSION_PATCH}")
-	      VALIDATE_VERSION(TCLVALID ${CURRENTTCLVERSION})
+	      validate_version(TCLVALID ${CURRENTTCLVERSION})
 	      if(TCLVALID)
 		get_filename_component(TCL_CONF_PREFIX "${tcl_config_file}" PATH)
 		get_filename_component(TCL_LIBRARY_DIR2 "${TCL_CONF_PREFIX}" PATH)
-		FIND_LIBRARY_PATHS(TCL_LIBRARY_SEARCH_PATHS TCL_PREFIX ${TCL_VERSION_MAJOR} ${TCL_VERSION_MINOR})
+		find_library_paths(TCL_LIBRARY_SEARCH_PATHS TCL_PREFIX ${TCL_VERSION_MAJOR} ${TCL_VERSION_MINOR})
 		set(TCL_LIBRARY_SEARCH_PATHS "${TCL_CONF_PREFIX};${TCL_LIBRARY_DIR2};${TCL_LIBRARY_SEARCH_PATHS}")
 		find_library(TCL_LIBRARY tcl Tcl tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR} tcl${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR} PATHS ${TCL_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
 		find_library(TCL_STUB_LIBRARY tclstub${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR} tclstub${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR} PATHS ${TCL_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
 	      endif(TCLVALID)
-	      VALIDATE_TCL(TCLVALID)
+	      validate_tcl(TCLVALID)
 	      if(TCLVALID)
 		if(TCL_REQUIRE_TK)
 		  set(TKVALID 0)
 		  foreach(tk_config_file ${TKCONFIG_LIST})
 		    if(NOT TKVALID)
-		      RESET_TK_VARS()
-		      READ_TKCONFIG_file(${tk_config_file})
+		      reset_tk_vars()
+		      read_tkconfig_file(${tk_config_file})
 		      set(TKVALID 0)
 		      set(CURRENTTKVERSION "${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}.${TK_VERSION_PATCH}")
 		      set(vtcltkcompare 0)
@@ -952,18 +952,18 @@
 		      if(TKVALID)
 			get_filename_component(TCL_TK_CONF_PREFIX "${tk_config_file}" PATH)
 			get_filename_component(TCL_TK_LIBRARY_DIR2 "${TCL_TK_CONF_PREFIX}" PATH)
-			FIND_LIBRARY_PATHS(TCL_TK_LIBRARY_SEARCH_PATHS TK_PREFIX ${TK_VERSION_MAJOR} ${TK_VERSION_MINOR})
+			find_library_paths(TCL_TK_LIBRARY_SEARCH_PATHS TK_PREFIX ${TK_VERSION_MAJOR} ${TK_VERSION_MINOR})
 			set(TCL_TK_LIBRARY_SEARCH_PATHS "${TCL_TK_CONF_PREFIX};${TCL_TK_LIBRARY_DIR2};${TCL_TK_LIBRARY_SEARCH_PATHS}")
 			find_library(TCL_TK_LIBRARY tk Tk tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR} tk${TK_VERSION_MAJOR}${TK_VERSION_MINOR} PATHS ${TCL_TK_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
 			find_library(TCL_TK_STUB_LIBRARY tkstub tkstub${TK_VERSION_MAJOR}.${TK_VERSION_MINOR} tkstub${TK_VERSION_MAJOR}${TK_VERSION_MINOR} PATHS ${TCL_TK_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
-			VALIDATE_TK(TKVALID)
+			validate_tk(TKVALID)
 		      endif(TKVALID)
 		    endif(NOT TKVALID)
 		  endforeach(tk_config_file ${TKCONFIG_LIST})
 		  if(NOT TKVALID)
 		    set(TCLVALID 0)
-		    RESET_TCL_VARS()
-		    RESET_TK_VARS()
+		    reset_tcl_vars()
+		    reset_tk_vars()
 		  endif(NOT TKVALID)
 		endif(TCL_REQUIRE_TK)
 	      endif(TCLVALID)
@@ -983,29 +983,29 @@
 	      foreach(MINORNUM ${TCL_POSSIBLE_MINOR_VERSIONS})
 		foreach(SPATH ${PATHLIST})
 		  if(NOT TCLVALID)
-		    RESET_TCL_VARS()
+		    reset_tcl_vars()
 		    set(CURRENT_SEARCH_VERSION "${MAJORNUM}.${MINORNUM}")
-		    VALIDATE_VERSION(dosearch ${CURRENT_SEARCH_VERSION})
+		    validate_version(dosearch ${CURRENT_SEARCH_VERSION})
 		    if(dosearch)
-		      FIND_LIBRARY_PATHS(TCL_LIBRARY_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
-		      FIND_PROGRAM_PATHS(TCL_PROGRAM_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		      find_library_paths(TCL_LIBRARY_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		      find_program_paths(TCL_PROGRAM_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
 		      find_program(TCL_TCLSH_EXECUTABLE NAMES tclsh${MAJORNUM}.${MINORNUM} tclsh${MAJORNUM}${MINORNUM} PATHS ${TCL_PROGRAM_SEARCH_PATHS} NO_SYSTEM_PATH)
 		    endif(dosearch)
-		    VALIDATE_TCL(TCLVALID)
+		    validate_tcl(TCLVALID)
 		    if(TCLVALID)
 		      if(TCL_REQUIRE_TK)
 			set(TKVALID 0)
-			RESET_TK_VARS()
+			reset_tk_vars()
 			find_program(TCL_WISH_EXECUTABLE NAMES wish${MAJORNUM}.${MINORNUM} wish${MAJORNUM}${MINORNUM} PATHS ${TCL_PROGRAM_SEARCH_PATHS} NO_SYSTEM_PATH)
-			VALIDATE_TK(TKVALID)
+			validate_tk(TKVALID)
 			if(NOT TKVALID)
 			  set(TCLVALID 0)
-			  RESET_TCL_VARS()
-			  RESET_TK_VARS()
+			  reset_tcl_vars()
+			  reset_tk_vars()
 			endif(NOT TKVALID)	
 		      endif(TCL_REQUIRE_TK)
 		    else(TCLVALID)
-		      RESET_TCL_VARS()
+		      reset_tcl_vars()
 		    endif(TCLVALID)
 		  endif(NOT TCLVALID)
 		endforeach(SPATH ${PATHLIST})
@@ -1023,11 +1023,11 @@
 	  set(TCL_STUB_LIBRARIES ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY})
 	  set(TCL_ROOT_PATH ${TCL_CONF_PREFIX})
 	  set(TCL_VERSION_STRING "${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}.${TCL_VERSION_PATCH}")
-	  FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCL DEFAULT_MSG TCL_LIBRARY ${PACKAGE_HANDLE_VARS})
+	  find_package_handle_standard_args(TCL DEFAULT_MSG TCL_LIBRARY ${PACKAGE_HANDLE_VARS})
 	  if(TCL_REQUIRE_TK)
 	    set(TK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
 	    set(PACKAGE_HANDLE_VARS "${PACKAGE_HANDLE_VARS};TCL_LIBRARY")
-	    FIND_PACKAGE_HANDLE_STANDARD_ARGS(TK DEFAULT_MSG TCL_TK_LIBRARY ${PACKAGE_HANDLE_VARS})
+	    find_package_handle_standard_args(TK DEFAULT_MSG TCL_TK_LIBRARY ${PACKAGE_HANDLE_VARS})
 	  endif(TCL_REQUIRE_TK)
 
 	  foreach(pkgvar ${PACKAGE_HANDLE_VARS})
Index: src/other/tkpng/CMake/FindX11.cmake
===================================================================
--- src/other/tkpng/CMake/FindX11.cmake	(revision 54114)
+++ src/other/tkpng/CMake/FindX11.cmake	(working copy)
@@ -130,16 +130,16 @@
 # 
 #=============================================================================
 
-MACRO(X11_FIND_INCLUDE_PATH component header)
+macro(X11_FIND_INCLUDE_PATH component header)
   find_path(X11_${component}_INCLUDE_PATH ${header} ${X11_INC_SEARCH_PATH} NO_CMAKE_SYSTEM_PATH)
   set(X11_HDR_VARS ${X11_HDR_VARS} X11_${component}_INCLUDE_PATH)
   if(X11_${component}_INCLUDE_PATH)
     set(X11_HDR_PATHS ${X11_HDR_PATHS} ${X11_${component}_INCLUDE_PATH})
     list(REMOVE_DUPLICATES X11_HDR_PATHS)
   endif(X11_${component}_INCLUDE_PATH)
-ENDMACRO(X11_FIND_INCLUDE_PATH)
+endmacro(X11_FIND_INCLUDE_PATH)
 
-MACRO(X11_FIND_LIB_PATH component libname)
+macro(X11_FIND_LIB_PATH component libname)
   find_library(X11_${component}_LIB ${libname} ${X11_LIB_SEARCH_PATH} NO_CMAKE_SYSTEM_PATH)
   set(X11_LIB_VARS ${X11_LIB_VARS} X11_${component}_LIB)
   if(X11_${component}_LIB)
@@ -147,7 +147,7 @@
     set(X11_LIB_PATHS ${X11_LIB_PATHS} ${X11_${component}_DIR})
     list(REMOVE_DUPLICATES X11_LIB_PATHS)
   endif(X11_${component}_LIB)
-ENDMACRO(X11_FIND_LIB_PATH)
+endmacro(X11_FIND_LIB_PATH)
 
 if(UNIX)
   set(X11_FOUND 0)
@@ -208,63 +208,63 @@
   set(X11_LIB_PATHS)
   
   # Find primary X11 headers
-  X11_FIND_INCLUDE_PATH(X11		X11/X.h)
-  X11_FIND_INCLUDE_PATH(Xlib		X11/Xlib.h)
+  x11_find_include_path(X11		X11/X.h)
+  x11_find_include_path(Xlib		X11/Xlib.h)
   # Look for other X11 includes; keep the list sorted by name of the cmake X11_<component>_INCLUDE_PATH
   # variable (component doesn't need to match the include file name).
-  X11_FIND_INCLUDE_PATH(ICE 		X11/ICE/ICE.h)
-  X11_FIND_INCLUDE_PATH(Xaccessrules 	X11/extensions/XKBrules.h)
-  X11_FIND_INCLUDE_PATH(Xaccessstr 	X11/extensions/XKBstr.h)
-  X11_FIND_INCLUDE_PATH(Xau 		X11/Xauth.h)
-  X11_FIND_INCLUDE_PATH(Xcomposite 	X11/extensions/Xcomposite.h)
-  X11_FIND_INCLUDE_PATH(Xcursor 	X11/Xcursor/Xcursor.h)
-  X11_FIND_INCLUDE_PATH(Xdamage 	X11/extensions/Xdamage.h)
-  X11_FIND_INCLUDE_PATH(Xdmcp 		X11/Xdmcp.h)
-  X11_FIND_INCLUDE_PATH(dpms 		X11/extensions/dpms.h)
-  X11_FIND_INCLUDE_PATH(xf86misc 	X11/extensions/xf86misc.h)
-  X11_FIND_INCLUDE_PATH(xf86vmode 	X11/extensions/xf86vmode.h)
-  X11_FIND_INCLUDE_PATH(Xfixes		X11/extensions/Xfixes.h)
-  X11_FIND_INCLUDE_PATH(Xft		X11/Xft/Xft.h)
-  X11_FIND_INCLUDE_PATH(Xi		X11/extensions/XInput.h)
-  X11_FIND_INCLUDE_PATH(Xinerama	X11/extensions/Xinerama.h)
-  X11_FIND_INCLUDE_PATH(Xinput		X11/extensions/XInput.h)
-  X11_FIND_INCLUDE_PATH(Xkb		X11/extensions/XKB.h)
-  X11_FIND_INCLUDE_PATH(Xkblib		X11/XKBlib.h)
-  X11_FIND_INCLUDE_PATH(Xpm		X11/xpm.h)
-  X11_FIND_INCLUDE_PATH(XTest		X11/extensions/XTest.h)
-  X11_FIND_INCLUDE_PATH(XShm		X11/extensions/XShm.h)
-  X11_FIND_INCLUDE_PATH(Xrandr		X11/extensions/Xrandr.h)
-  X11_FIND_INCLUDE_PATH(Xrender		X11/extensions/Xrender.h)
-  X11_FIND_INCLUDE_PATH(Xscreensaver	X11/extensions/scrnsaver.h)
-  X11_FIND_INCLUDE_PATH(Xshape		X11/extensions/shape.h)
-  X11_FIND_INCLUDE_PATH(Xutil		X11/Xutil.h)
-  X11_FIND_INCLUDE_PATH(Xt		X11/Intrinsic.h)
-  X11_FIND_INCLUDE_PATH(Xv		X11/extensions/Xvlib.h)
+  x11_find_include_path(ICE 		X11/ICE/ICE.h)
+  x11_find_include_path(Xaccessrules 	X11/extensions/XKBrules.h)
+  x11_find_include_path(Xaccessstr 	X11/extensions/XKBstr.h)
+  x11_find_include_path(Xau 		X11/Xauth.h)
+  x11_find_include_path(Xcomposite 	X11/extensions/Xcomposite.h)
+  x11_find_include_path(Xcursor 	X11/Xcursor/Xcursor.h)
+  x11_find_include_path(Xdamage 	X11/extensions/Xdamage.h)
+  x11_find_include_path(Xdmcp 		X11/Xdmcp.h)
+  x11_find_include_path(dpms 		X11/extensions/dpms.h)
+  x11_find_include_path(xf86misc 	X11/extensions/xf86misc.h)
+  x11_find_include_path(xf86vmode 	X11/extensions/xf86vmode.h)
+  x11_find_include_path(Xfixes		X11/extensions/Xfixes.h)
+  x11_find_include_path(Xft		X11/Xft/Xft.h)
+  x11_find_include_path(Xi		X11/extensions/XInput.h)
+  x11_find_include_path(Xinerama	X11/extensions/Xinerama.h)
+  x11_find_include_path(Xinput		X11/extensions/XInput.h)
+  x11_find_include_path(Xkb		X11/extensions/XKB.h)
+  x11_find_include_path(Xkblib		X11/XKBlib.h)
+  x11_find_include_path(Xpm		X11/xpm.h)
+  x11_find_include_path(XTest		X11/extensions/XTest.h)
+  x11_find_include_path(XShm		X11/extensions/XShm.h)
+  x11_find_include_path(Xrandr		X11/extensions/Xrandr.h)
+  x11_find_include_path(Xrender		X11/extensions/Xrender.h)
+  x11_find_include_path(Xscreensaver	X11/extensions/scrnsaver.h)
+  x11_find_include_path(Xshape		X11/extensions/shape.h)
+  x11_find_include_path(Xutil		X11/Xutil.h)
+  x11_find_include_path(Xt		X11/Intrinsic.h)
+  x11_find_include_path(Xv		X11/extensions/Xvlib.h)
   
 
   # Find primary X11 library
-  X11_FIND_LIB_PATH(X11			X11)
+  x11_find_lib_path(X11			X11)
   # Find additional X libraries. Keep list sorted by library name.
-  X11_FIND_LIB_PATH(ICE			ICE)
-  X11_FIND_LIB_PATH(SM			SM)
-  X11_FIND_LIB_PATH(Xau			Xau)
-  X11_FIND_LIB_PATH(Xcomposite		Xcomposite)
-  X11_FIND_LIB_PATH(Xcursor		Xcursor)
-  X11_FIND_LIB_PATH(Xdamage		Xdamage)
-  X11_FIND_LIB_PATH(Xdmcp		Xdmcp)
-  X11_FIND_LIB_PATH(Xext		Xext)
-  X11_FIND_LIB_PATH(Xfixes		Xfixes)
-  X11_FIND_LIB_PATH(Xft			Xft)
-  X11_FIND_LIB_PATH(Xi			Xi)
-  X11_FIND_LIB_PATH(Xinerama		Xinerama)
-  X11_FIND_LIB_PATH(Xpm			Xpm)
-  X11_FIND_LIB_PATH(Xrandr		Xrandr)
-  X11_FIND_LIB_PATH(Xrender		Xrender)
-  X11_FIND_LIB_PATH(Xscreensaver	Xss)
-  X11_FIND_LIB_PATH(Xt			Xt)
-  X11_FIND_LIB_PATH(XTest		Xtst)
-  X11_FIND_LIB_PATH(Xv			Xv)
-  X11_FIND_LIB_PATH(Xxf86misc		Xxf86misc)
+  x11_find_lib_path(ICE			ICE)
+  x11_find_lib_path(SM			SM)
+  x11_find_lib_path(Xau			Xau)
+  x11_find_lib_path(Xcomposite		Xcomposite)
+  x11_find_lib_path(Xcursor		Xcursor)
+  x11_find_lib_path(Xdamage		Xdamage)
+  x11_find_lib_path(Xdmcp		Xdmcp)
+  x11_find_lib_path(Xext		Xext)
+  x11_find_lib_path(Xfixes		Xfixes)
+  x11_find_lib_path(Xft			Xft)
+  x11_find_lib_path(Xi			Xi)
+  x11_find_lib_path(Xinerama		Xinerama)
+  x11_find_lib_path(Xpm			Xpm)
+  x11_find_lib_path(Xrandr		Xrandr)
+  x11_find_lib_path(Xrender		Xrender)
+  x11_find_lib_path(Xscreensaver	Xss)
+  x11_find_lib_path(Xt			Xt)
+  x11_find_lib_path(XTest		Xtst)
+  x11_find_lib_path(Xv			Xv)
+  x11_find_lib_path(Xxf86misc		Xxf86misc)
 
   set(X11_LIBRARY_DIR "")
   if(X11_X11_LIB)
@@ -437,69 +437,69 @@
       set(X11_X_EXTRA_LIBS "")
 
       # See if XOpenDisplay in X11 works by itself.
-      CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
+      check_library_exists("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
       if(NOT X11_LIB_X11_SOLO)
         # Find library needed for dnet_ntoa.
-        CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
+        check_library_exists("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
         if(X11_LIB_DNET_HAS_DNET_NTOA)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
         else(X11_LIB_DNET_HAS_DNET_NTOA)
-          CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
+          check_library_exists("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
           if(X11_LIB_DNET_STUB_HAS_DNET_NTOA)
-            SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
+            set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
           endif(X11_LIB_DNET_STUB_HAS_DNET_NTOA)
         endif(X11_LIB_DNET_HAS_DNET_NTOA)
       endif(NOT X11_LIB_X11_SOLO)
 
       # Find library needed for gethostbyname.
-      CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
+      check_function_exists("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
       if(NOT CMAKE_HAVE_GETHOSTBYNAME)
-        CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+        check_library_exists("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
         if(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
         else(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-          CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+          check_library_exists("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
           if(CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
-            SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
+            set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
           endif(CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
         endif(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
       endif(NOT CMAKE_HAVE_GETHOSTBYNAME)
 
       # Find library needed for connect.
-      CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT)
+      check_function_exists("connect" CMAKE_HAVE_CONNECT)
       if(NOT CMAKE_HAVE_CONNECT)
-        CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
+        check_library_exists("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
         if(CMAKE_LIB_SOCKET_HAS_CONNECT)
-          SET (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
+          set (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
         endif(CMAKE_LIB_SOCKET_HAS_CONNECT)
       endif(NOT CMAKE_HAVE_CONNECT)
 
       # Find library needed for remove.
-      CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE)
+      check_function_exists("remove" CMAKE_HAVE_REMOVE)
       if(NOT CMAKE_HAVE_REMOVE)
-        CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
+        check_library_exists("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
         if(CMAKE_LIB_POSIX_HAS_REMOVE)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
         endif(CMAKE_LIB_POSIX_HAS_REMOVE)
       endif(NOT CMAKE_HAVE_REMOVE)
 
       # Find library needed for shmat.
-      CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT)
+      check_function_exists("shmat" CMAKE_HAVE_SHMAT)
       if(NOT CMAKE_HAVE_SHMAT)
-        CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
+        check_library_exists("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
         if(CMAKE_LIB_IPS_HAS_SHMAT)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
         endif(CMAKE_LIB_IPS_HAS_SHMAT)
       endif(NOT CMAKE_HAVE_SHMAT)
     endif($ENV{ISC} MATCHES "^yes$")
 
     if(X11_ICE_FOUND)
-      CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
+      check_library_exists("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
         CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
       if(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
-        SET (X11_X_PRE_LIBS ${X11_ICE_LIB})
+        set (X11_X_PRE_LIBS ${X11_ICE_LIB})
         if(X11_SM_LIB)
-          SET (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
+          set (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
         endif(X11_SM_LIB)
       endif(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
     endif(X11_ICE_FOUND)
@@ -548,7 +548,7 @@
     endif("${LIB_PATH_CNT}" GREATER 1)
 
     include(FindPackageMessage)
-    FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
+    find_package_message(X11 "Found X11: ${X11_X11_LIB}"
       "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
   else(X11_FOUND)
     if(X11_FIND_REQUIRED)
Index: src/liboptical/CMakeLists.txt
===================================================================
--- src/liboptical/CMakeLists.txt	(revision 54114)
+++ src/liboptical/CMakeLists.txt	(working copy)
@@ -6,7 +6,7 @@
   ${BN_INCLUDE_DIRS}
   ${RT_INCLUDE_DIRS}
   )
-BRLCAD_LIB_INCLUDE_DIRS(optical OPTICAL_INCLUDE_DIRS "")
+brlcad_lib_include_dirs(optical OPTICAL_INCLUDE_DIRS "")
 
 set(LIBOPTICAL_SOURCES
   init.c
@@ -96,7 +96,7 @@
 
   set(OSLRT_LIBS ${OSLEXEC_LIBRARY} ${OSLCOMP_LIBRARY} ${OSLQUERY_LIBRARY} ${OPENIMAGEIO_LIBRARY} ${Boost_LIBRARIES} ${Boost_FILESYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY})
 
-  BRLCAD_ADDLIB(liboslrend "${OSLRT_SOURCES}" "${OSLRT_LIBS}")
+  brlcad_addlib(liboslrend "${OSLRT_SOURCES}" "${OSLRT_LIBS}")
 
   ##########################################
   # Build OSL Shader
@@ -106,15 +106,15 @@
   set(LIBOPTICAL_SOURCES ${LIBOPTICAL_SOURCES} sh_osl.cpp)
 
   # Link liboptical with osl-renderer library
-  BRLCAD_ADDLIB(liboptical "${LIBOPTICAL_SOURCES}" "librt;libbn;libbu;liboslrend")
+  brlcad_addlib(liboptical "${LIBOPTICAL_SOURCES}" "librt;libbn;libbu;liboslrend")
 
 else(BRLCAD_ENABLE_OSL)
 
-  BRLCAD_ADDLIB(liboptical "${LIBOPTICAL_SOURCES}" "librt;libbn;libbu")
+  brlcad_addlib(liboptical "${LIBOPTICAL_SOURCES}" "librt;libbn;libbu")
 
 endif(BRLCAD_ENABLE_OSL)
 
-CMAKEFILES(
+cmakefiles(
   liboslrend.cpp
   oslexec_pvt.h
   render_svc.h
@@ -124,9 +124,9 @@
   render_svc.cpp
   )
 
-SET_TARGET_PROPERTIES(liboptical PROPERTIES VERSION 20.0.1 SOVERSION 20)
+set_target_properties(liboptical PROPERTIES VERSION 20.0.1 SOVERSION 20)
 
-CMAKEFILES(Makefile.am)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/shapes/CMakeLists.txt
===================================================================
--- src/shapes/CMakeLists.txt	(revision 54114)
+++ src/shapes/CMakeLists.txt	(working copy)
@@ -2,23 +2,23 @@
   ${WDB_INCLUDE_DIRS}
   ${CMAKE_CURRENT_SOURCE_DIR}
   )
-LIST(REMOVE_DUPLICATES SHAPES_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES SHAPES_INCLUDE_DIRS)
 include_directories(${SHAPES_INCLUDE_DIRS})
 
-BRLCAD_ADDEXEC(bolt bolt.c "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(coil coil.c "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(fence fence.c "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(gastank gastank.c libwdb)
-BRLCAD_ADDEXEC(handle handle.c libwdb)
-BRLCAD_ADDEXEC(human human.c "libged;libwdb")
-BRLCAD_ADDEXEC(picket_fence picket_fence.c "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(tire tire.c "libged;libwdb")
-BRLCAD_ADDEXEC(window window.c libwdb)
-BRLCAD_ADDEXEC(window_frame window_frame.c libwdb)
-BRLCAD_ADDEXEC(wire wire.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(bolt bolt.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(coil coil.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(fence fence.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(gastank gastank.c libwdb)
+brlcad_addexec(handle handle.c libwdb)
+brlcad_addexec(human human.c "libged;libwdb")
+brlcad_addexec(picket_fence picket_fence.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(tire tire.c "libged;libwdb")
+brlcad_addexec(window window.c libwdb)
+brlcad_addexec(window_frame window_frame.c libwdb)
+brlcad_addexec(wire wire.c "libwdb;${M_LIBRARY}")
 
-CMAKEFILES(fence.h)
-CMAKEFILES(Makefile.am)
+cmakefiles(fence.h)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/anim/CMakeLists.txt
===================================================================
--- src/anim/CMakeLists.txt	(revision 54114)
+++ src/anim/CMakeLists.txt	(working copy)
@@ -2,41 +2,41 @@
   ${BU_INCLUDE_DIRS}
   ${BN_INCLUDE_DIRS}
   )
-LIST(REMOVE_DUPLICATES ANIM_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES ANIM_INCLUDE_DIRS)
 include_directories(${ANIM_INCLUDE_DIRS})
 
-BRLCAD_ADDEXEC(anim_cascade anim_cascade.c "libbn;libbu")
+brlcad_addexec(anim_cascade anim_cascade.c "libbn;libbu")
 
-BRLCAD_ADDEXEC(anim_fly anim_fly.c "libbu;${M_LIBRARY}")
+brlcad_addexec(anim_fly anim_fly.c "libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(anim_hardtrack anim_hardtrack.c "libbn;libbu;${M_LIBRARY}")
+brlcad_addexec(anim_hardtrack anim_hardtrack.c "libbn;libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(anim_keyread anim_keyread.c "libbn;libbu")
+brlcad_addexec(anim_keyread anim_keyread.c "libbn;libbu")
 
-BRLCAD_ADDEXEC(anim_lookat anim_lookat.c "libbn;libbu;${M_LIBRARY}")
+brlcad_addexec(anim_lookat anim_lookat.c "libbn;libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(anim_offset anim_offset.c "libbn;libbu")
+brlcad_addexec(anim_offset anim_offset.c "libbn;libbu")
 
-BRLCAD_ADDEXEC(anim_orient anim_orient.c "libbn;libbu")
+brlcad_addexec(anim_orient anim_orient.c "libbn;libbu")
 
-BRLCAD_ADDEXEC(anim_script anim_script.c "libbn;libbu")
+brlcad_addexec(anim_script anim_script.c "libbn;libbu")
 
-BRLCAD_ADDEXEC(anim_sort anim_sort.c libbu)
+brlcad_addexec(anim_sort anim_sort.c libbu)
 
-BRLCAD_ADDEXEC(anim_time anim_time.c "libbu;${M_LIBRARY}")
+brlcad_addexec(anim_time anim_time.c "libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(anim_track "anim_track.c;cattrack.c" "libbn;libbu;${M_LIBRARY}")
+brlcad_addexec(anim_track "anim_track.c;cattrack.c" "libbn;libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(anim_turn anim_turn.c "libbn;libbu;${M_LIBRARY}")
+brlcad_addexec(anim_turn anim_turn.c "libbn;libbu;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(chan_add chan_add.c libbu)
+brlcad_addexec(chan_add chan_add.c libbu)
 
-BRLCAD_ADDEXEC(chan_mult chan_mult.c libbu)
+brlcad_addexec(chan_mult chan_mult.c libbu)
 
-BRLCAD_ADDEXEC(chan_permute chan_permute.c libbu)
+brlcad_addexec(chan_permute chan_permute.c libbu)
 
-CMAKEFILES(cattrack.h)
-CMAKEFILES(Makefile.am)
+cmakefiles(cattrack.h)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/rttherm/CMakeLists.txt
===================================================================
--- src/rttherm/CMakeLists.txt	(revision 54114)
+++ src/rttherm/CMakeLists.txt	(working copy)
@@ -5,21 +5,21 @@
   ${MULTISPECTRAL_INCLUDE_DIRS}
   ${OPTICAL_INCLUDE_DIRS}
   )
-LIST(REMOVE_DUPLICATES RTTHERM_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES RTTHERM_INCLUDE_DIRS)
 include_directories(${RTTHERM_INCLUDE_DIRS})
 
 if(BRLCAD_ENABLE_X11 AND BRLCAD_ENABLE_TK)
-  BRLCAD_ADDEXEC(ssampview "spectrum.c;ssampview.c" "libfb;libmultispectral;${TCL_TK_LIBRARY};${X11_LIBRARIES}")
+  brlcad_addexec(ssampview "spectrum.c;ssampview.c" "libfb;libmultispectral;${TCL_TK_LIBRARY};${X11_LIBRARIES}")
 endif(BRLCAD_ENABLE_X11 AND BRLCAD_ENABLE_TK)
 
-BRLCAD_ADDEXEC(rttherm "spectrum.c;viewtherm.c" "libfb;libged;librttherm;libmultispectral")
-SET_TARGET_PROPERTIES(rttherm PROPERTIES COMPILE_DEFINITIONS "RT_MULTISPECTRAL")
+brlcad_addexec(rttherm "spectrum.c;viewtherm.c" "libfb;libged;librttherm;libmultispectral")
+set_target_properties(rttherm PROPERTIES COMPILE_DEFINITIONS "RT_MULTISPECTRAL")
 install(PROGRAMS ssampview.tcl DESTINATION ${BIN_DIR})
 
-BRLCAD_ADDEXEC(ssamp-bw ssamp-bw.c libmultispectral)
+brlcad_addexec(ssamp-bw ssamp-bw.c libmultispectral)
 
-CMAKEFILES(pixtest.c ssampview.tcl std_day_1km.dat test.sh)
-CMAKEFILES(Makefile.am)
+cmakefiles(pixtest.c ssampview.tcl std_day_1km.dat test.sh)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/rt/CMakeLists.txt
===================================================================
--- src/rt/CMakeLists.txt	(revision 54114)
+++ src/rt/CMakeLists.txt	(working copy)
@@ -4,7 +4,7 @@
   ${RT_INCLUDE_DIRS}
   ${CMAKE_CURRENT_SOURCE_DIR}
   )
-LIST(REMOVE_DUPLICATES RTBIN_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES RTBIN_INCLUDE_DIRS)
 include_directories(${RTBIN_INCLUDE_DIRS})
 
 set(RT_COMMON_SRCS
@@ -18,7 +18,7 @@
 endif(NOT MSVC)
 
 set(rtexample_SRCS rtexample.c)
-BRLCAD_ADDDATA(rtexample.c sample_applications)
+brlcad_adddata(rtexample.c sample_applications)
 
 set(reshoot_SRCS reshoot.c)
 
@@ -129,49 +129,49 @@
   set(LIBREMRT_SOURCES ${LIBREMRT_SOURCES} heatgraph.c)
 endif(NOT MSVC)
 
-BRLCAD_ADDEXEC(rtexample "${rtexample_SRCS}" "librt;libfb;liboptical;libicv" NO_INSTALL)
+brlcad_addexec(rtexample "${rtexample_SRCS}" "librt;libfb;liboptical;libicv" NO_INSTALL)
 
-BRLCAD_ADDEXEC(reshoot "${reshoot_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv")
+brlcad_addexec(reshoot "${reshoot_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv")
 
-BRLCAD_ADDEXEC(rtwalk "${rtwalk_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtwalk "${rtwalk_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rtshot "${rtshot_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtshot "${rtshot_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rtregis "${rtregis_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv")
+brlcad_addexec(rtregis "${rtregis_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv")
 
-BRLCAD_ADDEXEC(rtscale "${rtscale_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtscale "${rtscale_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rt "${rt_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rt "${rt_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rt_bot_faces "${rt_bot_faces_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rt_bot_faces "${rt_bot_faces_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rtarea "${rtarea_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtarea "${rtarea_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rtcell "${rtcell_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtcell "${rtcell_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rtcheck "${rtcheck_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtcheck "${rtcheck_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rtedge "${rtedge_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtedge "${rtedge_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rtfrac "${rtfrac_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtfrac "${rtfrac_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rtg3 "${rtg3_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtg3 "${rtg3_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rthide "${rthide_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rthide "${rthide_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rtpp "${rtpp_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtpp "${rtpp_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rtrad "${rtrad_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtrad "${rtrad_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rtrange "${rtrange_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtrange "${rtrange_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rtray "${rtray_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtray "${rtray_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rtsil "${rtsil_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtsil "${rtsil_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rtweight "${rtweight_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtweight "${rtweight_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
-BRLCAD_ADDEXEC(rtxray "${rtxray_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
+brlcad_addexec(rtxray "${rtxray_SRCS}" "${CMAKE_THREAD_LIBS_INIT};librt;libfb;liboptical;libicv;${M_LIBRARY}")
 
 
 add_library(libremrt STATIC ${LIBREMRT_SOURCES})
@@ -180,7 +180,7 @@
 endif(M_LIBRARY)
 
 add_library(librttherm STATIC ${RT_COMMON_SRCS})
-SET_TARGET_PROPERTIES(librttherm PROPERTIES LINKER_LANGUAGE C)
+set_target_properties(librttherm PROPERTIES LINKER_LANGUAGE C)
 
 set(rt_ignore_files
   ext.h
@@ -192,8 +192,8 @@
   viewdummy.c
   viewscat.c
   )
-CMAKEFILES(${rt_ignore_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${rt_ignore_files})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/libtermio/CMakeLists.txt
===================================================================
--- src/libtermio/CMakeLists.txt	(revision 54114)
+++ src/libtermio/CMakeLists.txt	(working copy)
@@ -5,12 +5,12 @@
     ${BRLCAD_SOURCE_DIR}/include
     ${TERMLIB_INCLUDE_DIRS}
     )
-  BRLCAD_LIB_INCLUDE_DIRS(termio TERMIO_INCLUDE_DIRS "")
+  brlcad_lib_include_dirs(termio TERMIO_INCLUDE_DIRS "")
 
-  BRLCAD_ADDLIB(libtermio termio.c "${TERMLIB_LIBRARY}")
-  SET_TARGET_PROPERTIES(libtermio PROPERTIES VERSION 20.0.1 SOVERSION 20)
-  CMAKEFILES(termio_win32.c)
-  CMAKEFILES(Makefile.am)
+  brlcad_addlib(libtermio termio.c "${TERMLIB_LIBRARY}")
+  set_target_properties(libtermio PROPERTIES VERSION 20.0.1 SOVERSION 20)
+  cmakefiles(termio_win32.c)
+  cmakefiles(Makefile.am)
 endif(HAVE_TERMLIB)
 
 # Local Variables:
Index: src/proc-db/CMakeLists.txt
===================================================================
--- src/proc-db/CMakeLists.txt	(revision 54114)
+++ src/proc-db/CMakeLists.txt	(working copy)
@@ -3,50 +3,50 @@
   ${OPENNURBS_INCLUDE_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}
   )
-LIST(REMOVE_DUPLICATES PROC_DB_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES PROC_DB_INCLUDE_DIRS)
 include_directories(${PROC_DB_INCLUDE_DIRS})
 
-BRLCAD_ADDEXEC(bottest bottest.c libwdb)
-BRLCAD_ADDEXEC(brep_cube brep_cube.cpp "libwdb;${OPENNURBS_LIBRARY}")
-BRLCAD_ADDEXEC(brep_simple brep_simple.cpp "libwdb;${OPENNURBS_LIBRARY}")
+brlcad_addexec(bottest bottest.c libwdb)
+brlcad_addexec(brep_cube brep_cube.cpp "libwdb;${OPENNURBS_LIBRARY}")
+brlcad_addexec(brep_simple brep_simple.cpp "libwdb;${OPENNURBS_LIBRARY}")
 
 # NOSTRICT used due to openNURBS header overflow warning
-BRLCAD_ADDEXEC(brepintersect brepintersect.cpp "libwdb;${OPENNURBS_LIBRARY}" NOSTRICT)
-BRLCAD_ADDEXEC(breplicator breplicator.cpp "libwdb;${OPENNURBS_LIBRARY}")
-BRLCAD_ADDEXEC(brickwall brickwall.c libwdb)
-BRLCAD_ADDEXEC(clutter "clutter.c;common.c" "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(contours contours.c libwdb)
-BRLCAD_ADDEXEC(csgbrep csgbrep.cpp libwdb)
-BRLCAD_ADDEXEC(globe globe.c libwdb)
-BRLCAD_ADDEXEC(kurt kurt.c "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(lens lens.c "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(masonry masonry.c "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(menger menger.c "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(metaball metaball.c "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(mkbuilding "mkbuilding.c;makebuilding/makebuilding.c" libwdb)
-BRLCAD_ADDEXEC(molecule molecule.c libwdb)
-BRLCAD_ADDEXEC(nmgmodel nmgmodel.c libwdb)
-BRLCAD_ADDEXEC(pdb-g pdb-g.c libwdb)
-BRLCAD_ADDEXEC(pipe pipe.c "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(pipetest pipetest.c libwdb)
-BRLCAD_ADDEXEC(pix2g pix2g.c libwdb)
-BRLCAD_ADDEXEC(pyramid pyramid.c "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(rawbot rawbot.c libwdb)
-BRLCAD_ADDEXEC(ringworld ringworld.c libwdb)
-BRLCAD_ADDEXEC(room "room.c;common.c" "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(sketch sketch.c libwdb)
-BRLCAD_ADDEXEC(sphflake sphflake.c "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(spltest spltest.c libwdb)
+brlcad_addexec(brepintersect brepintersect.cpp "libwdb;${OPENNURBS_LIBRARY}" NOSTRICT)
+brlcad_addexec(breplicator breplicator.cpp "libwdb;${OPENNURBS_LIBRARY}")
+brlcad_addexec(brickwall brickwall.c libwdb)
+brlcad_addexec(clutter "clutter.c;common.c" "libwdb;${M_LIBRARY}")
+brlcad_addexec(contours contours.c libwdb)
+brlcad_addexec(csgbrep csgbrep.cpp libwdb)
+brlcad_addexec(globe globe.c libwdb)
+brlcad_addexec(kurt kurt.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(lens lens.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(masonry masonry.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(menger menger.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(metaball metaball.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(mkbuilding "mkbuilding.c;makebuilding/makebuilding.c" libwdb)
+brlcad_addexec(molecule molecule.c libwdb)
+brlcad_addexec(nmgmodel nmgmodel.c libwdb)
+brlcad_addexec(pdb-g pdb-g.c libwdb)
+brlcad_addexec(pipe pipe.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(pipetest pipetest.c libwdb)
+brlcad_addexec(pix2g pix2g.c libwdb)
+brlcad_addexec(pyramid pyramid.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(rawbot rawbot.c libwdb)
+brlcad_addexec(ringworld ringworld.c libwdb)
+brlcad_addexec(room "room.c;common.c" "libwdb;${M_LIBRARY}")
+brlcad_addexec(sketch sketch.c libwdb)
+brlcad_addexec(sphflake sphflake.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(spltest spltest.c libwdb)
 
 # NOSTRICT used due to openNURBS header inlining warning
-BRLCAD_ADDEXEC(surfaceintersect surfaceintersect.cpp "libwdb;${OPENNURBS_LIBRARY}" NOSTRICT)
-BRLCAD_ADDEXEC(tea tea.c libwdb)
-BRLCAD_ADDEXEC(tea_nmg tea_nmg.c libwdb)
-BRLCAD_ADDEXEC(wavy wavy.c libwdb)
-BRLCAD_ADDEXEC(torii torii.c libwdb)
-BRLCAD_ADDEXEC(tube tube.c "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(vegetation vegetation.c "libwdb;${M_LIBRARY}")
-BRLCAD_ADDEXEC(wdb_example wdb_example.c libwdb)
+brlcad_addexec(surfaceintersect surfaceintersect.cpp "libwdb;${OPENNURBS_LIBRARY}" NOSTRICT)
+brlcad_addexec(tea tea.c libwdb)
+brlcad_addexec(tea_nmg tea_nmg.c libwdb)
+brlcad_addexec(wavy wavy.c libwdb)
+brlcad_addexec(torii torii.c libwdb)
+brlcad_addexec(tube tube.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(vegetation vegetation.c "libwdb;${M_LIBRARY}")
+brlcad_addexec(wdb_example wdb_example.c libwdb)
 
 set(proc-db_ignore_files
   brepintersect.h
@@ -58,8 +58,8 @@
   tea.h
   vegetation.h
   )
-CMAKEFILES(${proc-db_ignore_files})
-CMAKEFILES(Makefile.am)
+cmakefiles(${proc-db_ignore_files})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/fbserv/CMakeLists.txt
===================================================================
--- src/fbserv/CMakeLists.txt	(revision 54114)
+++ src/fbserv/CMakeLists.txt	(working copy)
@@ -2,9 +2,9 @@
   ${FB_INCLUDE_DIRS}
   )
 
-BRLCAD_ADDEXEC(fbserv "fbserv.c;server.c" libfb)
+brlcad_addexec(fbserv "fbserv.c;server.c" libfb)
 
-CMAKEFILES(Makefile.am)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/remrt/CMakeLists.txt
===================================================================
--- src/remrt/CMakeLists.txt	(revision 54114)
+++ src/remrt/CMakeLists.txt	(working copy)
@@ -4,7 +4,7 @@
   ${FB_INCLUDE_DIRS}
   ${PKG_INCLUDE_DIRS}
   )
-LIST(REMOVE_DUPLICATES REMRTBIN_INCLUDE_DIRS)
+list(REMOVE_DUPLICATES REMRTBIN_INCLUDE_DIRS)
 include_directories(${REMRTBIN_INCLUDE_DIRS})
 
 include_directories(
@@ -12,13 +12,13 @@
   ${TCL_INCLUDE_DIRS}
   )
 
-BRLCAD_ADDEXEC(remrt "ihost.c;remrt.c" "libremrt;liboptical;libfb")
+brlcad_addexec(remrt "ihost.c;remrt.c" "libremrt;liboptical;libfb")
 
-BRLCAD_ADDEXEC(rtsrv rtsrv.c "libremrt;liboptical;libpkg;libicv")
-SET_TARGET_PROPERTIES(rtsrv PROPERTIES COMPILE_DEFINITIONS "RTSRV")
+brlcad_addexec(rtsrv rtsrv.c "libremrt;liboptical;libpkg;libicv")
+set_target_properties(rtsrv PROPERTIES COMPILE_DEFINITIONS "RTSRV")
 
-CMAKEFILES(ihost.h protocol.h)
-CMAKEFILES(Makefile.am)
+cmakefiles(ihost.h protocol.h)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/libanalyze/tests/CMakeLists.txt
===================================================================
--- src/libanalyze/tests/CMakeLists.txt	(revision 54114)
+++ src/libanalyze/tests/CMakeLists.txt	(working copy)
@@ -1,4 +1,4 @@
-BRLCAD_ADDEXEC(tester_density density.c "libanalyze;libbu" NO_INSTALL LOCAL)
+brlcad_addexec(tester_density density.c "libanalyze;libbu" NO_INSTALL LOCAL)
 
 # Local Variables:
 # tab-width: 8
Index: src/libanalyze/CMakeLists.txt
===================================================================
--- src/libanalyze/CMakeLists.txt	(revision 54114)
+++ src/libanalyze/CMakeLists.txt	(working copy)
@@ -4,7 +4,7 @@
   ${BRLCAD_SOURCE_DIR}/include
   ${BU_INCLUDE_DIRS}
   )
-BRLCAD_LIB_INCLUDE_DIRS(analyze ANALYZE_INCLUDE_DIRS "")
+brlcad_lib_include_dirs(analyze ANALYZE_INCLUDE_DIRS "")
 
 set(LIBANALYZE_SOURCES
   density.c
@@ -14,9 +14,9 @@
 
 add_subdirectory(tests)
 
-BRLCAD_ADDLIB(libanalyze "${LIBANALYZE_SOURCES}" "libbu;librt")
-SET_TARGET_PROPERTIES(libanalyze PROPERTIES VERSION 20.0.1 SOVERSION 20)
-CMAKEFILES(Makefile.am)
+brlcad_addlib(libanalyze "${LIBANALYZE_SOURCES}" "libbu;librt")
+set_target_properties(libanalyze PROPERTIES VERSION 20.0.1 SOVERSION 20)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/canon/CMakeLists.txt
===================================================================
--- src/canon/CMakeLists.txt	(revision 54114)
+++ src/canon/CMakeLists.txt	(working copy)
@@ -4,9 +4,9 @@
   ${CMAKE_CURRENT_SOURCE_DIR}
   )
 
-BRLCAD_ADDEXEC(canonize "canonize.c;canonlib.c" libfb)
-CMAKEFILES(canon.h chore.h)
-CMAKEFILES(Makefile.am)
+brlcad_addexec(canonize "canonize.c;canonlib.c" libfb)
+cmakefiles(canon.h chore.h)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/fbed/CMakeLists.txt
===================================================================
--- src/fbed/CMakeLists.txt	(revision 54114)
+++ src/fbed/CMakeLists.txt	(working copy)
@@ -6,7 +6,7 @@
     ${CURSOR_INCLUDE_DIRS}
     ${CMAKE_CURRENT_SOURCE_DIR}
     )
-  LIST(REMOVE_DUPLICATES FBED_INCLUDE_DIRS)
+  list(REMOVE_DUPLICATES FBED_INCLUDE_DIRS)
   include_directories(${FBED_INCLUDE_DIRS})
 
   set(fbed_SOURCES
@@ -23,11 +23,11 @@
     try.c
     )
 
-  BRLCAD_ADDEXEC(fbed "${fbed_SOURCES}" "libfb;libvfont;libtermio;libcursor;${TERMLIB_LIBRARY}")
+  brlcad_addexec(fbed "${fbed_SOURCES}" "libfb;libvfont;libtermio;libcursor;${TERMLIB_LIBRARY}")
 
-  CMAKEFILES(ascii.h cursorbits.h extern.h fb_ik.h popup.h std.h try.h)
+  cmakefiles(ascii.h cursorbits.h extern.h fb_ik.h popup.h std.h try.h)
 endif(HAVE_TERMLIB)
-CMAKEFILES(Makefile.am)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/libwdb/CMakeLists.txt
===================================================================
--- src/libwdb/CMakeLists.txt	(revision 54114)
+++ src/libwdb/CMakeLists.txt	(working copy)
@@ -7,7 +7,7 @@
   ${RT_INCLUDE_DIRS}
   ${SYSV_INCLUDE_DIRS}
   )
-BRLCAD_LIB_INCLUDE_DIRS(wdb WDB_INCLUDE_DIRS "")
+brlcad_lib_include_dirs(wdb WDB_INCLUDE_DIRS "")
 
 set(LIBWDB_SOURCES
   arbn.c
@@ -39,22 +39,22 @@
 
 # Set libwdb compile definitions
 get_property(libwdb_DEFINES GLOBAL PROPERTY libwdb_DEFINES)
-LIST(APPEND libwdb_DEFINES "OBJ_BREP=1")
+list(APPEND libwdb_DEFINES "OBJ_BREP=1")
 if(CPP_DLL_DEFINES)
-  LIST(APPEND libwdb_DEFINES "ON_DLL_IMPORTS")
+  list(APPEND libwdb_DEFINES "ON_DLL_IMPORTS")
 endif(CPP_DLL_DEFINES)
 set_property(GLOBAL PROPERTY libwdb_DEFINES "${libwdb_DEFINES}")
 
-BRLCAD_ADDLIB(libwdb "${LIBWDB_SOURCES}" "librt;libbn;libbu;libsysv;${OPENNURBS_LIBRARY};${REGEX_LIBRARY};${ZLIB_LIBRARY}")
+brlcad_addlib(libwdb "${LIBWDB_SOURCES}" "librt;libbn;libbu;libsysv;${OPENNURBS_LIBRARY};${REGEX_LIBRARY};${ZLIB_LIBRARY}")
 set_target_properties(libwdb PROPERTIES VERSION 20.0.1 SOVERSION 20)
 if(CPP_DLL_DEFINES)
   if(BUILD_STATIC_LIBS AND BRLCAD_ENABLE_BRLCAD_LIBRARY)
-    SET_PROPERTY(TARGET libwdb-static APPEND PROPERTY COMPILE_DEFINITIONS "OBJ_BREP=1")
-    SET_PROPERTY(TARGET libwdb-static APPEND PROPERTY COMPILE_DEFINITIONS "ON_DLL_IMPORTS")
+    set_property(TARGET libwdb-static APPEND PROPERTY COMPILE_DEFINITIONS "OBJ_BREP=1")
+    set_property(TARGET libwdb-static APPEND PROPERTY COMPILE_DEFINITIONS "ON_DLL_IMPORTS")
   endif(BUILD_STATIC_LIBS AND BRLCAD_ENABLE_BRLCAD_LIBRARY)
 endif(CPP_DLL_DEFINES)
 
-CMAKEFILES(Makefile.am)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: src/librtserver/CMakeLists.txt
===================================================================
--- src/librtserver/CMakeLists.txt	(revision 54114)
+++ src/librtserver/CMakeLists.txt	(working copy)
@@ -7,15 +7,15 @@
 	${RT_INCLUDE_DIRS}
 	${JNI_INCLUDE_DIRS}
 	)
-BRLCAD_LIB_INCLUDE_DIRS(rtserver RTSERVER_INCLUDE_DIRS "")
+brlcad_lib_include_dirs(rtserver RTSERVER_INCLUDE_DIRS "")
 
-BRLCAD_ADDLIB(rtserver rtserver.c "librt;libbn;libbu;${WINSOCK_LIB};${ZLIB_LIBRARY}")
+brlcad_addlib(rtserver rtserver.c "librt;libbn;libbu;${WINSOCK_LIB};${ZLIB_LIBRARY}")
 set_target_properties(rtserver PROPERTIES VERSION 20.0.1 SOVERSION 20)
 set_target_properties(rtserver PROPERTIES SUFFIX ".jnilib")
 
-BRLCAD_ADDEXEC(rtserverTest rtserverTest.c "libbu;rtserver" NO_INSTALL)
+brlcad_addexec(rtserverTest rtserverTest.c "libbu;rtserver" NO_INSTALL)
 
-CMAKEFILES(Makefile.am)
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: misc/pkgconfig/CMakeLists.txt
===================================================================
--- misc/pkgconfig/CMakeLists.txt	(revision 54114)
+++ misc/pkgconfig/CMakeLists.txt	(working copy)
@@ -46,8 +46,8 @@
   install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${filename_root}.pc DESTINATION ${LIB_DIR}/pkgconfig)
 endforeach(pkgfile ${pkgconfig_DATA})
 
-CMAKEFILES(${pkgconfig_DATA})
-CMAKEFILES(Makefile.am)
+cmakefiles(${pkgconfig_DATA})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: misc/CMakeLists.txt
===================================================================
--- misc/CMakeLists.txt	(revision 54114)
+++ misc/CMakeLists.txt	(working copy)
@@ -17,7 +17,7 @@
     DESTINATION ${CMAKE_BINARY_DIR}/${BIN_DIR}
     FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
     GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/${BIN_DIR}/brlcad-config)
+  distclean(${CMAKE_BINARY_DIR}/${BIN_DIR}/brlcad-config)
   file(REMOVE ${CMAKE_BINARY_DIR}/misc/brlcad-config)
   install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/brlcad-config DESTINATION ${BIN_DIR})
 else(NOT CMAKE_CONFIGURATION_TYPES)
@@ -28,22 +28,22 @@
       DESTINATION ${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/${BIN_DIR}
       FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
       GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
-    DISTCLEAN(${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/${BIN_DIR}/brlcad-config)
+    distclean(${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/${BIN_DIR}/brlcad-config)
     file(REMOVE ${CMAKE_BINARY_DIR}/${CFG_TYPE_UPPER}/misc/brlcad-config)
   endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
   install(PROGRAMS ${CMAKE_BINARY_DIR}/\${BUILD_TYPE}/bin/brlcad-config DESTINATION ${BIN_DIR})
 endif(NOT CMAKE_CONFIGURATION_TYPES)
 
-BRLCAD_ADDDATA(fortran_example.f sample_applications)
+brlcad_adddata(fortran_example.f sample_applications)
 
 set(density_DATAFILES
   GQA_SAMPLE_DENSITIES
   NIST_DENSITIES
   )
-BRLCAD_ADDDATA(density_DATAFILES data)
+brlcad_adddata(density_DATAFILES data)
 
-BRLCAD_ADDDATA(nsis/brlcad.ico icons)
-BRLCAD_ADDDATA(nsis/archer.ico icons)
+brlcad_adddata(nsis/brlcad.ico icons)
+brlcad_adddata(nsis/archer.ico icons)
 
 find_package(Doxygen)
 if(DOXYGEN_FOUND)
@@ -82,7 +82,7 @@
   win32-msvc
   Makefile.am
   )
-CMAKEFILES(${misc_ignore_files})
+cmakefiles(${misc_ignore_files})
 
 # Local Variables:
 # tab-width: 8
Index: misc/CMake/TCL_PKGINDEX.cmake
===================================================================
--- misc/CMake/TCL_PKGINDEX.cmake	(revision 54114)
+++ misc/CMake/TCL_PKGINDEX.cmake	(working copy)
@@ -48,15 +48,15 @@
     file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl "package ifneeded ${pkgname} ${pkgversion} [list load [file join $dir .. .. \"${loadable_libdir_install}\" ${target_LIBNAME}] ${pkgname}]")
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl DESTINATION lib/${pkgname}${pkgversion})
     file(WRITE ${CMAKE_BINARY_DIR}/lib/${pkgname}${pkgversion}/pkgIndex.tcl "package ifneeded ${pkgname} ${pkgversion} [list load [file join $dir \"${loadable_libdir_build}\" ${target_LIBNAME}] ${pkgname}]")
-    DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl)
-    DISTCLEAN(${CMAKE_BINARY_DIR}/lib/${pkgname}${pkgversion})
+    distclean(${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl)
+    distclean(${CMAKE_BINARY_DIR}/lib/${pkgname}${pkgversion})
   else(NOT CMAKE_CONFIGURATION_TYPES)
     if(MSVC)
       set(loadable_libdir_install "${BIN_DIR}")
     else(MSVC)
       set(loadable_libdir_install "${LIB_DIR}")
     endif(MSVC)
-    DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl)
+    distclean(${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl)
     foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
       string(TOUPPER "${CFG_TYPE}" CFG_TYPE_UPPER)
       if(MSVC)
@@ -67,7 +67,7 @@
       get_target_property(target_LIBLOCATION ${target} LOCATION_${CFG_TYPE_UPPER})
       get_filename_component(target_LIBNAME ${target_LIBLOCATION} NAME)
       file(WRITE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}}/${pkgname}${pkgversion}/pkgIndex.tcl "package ifneeded ${pkgname} ${pkgversion} [list load [file join $dir \"${loadable_libdir_build}\" ${target_LIBNAME}] ${pkgname}]")
-      DISTCLEAN(${CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}}/${pkgname}${pkgversion})
+      distclean(${CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}}/${pkgname}${pkgversion})
     endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
     file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl "package ifneeded ${pkgname} ${pkgversion} [list load [file join $dir .. .. \"${loadable_libdir_install}\" ${target_LIBNAME}] ${pkgname}]")
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgIndex.tcl DESTINATION lib/${pkgname}${pkgversion})
Index: misc/CMake/FindLEMON.cmake
===================================================================
--- misc/CMake/FindLEMON.cmake	(revision 54114)
+++ misc/CMake/FindLEMON.cmake	(working copy)
@@ -60,7 +60,7 @@
   endif(lemon_path)
 endif(LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LEMON DEFAULT_MSG LEMON_EXECUTABLE LEMON_TEMPLATE)
+find_package_handle_standard_args(LEMON DEFAULT_MSG LEMON_EXECUTABLE LEMON_TEMPLATE)
 mark_as_advanced(LEMON_TEMPLATE)
 
 #============================================================
Index: misc/CMake/FindXSLTPROC.cmake
===================================================================
--- misc/CMake/FindXSLTPROC.cmake	(revision 54114)
+++ misc/CMake/FindXSLTPROC.cmake	(working copy)
@@ -43,7 +43,7 @@
 mark_as_advanced(XSLTPROC_EXECUTABLE)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(XSLTPROC DEFAULT_MSG XSLTPROC_EXECUTABLE)
+find_package_handle_standard_args(XSLTPROC DEFAULT_MSG XSLTPROC_EXECUTABLE)
 
 # FindXSLTPROC.cmake ends here
 
Index: misc/CMake/BRLCAD_Targets.cmake
===================================================================
--- misc/CMake/BRLCAD_Targets.cmake	(revision 54114)
+++ misc/CMake/BRLCAD_Targets.cmake	(working copy)
@@ -36,7 +36,7 @@
 
 # When defining targets, we need to know if we have a no-error flag
 include(CheckCCompilerFlag)
-CHECK_C_COMPILER_FLAG(-Wno-error NOERROR_FLAG)
+check_c_compiler_flag(-Wno-error NOERROR_FLAG)
 
 # Utility macro checking for a specific arg in un-named arguments to a
 # macro.
@@ -161,7 +161,7 @@
 
   # Make sure we don't have a non-installed exec target.  If it is to
   # be installed, call the install function
-  CHECK_OPT("NO_INSTALL" NO_EXEC_INSTALL "${ARGN}")
+  check_opt("NO_INSTALL" NO_EXEC_INSTALL "${ARGN}")
   if(NOT NO_EXEC_INSTALL)
     install(TARGETS ${execname} DESTINATION ${BIN_DIR})
   endif(NOT NO_EXEC_INSTALL)
@@ -170,7 +170,7 @@
   # be able to force the executable to remain in the local directory
   # regardless of the global CMAKE_RUNTIME_OUTPUT_DIRECTORY setting.
   # The LOCAL flag is used to denote such executables.
-  CHECK_OPT("LOCAL" LOCAL_EXEC "${ARGN}")
+  check_opt("LOCAL" LOCAL_EXEC "${ARGN}")
   if(LOCAL_EXEC)
     if(NOT CMAKE_CONFIGURATION_TYPES)
       set_target_properties(${execname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
@@ -184,13 +184,13 @@
 
   # Use the list of libraries to be linked into this target to
   # accumulate the necessary definitions and compilation flags.
-  GET_TARGET_DEFINES(${execname} "${libslist}")
+  get_target_defines(${execname} "${libslist}")
   # For DLL libraries, we may need additional flags
-  GET_TARGET_DLL_DEFINES(${execname} "${libslist}")
-  GET_TARGET_FLAGS(${execname} "${libslist}")
+  get_target_dll_defines(${execname} "${libslist}")
+  get_target_flags(${execname} "${libslist}")
 
   # Find out if we have C, C++, or both
-  SRCS_LANG("${srcslist}" exec_type ${execname})
+  srcs_lang("${srcslist}" exec_type ${execname})
 
   # Add the definitions
   foreach(lib_define ${${execname}_DEFINES})
@@ -203,7 +203,7 @@
   # If we have a mixed language exec, pass on the flags to
   # the source files - otherwise, use the target.
   if(${exec_type} STREQUAL "MIXED")
-    FLAGS_TO_FILES("${srcslist}" ${execname})
+    flags_to_files("${srcslist}" ${execname})
   else(${exec_type} STREQUAL "MIXED")
     # All one language - we can apply the flags to the target
     foreach(lib_flag ${${execname}_${exec_type}_FLAGS})
@@ -222,7 +222,7 @@
 
   # C++ is handled separately (on a per-file basis) if we have mixed sources via the NOSTRICTCXX flag
   if(${exec_type} STREQUAL "MIXED")
-    CXX_NOSTRICT("${srcslist}" "${ARGN}")
+    cxx_nostrict("${srcslist}" "${ARGN}")
   endif(${exec_type} STREQUAL "MIXED")
 
 endmacro(BRLCAD_ADDEXEC execname srcslist libslist)
@@ -239,19 +239,19 @@
   set(BRLCAD_LIBS "${BRLCAD_LIBS}" CACHE STRING "BRL-CAD libraries" FORCE)
 
   # Collect the definitions and flags needed by this library
-  GET_TARGET_DEFINES(${libname} "${libslist}")
+  get_target_defines(${libname} "${libslist}")
   # For DLL libraries, we may need additional flags
-  GET_TARGET_DLL_DEFINES(${libname} "${libslist}")
-  GET_TARGET_FLAGS(${libname} "${libslist}")
+  get_target_dll_defines(${libname} "${libslist}")
+  get_target_flags(${libname} "${libslist}")
 
   # Find out if we have C, C++, or both
-  SRCS_LANG("${srcslist}" lib_type ${libname})
+  srcs_lang("${srcslist}" lib_type ${libname})
 
   # If we have a mixed language library, go ahead and pass on the flags to
   # the source files - we don't need the targets defined since the flags
   # will be managed per-source-file.
   if(${lib_type} STREQUAL "MIXED")
-    FLAGS_TO_FILES("${srcslist}" ${libname})
+    flags_to_files("${srcslist}" ${libname})
   endif(${lib_type} STREQUAL "MIXED")
 
   # Handle "shared" libraries (with MSVC, these would be dynamic libraries)
@@ -359,7 +359,7 @@
   # C++ STRICTNESS is handled separately (on a per-file basis) if we have mixed
   # sources via the NOSTRICTCXX flag
   if(${lib_type} STREQUAL "MIXED")
-    CXX_NOSTRICT("${srcslist}" "${ARGN}")
+    cxx_nostrict("${srcslist}" "${ARGN}")
   endif(${lib_type} STREQUAL "MIXED")
 
   # For any CPP_DLL_DEFINES DLL library, users of that library will need the DLL_IMPORTS
@@ -418,7 +418,7 @@
 
     # paths in BRL-CAD build dir
     foreach(inc_path ${${DIR_LIST}})
-      IS_SUBPATH("${BRLCAD_BINARY_DIR}" "${inc_path}" SUBPATH_TEST)
+      is_subpath("${BRLCAD_BINARY_DIR}" "${inc_path}" SUBPATH_TEST)
       if("${SUBPATH_TEST}" STREQUAL "1")
 	set(NEW_DIR_LIST ${NEW_DIR_LIST} ${inc_path})
 	list(REMOVE_ITEM ${DIR_LIST} ${inc_path})
@@ -427,7 +427,7 @@
 
     # paths in BRL-CAD source dir
     foreach(inc_path ${${DIR_LIST}})
-      IS_SUBPATH("${BRLCAD_SOURCE_DIR}" "${inc_path}" SUBPATH_TEST)
+      is_subpath("${BRLCAD_SOURCE_DIR}" "${inc_path}" SUBPATH_TEST)
       if("${SUBPATH_TEST}" STREQUAL "1")
 	set(NEW_DIR_LIST ${NEW_DIR_LIST} ${inc_path})
 	list(REMOVE_ITEM ${DIR_LIST} ${inc_path})
@@ -459,7 +459,7 @@
   mark_as_advanced(${DIR_LIST})
 
   set(ALL_INCLUDES ${${DIR_LIST}} ${${LOCAL_DIR_LIST}})
-  BRLCAD_SORT_INCLUDE_DIRS(ALL_INCLUDES)
+  brlcad_sort_include_dirs(ALL_INCLUDES)
   include_directories(${ALL_INCLUDES})
 endmacro(BRLCAD_LIB_INCLUDE_DIRS)
 
@@ -489,7 +489,7 @@
 macro(BRLCAD_MANAGE_FILES inputdata targetdir)
   # Handle both a list of one or more files and variable holding a list of files -
   # find out what we've got.
-  NORMALIZE_FILE_LIST("${inputdata}" datalist fullpath_datalist targetname)
+  normalize_file_list("${inputdata}" datalist fullpath_datalist targetname)
 
   # Now that the input data and target names are in order, define the custom
   # commands needed for build directory data copying on this platform (per
@@ -559,18 +559,18 @@
 
   # Define the target and add it to this directories list of data targets
   add_custom_target(${targetname}_cp ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${targetname}.sentinel)
-  BRLCAD_ADD_DIR_LIST_ENTRY(DATA_TARGETS "${CMAKE_CURRENT_BINARY_DIR}" ${targetname}_cp)
+  brlcad_add_dir_list_entry(DATA_TARGETS "${CMAKE_CURRENT_BINARY_DIR}" ${targetname}_cp)
 
   # Add outputs to the distclean rules - this is consistent regardless of what type the output
   # file is, symlink or copy.  Just need to handle the single and multiconfig cases.
   foreach(filename ${fullpath_datalist})
     get_filename_component(ITEM_NAME "${filename}" NAME)
     if(NOT CMAKE_CONFIGURATION_TYPES)
-      DISTCLEAN(${CMAKE_BINARY_DIR}/${targetdir}/${ITEM_NAME})
+      distclean(${CMAKE_BINARY_DIR}/${targetdir}/${ITEM_NAME})
     else(NOT CMAKE_CONFIGURATION_TYPES)
       foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
 	string(TOUPPER "${CFG_TYPE}" CFG_TYPE_UPPER)
-	DISTCLEAN(${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/${targetdir}/${ITEM_NAME})
+	distclean(${CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}}/${targetdir}/${ITEM_NAME})
       endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
     endif(NOT CMAKE_CONFIGURATION_TYPES)
   endforeach(filename ${fullpath_datalist})
@@ -586,17 +586,17 @@
 # of the common cases in BRL-CAD.
 
 macro(BRLCAD_ADDDATA datalist targetdir)
-  BRLCAD_MANAGE_FILES(${datalist} ${DATA_DIR}/${targetdir})
+  brlcad_manage_files(${datalist} ${DATA_DIR}/${targetdir})
 endmacro(BRLCAD_ADDDATA)
 
 macro(ADD_DOC doclist targetdir)
   set(doc_target_dir ${DOC_DIR}/${targetdir})
-  BRLCAD_MANAGE_FILES(${doclist} ${doc_target_dir})
+  brlcad_manage_files(${doclist} ${doc_target_dir})
 endmacro(ADD_DOC)
 
 macro(ADD_MAN_PAGES num inmanlist)
   set(man_target_dir ${MAN_DIR}/man${num})
-  BRLCAD_MANAGE_FILES(${inmanlist} ${man_target_dir})
+  brlcad_manage_files(${inmanlist} ${man_target_dir})
 endmacro(ADD_MAN_PAGES)
 
 # Local Variables:
Index: misc/CMake/FindSCL.cmake
===================================================================
--- misc/CMake/FindSCL.cmake	(revision 54114)
+++ misc/CMake/FindSCL.cmake	(working copy)
@@ -64,7 +64,7 @@
 find_library(SCL_EDITOR_LIB NAMES stepeditor)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SCL DEFAULT_MSG SCL_CORE_LIB SCL_DAI_LIB SCL_UTILS_LIB SCL_FEDEX_PLUS_EXECUTABLE SCL_EXPRESS_EXECUTABLE)
+find_package_handle_standard_args(SCL DEFAULT_MSG SCL_CORE_LIB SCL_DAI_LIB SCL_UTILS_LIB SCL_FEDEX_PLUS_EXECUTABLE SCL_EXPRESS_EXECUTABLE)
 
 mark_as_advanced(SCL_CORE_LIB SCL_DAI_LIB SCL_EDITOR_LIB SCL_EXPPP_LIB SCL_UTILS_LIB)
 mark_as_advanced(SCL_EXPPP_EXECUTABLE SCL_EXPRESS_EXECUTABLE SCL_FEDEX_IDL_EXECUTABLE SCL_FEDEX_OS_EXECUTABLE SCL_FEDEX_PLUS_EXECUTABLE SCL_SYMLINK_EXECUTABLE)
Index: misc/CMake/FindTCL.cmake
===================================================================
--- misc/CMake/FindTCL.cmake	(revision 54114)
+++ misc/CMake/FindTCL.cmake	(working copy)
@@ -240,13 +240,13 @@
 set(TCL_POSSIBLE_MINOR_VERSIONS 6 5 4 3 2 1 0)
 
 # Create the Tcl/Tk options if not already present
-OPTION(TK_NATIVE_GRAPHICS "Require native Tk graphics." OFF)
-OPTION(TK_X11_GRAPHICS "Require X11 Tk graphics." OFF)
-OPTION(TCL_USE_FRAMEWORK_ONLY "Don't use any Tcl/Tk installation that isn't a Framework." OFF)
-OPTION(TCL_REQUIRE_TK "Look for Tk installation, not just Tcl." ON)
-OPTION(TCL_REQUIRE_THREADS "Reject a Tcl/Tk installation unless threads are enabled." OFF)
-OPTION(TCL_NEED_HEADERS "Don't report a found Tcl/Tk unless headers are present." ON)
-OPTION(TCL_NEED_STUB_LIBS "Don't report a found Tcl/Tk unless the stub libraries are present." ON)
+option(TK_NATIVE_GRAPHICS "Require native Tk graphics." OFF)
+option(TK_X11_GRAPHICS "Require X11 Tk graphics." OFF)
+option(TCL_USE_FRAMEWORK_ONLY "Don't use any Tcl/Tk installation that isn't a Framework." OFF)
+option(TCL_REQUIRE_TK "Look for Tk installation, not just Tcl." ON)
+option(TCL_REQUIRE_THREADS "Reject a Tcl/Tk installation unless threads are enabled." OFF)
+option(TCL_NEED_HEADERS "Don't report a found Tcl/Tk unless headers are present." ON)
+option(TCL_NEED_STUB_LIBS "Don't report a found Tcl/Tk unless the stub libraries are present." ON)
 
 # Sanity check the settings - can't require both Native and X11 if X11 isn't
 # the native windowing system on the platform
@@ -282,7 +282,7 @@
 macro(TK_GRAPHICS_SYSTEM wishcmd resultvar)
   set(${resultvar} "wm-NOTFOUND")
   file(WRITE ${tkwin_scriptfile} ${tkwin_script})
-  EXEC_PROGRAM(${wishcmd} ARGS ${tkwin_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+  exec_program(${wishcmd} ARGS ${tkwin_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
   file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/TK_WINDOWINGSYSTEM readresultvar)
   string(REGEX REPLACE "\n" "" "${resultvar}" "${readresultvar}")
 endmacro()
@@ -300,7 +300,7 @@
 macro(TCL_GET_VERSION tclshcmd resultvar)
   set(${resultvar} "NOTFOUND")
   file(WRITE ${tclversion_scriptfile} ${tclversion_script})
-  EXEC_PROGRAM(${tclshcmd} ARGS ${tclversion_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+  exec_program(${tclshcmd} ARGS ${tclversion_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
   file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/TCL_VERSION readresultvar)
   string(REGEX REPLACE "\n" "" "${resultvar}" "${readresultvar}")
 endmacro()
@@ -318,7 +318,7 @@
 	macro(TCL_ISTHREADED tclshcmd resultvar)
 	  set(${resultvar} "NOTFOUND")
 	  file(WRITE ${tclthreaded_scriptfile} ${tclthreaded_script})
-	  EXEC_PROGRAM(${tclshcmd} ARGS ${tclthreaded_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
+	  exec_program(${tclshcmd} ARGS ${tclthreaded_scriptfile} OUTPUT_VARIABLE EXECOUTPUT)
 	  file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/TCL_THREADED readresultvar)
 	  string(REGEX REPLACE "\n" "" "${resultvar}" "${readresultvar}")
 	endmacro()
@@ -488,10 +488,10 @@
 	      foreach(SPATH ${${pathnames}})
 		set(TCL_CURRENTPATH TCL-NOTFOUND)
 		set(CURRENT_SEARCH_VERSION "${MAJORNUM}.${MINORNUM}")
-		VALIDATE_VERSION(dosearch ${CURRENT_SEARCH_VERSION})
+		validate_version(dosearch ${CURRENT_SEARCH_VERSION})
 		if(dosearch)
-		  FIND_PROGRAM_PATHS(BIN_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
-		  FIND_LIBRARY_PATHS(LIB_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		  find_program_paths(BIN_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		  find_library_paths(LIB_POSSIBLE_PATHS SPATH ${MAJORNUM} ${MINORNUM})
 		  foreach(targetbin ${targetbinnames})
 		    if(TCL_CURRENTPATH MATCHES "NOTFOUND$")
 		      find_program(TCL_CURRENTPATH NAMES ${targetbin}${MAJORNUM}.${MINORNUM} ${targetbin}${MAJORNUM}${MINORNUM} PATHS ${BIN_POSSIBLE_PATHS} ${options})
@@ -529,7 +529,7 @@
 	    foreach(MAJORNUM ${TCL_POSSIBLE_MAJOR_VERSIONS})
 	      foreach(MINORNUM ${TCL_POSSIBLE_MINOR_VERSIONS})
 		set(CURRENT_SEARCH_VERSION "${MAJORNUM}.${MINORNUM}")
-		VALIDATE_VERSION(isvalid ${CURRENT_SEARCH_VERSION})
+		validate_version(isvalid ${CURRENT_SEARCH_VERSION})
 		if(isvalid)
 		  foreach(genpath ${CONFIG_SEARCH_PATHS})
 		    set(CONFGENPATHS "${CONFGENPATHS};${genpath}${MAJORNUM}${MINORNUM};${genpath}${MAJORNUM}.${MINORNUM}")
@@ -619,7 +619,7 @@
 	#-----------------------------------------------------------------------------
 
 	macro(READ_TCLCONFIG_FILE tclconffile)
-	  RESET_TCL_VARS()
+	  reset_tcl_vars()
 	  set(TCL_CONF_FILE "")
 	  file(READ ${tclconffile} TCL_CONF_FILE)
 	  string(REGEX REPLACE "\r?\n" ";" ENT "${TCL_CONF_FILE}")
@@ -646,15 +646,15 @@
 		set(TCL_EXE_SUFFIX "")
 	      endif(MSVC)
 	      string(REGEX REPLACE ".*TCL_EXEC_PREFIX='(.+)'.*" "\\1" TCL_TCLSH_EXECUTABLE ${line})
-	      IF (EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      if (EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh-${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}${TCL_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh")
+	      elseif(EXISTS "${TCL_TCLSH_EXECUTABLE}/bin/tclsh")
 		set(TCL_TCLSH_EXECUTABLE "${TCL_TCLSH_EXECUTABLE}/bin/tclsh")
 	      endif()
 	    endif()
@@ -669,7 +669,7 @@
 
 
 	macro(READ_TKCONFIG_FILE tkconffile)
-	  RESET_TK_VARS()
+	  reset_tk_vars()
 	  set(TK_CONF_FILE "")
 	  file(READ ${tkconffile} TK_CONF_FILE)
 	  string(REGEX REPLACE "\r?\n" ";" ENT "${TK_CONF_FILE}")
@@ -696,15 +696,15 @@
 		set(TK_EXE_SUFFIX "")
 	      endif(MSVC)
 	      string(REGEX REPLACE ".*TK_EXEC_PREFIX='(.+)'.*" "\\1" TCL_WISH_EXECUTABLE ${line})
-	      IF (EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      if (EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish-${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}${TK_EXE_SUFFIX}")
-	      ELSEif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish")
+	      elseif(EXISTS "${TCL_WISH_EXECUTABLE}/bin/wish")
 		set(TCL_WISH_EXECUTABLE "${TCL_WISH_EXECUTABLE}/bin/wish")
 	      endif()
 	    endif()
@@ -723,16 +723,16 @@
 
 	macro(VALIDATE_TCL validvar)
 	  set(${validvar} 1)
-	  VALIDATE_TCL_VARIABLES(${validvar})
+	  validate_tcl_variables(${validvar})
 	  if(TCL_TCLSH_EXECUTABLE)
-	    TCL_GET_VERSION(${TCL_TCLSH_EXECUTABLE} CURRENT_SEARCH_VERSION)
-	    VALIDATE_VERSION(dosearch ${CURRENT_SEARCH_VERSION})
+	    tcl_get_version(${TCL_TCLSH_EXECUTABLE} CURRENT_SEARCH_VERSION)
+	    validate_version(dosearch ${CURRENT_SEARCH_VERSION})
 	    if(NOT dosearch)
 	      set(${validvar} 0)
 	    endif(NOT dosearch)
 	  endif(TCL_TCLSH_EXECUTABLE)
 	  if(TCL_REQUIRE_THREADS AND TCL_TCLSH_EXECUTABLE)
-	    TCL_ISTHREADED(${TCL_TCLSH_EXECUTABLE} TCL_THREADS)
+	    tcl_isthreaded(${TCL_TCLSH_EXECUTABLE} TCL_THREADS)
 	    if(NOT TCL_THREADS)
 	      set(${validvar} 0)
 	    endif(NOT TCL_THREADS)
@@ -741,9 +741,9 @@
 
 	macro(VALIDATE_TK validvar)
 	  set(${validvar} 1)
-	  VALIDATE_TK_VARIABLES(${validvar})
+	  validate_tk_variables(${validvar})
 	  if(TK_NATIVE_GRAPHICS OR TK_X11_GRAPHICS)
-	    TK_GRAPHICS_SYSTEM(${TCL_WISH_EXECUTABLE} TK_SYSTEM_GRAPHICS)
+	    tk_graphics_system(${TCL_WISH_EXECUTABLE} TK_SYSTEM_GRAPHICS)
 	    if(APPLE AND TK_NATIVE_GRAPHICS)
 	      if(NOT ${TK_SYSTEM_GRAPHICS} MATCHES "aqua")
 		set(${validvar} 0)
@@ -852,19 +852,19 @@
 	    set(TCL_PREFIX_LIBDIRS ${TCL_PREFIX_LIBDIRS} ${TCL_LIB_PATH_PARENT}/lib)
 	    set(TCL_PREFIX_LIBDIRS ${TCL_PREFIX_LIBDIRS} ${TCL_LIB_PATH_PARENT})
 	    list(REMOVE_DUPLICATES TCL_PREFIX_LIBDIRS)
-	    FIND_LIBRARY_VERSIONS(tcl TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
+	    find_library_versions(tcl TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
 	    set(FOUND_FILES "${TCL_tcl_LIST}")
-	    FIND_CONFIG_FILES(FOUND_FILES TCLCONFIG_LIST tclConfig.sh)
+	    find_config_files(FOUND_FILES TCLCONFIG_LIST tclConfig.sh)
 	    if(TCL_REQUIRE_TK)
-	      FIND_LIBRARY_VERSIONS(tk TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
+	      find_library_versions(tk TCL_PREFIX_LIBDIRS NO_SYSTEM_PATH)
 	      set(FOUND_FILES "${TCL_tk_LIST}")
-	      FIND_CONFIG_FILES(FOUND_FILES TKCONFIG_LIST tkConfig.sh)
+	      find_config_files(FOUND_FILES TKCONFIG_LIST tkConfig.sh)
 	    endif(TCL_REQUIRE_TK)
 	  else(TCL_PREFIX)
 	    set(TCLCONFIG_LIST "")
 	    if(APPLE)
 	      include(CMakeFindFrameworks)
-	      CMAKE_FIND_FRAMEWORKS(Tcl)
+	      cmake_find_frameworks(Tcl)
 	      foreach(dir ${Tcl_FRAMEWORKS})
 		set(tclconf "tclConfig.sh-NOTFOUND")
 		find_file(tclconf tclConfig.sh PATHS ${dir})
@@ -874,7 +874,7 @@
 		endif(NOT tclconf MATCHES "NOTFOUND$")
 	      endforeach(dir ${Tcl_FRAMEWORKS})
 	      if(TCL_REQUIRE_TK)
-		CMAKE_FIND_FRAMEWORKS(Tk)
+		cmake_find_frameworks(Tk)
 		foreach(dir ${Tk_FRAMEWORKS})
 		  set(tkconf "tkConfig.sh-NOTFOUND")
 		  find_file(tkconf tkConfig.sh PATHS ${dir})
@@ -889,7 +889,7 @@
 	      set(PATHLIST "$ENV{LD_LIBRARY_PATH}:$ENV{DYLD_LIBRARY_PATH}:$ENV{DYLD_FALLBACK_LIBRARY_PATH}:$ENV{PATH}")
 	      set(PATHLIST "${TCL_ADDITIONAL_SEARCH_PATHS}:${PATHLIST}")
 	      if(WIN32)
-		WIN32TCLPATHS(PATHLIST "")
+		win32tclpaths(PATHLIST "")
 	      endif(WIN32)
 	      string(REGEX REPLACE "/s?bin:" ":" PATHLIST "${PATHLIST}")
 	      string(REGEX REPLACE "/s?bin;" ":" PATHLIST "${PATHLIST}")
@@ -906,41 +906,41 @@
 	      endforeach()
 	      set(TCLPATHLIST "${PATHLIST}")
 	      set(TKPATHLIST "${PATHLIST}")
-	      FIND_POSSIBLE_PATHS("tclsh" "tcl" TCLPATHLIST NO_SYSTEM_PATH)
+	      find_possible_paths("tclsh" "tcl" TCLPATHLIST NO_SYSTEM_PATH)
 	      if(TCL_REQUIRE_TK)
-		FIND_POSSIBLE_PATHS("wish" "tk" TKPATHLIST NO_SYSTEM_PATH)
+		find_possible_paths("wish" "tk" TKPATHLIST NO_SYSTEM_PATH)
 	      endif(TCL_REQUIRE_TK)
 	      # Hunt up tclConfig.sh files
-	      FIND_CONFIG_FILES(TCLPATHLIST TCLCONFIG_LIST tclConfig.sh)
+	      find_config_files(TCLPATHLIST TCLCONFIG_LIST tclConfig.sh)
 	      # Hunt up tkConfig.sh files
-	      FIND_CONFIG_FILES(TKPATHLIST TKCONFIG_LIST tkConfig.sh)
+	      find_config_files(TKPATHLIST TKCONFIG_LIST tkConfig.sh)
 	    endif(NOT APPLE OR NOT TCL_USE_FRAMEWORK_ONLY)
 	  endif(TCL_PREFIX)
 	  set(TCLVALID 0)
-	  RESET_TCL_VARS()
+	  reset_tcl_vars()
 	  foreach(tcl_config_file ${TCLCONFIG_LIST})
 	    if(NOT TCLVALID)
-	      RESET_TCL_VARS()
-	      READ_TCLCONFIG_file(${tcl_config_file})
+	      reset_tcl_vars()
+	      read_tclconfig_file(${tcl_config_file})
 	      set(TCLVALID 1)
 	      set(CURRENTTCLVERSION "${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}.${TCL_VERSION_PATCH}")
-	      VALIDATE_VERSION(TCLVALID ${CURRENTTCLVERSION})
+	      validate_version(TCLVALID ${CURRENTTCLVERSION})
 	      if(TCLVALID)
 		get_filename_component(TCL_CONF_PREFIX "${tcl_config_file}" PATH)
 		get_filename_component(TCL_LIBRARY_DIR2 "${TCL_CONF_PREFIX}" PATH)
-		FIND_LIBRARY_PATHS(TCL_LIBRARY_SEARCH_PATHS TCL_PREFIX ${TCL_VERSION_MAJOR} ${TCL_VERSION_MINOR})
+		find_library_paths(TCL_LIBRARY_SEARCH_PATHS TCL_PREFIX ${TCL_VERSION_MAJOR} ${TCL_VERSION_MINOR})
 		set(TCL_LIBRARY_SEARCH_PATHS "${TCL_CONF_PREFIX};${TCL_LIBRARY_DIR2};${TCL_LIBRARY_SEARCH_PATHS}")
 		find_library(TCL_LIBRARY tcl Tcl tcl${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR} tcl${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR} PATHS ${TCL_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
 		find_library(TCL_STUB_LIBRARY tclstub${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR} tclstub${TCL_VERSION_MAJOR}${TCL_VERSION_MINOR} PATHS ${TCL_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
 	      endif(TCLVALID)
-	      VALIDATE_TCL(TCLVALID)
+	      validate_tcl(TCLVALID)
 	      if(TCLVALID)
 		if(TCL_REQUIRE_TK)
 		  set(TKVALID 0)
 		  foreach(tk_config_file ${TKCONFIG_LIST})
 		    if(NOT TKVALID)
-		      RESET_TK_VARS()
-		      READ_TKCONFIG_file(${tk_config_file})
+		      reset_tk_vars()
+		      read_tkconfig_file(${tk_config_file})
 		      set(TKVALID 0)
 		      set(CURRENTTKVERSION "${TK_VERSION_MAJOR}.${TK_VERSION_MINOR}.${TK_VERSION_PATCH}")
 		      set(vtcltkcompare 0)
@@ -952,18 +952,18 @@
 		      if(TKVALID)
 			get_filename_component(TCL_TK_CONF_PREFIX "${tk_config_file}" PATH)
 			get_filename_component(TCL_TK_LIBRARY_DIR2 "${TCL_TK_CONF_PREFIX}" PATH)
-			FIND_LIBRARY_PATHS(TCL_TK_LIBRARY_SEARCH_PATHS TK_PREFIX ${TK_VERSION_MAJOR} ${TK_VERSION_MINOR})
+			find_library_paths(TCL_TK_LIBRARY_SEARCH_PATHS TK_PREFIX ${TK_VERSION_MAJOR} ${TK_VERSION_MINOR})
 			set(TCL_TK_LIBRARY_SEARCH_PATHS "${TCL_TK_CONF_PREFIX};${TCL_TK_LIBRARY_DIR2};${TCL_TK_LIBRARY_SEARCH_PATHS}")
 			find_library(TCL_TK_LIBRARY tk Tk tk${TK_VERSION_MAJOR}.${TK_VERSION_MINOR} tk${TK_VERSION_MAJOR}${TK_VERSION_MINOR} PATHS ${TCL_TK_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
 			find_library(TCL_TK_STUB_LIBRARY tkstub tkstub${TK_VERSION_MAJOR}.${TK_VERSION_MINOR} tkstub${TK_VERSION_MAJOR}${TK_VERSION_MINOR} PATHS ${TCL_TK_LIBRARY_SEARCH_PATHS} NO_SYSTEM_PATH)
-			VALIDATE_TK(TKVALID)
+			validate_tk(TKVALID)
 		      endif(TKVALID)
 		    endif(NOT TKVALID)
 		  endforeach(tk_config_file ${TKCONFIG_LIST})
 		  if(NOT TKVALID)
 		    set(TCLVALID 0)
-		    RESET_TCL_VARS()
-		    RESET_TK_VARS()
+		    reset_tcl_vars()
+		    reset_tk_vars()
 		  endif(NOT TKVALID)
 		endif(TCL_REQUIRE_TK)
 	      endif(TCLVALID)
@@ -983,29 +983,29 @@
 	      foreach(MINORNUM ${TCL_POSSIBLE_MINOR_VERSIONS})
 		foreach(SPATH ${PATHLIST})
 		  if(NOT TCLVALID)
-		    RESET_TCL_VARS()
+		    reset_tcl_vars()
 		    set(CURRENT_SEARCH_VERSION "${MAJORNUM}.${MINORNUM}")
-		    VALIDATE_VERSION(dosearch ${CURRENT_SEARCH_VERSION})
+		    validate_version(dosearch ${CURRENT_SEARCH_VERSION})
 		    if(dosearch)
-		      FIND_LIBRARY_PATHS(TCL_LIBRARY_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
-		      FIND_PROGRAM_PATHS(TCL_PROGRAM_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		      find_library_paths(TCL_LIBRARY_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
+		      find_program_paths(TCL_PROGRAM_SEARCH_PATHS SPATH ${MAJORNUM} ${MINORNUM})
 		      find_program(TCL_TCLSH_EXECUTABLE NAMES tclsh${MAJORNUM}.${MINORNUM} tclsh${MAJORNUM}${MINORNUM} PATHS ${TCL_PROGRAM_SEARCH_PATHS} NO_SYSTEM_PATH)
 		    endif(dosearch)
-		    VALIDATE_TCL(TCLVALID)
+		    validate_tcl(TCLVALID)
 		    if(TCLVALID)
 		      if(TCL_REQUIRE_TK)
 			set(TKVALID 0)
-			RESET_TK_VARS()
+			reset_tk_vars()
 			find_program(TCL_WISH_EXECUTABLE NAMES wish${MAJORNUM}.${MINORNUM} wish${MAJORNUM}${MINORNUM} PATHS ${TCL_PROGRAM_SEARCH_PATHS} NO_SYSTEM_PATH)
-			VALIDATE_TK(TKVALID)
+			validate_tk(TKVALID)
 			if(NOT TKVALID)
 			  set(TCLVALID 0)
-			  RESET_TCL_VARS()
-			  RESET_TK_VARS()
+			  reset_tcl_vars()
+			  reset_tk_vars()
 			endif(NOT TKVALID)
 		      endif(TCL_REQUIRE_TK)
 		    else(TCLVALID)
-		      RESET_TCL_VARS()
+		      reset_tcl_vars()
 		    endif(TCLVALID)
 		  endif(NOT TCLVALID)
 		endforeach(SPATH ${PATHLIST})
@@ -1023,11 +1023,11 @@
 	  set(TCL_STUB_LIBRARIES ${TCL_STUB_LIBRARY} ${TK_STUB_LIBRARY})
 	  set(TCL_ROOT_PATH ${TCL_CONF_PREFIX})
 	  set(TCL_VERSION_STRING "${TCL_VERSION_MAJOR}.${TCL_VERSION_MINOR}.${TCL_VERSION_PATCH}")
-	  FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCL DEFAULT_MSG TCL_LIBRARY ${PACKAGE_HANDLE_VARS})
+	  find_package_handle_standard_args(TCL DEFAULT_MSG TCL_LIBRARY ${PACKAGE_HANDLE_VARS})
 	  if(TCL_REQUIRE_TK)
 	    set(TK_FIND_QUIETLY ${TCL_FIND_QUIETLY})
 	    set(PACKAGE_HANDLE_VARS "${PACKAGE_HANDLE_VARS};TCL_LIBRARY")
-	    FIND_PACKAGE_HANDLE_STANDARD_ARGS(TK DEFAULT_MSG TCL_TK_LIBRARY ${PACKAGE_HANDLE_VARS})
+	    find_package_handle_standard_args(TK DEFAULT_MSG TCL_TK_LIBRARY ${PACKAGE_HANDLE_VARS})
 	  endif(TCL_REQUIRE_TK)
 
 	  foreach(pkgvar ${PACKAGE_HANDLE_VARS})
Index: misc/CMake/BRLCAD_CompilerFlags.cmake
===================================================================
--- misc/CMake/BRLCAD_CompilerFlags.cmake	(revision 54114)
+++ misc/CMake/BRLCAD_CompilerFlags.cmake	(working copy)
@@ -40,23 +40,23 @@
 # -fast-math results in non-IEEE floating point math among a handful
 # of other optimizations that cause substantial error in ray tracing
 # and tessellation (and probably more).
-BRLCAD_CHECK_C_FLAG(O3 GROUPS OPTIMIZE_C_FLAGS)
-BRLCAD_CHECK_C_FLAG(fstrength-reduce GROUPS OPTIMIZE_C_FLAGS)
-BRLCAD_CHECK_C_FLAG(fexpensive-optimizations GROUPS OPTIMIZE_C_FLAGS)
-BRLCAD_CHECK_C_FLAG(finline-functions GROUPS OPTIMIZE_C_FLAGS)
-BRLCAD_CHECK_C_FLAG("finline-limit=10000 --param inline-unit-growth=300 --param large-function-growth=300" GROUPS OPTIMIZE_C_FLAGS)
-BRLCAD_CHECK_CXX_FLAG(O3 GROUPS OPTIMIZE_CXX_FLAGS)
-BRLCAD_CHECK_CXX_FLAG(fstrength-reduce GROUPS OPTIMIZE_CXX_FLAGS)
-BRLCAD_CHECK_CXX_FLAG(fexpensive-optimizations GROUPS OPTIMIZE_CXX_FLAGS)
-BRLCAD_CHECK_CXX_FLAG(finline-functions GROUPS OPTIMIZE_CXX_FLAGS)
-BRLCAD_CHECK_CXX_FLAG("finline-limit=10000 --param inline-unit-growth=300 --param large-function-growth=300" GROUPS OPTIMIZE_CXX_FLAGS)
+brlcad_check_c_flag(O3 GROUPS OPTIMIZE_C_FLAGS)
+brlcad_check_c_flag(fstrength-reduce GROUPS OPTIMIZE_C_FLAGS)
+brlcad_check_c_flag(fexpensive-optimizations GROUPS OPTIMIZE_C_FLAGS)
+brlcad_check_c_flag(finline-functions GROUPS OPTIMIZE_C_FLAGS)
+brlcad_check_c_flag("finline-limit=10000 --param inline-unit-growth=300 --param large-function-growth=300" GROUPS OPTIMIZE_C_FLAGS)
+brlcad_check_cxx_flag(O3 GROUPS OPTIMIZE_CXX_FLAGS)
+brlcad_check_cxx_flag(fstrength-reduce GROUPS OPTIMIZE_CXX_FLAGS)
+brlcad_check_cxx_flag(fexpensive-optimizations GROUPS OPTIMIZE_CXX_FLAGS)
+brlcad_check_cxx_flag(finline-functions GROUPS OPTIMIZE_CXX_FLAGS)
+brlcad_check_cxx_flag("finline-limit=10000 --param inline-unit-growth=300 --param large-function-growth=300" GROUPS OPTIMIZE_CXX_FLAGS)
 if(${BRLCAD_OPTIMIZED_BUILD} MATCHES "ON")
   if(NOT BRLCAD_ENABLE_PROFILING AND NOT BRLCAD_FLAGS_DEBUG)
-    BRLCAD_CHECK_C_FLAG(fomit-frame-pointer GROUPS OPTIMIZE_C_FLAGS)
-    BRLCAD_CHECK_CXX_FLAG(fomit-frame-pointer GROUPS OPTIMIZE_CXX_FLAGS)
+    brlcad_check_c_flag(fomit-frame-pointer GROUPS OPTIMIZE_C_FLAGS)
+    brlcad_check_cxx_flag(fomit-frame-pointer GROUPS OPTIMIZE_CXX_FLAGS)
   else(NOT BRLCAD_ENABLE_PROFILING AND NOT BRLCAD_FLAGS_DEBUG)
-    BRLCAD_CHECK_C_FLAG(fno-omit-frame-pointer GROUPS OPTIMIZE_C_FLAGS)
-    BRLCAD_CHECK_CXX_FLAG(fno-omit-frame-pointer GROUPS OPTIMIZE_CXX_FLAGS)
+    brlcad_check_c_flag(fno-omit-frame-pointer GROUPS OPTIMIZE_C_FLAGS)
+    brlcad_check_cxx_flag(fno-omit-frame-pointer GROUPS OPTIMIZE_CXX_FLAGS)
   endif(NOT BRLCAD_ENABLE_PROFILING AND NOT BRLCAD_FLAGS_DEBUG)
 endif(${BRLCAD_OPTIMIZED_BUILD} MATCHES "ON")
 
@@ -74,8 +74,8 @@
   endif(${BRLCAD_OPTIMIZED_BUILD} MATCHES "ON")
 endif(${BRLCAD_FLAGS_OPTIMIZATION} MATCHES "AUTO")
 if(opt_conf_list)
-  ADD_NEW_FLAG(C OPTIMIZE_C_FLAGS "${opt_conf_list}")
-  ADD_NEW_FLAG(CXX OPTIMIZE_CXX_FLAGS "${opt_conf_list}")
+  add_new_flag(C OPTIMIZE_C_FLAGS "${opt_conf_list}")
+  add_new_flag(CXX OPTIMIZE_CXX_FLAGS "${opt_conf_list}")
 endif(opt_conf_list)
 
 # verbose warning flags
@@ -83,45 +83,45 @@
   # also of interest:
   # -Wunreachable-code -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -ansi
   # -Wformat=2 (after bu_fopen_uniq() is obsolete)
-  BRLCAD_CHECK_C_FLAG(pedantic)
-  BRLCAD_CHECK_CXX_FLAG(pedantic)
+  brlcad_check_c_flag(pedantic)
+  brlcad_check_cxx_flag(pedantic)
 
   # The Wall warnings are too verbose with Visual C++
   if(NOT MSVC)
-    BRLCAD_CHECK_C_FLAG(Wall)
-    BRLCAD_CHECK_CXX_FLAG(Wall)
+    brlcad_check_c_flag(Wall)
+    brlcad_check_cxx_flag(Wall)
   else(NOT MSVC)
-    BRLCAD_CHECK_C_FLAG(W4)
-    BRLCAD_CHECK_CXX_FLAG(W4)
+    brlcad_check_c_flag(W4)
+    brlcad_check_cxx_flag(W4)
   endif(NOT MSVC)
 
-  BRLCAD_CHECK_C_FLAG(Wextra)
-  BRLCAD_CHECK_CXX_FLAG(Wextra)
+  brlcad_check_c_flag(Wextra)
+  brlcad_check_cxx_flag(Wextra)
 
-  BRLCAD_CHECK_C_FLAG(Wundef)
-  BRLCAD_CHECK_CXX_FLAG(Wundef)
+  brlcad_check_c_flag(Wundef)
+  brlcad_check_cxx_flag(Wundef)
 
-  BRLCAD_CHECK_C_FLAG(Wfloat-equal)
-  BRLCAD_CHECK_CXX_FLAG(Wfloat-equal)
+  brlcad_check_c_flag(Wfloat-equal)
+  brlcad_check_cxx_flag(Wfloat-equal)
 
-  BRLCAD_CHECK_C_FLAG(Wshadow)
-  BRLCAD_CHECK_CXX_FLAG(Wshadow)
+  brlcad_check_c_flag(Wshadow)
+  brlcad_check_cxx_flag(Wshadow)
 
-  BRLCAD_CHECK_C_FLAG(Winline)
-  BRLCAD_CHECK_CXX_FLAG(Winline)
+  brlcad_check_c_flag(Winline)
+  brlcad_check_cxx_flag(Winline)
 
   # Need this for tcl.h
-  BRLCAD_CHECK_C_FLAG(Wno-long-long)
-  BRLCAD_CHECK_CXX_FLAG(Wno-long-long)
+  brlcad_check_c_flag(Wno-long-long)
+  brlcad_check_cxx_flag(Wno-long-long)
 
   # Need this for X11 headers using variadic macros
-  BRLCAD_CHECK_C_FLAG(Wno-variadic-macros)
-  BRLCAD_CHECK_CXX_FLAG(Wno-variadic-macros)
+  brlcad_check_c_flag(Wno-variadic-macros)
+  brlcad_check_cxx_flag(Wno-variadic-macros)
 endif(BRLCAD_ENABLE_COMPILER_WARNINGS OR BRLCAD_ENABLE_STRICT)
 
 if(BRLCAD_ENABLE_STRICT)
-  BRLCAD_CHECK_C_FLAG(Werror)
-  BRLCAD_CHECK_CXX_FLAG(Werror)
+  brlcad_check_c_flag(Werror)
+  brlcad_check_cxx_flag(Werror)
 endif(BRLCAD_ENABLE_STRICT)
 
 # End detection of flags intended for BRL-CAD use.  Make sure all variables have
Index: misc/CMake/FindOSL.cmake
===================================================================
--- misc/CMake/FindOSL.cmake	(revision 54114)
+++ misc/CMake/FindOSL.cmake	(working copy)
@@ -65,7 +65,7 @@
   NAMES oslquery
   PATHS ${OSLHOME}/lib)
 
-FIND_PATH (OSL_INCLUDES
+find_path (OSL_INCLUDES
   NAMES oslexec.h
   PATHS ${OSLHOME}/include/OSL)
 
Index: misc/CMake/Fink_MacPorts.cmake
===================================================================
--- misc/CMake/Fink_MacPorts.cmake	(revision 54114)
+++ misc/CMake/Fink_MacPorts.cmake	(working copy)
@@ -109,24 +109,24 @@
     endif(${CMAKE_SEARCH_OSX_PATHS} STREQUAL "FINK" AND NOT FINK_EXEC)
 
     # Deduce the MacPorts paths from PORT_EXEC
-    IF(PORT_EXEC)
+    if(PORT_EXEC)
       get_filename_component(port_binpath ${PORT_EXEC} PATH)
       get_filename_component(port_path ${port_binpath} PATH)
       get_filename_component(port_path_normalized ${port_path} ABSOLUTE)
-      SET(CMAKE_MACPORTS_LIBRARY_PATH ${port_path_normalized}/lib CACHE STRING "MacPorts library path" FORCE)
-      SET(CMAKE_MACPORTS_INCLUDE_PATH ${port_path_normalized}/include CACHE STRING "MacPorts include path" FORCE)
+      set(CMAKE_MACPORTS_LIBRARY_PATH ${port_path_normalized}/lib CACHE STRING "MacPorts library path" FORCE)
+      set(CMAKE_MACPORTS_INCLUDE_PATH ${port_path_normalized}/include CACHE STRING "MacPorts include path" FORCE)
       if(CMAKE_SYSTEM_IGNORE_PATH)
 	list(REMOVE_ITEM CMAKE_SYSTEM_IGNORE_PATH "${port_path_normalized}/lib")
       endif(CMAKE_SYSTEM_IGNORE_PATH)
-    ENDIF(PORT_EXEC)
+    endif(PORT_EXEC)
 
     # Deduce the Fink paths from FINK_EXEC
     if(FINK_EXEC)
       get_filename_component(fink_binpath ${FINK_EXEC} PATH)
       get_filename_component(fink_path ${fink_binpath} PATH)
       get_filename_component(fink_path_normalized ${fink_path} ABSOLUTE)
-      SET(CMAKE_FINK_LIBRARY_PATH ${fink_path_normalized}/lib CACHE STRING "Fink library path" FORCE)
-      SET(CMAKE_FINK_INCLUDE_PATH ${fink_path_normalized}/include CACHE STRING "Fink include path" FORCE)
+      set(CMAKE_FINK_LIBRARY_PATH ${fink_path_normalized}/lib CACHE STRING "Fink library path" FORCE)
+      set(CMAKE_FINK_INCLUDE_PATH ${fink_path_normalized}/include CACHE STRING "Fink include path" FORCE)
       if(CMAKE_SYSTEM_IGNORE_PATH)
 	list(REMOVE_ITEM CMAKE_SYSTEM_IGNORE_PATH "${CMAKE_FINK_LIBRARY_PATH}")
       endif(CMAKE_SYSTEM_IGNORE_PATH)
Index: misc/CMake/FindGL.cmake
===================================================================
--- misc/CMake/FindGL.cmake	(revision 54114)
+++ misc/CMake/FindGL.cmake	(working copy)
@@ -187,7 +187,7 @@
     )
 
   if(APPLE)
-    OPTION(OPENGL_USE_AQUA "Require native OSX Framework version of OpenGL." ON)
+    option(OPENGL_USE_AQUA "Require native OSX Framework version of OpenGL." ON)
   endif(APPLE)
 
   if(OPENGL_USE_AQUA)
Index: misc/CMake/FindUTAHRLE.cmake
===================================================================
--- misc/CMake/FindUTAHRLE.cmake	(revision 54114)
+++ misc/CMake/FindUTAHRLE.cmake	(working copy)
@@ -48,9 +48,9 @@
 find_library(UTAHRLE_LIBRARY NAMES UTAHRLE)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(UTAHRLE DEFAULT_MSG UTAHRLE_LIBRARY UTAHRLE_INCLUDE_DIR)
+find_package_handle_standard_args(UTAHRLE DEFAULT_MSG UTAHRLE_LIBRARY UTAHRLE_INCLUDE_DIR)
 
-IF (UTAHRLE_FOUND)
+if (UTAHRLE_FOUND)
   set(UTAHRLE_INCLUDE_DIRS ${UTAHRLE_INCLUDE_DIR})
   set(UTAHRLE_LIBRARIES    ${UTAHRLE_LIBRARY})
 endif()
Index: misc/CMake/BRLCAD_CMakeFiles.cmake
===================================================================
--- misc/CMake/BRLCAD_CMakeFiles.cmake	(revision 54114)
+++ misc/CMake/BRLCAD_CMakeFiles.cmake	(working copy)
@@ -94,9 +94,9 @@
           # systems at some point in the future, we may have to
           # exclude src/other paths from this check.
 	  if(NOT "${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
-	    IS_SUBPATH("${CMAKE_BINARY_DIR}" "${ITEM_PATH}" SUBPATH_TEST)
+	    is_subpath("${CMAKE_BINARY_DIR}" "${ITEM_PATH}" SUBPATH_TEST)
 	    if("${SUBPATH_TEST}" STREQUAL "0")
-	      IS_SUBPATH("${CMAKE_SOURCE_DIR}" "${ITEM_PATH}" SUBPATH_TEST)
+	      is_subpath("${CMAKE_SOURCE_DIR}" "${ITEM_PATH}" SUBPATH_TEST)
 	      if("${SUBPATH_TEST}" STREQUAL "1")
 	        message(FATAL_ERROR "${ITEM} is listed in ${CMAKE_CURRENT_SOURCE_DIR} using its absolute path.  Please specify the location of this file using a relative path.")
 	      endif("${SUBPATH_TEST}" STREQUAL "1")
@@ -155,7 +155,7 @@
     foreach(filepath ${${filestoignore}})
       set(CMAKE_IGNORE_LIST ${CMAKE_IGNORE_LIST} "${targetdir}/${filepath}")
     endforeach(filepath ${filestoignore})
-    CMAKEFILES(${CMAKE_IGNORE_LIST})
+    cmakefiles(${CMAKE_IGNORE_LIST})
   endif(NOT BRLCAD_IS_SUBBUILD)
 endmacro(CMAKEFILES_IN_DIR)
 
Index: misc/CMake/FindOPENNURBS.cmake
===================================================================
--- misc/CMake/FindOPENNURBS.cmake	(revision 54114)
+++ misc/CMake/FindOPENNURBS.cmake	(working copy)
@@ -45,9 +45,9 @@
 find_library(OPENNURBS_LIBRARY NAMES opennurbs openNURBS OpenNURBS)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENNURBS DEFAULT_MSG OPENNURBS_LIBRARY OPENNURBS_INCLUDE_DIR)
+find_package_handle_standard_args(OPENNURBS DEFAULT_MSG OPENNURBS_LIBRARY OPENNURBS_INCLUDE_DIR)
 
-IF (OPENNURBS_FOUND)
+if (OPENNURBS_FOUND)
   set(OPENNURBS_INCLUDE_DIRS ${OPENNURBS_INCLUDE_DIR})
   set(OPENNURBS_LIBRARIES    ${OPENNURBS_LIBRARY})
 endif()
Index: misc/CMake/BRLCAD_CheckFunctions.cmake
===================================================================
--- misc/CMake/BRLCAD_CheckFunctions.cmake	(revision 54114)
+++ misc/CMake/BRLCAD_CheckFunctions.cmake	(working copy)
@@ -53,9 +53,9 @@
 macro(BRLCAD_FUNCTION_EXISTS function var)
   set(CMAKE_C_FLAGS_TMP "${CMAKE_C_FLAGS}")
   set(CMAKE_C_FLAGS "")
-  CHECK_FUNCTION_EXISTS(${function} ${var})
+  check_function_exists(${function} ${var})
   if(CONFIG_H_FILE AND ${var})
-    CONFIG_H_APPEND(BRLCAD "#cmakedefine ${var} 1\n")
+    config_h_append(BRLCAD "#cmakedefine ${var} 1\n")
   endif(CONFIG_H_FILE AND ${var})
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_TMP}")
 endmacro(BRLCAD_FUNCTION_EXISTS)
@@ -82,7 +82,7 @@
   endif(NOT "${ARGV2}" STREQUAL "")
 
   # search for the header
-  CHECK_INCLUDE_FILES("${filelist}" ${var})
+  check_include_files("${filelist}" ${var})
 
   # !!! curiously strequal matches true above for all the NOT ${var} cases
   # if (NOT ${var})
@@ -90,7 +90,7 @@
   # endif (NOT ${var})
 
   if(CONFIG_H_FILE AND ${var})
-    CONFIG_H_APPEND(BRLCAD "#cmakedefine ${var} 1\n")
+    config_h_append(BRLCAD "#cmakedefine ${var} 1\n")
   endif(CONFIG_H_FILE AND ${var})
 
   if(NOT "${ARGV2}" STREQUAL "")
@@ -108,9 +108,9 @@
 macro(BRLCAD_INCLUDE_FILE_CXX filename var)
   set(CMAKE_CXX_FLAGS_TMP "${CMAKE_CXX_FLAGS}")
   set(CMAKE_CXX_FLAGS "")
-  CHECK_INCLUDE_FILE_CXX(${filename} ${var})
+  check_include_file_cxx(${filename} ${var})
   if(CONFIG_H_FILE AND ${var})
-    CONFIG_H_APPEND(BRLCAD "#cmakedefine ${var} 1\n")
+    config_h_append(BRLCAD "#cmakedefine ${var} 1\n")
   endif(CONFIG_H_FILE AND ${var})
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_TMP}")
 endmacro(BRLCAD_INCLUDE_FILE_CXX)
@@ -136,12 +136,12 @@
   # variable incorporating both the typename and the headers string
   string(REGEX REPLACE "[^a-zA-Z0-9]" "_" testvar "HAVE_${typename}${headers}")
   string(TOUPPER "${testvar}" testvar)
-  CHECK_TYPE_SIZE(${typename} ${testvar})
+  check_type_size(${typename} ${testvar})
   set(CMAKE_EXTRA_INCLUDE_FILES "${CMAKE_EXTRA_INCLUDE_FILES_BAK}")
   # Produce config.h lines as appropriate
   if(CONFIG_H_FILE AND ${testvar})
-    CONFIG_H_APPEND(BRLCAD "#define HAVE_${var} 1\n")
-    CONFIG_H_APPEND(BRLCAD "#define SIZEOF_${var} ${${testvar}}\n")
+    config_h_append(BRLCAD "#define HAVE_${var} 1\n")
+    config_h_append(BRLCAD "#define SIZEOF_${var} ${${testvar}}\n")
   endif(CONFIG_H_FILE AND ${testvar})
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_TMP}")
 endmacro(BRLCAD_TYPE_SIZE)
@@ -155,9 +155,9 @@
 macro(BRLCAD_STRUCT_MEMBER structname member headers var)
   set(CMAKE_C_FLAGS_TMP "${CMAKE_C_FLAGS}")
   set(CMAKE_C_FLAGS "")
-  CHECK_STRUCT_HAS_MEMBER(${structname} ${member} "${headers}" HAVE_${var})
+  check_struct_has_member(${structname} ${member} "${headers}" HAVE_${var})
   if(CONFIG_H_FILE AND HAVE_${var})
-    CONFIG_H_APPEND(BRLCAD "#define HAVE_${var} 1\n")
+    config_h_append(BRLCAD "#define HAVE_${var} 1\n")
   endif(CONFIG_H_FILE AND HAVE_${var})
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_TMP}")
 endmacro(BRLCAD_STRUCT_MEMBER)
@@ -171,9 +171,9 @@
   set(CMAKE_C_FLAGS_TMP "${CMAKE_C_FLAGS}")
   set(CMAKE_C_FLAGS "")
   if(NOT ${targetname}_LIBRARY)
-    CHECK_LIBRARY_EXISTS(${lname} ${func} "" HAVE_${targetname}_${lname})
+    check_library_exists(${lname} ${func} "" HAVE_${targetname}_${lname})
     if(HAVE_${targetname}_${lname})
-      RESOLVE_LIBRARIES (${targetname}_LIBRARY "-l${lname}")
+      resolve_libraries (${targetname}_LIBRARY "-l${lname}")
       set(${targetname}_LINKOPT "-l${lname}" CACHE STRING "${targetname} link option")
       mark_as_advanced(${targetname}_LINKOPT)
     endif(HAVE_${targetname}_${lname})
@@ -203,9 +203,9 @@
 (void)basename(argv[0]);
 return 0;
 }")
-  CHECK_C_SOURCE_RUNS("${BASENAME_SRC}" HAVE_BASENAME)
+  check_c_source_runs("${BASENAME_SRC}" HAVE_BASENAME)
   if(HAVE_BASENAME)
-    CONFIG_H_APPEND(BRLCAD "#define HAVE_BASENAME 1\n")
+    config_h_append(BRLCAD "#define HAVE_BASENAME 1\n")
   endif(HAVE_BASENAME)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_TMP}")
 endmacro(BRLCAD_CHECK_BASENAME var)
@@ -222,9 +222,9 @@
 (void)dirname(argv[0]);
 return 0;
 }")
-  CHECK_C_SOURCE_RUNS("${DIRNAME_SRC}" HAVE_DIRNAME)
+  check_c_source_runs("${DIRNAME_SRC}" HAVE_DIRNAME)
   if(HAVE_DIRNAME)
-    CONFIG_H_APPEND(BRLCAD "#define HAVE_DIRNAME 1\n")
+    config_h_append(BRLCAD "#define HAVE_DIRNAME 1\n")
   endif(HAVE_DIRNAME)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_TMP}")
 endmacro(BRLCAD_CHECK_DIRNAME var)
@@ -236,9 +236,9 @@
 macro(BRLCAD_HEADER_SYS_WAIT)
   set(CMAKE_C_FLAGS_TMP "${CMAKE_C_FLAGS}")
   set(CMAKE_C_FLAGS "")
-  CHECK_C_SOURCE_RUNS(${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/sys_wait_test.c WORKING_SYS_WAIT)
+  check_c_source_runs(${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/sys_wait_test.c WORKING_SYS_WAIT)
   if(WORKING_SYS_WAIT)
-    CONFIG_H_APPEND(BRLCAD "#define HAVE_SYS_WAIT_H 1\n")
+    config_h_append(BRLCAD "#define HAVE_SYS_WAIT_H 1\n")
   endif(WORKING_SYS_WAIT)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_TMP}")
 endmacro(BRLCAD_HEADER_SYS_WAIT)
@@ -250,14 +250,14 @@
 macro(BRLCAD_ALLOCA)
   set(CMAKE_C_FLAGS_TMP "${CMAKE_C_FLAGS}")
   set(CMAKE_C_FLAGS "")
-  CHECK_C_SOURCE_RUNS(${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/alloca_header_test.c WORKING_ALLOCA_H)
+  check_c_source_runs(${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/alloca_header_test.c WORKING_ALLOCA_H)
   if(WORKING_ALLOCA_H)
-    CONFIG_H_APPEND(BRLCAD "#define HAVE_ALLOCA_H 1\n")
+    config_h_append(BRLCAD "#define HAVE_ALLOCA_H 1\n")
     set(FILE_RUN_DEFINITIONS "-DHAVE_ALLOCA_H")
   endif(WORKING_ALLOCA_H)
-  CHECK_C_SOURCE_RUNS(${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/alloca_test.c WORKING_ALLOCA)
+  check_c_source_runs(${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/alloca_test.c WORKING_ALLOCA)
   if(WORKING_ALLOCA)
-    CONFIG_H_APPEND(BRLCAD "#define HAVE_ALLOCA 1\n")
+    config_h_append(BRLCAD "#define HAVE_ALLOCA 1\n")
   endif(WORKING_ALLOCA)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_TMP}")
 endmacro(BRLCAD_ALLOCA)
@@ -271,7 +271,7 @@
   set(CMAKE_C_FLAGS_TMP "${CMAKE_C_FLAGS}")
   set(CMAKE_C_FLAGS "")
   set(CMAKE_REQUIRED_DEFINITIONS_BAK ${CMAKE_REQUIRED_DEFINITIONS})
-  CHECK_INCLUDE_file(stdint.h HAVE_STDINT_H)
+  check_include_file(stdint.h HAVE_STDINT_H)
   if(HAVE_STDINT_H)
     set(CMAKE_REQUIRED_DEFINITIONS "-DHAVE_STDINT_H=1")
   endif(HAVE_STDINT_H)
@@ -291,9 +291,9 @@
   return 0;
 }
 ")
-  CHECK_C_SOURCE_RUNS("${CHECK_C99_FORMAT_SPECIFIERS_SRC}" HAVE_C99_FORMAT_SPECIFIERS)
+  check_c_source_runs("${CHECK_C99_FORMAT_SPECIFIERS_SRC}" HAVE_C99_FORMAT_SPECIFIERS)
   if(HAVE_C99_FORMAT_SPECIFIERS)
-    CONFIG_H_APPEND(BRLCAD "#define HAVE_C99_FORMAT_SPECIFIERS 1\n")
+    config_h_append(BRLCAD "#define HAVE_C99_FORMAT_SPECIFIERS 1\n")
   endif(HAVE_C99_FORMAT_SPECIFIERS)
   set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS_BAK})
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_TMP}")
Index: misc/CMake/BRLCAD_Util.cmake
===================================================================
--- misc/CMake/BRLCAD_Util.cmake	(revision 54114)
+++ misc/CMake/BRLCAD_Util.cmake	(working copy)
@@ -97,14 +97,14 @@
   # generate a target name.
   if(NOT havevarname)
     set(${targetvar} "${inlist}")
-    BRLCAD_TARGET_NAME("${inlist}" targetname)
+    brlcad_target_name("${inlist}" targetname)
   else(NOT havevarname)
     set(${targetvar} "${${inlist}}")
     set(targetname "${inlist}")
   endif(NOT havevarname)
 
   # Mark the inputs as files to ignore in distcheck
-  CMAKEFILES(${${targetvar}})
+  cmakefiles(${${targetvar}})
 
   # For some uses, we need the contents of the input list
   # with full paths.  Generate a list that we're sure has
Index: misc/CMake/RE2C_Util.cmake
===================================================================
--- misc/CMake/RE2C_Util.cmake	(revision 54114)
+++ misc/CMake/RE2C_Util.cmake	(working copy)
@@ -80,7 +80,7 @@
     if(${ARGC} EQUAL 5)
       if("${ARGV3}" STREQUAL "COMPILE_FLAGS")
 	set(RE2C_EXECUTABLE_opts  "${ARGV4}")
-	SEPARATE_ARGUMENTS(RE2C_EXECUTABLE_opts)
+	separate_arguments(RE2C_EXECUTABLE_opts)
       else()
 	message(SEND_ERROR ${RE2C_TARGET_usage})
       endif()
Index: misc/CMake/ThirdParty.cmake
===================================================================
--- misc/CMake/ThirdParty.cmake	(revision 54114)
+++ misc/CMake/ThirdParty.cmake	(working copy)
@@ -137,7 +137,7 @@
       if("${BRLCAD_BUNDLED_LIBS}" STREQUAL "SYSTEM")
 	set(${CMAKE_PROJECT_NAME}_${upper}_BUILD OFF)
 	set(${upper}_MET_CONDITION 5)
-      ELSEif("${BRLCAD_BUNDLED_LIBS}" STREQUAL "BUNDLED")
+      elseif("${BRLCAD_BUNDLED_LIBS}" STREQUAL "BUNDLED")
 	set(${CMAKE_PROJECT_NAME}_${upper}_BUILD ON)
 	set(${upper}_DISABLE_TEST 1)
 	set(${upper}_MET_CONDITION 5)
@@ -206,7 +206,7 @@
     file(GLOB STALE_FILES "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${rootname}*${CMAKE_SHARED_LIBRARY_SUFFIX}*")
 
     foreach(stale_file ${STALE_FILES})
-      EXEC_PROGRAM(
+      exec_program(
 	${CMAKE_COMMAND} ARGS -E remove ${stale_file}
 	OUTPUT_VARIABLE rm_out
 	RETURN_VALUE rm_retval
@@ -227,16 +227,16 @@
     set(${upper}_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${dir};${CMAKE_CURRENT_BINARY_DIR}/${dir} CACHE STRING "set by THIRD_PARTY_SUBDIR macro" FORCE)
     if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}.dist)
       include(${CMAKE_CURRENT_SOURCE_DIR}/${dir}.dist)
-      CMAKEFILES_IN_DIR(${dir}_ignore_files ${dir})
+      cmakefiles_in_dir(${dir}_ignore_files ${dir})
     else(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}.dist)
       message("Bundled build, but file ${CMAKE_CURRENT_SOURCE_DIR}/${dir}.dist not found")
     endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}.dist)
   else(${CMAKE_PROJECT_NAME}_${upper}_BUILD)
-    CMAKEFILES(${dir})
+    cmakefiles(${dir})
   endif(${CMAKE_PROJECT_NAME}_${upper}_BUILD)
 
-  OPTION_ALIASES("${CMAKE_PROJECT_NAME}_${upper}" "${aliases}" "ABS")
-  OPTION_DESCRIPTION("${CMAKE_PROJECT_NAME}_${upper}" "${aliases}" "${description}")
+  option_aliases("${CMAKE_PROJECT_NAME}_${upper}" "${aliases}" "ABS")
+  option_description("${CMAKE_PROJECT_NAME}_${upper}" "${aliases}" "${description}")
 
   # For drop-down menus in CMake gui - set STRINGS property
   set_property(CACHE ${CMAKE_PROJECT_NAME}_${upper} PROPERTY STRINGS AUTO BUNDLED SYSTEM)
@@ -280,7 +280,7 @@
   # or cached value will be replaced with the local path.  A feature based disablement
   # of the tool also applies to the cached version.
   if(${upper}_EXECUTABLE)
-    IS_SUBPATH("${CMAKE_BINARY_DIR}" "${${upper}_EXECUTABLE}" SUBBUILD_TEST)
+    is_subpath("${CMAKE_BINARY_DIR}" "${${upper}_EXECUTABLE}" SUBBUILD_TEST)
     if("${SUBBUILD_TEST}" STREQUAL "0")
       get_filename_component(FULL_PATH_EXEC ${${upper}_EXECUTABLE} ABSOLUTE)
       if("${FULL_PATH_EXEC}" STREQUAL "${${upper}_EXECUTABLE}")
@@ -381,7 +381,7 @@
       if("${BRLCAD_BUNDLED_LIBS}" STREQUAL "SYSTEM")
 	set(${CMAKE_PROJECT_NAME}_${upper}_BUILD OFF)
 	set(${upper}_MET_CONDITION 5)
-      ELSEif("${BRLCAD_BUNDLED_LIBS}" STREQUAL "BUNDLED")
+      elseif("${BRLCAD_BUNDLED_LIBS}" STREQUAL "BUNDLED")
 	set(${CMAKE_PROJECT_NAME}_${upper}_BUILD ON)
 	set(${upper}_DISABLE_TEST 1)
 	set(${upper}_MET_CONDITION 5)
@@ -434,7 +434,7 @@
     if(EXEC_CACHED)
       # Is it a build target?  If so, don't cache it.
       get_filename_component(EXEC_CACHED_ABS_PATH ${EXEC_CACHED} ABSOLUTE)
-      IF ("${EXEC_CACHED_ABS_PATH}" STREQUAL "${PATH_ABS}")
+      if ("${EXEC_CACHED_ABS_PATH}" STREQUAL "${PATH_ABS}")
 	# Is it the bundled path? (don't override if it is, the bundled option setting takes care of that)
 	if(NOT "${EXEC_CACHED}" STREQUAL "${CMAKE_BINARY_DIR}/${BIN_DIR}/${lower}")
 	  # Is it the same as the found results?
@@ -490,7 +490,7 @@
 	mark_as_advanced(SRC_OTHER_ADDED_DIRS)
 	if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}.dist)
 	  include(${CMAKE_CURRENT_SOURCE_DIR}/${dir}.dist)
-	  CMAKEFILES_IN_DIR(${dir}_ignore_files ${dir})
+	  cmakefiles_in_dir(${dir}_ignore_files ${dir})
 	else(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}.dist)
 	  message("Bundled build, but file ${CMAKE_CURRENT_SOURCE_DIR}/${dir}.dist not found")
 	endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}.dist)
@@ -501,7 +501,7 @@
       mark_as_advanced(SRC_OTHER_ADDED_DIRS)
       if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}.dist)
 	include(${CMAKE_CURRENT_SOURCE_DIR}/${dir}.dist)
-	CMAKEFILES_IN_DIR(${dir}_ignore_files ${dir})
+	cmakefiles_in_dir(${dir}_ignore_files ${dir})
       else(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}.dist)
 	message("Bundled build, but file ${CMAKE_CURRENT_SOURCE_DIR}/${dir}.dist not found")
       endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}.dist)
@@ -513,12 +513,12 @@
     endif(CMAKE_CONFIGURATION_TYPES)
     set(${upper}_EXECUTABLE_TARGET ${lower} CACHE STRING "Build target for ${lower}" FORCE)
   else(${CMAKE_PROJECT_NAME}_${upper}_BUILD)
-    CMAKEFILES(${dir})
+    cmakefiles(${dir})
     set(${upper}_EXECUTABLE_TARGET "" CACHE STRING "No build target for ${lower}" FORCE)
   endif(${CMAKE_PROJECT_NAME}_${upper}_BUILD)
 
-  OPTION_ALIASES("${CMAKE_PROJECT_NAME}_${upper}" "${aliases}" "ABS")
-  OPTION_DESCRIPTION("${CMAKE_PROJECT_NAME}_${upper}" "${aliases}" "${description}")
+  option_aliases("${CMAKE_PROJECT_NAME}_${upper}" "${aliases}" "ABS")
+  option_description("${CMAKE_PROJECT_NAME}_${upper}" "${aliases}" "${description}")
 
   # For drop-down menus in CMake gui - set STRINGS property
   set_property(CACHE ${CMAKE_PROJECT_NAME}_${upper} PROPERTY STRINGS AUTO BUNDLED SYSTEM)
Index: misc/CMake/BRLCAD_Options.cmake
===================================================================
--- misc/CMake/BRLCAD_Options.cmake	(revision 54114)
+++ misc/CMake/BRLCAD_Options.cmake	(working copy)
@@ -120,7 +120,7 @@
 	  set(invert_item ${${item}})
 	  if("${${item}}" STREQUAL "ON")
 	    set(invert_item "OFF")
-	  ELSEif("${invert_item}" STREQUAL "OFF")
+	  elseif("${invert_item}" STREQUAL "OFF")
 	    set(invert_item "ON")
 	  endif("${${item}}" STREQUAL "ON")
 	  set(${opt} ${invert_item} CACHE STRING "setting ${opt} via alias ${item}" FORCE)
@@ -190,15 +190,15 @@
   if(NOT DEFINED ${opt} OR "${${opt}}" STREQUAL "")
     if("${default}" STREQUAL "ON" OR "${default}" STREQUAL "YES")
       set(${opt} ON CACHE BOOL "define ${opt}" FORCE)
-    ELSEif("${default}" STREQUAL "OFF" OR "${default}" STREQUAL "NO")
+    elseif("${default}" STREQUAL "OFF" OR "${default}" STREQUAL "NO")
       set(${opt} OFF CACHE BOOL "define ${opt}" FORCE)
     else("${default}" STREQUAL "ON" OR "${default}" STREQUAL "YES")
       set(${opt} ${default} CACHE STRING "define ${opt}" FORCE)
     endif("${default}" STREQUAL "ON" OR "${default}" STREQUAL "YES")
   endif(NOT DEFINED ${opt} OR "${${opt}}" STREQUAL "")
 
-  OPTION_ALIASES("${opt}" "${opt_ALIASES}" "BOOL")
-  OPTION_DESCRIPTION("${opt}" "${opt_ALIASES}" "${opt_DESCRIPTION}")
+  option_aliases("${opt}" "${opt_ALIASES}" "BOOL")
+  option_description("${opt}" "${opt_ALIASES}" "${opt_DESCRIPTION}")
 endmacro(BRLCAD_OPTION)
 
 # Local Variables:
Index: misc/CMake/FindREGEX.cmake
===================================================================
--- misc/CMake/FindREGEX.cmake	(revision 54114)
+++ misc/CMake/FindREGEX.cmake	(working copy)
@@ -51,7 +51,7 @@
 set(REGEX_NAMES c regex compat)
 foreach(rname ${REGEX_NAMES})
   if(NOT REGEX_LIBRARY)
-    CHECK_LIBRARY_EXISTS(${rname} regcomp "" HAVE_REGEX_LIB)
+    check_library_exists(${rname} regcomp "" HAVE_REGEX_LIB)
     if(HAVE_REGEX_LIB)
       find_library(REGEX_LIBRARY NAMES ${rname})
     endif(HAVE_REGEX_LIB)
@@ -63,7 +63,7 @@
 # handle the QUIETLY and REQUIRED arguments and set REGEX_FOUND to TRUE if
 # all listed variables are TRUE
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(REGEX DEFAULT_MSG REGEX_INCLUDE_DIR REGEX_LIBRARY)
+find_package_handle_standard_args(REGEX DEFAULT_MSG REGEX_INCLUDE_DIR REGEX_LIBRARY)
 
 
 # Local Variables:
Index: misc/CMake/DocBook.cmake
===================================================================
--- misc/CMake/DocBook.cmake	(revision 54114)
+++ misc/CMake/DocBook.cmake	(working copy)
@@ -146,7 +146,7 @@
   if("${IN_LIST}" STREQUAL "-1")
     set_property(GLOBAL APPEND PROPERTY DB_VALIDATION_FILE_LIST "${CMAKE_CURRENT_SOURCE_DIR}/${filename}")
 
-    DB_SCRIPT("${filename_root}_validate" "${DOC_DIR}/${targetdir}" "${VALIDATE_EXECUTABLE}")
+    db_script("${filename_root}_validate" "${DOC_DIR}/${targetdir}" "${VALIDATE_EXECUTABLE}")
     add_custom_command(
       OUTPUT ${xml_valid_stamp}
       COMMAND ${CMAKE_COMMAND} -P ${scriptfile}
@@ -174,11 +174,11 @@
       endforeach(extra_out ${EXTRA_OUTPUTS})
 
       if(BRLCAD_EXTRADOCS_VALIDATE)
-	DB_VALIDATE_TARGET(${targetdir} "${filename}" ${filename_root})
+	db_validate_target(${targetdir} "${filename}" ${filename_root})
       endif(BRLCAD_EXTRADOCS_VALIDATE)
 
       # Generate the script that will be used to run the XSLT executable
-      DB_SCRIPT("${targetname}" "${DOC_DIR}/${targetdir}" "${XSLT_EXECUTABLE}")
+      db_script("${targetname}" "${DOC_DIR}/${targetdir}" "${XSLT_EXECUTABLE}")
 
       add_custom_command(
 	OUTPUT ${outfile} ${EXTRAS}
@@ -214,7 +214,7 @@
     endforeach(filename ${${xml_files}})
   endif(BRLCAD_EXTRADOCS_HTML)
 
-  CMAKEFILES(${${xml_files}})
+  cmakefiles(${${xml_files}})
 endmacro(DOCBOOK_TO_HTML targetname_suffix srcfile outfile targetdir deps_list)
 
 # This macro produces Unix-style manual or "man" pages
@@ -235,11 +235,11 @@
       endforeach(extra_out ${EXTRA_OUTPUTS})
 
       if(BRLCAD_EXTRADOCS_VALIDATE)
-	DB_VALIDATE_TARGET(${targetdir} "${filename}" ${filename_root})
+	db_validate_target(${targetdir} "${filename}" ${filename_root})
       endif(BRLCAD_EXTRADOCS_VALIDATE)
 
       # Generate the script that will be used to run the XSLT executable
-      DB_SCRIPT("${targetname}" "${MAN_DIR}/${targetdir}" "${XSLT_EXECUTABLE}")
+      db_script("${targetname}" "${MAN_DIR}/${targetdir}" "${XSLT_EXECUTABLE}")
 
       add_custom_command(
 	OUTPUT ${outfile} ${EXTRAS}
@@ -276,7 +276,7 @@
     endforeach(filename ${${xml_files}})
   endif(BRLCAD_EXTRADOCS_MAN)
   # Mark files for distcheck
-  CMAKEFILES(${${xml_files}})
+  cmakefiles(${${xml_files}})
 endmacro(DOCBOOK_TO_MAN targetname_suffix srcfile outfile targetdir deps_list)
 
 # PDF output is generated in a two stage process - the XML file is first
@@ -296,9 +296,9 @@
       set(fo_outfile ${outfile})
       set(CURRENT_XSL_STYLESHEET ${XSL_FO_STYLESHEET})
       if(BRLCAD_EXTRADOCS_VALIDATE)
-	DB_VALIDATE_TARGET(${targetdir} "${filename}" ${filename_root})
+	db_validate_target(${targetdir} "${filename}" ${filename_root})
       endif(BRLCAD_EXTRADOCS_VALIDATE)
-      DB_SCRIPT("${targetname}" "${DOC_DIR}/${targetdir}" "${XSLT_EXECUTABLE}")
+      db_script("${targetname}" "${DOC_DIR}/${targetdir}" "${XSLT_EXECUTABLE}")
       add_custom_command(
 	OUTPUT ${outfile}
 	COMMAND ${CMAKE_COMMAND} -P ${scriptfile}
@@ -306,7 +306,7 @@
 	)
       set(targetname ${filename_root}_${targetname_suffix}_pdf)
       set(outfile ${bin_root}/${DOC_DIR}/${targetdir}/${filename_root}.pdf)
-      DB_SCRIPT("${targetname}_pdf" "${DOC_DIR}/${targetdir}" "${PDF_CONV_EXECUTABLE}")
+      db_script("${targetname}_pdf" "${DOC_DIR}/${targetdir}" "${PDF_CONV_EXECUTABLE}")
       add_custom_command(
 	OUTPUT ${outfile}
 	COMMAND ${CMAKE_COMMAND} -P ${scriptfile}
@@ -335,7 +335,7 @@
 
     endforeach(filename ${${xml_files}})
   endif(BRLCAD_EXTRADOCS_PDF)
-  CMAKEFILES(${${xml_files}})
+  cmakefiles(${${xml_files}})
 endmacro(DOCBOOK_TO_PDF targetname_suffix srcfile outfile targetdir deps_list)
 
 # Local Variables:
Index: misc/CMake/FindYACC.cmake
===================================================================
--- misc/CMake/FindYACC.cmake	(revision 54114)
+++ misc/CMake/FindYACC.cmake	(working copy)
@@ -129,7 +129,7 @@
   # internal macro
   macro(YACC_TARGET_option_extraopts Options)
     set(YACC_TARGET_extraopts "${Options}")
-    SEPARATE_ARGUMENTS(YACC_TARGET_extraopts)
+    separate_arguments(YACC_TARGET_extraopts)
     list(APPEND YACC_TARGET_cmdopt ${YACC_TARGET_extraopts})
   endmacro(YACC_TARGET_option_extraopts)
 
@@ -147,20 +147,20 @@
       # Parsing parameters
       if(${ARGC} GREATER 5 OR ${ARGC} EQUAL 5)
         if("${ARGV3}" STREQUAL "VERBOSE")
-          YACC_TARGET_option_verbose(${Name} ${YaccOutput} "${ARGV4}")
+          yacc_target_option_verbose(${Name} ${YaccOutput} "${ARGV4}")
         endif()
         if("${ARGV3}" STREQUAL "COMPILE_FLAGS")
-          YACC_TARGET_option_extraopts("${ARGV4}")
+          yacc_target_option_extraopts("${ARGV4}")
         endif()
       endif()
 
       if(${ARGC} EQUAL 7)
         if("${ARGV5}" STREQUAL "VERBOSE")
-          YACC_TARGET_option_verbose(${Name} ${YaccOutput} "${ARGV6}")
+          yacc_target_option_verbose(${Name} ${YaccOutput} "${ARGV6}")
         endif()
 
         if("${ARGV5}" STREQUAL "COMPILE_FLAGS")
-          YACC_TARGET_option_extraopts("${ARGV6}")
+          yacc_target_option_extraopts("${ARGV6}")
         endif()
       endif()
 
@@ -195,7 +195,7 @@
 endif(YACC_EXECUTABLE)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(YACC DEFAULT_MSG YACC_EXECUTABLE)
+find_package_handle_standard_args(YACC DEFAULT_MSG YACC_EXECUTABLE)
 
 # FindYACC.cmake ends here
 
Index: misc/CMake/FindShellDeps.cmake
===================================================================
--- misc/CMake/FindShellDeps.cmake	(revision 54114)
+++ misc/CMake/FindShellDeps.cmake	(working copy)
@@ -48,7 +48,7 @@
 find_program(RM_EXEC NAMES rm DOC "path to remove executable")
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SHELL_SUPPORTED DEFAULT_MSG SH_EXEC CP_EXEC MV_EXEC RM_EXEC)
+find_package_handle_standard_args(SHELL_SUPPORTED DEFAULT_MSG SH_EXEC CP_EXEC MV_EXEC RM_EXEC)
 mark_as_advanced(SH_EXEC)
 mark_as_advanced(MV_EXEC)
 mark_as_advanced(CP_EXEC)
Index: misc/CMake/CompilerFlags.cmake
===================================================================
--- misc/CMake/CompilerFlags.cmake	(revision 54114)
+++ misc/CMake/CompilerFlags.cmake	(working copy)
@@ -72,10 +72,10 @@
 # Convenience language based wrapper for calling the correct compiler flag test macro
 macro(CHECK_COMPILER_FLAG FLAG_LANG NEW_FLAG RESULTVAR)
   if("${FLAG_LANG}" STREQUAL "C")
-    CHECK_C_COMPILER_FLAG(${NEW_FLAG} ${RESULTVAR})
+    check_c_compiler_flag(${NEW_FLAG} ${RESULTVAR})
   endif("${FLAG_LANG}" STREQUAL "C")
   if("${FLAG_LANG}" STREQUAL "CXX")
-    CHECK_CXX_COMPILER_FLAG(${NEW_FLAG} ${RESULTVAR})
+    check_cxx_compiler_flag(${NEW_FLAG} ${RESULTVAR})
   endif("${FLAG_LANG}" STREQUAL "CXX")
 endmacro(CHECK_COMPILER_FLAG LANG NEW_FLAG RESULTVAR)
 
@@ -123,21 +123,21 @@
   if(${ARGC} LESS 3)
 
     # Handle default (global) case
-    CHECK_COMPILER_FLAG(${FLAG_LANG} ${NEW_FLAG} ${UPPER_FLAG}_COMPILER_FLAG_FOUND)
+    check_compiler_flag(${FLAG_LANG} ${NEW_FLAG} ${UPPER_FLAG}_COMPILER_FLAG_FOUND)
     if(${UPPER_FLAG}_COMPILER_FLAG_FOUND)
-      ADD_NEW_FLAG(${FLAG_LANG} NEW_FLAG ALL)
+      add_new_flag(${FLAG_LANG} NEW_FLAG ALL)
     endif(${UPPER_FLAG}_COMPILER_FLAG_FOUND)
 
   else(${ARGC} LESS 3)
 
     # Parse extra arguments
-    CMAKE_PARSE_ARGUMENTS(FLAG "" "" "BUILD_TYPES;GROUPS;VARS" ${ARGN})
+    cmake_parse_arguments(FLAG "" "" "BUILD_TYPES;GROUPS;VARS" ${ARGN})
 
     # Iterate over listed Build types and append the flag to them if successfully tested.
     foreach(build_type ${FLAG_BUILD_TYPES})
-      CHECK_COMPILER_FLAG(${FLAG_LANG} ${NEW_FLAG} ${UPPER_FLAG}_COMPILER_FLAG_FOUND)
+      check_compiler_flag(${FLAG_LANG} ${NEW_FLAG} ${UPPER_FLAG}_COMPILER_FLAG_FOUND)
       if(${UPPER_FLAG}_COMPILER_FLAG_FOUND)
-	ADD_NEW_FLAG(C NEW_FLAG "${build_type}")
+	add_new_flag(C NEW_FLAG "${build_type}")
       endif(${UPPER_FLAG}_COMPILER_FLAG_FOUND)
     endforeach(build_type ${FLAG_BUILD_TYPES})
 
@@ -145,7 +145,7 @@
     # a string build, not a CMake list build.  Do this for all supplied
     # group variables.
     foreach(flag_group ${FLAG_GROUPS})
-      CHECK_COMPILER_FLAG(${FLAG_LANG} ${NEW_FLAG} ${UPPER_FLAG}_COMPILER_FLAG_FOUND)
+      check_compiler_flag(${FLAG_LANG} ${NEW_FLAG} ${UPPER_FLAG}_COMPILER_FLAG_FOUND)
       if(${UPPER_FLAG}_COMPILER_FLAG_FOUND)
 	if(${flag_group})
 	  set(${flag_group} "${${flag_group}} ${NEW_FLAG}")
@@ -159,7 +159,7 @@
     # the flag as the variable's value.  Do this for all supplied variables.
     foreach(flag_var ${FLAG_VARS})
       if(NOT ${flag_var})
-	CHECK_COMPILER_FLAG(${FLAG_LANG} ${NEW_FLAG} ${UPPER_FLAG}_COMPILER_FLAG_FOUND)
+	check_compiler_flag(${FLAG_LANG} ${NEW_FLAG} ${UPPER_FLAG}_COMPILER_FLAG_FOUND)
 	if(${UPPER_FLAG}_COMPILER_FLAG_FOUND AND NOT "${${flag_var}}")
 	  set(${flag_var} "${NEW_FLAG}")
 	endif(${UPPER_FLAG}_COMPILER_FLAG_FOUND AND NOT "${${flag_var}}")
@@ -171,10 +171,10 @@
 
 # Convenience wrappers to call the primary checking function with a default language.
 macro(BRLCAD_CHECK_C_FLAG)
-  BRLCAD_CHECK_FLAG(C ${ARGN})
+  brlcad_check_flag(C ${ARGN})
 endmacro(BRLCAD_CHECK_C_FLAG)
 macro(BRLCAD_CHECK_CXX_FLAG)
-  BRLCAD_CHECK_FLAG(CXX ${ARGN})
+  brlcad_check_flag(CXX ${ARGN})
 endmacro(BRLCAD_CHECK_CXX_FLAG)
 
 # Clear out most CMake-assigned defaults - We're managing
@@ -210,30 +210,30 @@
 #set(CMAKE_EXE_LINKER_FLAGS "")
 
 # try to use -pipe to speed up the compiles
-BRLCAD_CHECK_C_FLAG(pipe)
-BRLCAD_CHECK_CXX_FLAG(pipe)
+brlcad_check_c_flag(pipe)
+brlcad_check_cxx_flag(pipe)
 
 # check for -fno-strict-aliasing
 # XXX - THIS FLAG IS REQUIRED if any level of optimization is
 # enabled with GCC as we do use aliasing and type-punning.
-BRLCAD_CHECK_C_FLAG(fno-strict-aliasing)
-BRLCAD_CHECK_CXX_FLAG(fno-strict-aliasing)
+brlcad_check_c_flag(fno-strict-aliasing)
+brlcad_check_cxx_flag(fno-strict-aliasing)
 
 # check for -fno-common (libtcl needs it on darwin)
-BRLCAD_CHECK_C_FLAG(fno-common)
-BRLCAD_CHECK_CXX_FLAG(fno-common)
+brlcad_check_c_flag(fno-common)
+brlcad_check_cxx_flag(fno-common)
 
 # check for -fexceptions
 # this is needed to resolve __Unwind_Resume when compiling and
 # linking against openNURBS in librt for some binaries, for
 # example rttherm (i.e. any -static binaries)
-BRLCAD_CHECK_C_FLAG(fexceptions)
-BRLCAD_CHECK_CXX_FLAG(fexceptions)
+brlcad_check_c_flag(fexceptions)
+brlcad_check_cxx_flag(fexceptions)
 
 # check for -ftemplate-depth-NN this is needed in libpc and
 # other code using boost where the template instantiation depth
 # needs to be increased from the default ANSI minimum of 17.
-BRLCAD_CHECK_CXX_FLAG(ftemplate-depth-128)
+brlcad_check_cxx_flag(ftemplate-depth-128)
 
 # dynamic SSE optimizations for NURBS processing
 #
@@ -242,7 +242,7 @@
 #     may still output SSE instructions (e.g., for cross-compiling).
 # BRLCAD_CHECK_C_FLAG(msse)
 # BRLCAD_CHECK_C_FLAG(msse2)
-BRLCAD_CHECK_C_FLAG(msse3 BUILD_TYPES Debug)
+brlcad_check_c_flag(msse3 BUILD_TYPES Debug)
 
 # Check for c90 support with gnu extensions if we're not building for a
 # release and c99 support with gnu extensions when we are building for a
@@ -256,69 +256,69 @@
 # having '//' comments embedded).  Do as the Autotools system did
 # and use gnu99 here - c99 has problems on Linux.
 # BRLCAD_CHECK_C_FLAG("std=gnu1x")
-BRLCAD_CHECK_C_FLAG("std=gnu99" BUILD_TYPES Release VARS C99_FLAG)
-BRLCAD_CHECK_C_FLAG("std=gnu89" BUILD_TYPES Debug)
+brlcad_check_c_flag("std=gnu99" BUILD_TYPES Release VARS C99_FLAG)
+brlcad_check_c_flag("std=gnu89" BUILD_TYPES Debug)
 
 # Silence check for unused arguments (used to silence clang warnings about
 # unused options on the command line). By default clang generates a lot of
 # warnings about such arguments, and we don't really care.
-BRLCAD_CHECK_C_FLAG(Qunused-arguments)
-BRLCAD_CHECK_CXX_FLAG(Qunused-arguments)
+brlcad_check_c_flag(Qunused-arguments)
+brlcad_check_cxx_flag(Qunused-arguments)
 
 # 64bit compilation flags
 if(${CMAKE_WORD_SIZE} MATCHES "64BIT")
-  BRLCAD_CHECK_C_FLAG(m64 VARS 64BIT_FLAG)
-  BRLCAD_CHECK_C_FLAG("arch x86_64" VARS 64BIT_FLAG)
-  BRLCAD_CHECK_C_FLAG(64 VARS 64BIT_FLAG)
-  BRLCAD_CHECK_C_FLAG("mabi=64" VARS  64BIT_FLAG)
+  brlcad_check_c_flag(m64 VARS 64BIT_FLAG)
+  brlcad_check_c_flag("arch x86_64" VARS 64BIT_FLAG)
+  brlcad_check_c_flag(64 VARS 64BIT_FLAG)
+  brlcad_check_c_flag("mabi=64" VARS  64BIT_FLAG)
   if(NOT 64BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "64BIT")
     message(FATAL_ERROR "Trying to compile 64BIT but all 64 bit compiler flag tests failed!")
   endif(NOT 64BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "64BIT")
-  BRLCAD_CHECK_C_FLAG(q64 VARS 64BIT_FLAG)
-  ADD_NEW_FLAG(C 64BIT_FLAG ALL)
-  ADD_NEW_FLAG(CXX 64BIT_FLAG ALL)
-  ADD_NEW_FLAG(SHARED_LINKER 64BIT_FLAG ALL)
-  ADD_NEW_FLAG(EXE_LINKER 64BIT_FLAG ALL)
+  brlcad_check_c_flag(q64 VARS 64BIT_FLAG)
+  add_new_flag(C 64BIT_FLAG ALL)
+  add_new_flag(CXX 64BIT_FLAG ALL)
+  add_new_flag(SHARED_LINKER 64BIT_FLAG ALL)
+  add_new_flag(EXE_LINKER 64BIT_FLAG ALL)
 endif(${CMAKE_WORD_SIZE} MATCHES "64BIT")
 
 # 32 bit compilation flags
 if(${CMAKE_WORD_SIZE} MATCHES "32BIT" AND NOT ${BRLCAD_WORD_SIZE} MATCHES "AUTO")
-  BRLCAD_CHECK_C_FLAG(m32 VARS 32BIT_FLAG)
-  BRLCAD_CHECK_C_FLAG("arch i686" VARS 32BIT_FLAG)
-  BRLCAD_CHECK_C_FLAG(32 VARS 32BIT_FLAG)
-  BRLCAD_CHECK_C_FLAG("mabi=32" VARS 32BIT_FLAG)
-  BRLCAD_CHECK_C_FLAG(q32 VARS 32BIT_FLAG)
+  brlcad_check_c_flag(m32 VARS 32BIT_FLAG)
+  brlcad_check_c_flag("arch i686" VARS 32BIT_FLAG)
+  brlcad_check_c_flag(32 VARS 32BIT_FLAG)
+  brlcad_check_c_flag("mabi=32" VARS 32BIT_FLAG)
+  brlcad_check_c_flag(q32 VARS 32BIT_FLAG)
   if(NOT 32BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "32BIT")
     message(FATAL_ERROR "Trying to compile 32BIT but all 32 bit compiler flag tests failed!")
   endif(NOT 32BIT_FLAG AND ${CMAKE_WORD_SIZE} MATCHES "32BIT")
-  ADD_NEW_FLAG(C 32BIT_FLAG ALL)
-  ADD_NEW_FLAG(CXX 32BIT_FLAG ALL)
-  ADD_NEW_FLAG(SHARED_LINKER 32BIT_FLAG ALL)
-  ADD_NEW_FLAG(EXE_LINKER 32BIT_FLAG ALL)
+  add_new_flag(C 32BIT_FLAG ALL)
+  add_new_flag(CXX 32BIT_FLAG ALL)
+  add_new_flag(SHARED_LINKER 32BIT_FLAG ALL)
+  add_new_flag(EXE_LINKER 32BIT_FLAG ALL)
 endif(${CMAKE_WORD_SIZE} MATCHES "32BIT" AND NOT ${BRLCAD_WORD_SIZE} MATCHES "AUTO")
 
 if(BRLCAD_ENABLE_PROFILING)
-  BRLCAD_CHECK_C_FLAG(pg VARS PROFILE_FLAG)
-  BRLCAD_CHECK_C_FLAG(p VARS PROFILE_FLAG)
-  BRLCAD_CHECK_C_FLAG(prof_gen VARS PROFILE_FLAG)
+  brlcad_check_c_flag(pg VARS PROFILE_FLAG)
+  brlcad_check_c_flag(p VARS PROFILE_FLAG)
+  brlcad_check_c_flag(prof_gen VARS PROFILE_FLAG)
   if(NOT PROFILE_FLAG)
     message("Warning - profiling requested, but don't know how to profile with this compiler - disabling.")
     set(BRLCAD_ENABLE_PROFILING OFF)
   else(NOT PROFILE_FLAG)
-    ADD_NEW_FLAG(C PROFILE_FLAG ALL)
-    ADD_NEW_FLAG(CXX PROFILE_FLAG ALL)
+    add_new_flag(C PROFILE_FLAG ALL)
+    add_new_flag(CXX PROFILE_FLAG ALL)
   endif(NOT PROFILE_FLAG)
 endif(BRLCAD_ENABLE_PROFILING)
 
 # Debugging flags
 if(BRLCAD_FLAGS_DEBUG)
-  BRLCAD_CHECK_C_FLAG(g GROUPS DEBUG_C_FLAGS)
-  BRLCAD_CHECK_CXX_FLAG(g GROUPS DEBUG_CXX_FLAGS)
+  brlcad_check_c_flag(g GROUPS DEBUG_C_FLAGS)
+  brlcad_check_cxx_flag(g GROUPS DEBUG_CXX_FLAGS)
   if(APPLE)
-    EXEC_PROGRAM(sw_vers ARGS -productVersion OUTPUT_VARIABLE MACOSX_VERSION)
+    exec_program(sw_vers ARGS -productVersion OUTPUT_VARIABLE MACOSX_VERSION)
     if(${MACOSX_VERSION} VERSION_LESS "10.5")
-      BRLCAD_CHECK_C_FLAG(ggdb3 GROUPS DEBUG_C_FLAGS)
-      BRLCAD_CHECK_CXX_FLAG(ggdb3 GROUPS DEBUG_CXX_FLAGS)
+      brlcad_check_c_flag(ggdb3 GROUPS DEBUG_C_FLAGS)
+      brlcad_check_cxx_flag(ggdb3 GROUPS DEBUG_CXX_FLAGS)
     else(${MACOSX_VERSION} VERSION_LESS "10.5")
       # CHECK_C_COMPILER_FLAG silently eats gstabs+ - also, compiler
       # apparently doesn't like mixing stabs with another debug flag.
@@ -326,19 +326,19 @@
       set(DEBUG_CXX_FLAGS "-ggdb")
     endif(${MACOSX_VERSION} VERSION_LESS "10.5")
   else(APPLE)
-    BRLCAD_CHECK_C_FLAG(ggdb3 GROUPS DEBUG_C_FLAGS)
-    BRLCAD_CHECK_CXX_FLAG(ggdb3 GROUPS DEBUG_CXX_FLAGS)
+    brlcad_check_c_flag(ggdb3 GROUPS DEBUG_C_FLAGS)
+    brlcad_check_cxx_flag(ggdb3 GROUPS DEBUG_CXX_FLAGS)
   endif(APPLE)
   if(CMAKE_CONFIGURATION_TYPES)
     set(debug_config_list "${CMAKE_CONFIGURATION_TYPES}")
   else(CMAKE_CONFIGURATION_TYPES)
     set(debug_config_list "ALL")
   endif(CMAKE_CONFIGURATION_TYPES)
-  ADD_NEW_FLAG(C DEBUG_C_FLAGS "${debug_config_list}")
-  ADD_NEW_FLAG(CXX DEBUG_CXX_FLAGS "${debug_config_list}")
+  add_new_flag(C DEBUG_C_FLAGS "${debug_config_list}")
+  add_new_flag(CXX DEBUG_CXX_FLAGS "${debug_config_list}")
   # TODO - need to figure out a way to actually test linker flags
-  ADD_NEW_FLAG(SHARED_LINKER DEBUG_C_FLAGS "${debug_config_list}")
-  ADD_NEW_FLAG(EXE_LINKER DEBUG_C_FLAGS "${debug_config_list}")
+  add_new_flag(SHARED_LINKER DEBUG_C_FLAGS "${debug_config_list}")
+  add_new_flag(EXE_LINKER DEBUG_C_FLAGS "${debug_config_list}")
   mark_as_advanced(DEBUG_FLAGS)
 endif(BRLCAD_FLAGS_DEBUG)
 
@@ -352,22 +352,22 @@
   endif(NOT MACOSX_DEPLOYMENT_TARGET)
 
   if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.3")
-    BRLCAD_CHECK_C_FLAG("mmacosx-version-min=10.3 -isysroot /Developer/SDKs/MacOSX10.3.9.sdk" VARS SDK_FLAG)
+    brlcad_check_c_flag("mmacosx-version-min=10.3 -isysroot /Developer/SDKs/MacOSX10.3.9.sdk" VARS SDK_FLAG)
   endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.3")
   if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.4")
-    BRLCAD_CHECK_C_FLAG("mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" VARS SDK_FLAG)
+    brlcad_check_c_flag("mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" VARS SDK_FLAG)
   endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.4")
   if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.5")
-    BRLCAD_CHECK_C_FLAG("mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk" VARS SDK_FLAG)
+    brlcad_check_c_flag("mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk" VARS SDK_FLAG)
   endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.5")
   if(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.6")
-    BRLCAD_CHECK_C_FLAG("mmacosx-version-min=10.6 -isysroot /Developer/SDKs/MacOSX10.6.sdk" VARS SDK_FLAG)
+    brlcad_check_c_flag("mmacosx-version-min=10.6 -isysroot /Developer/SDKs/MacOSX10.6.sdk" VARS SDK_FLAG)
   endif(MACOSX_DEPLOYMENT_TARGET STREQUAL "10.6")
 
-  ADD_NEW_FLAG(C SDK_FLAG ALL)
-  ADD_NEW_FLAG(CXX SDK_FLAG ALL)
-  ADD_NEW_FLAG(SHARED_LINKER SDK_FLAG ALL)
-  ADD_NEW_FLAG(EXE_LINKER SDK_FLAG ALL)
+  add_new_flag(C SDK_FLAG ALL)
+  add_new_flag(CXX SDK_FLAG ALL)
+  add_new_flag(SHARED_LINKER SDK_FLAG ALL)
+  add_new_flag(EXE_LINKER SDK_FLAG ALL)
 endif(APPLE)
 
 # Local Variables:
Index: misc/CMake/FindXMLLINT.cmake
===================================================================
--- misc/CMake/FindXMLLINT.cmake	(revision 54114)
+++ misc/CMake/FindXMLLINT.cmake	(working copy)
@@ -43,7 +43,7 @@
 mark_as_advanced(XMLLINT_EXECUTABLE)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(XMLLINT DEFAULT_MSG XMLLINT_EXECUTABLE)
+find_package_handle_standard_args(XMLLINT DEFAULT_MSG XMLLINT_EXECUTABLE)
 
 # FindXMLLINT.cmake ends here
 
Index: misc/CMake/FindLEX.cmake
===================================================================
--- misc/CMake/FindLEX.cmake	(revision 54114)
+++ misc/CMake/FindLEX.cmake	(working copy)
@@ -101,7 +101,7 @@
       if(${ARGC} EQUAL 5)
         if("${ARGV3}" STREQUAL "COMPILE_FLAGS")
           set(LEX_EXECUTABLE_opts  "${ARGV4}")
-          SEPARATE_ARGUMENTS(LEX_EXECUTABLE_opts)
+          separate_arguments(LEX_EXECUTABLE_opts)
         else()
           message(SEND_ERROR ${LEX_TARGET_usage})
         endif()
@@ -146,20 +146,20 @@
 
   #Need to run a test lex file to determine if YYTEXT_POINTER needs
   #to be defined
-  EXEC_PROGRAM(${LEX_EXECUTABLE} ARGS ${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/lex_test.l -o ${CMAKE_BINARY_DIR}/CMakeTmp/lex_test.c RETURN_VALUE _retval OUTPUT_VARIABLE _lexOut)
-  INCLUDE (CheckCSourceRuns)
+  exec_program(${LEX_EXECUTABLE} ARGS ${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/lex_test.l -o ${CMAKE_BINARY_DIR}/CMakeTmp/lex_test.c RETURN_VALUE _retval OUTPUT_VARIABLE _lexOut)
+  include (CheckCSourceRuns)
   set(FILE_RUN_DEFINITIONS "-DYYTEXT_POINTER=1")
-  CHECK_C_SOURCE_RUNS(${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/sys_wait_test.c YYTEXT_POINTER)
+  check_c_source_runs(${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/sys_wait_test.c YYTEXT_POINTER)
   set(FILE_RUN_DEFINITIONS)
   if(CONFIG_H_FILE)
-    CONFIG_H_APPEND(${CMAKE_CURRENT_PROJECT} "#cmakedefine YYTEXT_POINTER 1\n")
+    config_h_append(${CMAKE_CURRENT_PROJECT} "#cmakedefine YYTEXT_POINTER 1\n")
   endif(CONFIG_H_FILE)
 
 
 endif(LEX_EXECUTABLE)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LEX DEFAULT_MSG LEX_EXECUTABLE)
+find_package_handle_standard_args(LEX DEFAULT_MSG LEX_EXECUTABLE)
 
 # Local Variables:
 # tab-width: 8
Index: misc/CMake/FindOIIO.cmake
===================================================================
--- misc/CMake/FindOIIO.cmake	(revision 54114)
+++ misc/CMake/FindOIIO.cmake	(working copy)
@@ -45,27 +45,27 @@
 endif ()
 
 
-MESSAGE ( STATUS "OPENIMAGEIOHOME = ${OPENIMAGEIOHOME}" )
+message ( STATUS "OPENIMAGEIOHOME = ${OPENIMAGEIOHOME}" )
 
 find_library ( OPENIMAGEIO_LIBRARY
   NAMES OpenImageIO
   PATHS ${OPENIMAGEIOHOME}/lib )
 find_path ( OPENIMAGEIO_INCLUDES OpenImageIO/imageio.h
   ${OPENIMAGEIOHOME}/include )
-IF (OPENIMAGEIO_INCLUDES AND OPENIMAGEIO_LIBRARY )
-  SET ( OPENIMAGEIO_FOUND TRUE )
-  MESSAGE ( STATUS "OpenImageIO includes = ${OPENIMAGEIO_INCLUDES}" )
-  MESSAGE ( STATUS "OpenImageIO library = ${OPENIMAGEIO_LIBRARY}" )
-  MESSAGE ( STATUS "OpenImageIO namespace = ${OPENIMAGEIO_NAMESPACE}" )
+if (OPENIMAGEIO_INCLUDES AND OPENIMAGEIO_LIBRARY )
+  set ( OPENIMAGEIO_FOUND TRUE )
+  message ( STATUS "OpenImageIO includes = ${OPENIMAGEIO_INCLUDES}" )
+  message ( STATUS "OpenImageIO library = ${OPENIMAGEIO_LIBRARY}" )
+  message ( STATUS "OpenImageIO namespace = ${OPENIMAGEIO_NAMESPACE}" )
   if (OPENIMAGEIO_NAMESPACE)
     add_definitions ("-DOPENIMAGEIO_NAMESPACE=${OPENIMAGEIO_NAMESPACE}")
   endif ()
   # N.B. -- once we're confident that we only build against OIIO >= 0.9.x,
   # specifically versions after we did the big namespace change, then we
   # can completely eliminate the 'OPENIMAGEIO_NAMESPACE' parts above.
-ELSE ()
-  MESSAGE ( STATUS "OpenImageIO not found" )
-ENDIF ()
+else ()
+  message ( STATUS "OpenImageIO not found" )
+endif ()
 
 # end OpenImageIO setup
 ###########################################################################
Index: misc/CMake/BRLCAD_Summary.cmake
===================================================================
--- misc/CMake/BRLCAD_Summary.cmake	(revision 54114)
+++ misc/CMake/BRLCAD_Summary.cmake	(working copy)
@@ -320,7 +320,7 @@
 
 # Set state messages for standard components
 foreach(item ${THIRD_PARTY_COMPONENT_LIST})
-  GET_BUILD_STATE(${item})
+  get_build_state(${item})
 endforeach(item ${THIRD_PARTY_COMPONENT_LIST})
 
 # IncrTcl is both ITCL and ITK - handle the various possibilities here
Index: misc/CMake/CheckCSourceRuns.cmake
===================================================================
--- misc/CMake/CheckCSourceRuns.cmake	(revision 54114)
+++ misc/CMake/CheckCSourceRuns.cmake	(working copy)
@@ -70,32 +70,32 @@
 #
 #=============================================================================
 
-MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
-  IF("${VAR}" MATCHES "^${VAR}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS
+macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
+  if("${VAR}" MATCHES "^${VAR}$")
+    set(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    IF(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
+    if(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
         "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
+    else(CMAKE_REQUIRED_LIBRARIES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
+    endif(CMAKE_REQUIRED_LIBRARIES)
+    if(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
         "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    IF(EXISTS "${SOURCE}")
-      SET(CHECK_SRC "${SOURCE}")
-    ELSE(EXISTS "${SOURCE}")
-      FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
+    else(CMAKE_REQUIRED_INCLUDES)
+      set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
+    endif(CMAKE_REQUIRED_INCLUDES)
+    if(EXISTS "${SOURCE}")
+      set(CHECK_SRC "${SOURCE}")
+    else(EXISTS "${SOURCE}")
+      file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
         "${SOURCE}\n")
-      SET(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
-    ENDIF(EXISTS "${SOURCE}")
+      set(CHECK_SRC "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c")
+    endif(EXISTS "${SOURCE}")
 
-    MESSAGE(STATUS "Performing Test ${VAR}")
-    TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
+    message(STATUS "Performing Test ${VAR}")
+    try_run(${VAR}_EXITCODE ${VAR}_COMPILED
       ${CMAKE_BINARY_DIR}
       ${CHECK_SRC}
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@@ -105,35 +105,35 @@
       "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
       COMPILE_OUTPUT_VARIABLE OUTPUT)
     # if it did not compile make the return value fail code of 1
-    IF(NOT ${VAR}_COMPILED)
-      SET(${VAR}_EXITCODE 1)
-    ENDIF(NOT ${VAR}_COMPILED)
+    if(NOT ${VAR}_COMPILED)
+      set(${VAR}_EXITCODE 1)
+    endif(NOT ${VAR}_COMPILED)
     # if the return value was 0 then it worked
-    IF("${${VAR}_EXITCODE}" EQUAL 0)
-      SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
-      MESSAGE(STATUS "Performing Test ${VAR} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    if("${${VAR}_EXITCODE}" EQUAL 0)
+      set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+      message(STATUS "Performing Test ${VAR} - Success")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing C SOURCE FILE Test ${VAR} succeeded with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}}\n"
         "Source file was:\n${SOURCE}\n")
-    ELSE("${${VAR}_EXITCODE}" EQUAL 0)
-      IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "${${VAR}_EXITCODE}")
-      ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
-        SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
-      ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+    else("${${VAR}_EXITCODE}" EQUAL 0)
+      if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "${${VAR}_EXITCODE}")
+      else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
+        set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+      endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
 
-      MESSAGE(STATUS "Performing Test ${VAR} - Failed")
-      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+      message(STATUS "Performing Test ${VAR} - Failed")
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
         "${OUTPUT}\n"
         "Return value: ${${VAR}_EXITCODE}\n"
         "Source file was:\n${SOURCE}\n")
 
-    ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
-  ENDIF("${VAR}" MATCHES "^${VAR}$")
-ENDMACRO(CHECK_C_SOURCE_RUNS)
+    endif("${${VAR}_EXITCODE}" EQUAL 0)
+  endif("${VAR}" MATCHES "^${VAR}$")
+endmacro(CHECK_C_SOURCE_RUNS)
 
 
 # Local Variables:
Index: misc/CMake/FindX11.cmake
===================================================================
--- misc/CMake/FindX11.cmake	(revision 54114)
+++ misc/CMake/FindX11.cmake	(working copy)
@@ -130,16 +130,16 @@
 #
 #=============================================================================
 
-MACRO(X11_FIND_INCLUDE_PATH component header)
+macro(X11_FIND_INCLUDE_PATH component header)
   find_path(X11_${component}_INCLUDE_PATH ${header} ${X11_INC_SEARCH_PATH} NO_CMAKE_SYSTEM_PATH)
   set(X11_HDR_VARS ${X11_HDR_VARS} X11_${component}_INCLUDE_PATH)
   if(X11_${component}_INCLUDE_PATH)
     set(X11_HDR_PATHS ${X11_HDR_PATHS} ${X11_${component}_INCLUDE_PATH})
     list(REMOVE_DUPLICATES X11_HDR_PATHS)
   endif(X11_${component}_INCLUDE_PATH)
-ENDMACRO(X11_FIND_INCLUDE_PATH)
+endmacro(X11_FIND_INCLUDE_PATH)
 
-MACRO(X11_FIND_LIB_PATH component libname)
+macro(X11_FIND_LIB_PATH component libname)
   find_library(X11_${component}_LIB ${libname} ${X11_LIB_SEARCH_PATH} NO_CMAKE_SYSTEM_PATH)
   set(X11_LIB_VARS ${X11_LIB_VARS} X11_${component}_LIB)
   if(X11_${component}_LIB)
@@ -147,7 +147,7 @@
     set(X11_LIB_PATHS ${X11_LIB_PATHS} ${X11_${component}_DIR})
     list(REMOVE_DUPLICATES X11_LIB_PATHS)
   endif(X11_${component}_LIB)
-ENDMACRO(X11_FIND_LIB_PATH)
+endmacro(X11_FIND_LIB_PATH)
 
 if(UNIX)
   set(X11_FOUND 0)
@@ -208,63 +208,63 @@
   set(X11_LIB_PATHS)
 
   # Find primary X11 headers
-  X11_FIND_INCLUDE_PATH(X11		X11/X.h)
-  X11_FIND_INCLUDE_PATH(Xlib		X11/Xlib.h)
+  x11_find_include_path(X11		X11/X.h)
+  x11_find_include_path(Xlib		X11/Xlib.h)
   # Look for other X11 includes; keep the list sorted by name of the cmake X11_<component>_INCLUDE_PATH
   # variable (component doesn't need to match the include file name).
-  X11_FIND_INCLUDE_PATH(ICE 		X11/ICE/ICE.h)
-  X11_FIND_INCLUDE_PATH(Xaccessrules 	X11/extensions/XKBrules.h)
-  X11_FIND_INCLUDE_PATH(Xaccessstr 	X11/extensions/XKBstr.h)
-  X11_FIND_INCLUDE_PATH(Xau 		X11/Xauth.h)
-  X11_FIND_INCLUDE_PATH(Xcomposite 	X11/extensions/Xcomposite.h)
-  X11_FIND_INCLUDE_PATH(Xcursor 	X11/Xcursor/Xcursor.h)
-  X11_FIND_INCLUDE_PATH(Xdamage 	X11/extensions/Xdamage.h)
-  X11_FIND_INCLUDE_PATH(Xdmcp 		X11/Xdmcp.h)
-  X11_FIND_INCLUDE_PATH(dpms 		X11/extensions/dpms.h)
-  X11_FIND_INCLUDE_PATH(xf86misc 	X11/extensions/xf86misc.h)
-  X11_FIND_INCLUDE_PATH(xf86vmode 	X11/extensions/xf86vmode.h)
-  X11_FIND_INCLUDE_PATH(Xfixes		X11/extensions/Xfixes.h)
-  X11_FIND_INCLUDE_PATH(Xft		X11/Xft/Xft.h)
-  X11_FIND_INCLUDE_PATH(Xi		X11/extensions/XInput.h)
-  X11_FIND_INCLUDE_PATH(Xinerama	X11/extensions/Xinerama.h)
-  X11_FIND_INCLUDE_PATH(Xinput		X11/extensions/XInput.h)
-  X11_FIND_INCLUDE_PATH(Xkb		X11/extensions/XKB.h)
-  X11_FIND_INCLUDE_PATH(Xkblib		X11/XKBlib.h)
-  X11_FIND_INCLUDE_PATH(Xpm		X11/xpm.h)
-  X11_FIND_INCLUDE_PATH(XTest		X11/extensions/XTest.h)
-  X11_FIND_INCLUDE_PATH(XShm		X11/extensions/XShm.h)
-  X11_FIND_INCLUDE_PATH(Xrandr		X11/extensions/Xrandr.h)
-  X11_FIND_INCLUDE_PATH(Xrender		X11/extensions/Xrender.h)
-  X11_FIND_INCLUDE_PATH(Xscreensaver	X11/extensions/scrnsaver.h)
-  X11_FIND_INCLUDE_PATH(Xshape		X11/extensions/shape.h)
-  X11_FIND_INCLUDE_PATH(Xutil		X11/Xutil.h)
-  X11_FIND_INCLUDE_PATH(Xt		X11/Intrinsic.h)
-  X11_FIND_INCLUDE_PATH(Xv		X11/extensions/Xvlib.h)
+  x11_find_include_path(ICE 		X11/ICE/ICE.h)
+  x11_find_include_path(Xaccessrules 	X11/extensions/XKBrules.h)
+  x11_find_include_path(Xaccessstr 	X11/extensions/XKBstr.h)
+  x11_find_include_path(Xau 		X11/Xauth.h)
+  x11_find_include_path(Xcomposite 	X11/extensions/Xcomposite.h)
+  x11_find_include_path(Xcursor 	X11/Xcursor/Xcursor.h)
+  x11_find_include_path(Xdamage 	X11/extensions/Xdamage.h)
+  x11_find_include_path(Xdmcp 		X11/Xdmcp.h)
+  x11_find_include_path(dpms 		X11/extensions/dpms.h)
+  x11_find_include_path(xf86misc 	X11/extensions/xf86misc.h)
+  x11_find_include_path(xf86vmode 	X11/extensions/xf86vmode.h)
+  x11_find_include_path(Xfixes		X11/extensions/Xfixes.h)
+  x11_find_include_path(Xft		X11/Xft/Xft.h)
+  x11_find_include_path(Xi		X11/extensions/XInput.h)
+  x11_find_include_path(Xinerama	X11/extensions/Xinerama.h)
+  x11_find_include_path(Xinput		X11/extensions/XInput.h)
+  x11_find_include_path(Xkb		X11/extensions/XKB.h)
+  x11_find_include_path(Xkblib		X11/XKBlib.h)
+  x11_find_include_path(Xpm		X11/xpm.h)
+  x11_find_include_path(XTest		X11/extensions/XTest.h)
+  x11_find_include_path(XShm		X11/extensions/XShm.h)
+  x11_find_include_path(Xrandr		X11/extensions/Xrandr.h)
+  x11_find_include_path(Xrender		X11/extensions/Xrender.h)
+  x11_find_include_path(Xscreensaver	X11/extensions/scrnsaver.h)
+  x11_find_include_path(Xshape		X11/extensions/shape.h)
+  x11_find_include_path(Xutil		X11/Xutil.h)
+  x11_find_include_path(Xt		X11/Intrinsic.h)
+  x11_find_include_path(Xv		X11/extensions/Xvlib.h)
 
 
   # Find primary X11 library
-  X11_FIND_LIB_PATH(X11			X11)
+  x11_find_lib_path(X11			X11)
   # Find additional X libraries. Keep list sorted by library name.
-  X11_FIND_LIB_PATH(ICE			ICE)
-  X11_FIND_LIB_PATH(SM			SM)
-  X11_FIND_LIB_PATH(Xau			Xau)
-  X11_FIND_LIB_PATH(Xcomposite		Xcomposite)
-  X11_FIND_LIB_PATH(Xcursor		Xcursor)
-  X11_FIND_LIB_PATH(Xdamage		Xdamage)
-  X11_FIND_LIB_PATH(Xdmcp		Xdmcp)
-  X11_FIND_LIB_PATH(Xext		Xext)
-  X11_FIND_LIB_PATH(Xfixes		Xfixes)
-  X11_FIND_LIB_PATH(Xft			Xft)
-  X11_FIND_LIB_PATH(Xi			Xi)
-  X11_FIND_LIB_PATH(Xinerama		Xinerama)
-  X11_FIND_LIB_PATH(Xpm			Xpm)
-  X11_FIND_LIB_PATH(Xrandr		Xrandr)
-  X11_FIND_LIB_PATH(Xrender		Xrender)
-  X11_FIND_LIB_PATH(Xscreensaver	Xss)
-  X11_FIND_LIB_PATH(Xt			Xt)
-  X11_FIND_LIB_PATH(XTest		Xtst)
-  X11_FIND_LIB_PATH(Xv			Xv)
-  X11_FIND_LIB_PATH(Xxf86misc		Xxf86misc)
+  x11_find_lib_path(ICE			ICE)
+  x11_find_lib_path(SM			SM)
+  x11_find_lib_path(Xau			Xau)
+  x11_find_lib_path(Xcomposite		Xcomposite)
+  x11_find_lib_path(Xcursor		Xcursor)
+  x11_find_lib_path(Xdamage		Xdamage)
+  x11_find_lib_path(Xdmcp		Xdmcp)
+  x11_find_lib_path(Xext		Xext)
+  x11_find_lib_path(Xfixes		Xfixes)
+  x11_find_lib_path(Xft			Xft)
+  x11_find_lib_path(Xi			Xi)
+  x11_find_lib_path(Xinerama		Xinerama)
+  x11_find_lib_path(Xpm			Xpm)
+  x11_find_lib_path(Xrandr		Xrandr)
+  x11_find_lib_path(Xrender		Xrender)
+  x11_find_lib_path(Xscreensaver	Xss)
+  x11_find_lib_path(Xt			Xt)
+  x11_find_lib_path(XTest		Xtst)
+  x11_find_lib_path(Xv			Xv)
+  x11_find_lib_path(Xxf86misc		Xxf86misc)
 
   set(X11_LIBRARY_DIR "")
   if(X11_X11_LIB)
@@ -437,69 +437,69 @@
       set(X11_X_EXTRA_LIBS "")
 
       # See if XOpenDisplay in X11 works by itself.
-      CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
+      check_library_exists("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
       if(NOT X11_LIB_X11_SOLO)
         # Find library needed for dnet_ntoa.
-        CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
+        check_library_exists("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
         if(X11_LIB_DNET_HAS_DNET_NTOA)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
         else(X11_LIB_DNET_HAS_DNET_NTOA)
-          CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
+          check_library_exists("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
           if(X11_LIB_DNET_STUB_HAS_DNET_NTOA)
-            SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
+            set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
           endif(X11_LIB_DNET_STUB_HAS_DNET_NTOA)
         endif(X11_LIB_DNET_HAS_DNET_NTOA)
       endif(NOT X11_LIB_X11_SOLO)
 
       # Find library needed for gethostbyname.
-      CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
+      check_function_exists("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
       if(NOT CMAKE_HAVE_GETHOSTBYNAME)
-        CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+        check_library_exists("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
         if(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
         else(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
-          CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+          check_library_exists("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
           if(CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
-            SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
+            set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
           endif(CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
         endif(CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
       endif(NOT CMAKE_HAVE_GETHOSTBYNAME)
 
       # Find library needed for connect.
-      CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT)
+      check_function_exists("connect" CMAKE_HAVE_CONNECT)
       if(NOT CMAKE_HAVE_CONNECT)
-        CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
+        check_library_exists("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
         if(CMAKE_LIB_SOCKET_HAS_CONNECT)
-          SET (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
+          set (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
         endif(CMAKE_LIB_SOCKET_HAS_CONNECT)
       endif(NOT CMAKE_HAVE_CONNECT)
 
       # Find library needed for remove.
-      CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE)
+      check_function_exists("remove" CMAKE_HAVE_REMOVE)
       if(NOT CMAKE_HAVE_REMOVE)
-        CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
+        check_library_exists("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
         if(CMAKE_LIB_POSIX_HAS_REMOVE)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
         endif(CMAKE_LIB_POSIX_HAS_REMOVE)
       endif(NOT CMAKE_HAVE_REMOVE)
 
       # Find library needed for shmat.
-      CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT)
+      check_function_exists("shmat" CMAKE_HAVE_SHMAT)
       if(NOT CMAKE_HAVE_SHMAT)
-        CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
+        check_library_exists("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
         if(CMAKE_LIB_IPS_HAS_SHMAT)
-          SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
+          set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
         endif(CMAKE_LIB_IPS_HAS_SHMAT)
       endif(NOT CMAKE_HAVE_SHMAT)
     endif($ENV{ISC} MATCHES "^yes$")
 
     if(X11_ICE_FOUND)
-      CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
+      check_library_exists("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
         CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
       if(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
-        SET (X11_X_PRE_LIBS ${X11_ICE_LIB})
+        set (X11_X_PRE_LIBS ${X11_ICE_LIB})
         if(X11_SM_LIB)
-          SET (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
+          set (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
         endif(X11_SM_LIB)
       endif(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
     endif(X11_ICE_FOUND)
@@ -548,7 +548,7 @@
     endif("${LIB_PATH_CNT}" GREATER 1)
 
     include(FindPackageMessage)
-    FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
+    find_package_message(X11 "Found X11: ${X11_X11_LIB}"
       "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
   else(X11_FOUND)
     if(X11_FIND_REQUIRED)
Index: misc/CMake/FindPERPLEX.cmake
===================================================================
--- misc/CMake/FindPERPLEX.cmake	(revision 54114)
+++ misc/CMake/FindPERPLEX.cmake	(working copy)
@@ -65,7 +65,7 @@
   endif(EXISTS /usr/share/perplex/perplex_template.c AND NOT PERPLEX_TEMPLATE)
 endif(PERPLEX_EXECUTABLE AND NOT PERPLEX_TEMPLATE)
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(PERPLEX DEFAULT_MSG PERPLEX_EXECUTABLE PERPLEX_TEMPLATE)
+find_package_handle_standard_args(PERPLEX DEFAULT_MSG PERPLEX_EXECUTABLE PERPLEX_TEMPLATE)
 mark_as_advanced(PERPLEX_TEMPLATE)
 
 #============================================================
Index: misc/CMake/FindADAPTAGRAMS.cmake
===================================================================
--- misc/CMake/FindADAPTAGRAMS.cmake	(revision 54114)
+++ misc/CMake/FindADAPTAGRAMS.cmake	(working copy)
@@ -52,9 +52,9 @@
 set(ADAPTAGRAMS_LIBRARIES    ${AVOID_LIBRARY} CACHE STRING "Adaptagrams libs")
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ADAPTAGRAMS DEFAULT_MSG AVOID_LIBRARY AVOID_INCLUDE_DIR)
+find_package_handle_standard_args(ADAPTAGRAMS DEFAULT_MSG AVOID_LIBRARY AVOID_INCLUDE_DIR)
 
-MARK_AS_ADVANCED(ADAPTAGRAMS_LIBRARIES ADAPTAGRAMS_INCLUDE_DIRS AVOID_LIBRARY AVOID_INCLUDE_DIR)
+mark_as_advanced(ADAPTAGRAMS_LIBRARIES ADAPTAGRAMS_INCLUDE_DIRS AVOID_LIBRARY AVOID_INCLUDE_DIR)
 # Local Variables:
 # tab-width: 8
 # mode: cmake
Index: misc/CMake/ThirdParty_TCL.cmake
===================================================================
--- misc/CMake/ThirdParty_TCL.cmake	(revision 54114)
+++ misc/CMake/ThirdParty_TCL.cmake	(working copy)
@@ -249,7 +249,7 @@
       set(CURRENT_TCL_PACKAGE_NAME ${pkgname})
       set(pkg_test_file ${CMAKE_BINARY_DIR}/CMakeTmp/${pkgname}_version.tcl)
       configure_file(${BRLCAD_SOURCE_DIR}/misc/CMake/tcltest.tcl.in ${pkg_test_file} @ONLY)
-      EXEC_PROGRAM(${wishcmd} ARGS ${pkg_test_file} OUTPUT_VARIABLE EXECOUTPUT)
+      exec_program(${wishcmd} ARGS ${pkg_test_file} OUTPUT_VARIABLE EXECOUTPUT)
       file(READ ${CMAKE_BINARY_DIR}/CMakeTmp/${PKGNAME_UPPER}_PKG_VERSION pkgversion)
       string(REGEX REPLACE "\n" "" ${PKGNAME_UPPER}_PACKAGE_VERSION ${pkgversion})
       if(${PKGNAME_UPPER}_PACKAGE_VERSION)
@@ -333,9 +333,9 @@
 	endif(BRLCAD_BUILD_${DEP_UPPER})
       endforeach(dep ${depends})
       include(${CMAKE_CURRENT_SOURCE_DIR}/${PKGNAME_LOWER}.dist)
-      CMAKEFILES_IN_DIR(${PKGNAME_LOWER}_ignore_files ${dir})
+      cmakefiles_in_dir(${PKGNAME_LOWER}_ignore_files ${dir})
     else(${CMAKE_PROJECT_NAME}_${PKGNAME_UPPER}_BUILD)
-      CMAKEFILES(${dir})
+      cmakefiles(${dir})
     endif(${CMAKE_PROJECT_NAME}_${PKGNAME_UPPER}_BUILD)
   endif(${PKGNAME_UPPER}_DISABLE_TEST)
 
@@ -384,14 +384,14 @@
 	endif(BRLCAD_BUILD_${DEP_UPPER})
       endforeach(dep ${depends})
       include(${CMAKE_CURRENT_SOURCE_DIR}/${PKGNAME_LOWER}.dist)
-      CMAKEFILES_IN_DIR(${PKGNAME_LOWER}_ignore_files ${dir})
+      cmakefiles_in_dir(${PKGNAME_LOWER}_ignore_files ${dir})
     else(${CMAKE_PROJECT_NAME}_${PKGNAME_UPPER}_BUILD)
-      CMAKEFILES(${dir})
+      cmakefiles(${dir})
     endif(${CMAKE_PROJECT_NAME}_${PKGNAME_UPPER}_BUILD)
   endif(NOT ${PKGNAME_UPPER}_MET_CONDITION)
 
-  OPTION_ALIASES("${CMAKE_PROJECT_NAME}_${PKGNAME_UPPER}" "${aliases}" "ABS")
-  OPTION_DESCRIPTION("${CMAKE_PROJECT_NAME}_${PKGNAME_UPPER}" "${aliases}" "${description}")
+  option_aliases("${CMAKE_PROJECT_NAME}_${PKGNAME_UPPER}" "${aliases}" "ABS")
+  option_description("${CMAKE_PROJECT_NAME}_${PKGNAME_UPPER}" "${aliases}" "${description}")
 
   # For drop-down menus in CMake gui - set STRINGS property
   set_property(CACHE ${CMAKE_PROJECT_NAME}_${PKGNAME_UPPER} PROPERTY STRINGS AUTO BUNDLED SYSTEM)
Index: misc/CMake/FindRE2C.cmake
===================================================================
--- misc/CMake/FindRE2C.cmake	(revision 54114)
+++ misc/CMake/FindRE2C.cmake	(working copy)
@@ -7,4 +7,4 @@
 mark_as_advanced(RE2C_EXECUTABLE)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(RE2C DEFAULT_MSG RE2C_EXECUTABLE)
+find_package_handle_standard_args(RE2C DEFAULT_MSG RE2C_EXECUTABLE)
Index: misc/CMake/FindFontconfig.cmake
===================================================================
--- misc/CMake/FindFontconfig.cmake	(revision 54114)
+++ misc/CMake/FindFontconfig.cmake	(working copy)
@@ -62,7 +62,7 @@
   )
 
   include(FindPackageHandleStandardArgs)
-  FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR )
+  find_package_handle_standard_args(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR )
 
   mark_as_advanced(FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR)
 
Index: misc/CMake/FindTERMLIB.cmake
===================================================================
--- misc/CMake/FindTERMLIB.cmake	(revision 54114)
+++ misc/CMake/FindTERMLIB.cmake	(working copy)
@@ -44,28 +44,28 @@
 include(ResolveCompilerPaths)
 macro(TERMLIB_CHECK_LIBRARY targetname lname func)
   if(NOT ${targetname}_LIBRARY)
-    CHECK_LIBRARY_EXISTS(${lname} ${func} "" HAVE_${targetname}_${lname})
+    check_library_exists(${lname} ${func} "" HAVE_${targetname}_${lname})
     if(HAVE_${targetname}_${lname})
       find_path(TERMLIB_INCLUDE_DIR ${lname}.h)
-      RESOLVE_LIBRARIES (${targetname}_LIBRARY "-l${lname}")
+      resolve_libraries (${targetname}_LIBRARY "-l${lname}")
       set(${targetname}_LINKOPT "-l${lname}" CACHE STRING "${targetname} link option")
       mark_as_advanced(${targetname}_LINKOPT)
     endif(HAVE_${targetname}_${lname})
   endif(NOT ${targetname}_LIBRARY)
 endmacro(TERMLIB_CHECK_LIBRARY lname func)
 
-TERMLIB_CHECK_LIBRARY(TERMLIB termlib tputs)
-TERMLIB_CHECK_LIBRARY(TERMLIB ncurses tputs)
-TERMLIB_CHECK_LIBRARY(TERMLIB curses tputs)
-TERMLIB_CHECK_LIBRARY(TERMLIB termcap tputs)
-TERMLIB_CHECK_LIBRARY(TERMLIB terminfo tputs)
-TERMLIB_CHECK_LIBRARY(TERMLIB tinfo tputs)
-TERMLIB_CHECK_LIBRARY(TERMLIB ccurses tputs)
+termlib_check_library(TERMLIB termlib tputs)
+termlib_check_library(TERMLIB ncurses tputs)
+termlib_check_library(TERMLIB curses tputs)
+termlib_check_library(TERMLIB termcap tputs)
+termlib_check_library(TERMLIB terminfo tputs)
+termlib_check_library(TERMLIB tinfo tputs)
+termlib_check_library(TERMLIB ccurses tputs)
 include(CheckCSourceRuns)
 configure_file(${BRLCAD_CMAKE_DIR}/test_srcs/termlib.c.in ${CMAKE_BINARY_DIR}/CMakeTmp/termlib.c)
 set(CMAKE_REQUIRED_LIBRARIES_BAK ${CMAKE_REQUIRED_LIBRARIES})
 set(CMAKE_REQUIRED_LIBRARIES ${TERMLIB_LIBRARY})
-CHECK_C_SOURCE_RUNS(${CMAKE_BINARY_DIR}/CMakeTmp/termlib.c LIBTERM_RESULT)
+check_c_source_runs(${CMAKE_BINARY_DIR}/CMakeTmp/termlib.c LIBTERM_RESULT)
 if(NOT LIBTERM_RESULT)
   set(TERMLIB_LIBRARY "NOTFOUND" CACHE STRING "TERMLIB" FORCE)
 else(NOT LIBTERM_RESULT)
@@ -76,7 +76,7 @@
 # handle the QUIETLY and REQUIRED arguments and set TERMLIB_FOUND to TRUE if
 # all listed variables are TRUE
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(TERMLIB DEFAULT_MSG TERMLIB_LIBRARY TERMLIB_INCLUDE_DIR)
+find_package_handle_standard_args(TERMLIB DEFAULT_MSG TERMLIB_LIBRARY TERMLIB_INCLUDE_DIR)
 
 
 # Local Variables:
Index: misc/CMake/Distcheck.cmake
===================================================================
--- misc/CMake/Distcheck.cmake	(revision 54114)
+++ misc/CMake/Distcheck.cmake	(working copy)
@@ -66,7 +66,7 @@
   # of the source files.  When we're doing distcheck, on the other hand, we CAN be intelligent
   # about triggering the copy rule - let's only do it once, since it's a rather slow operation.
   set(create_source_archive_dir_script "
-  CMAKE_POLICY(SET CMP0007 OLD)
+  cmake_policy(SET CMP0007 OLD)
   file(REMOVE_RECURSE \"${CMAKE_BINARY_DIR}/source_archive_contents\")
   file(STRINGS ${CMAKE_BINARY_DIR}/cmakefiles.cmake source_tree_files)
   file(STRINGS ${CMAKE_BINARY_DIR}/cmakedirs.cmake ignored_dirctories)
@@ -123,8 +123,8 @@
     get_target_property(not_in_all distcheck-${TARGET_SUFFIX} EXCLUDE_FROM_ALL)
     if(NOT not_in_all)
       # Need to set these locally so configure_file will pick them up...
-      SET(TARGET_SUFFIX ${TARGET_SUFFIX})
-      SET(CMAKE_OPTS ${CMAKE_OPTS})
+      set(TARGET_SUFFIX ${TARGET_SUFFIX})
+      set(CMAKE_OPTS ${CMAKE_OPTS})
 
       # For configure_file, need to set these as variables not just input parameters
       set(source_dir "${source_dir}")
@@ -135,7 +135,7 @@
       if("${CMAKE_GENERATOR}" MATCHES "Make")
 	if(NOT CMAKE_VERBOSE_DISTCHECK)
 	  set(TARGET_REDIRECT " >> distcheck-${TARGET_SUFFIX}.log 2>&1")
-	  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/distcheck-${TARGET_SUFFIX}.log)
+	  distclean(${CMAKE_CURRENT_BINARY_DIR}/distcheck-${TARGET_SUFFIX}.log)
 	endif(NOT CMAKE_VERBOSE_DISTCHECK)
 	set(DISTCHECK_BUILD_CMD "$(MAKE)")
 	set(DISTCHECK_INSTALL_CMD "$(MAKE) install")
@@ -173,8 +173,8 @@
       endif(${ARGV0_UPPER} STREQUAL "FULL")
     endif(${ARGC} EQUAL 1)
 
-    CREATE_DISTCHECK(enableall_debug   "-DCMAKE_BUILD_TYPE=Debug -DBRLCAD_BUNDLED_LIBS=BUNDLED" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "build" "install")
-    CREATE_DISTCHECK(enableall_release "-DCMAKE_BUILD_TYPE=Release -DBRLCAD_BUNDLED_LIBS=BUNDLED" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "build" "install")
+    create_distcheck(enableall_debug   "-DCMAKE_BUILD_TYPE=Debug -DBRLCAD_BUNDLED_LIBS=BUNDLED" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "build" "install")
+    create_distcheck(enableall_release "-DCMAKE_BUILD_TYPE=Release -DBRLCAD_BUNDLED_LIBS=BUNDLED" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "build" "install")
 
     add_custom_target(distcheck-std
       # The source repository verification script is responsible for generating these files
Index: misc/CMake/FindZLIB.cmake
===================================================================
--- misc/CMake/FindZLIB.cmake	(revision 54114)
+++ misc/CMake/FindZLIB.cmake	(working copy)
@@ -117,7 +117,7 @@
 )
 mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
 
-IF (ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
+if (ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
     file(READ "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H)
     string(REGEX REPLACE ".*#define ZLIB_VERSION \"([0-9]+)\\.([0-9]+)\\.([0-9]+)\".*" "\\1.\\2.\\3" ZLIB_VERSION_STRING "${ZLIB_H}")
 endif()
@@ -125,9 +125,9 @@
 # handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
 # all listed variables are TRUE
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_INCLUDE_DIR ZLIB_LIBRARY)
+find_package_handle_standard_args(ZLIB DEFAULT_MSG ZLIB_INCLUDE_DIR ZLIB_LIBRARY)
 
-IF (ZLIB_FOUND)
+if (ZLIB_FOUND)
     set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
     set(ZLIB_LIBRARIES    ${ZLIB_LIBRARY})
 endif()
Index: misc/CMake/FindSTL.cmake
===================================================================
--- misc/CMake/FindSTL.cmake	(revision 54114)
+++ misc/CMake/FindSTL.cmake	(working copy)
@@ -59,7 +59,7 @@
 
 # first try with no library
 set(CMAKE_REQUIRED_LIBRARIES "")
-CHECK_C_SOURCE_RUNS("${stl_test_src}" STL_LIB_TEST)
+check_c_source_runs("${stl_test_src}" STL_LIB_TEST)
 
 if("${STL_LIB_TEST}" EQUAL 1)
   # succeeded - no STL needed
@@ -71,7 +71,7 @@
   endif(NOT STDCXX_LIBRARIES)
 
   set(CMAKE_REQUIRED_LIBRARIES "${STDCXX_LIBRARIES}")
-  CHECK_C_SOURCE_RUNS("${stl_test_src}" STL_LIB_TEST)
+  check_c_source_runs("${stl_test_src}" STL_LIB_TEST)
 
   if("${STL_LIB_TEST}" EQUAL 1)
     set(STDCXX_LIBRARIES "${STDCXX_LIBRARIES}" CACHE STRING "STL found" FORCE)
@@ -83,7 +83,7 @@
 
   # handle the QUIETLY and REQUIRED arguments
   include(FindPackageHandleStandardArgs)
-  FIND_PACKAGE_HANDLE_STANDARD_ARGS(STL DEFAULT_MSG STDCXX_LIBRARIES)
+  find_package_handle_standard_args(STL DEFAULT_MSG STDCXX_LIBRARIES)
 endif("${STL_LIB_TEST}" EQUAL 1)
 mark_as_advanced(STDCXX_LIBRARIES)
 
Index: pix/CMakeLists.txt
===================================================================
--- pix/CMakeLists.txt	(revision 54114)
+++ pix/CMakeLists.txt	(working copy)
@@ -29,14 +29,14 @@
   cube.rt
   )
 
-BRLCAD_ADDDATA(BENCHMARK_PIX pix)
-BRLCAD_ADDDATA(PIX_LOG pix)
+brlcad_adddata(BENCHMARK_PIX pix)
+brlcad_adddata(PIX_LOG pix)
 
-CMAKEFILES(${BENCHMARK_PIX})
-CMAKEFILES(${OTHER_PIX})
-CMAKEFILES(${PIX_LOG})
-CMAKEFILES(${SAVEVIEWS})
-CMAKEFILES(Makefile.am)
+cmakefiles(${BENCHMARK_PIX})
+cmakefiles(${OTHER_PIX})
+cmakefiles(${PIX_LOG})
+cmakefiles(${SAVEVIEWS})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: doc/legal/CMakeLists.txt
===================================================================
--- doc/legal/CMakeLists.txt	(revision 54114)
+++ doc/legal/CMakeLists.txt	(working copy)
@@ -3,9 +3,9 @@
   bdl.txt
   lgpl.txt
   )
-ADD_DOC(doc_legal legal)
+add_doc(doc_legal legal)
 
-CMAKEFILES(Makefile.am bsd.txt bdl.txt lgpl.txt)
+cmakefiles(Makefile.am bsd.txt bdl.txt lgpl.txt)
 
 # Local Variables:
 # tab-width: 8
Index: doc/html/CMakeLists.txt
===================================================================
--- doc/html/CMakeLists.txt	(revision 54114)
+++ doc/html/CMakeLists.txt	(working copy)
@@ -2,7 +2,7 @@
   bookmarks.html
   toc.html
   )
-ADD_DOC(toplevel_HTML html)
+add_doc(toplevel_HTML html)
 
 set(anim_tutorial_HTML
   manuals/Anim_Tutorial/Lee_tux.gif
@@ -47,7 +47,7 @@
   manuals/Anim_Tutorial/v_eqn1.gif
   manuals/Anim_Tutorial/v_eqn2.gif
   )
-ADD_DOC(anim_tutorial_HTML html/manuals/Anim_Tutorial)
+add_doc(anim_tutorial_HTML html/manuals/Anim_Tutorial)
 
 set(cadwidgets_HTML
   manuals/cadwidgets/Command.html
@@ -64,14 +64,14 @@
   manuals/cadwidgets/index.html
   manuals/cadwidgets/skeleton.html
   )
-ADD_DOC(cadwidgets_HTML html/manuals/cadwidgets)
+add_doc(cadwidgets_HTML html/manuals/cadwidgets)
 
 set(libbu_HTML
   manuals/libbu/cmdhist_obj.html
   manuals/libbu/contents.html
   manuals/libbu/index.html
   )
-ADD_DOC(libbu_HTML html/manuals/libbu)
+add_doc(libbu_HTML html/manuals/libbu)
 
 set(libdm_HTML
   manuals/libdm/api.html
@@ -81,7 +81,7 @@
   manuals/libdm/preface.html
   manuals/libdm/tcl.html
   )
-ADD_DOC(libdm_HTML html/manuals/libdm)
+add_doc(libdm_HTML html/manuals/libdm)
 
 set(librt_HTML
   manuals/librt/contents.html
@@ -90,7 +90,7 @@
   manuals/librt/view_obj.html
   manuals/librt/wdb_obj.html
   )
-ADD_DOC(librt_HTML html/manuals/librt)
+add_doc(librt_HTML html/manuals/librt)
 
 set(manuals_HTML
   manuals/Install.html
@@ -101,7 +101,7 @@
   manuals/index.html
   manuals/small-eagleCAD.gif
   )
-ADD_DOC(manuals_HTML html/manuals)
+add_doc(manuals_HTML html/manuals)
 
 set(manuals_mged_animmate_HTML
   manuals/mged/animmate/anim_cascade.html
@@ -169,7 +169,7 @@
   manuals/mged/animmate/viewget.html
   manuals/mged/animmate/vscript_doc.html
   )
-ADD_DOC(manuals_mged_animmate_HTML html/manuals/mged/animmate)
+add_doc(manuals_mged_animmate_HTML html/manuals/mged/animmate)
 
 set(manuals_mged_HTML
   manuals/mged/az_el.gif
@@ -234,9 +234,9 @@
   manuals/mged/skipped
   manuals/mged/tex-html.tcl
   )
-ADD_DOC(manuals_mged_HTML html/manuals/mged)
+add_doc(manuals_mged_HTML html/manuals/mged)
 
-ADD_DOC(manuals/shaders/camo.html html/manuals/shaders)
+add_doc(manuals/shaders/camo.html html/manuals/shaders)
 
 set(relnotes_HTML
   ReleaseNotes/email2.0.html
@@ -247,7 +247,7 @@
   ReleaseNotes/email5.0.html
   ReleaseNotes/index.html
   )
-ADD_DOC(relnotes_HTML html/ReleaseNotes)
+add_doc(relnotes_HTML html/ReleaseNotes)
 
 set(relnotes_5_HTML
   ReleaseNotes/Rel5.0/deprecated.html
@@ -255,7 +255,7 @@
   ReleaseNotes/Rel5.0/new_cmds.html
   ReleaseNotes/Rel5.0/new_libs.html
   )
-ADD_DOC(relnotes_5_HTML html/ReleaseNotes/Rel5.0)
+add_doc(relnotes_5_HTML html/ReleaseNotes/Rel5.0)
 
 set(relnotes_5_summary_HTML
   ReleaseNotes/Rel5.0/Summary/activem.gif
@@ -331,9 +331,9 @@
   ReleaseNotes/Rel5.0/Summary/tsld018.htm
   ReleaseNotes/Rel5.0/Summary/tsld019.htm
   )
-ADD_DOC(relnotes_5_summary_HTML html/ReleaseNotes/Rel5.0/Summary)
+add_doc(relnotes_5_summary_HTML html/ReleaseNotes/Rel5.0/Summary)
 
-ADD_DOC(ReleaseNotes/Rel6.0/index.html html/ReleaseNotes/Rel6.0)
+add_doc(ReleaseNotes/Rel6.0/index.html html/ReleaseNotes/Rel6.0)
 
 set(html_ignore_files
   ReleaseNotes/Rel6.0
@@ -352,7 +352,7 @@
   manuals/librt/Makefile.am
   manuals/mged/Makefile.am
   )
-CMAKEFILES(${html_ignore_files})
+cmakefiles(${html_ignore_files})
 
 # Local Variables:
 # tab-width: 8
Index: doc/CMakeLists.txt
===================================================================
--- doc/CMakeLists.txt	(revision 54114)
+++ doc/CMakeLists.txt	(working copy)
@@ -1,7 +1,7 @@
 if(BRLCAD_EXTRADOCS)
   add_subdirectory(docbook)
 else(BRLCAD_EXTRADOCS)
-  CMAKEFILES(docbook)
+  cmakefiles(docbook)
 endif(BRLCAD_EXTRADOCS)
 
 add_subdirectory(html)
@@ -35,7 +35,7 @@
   mater.txt
   matrix.txt
   )
-ADD_DOC(documentation_DATA ".")
+add_doc(documentation_DATA ".")
 
 set(documentation_mged_old_DATA
   mged/a.tex
@@ -213,12 +213,12 @@
   tool_categories.txt
   ecosystem.dot
   )
-ADD_DOC(documentation_mged_old_DATA mged_old)
+add_doc(documentation_mged_old_DATA mged_old)
 
 configure_file(pad_file.xml.in ${CMAKE_CURRENT_BINARY_DIR}/pad_file.xml @ONLY)
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pad_file.xml DESTINATION ${DOC_DIR})
 
-CMAKEFILES(Makefile.am pad_file.xml.in STARTERS)
+cmakefiles(Makefile.am pad_file.xml.in STARTERS)
 
 # Local Variables:
 # tab-width: 8
Index: doc/docbook/presentations/CMakeLists.txt
===================================================================
--- doc/docbook/presentations/CMakeLists.txt	(revision 54114)
+++ doc/docbook/presentations/CMakeLists.txt	(working copy)
@@ -1,5 +1,5 @@
 add_subdirectory(en)
-CMAKEFILES(README)
+cmakefiles(README)
 
 # Local Variables:
 # tab-width: 8
Index: doc/docbook/presentations/en/CMakeLists.txt
===================================================================
--- doc/docbook/presentations/en/CMakeLists.txt	(revision 54114)
+++ doc/docbook/presentations/en/CMakeLists.txt	(working copy)
@@ -9,10 +9,10 @@
   images/special-character-interpretation.png
   images/tk-based-gui-for-mged.png
   )
-ADD_DOC(docbook_presentations_EN_IMAGES html/presentations/en/images)
+add_doc(docbook_presentations_EN_IMAGES html/presentations/en/images)
 
-DOCBOOK_TO_HTML(presentation docbook_presentations_EN html/presentations/en docbook_presentations_EN_IMAGES_cp)
-DOCBOOK_TO_PDF(presentation docbook_presentations_EN pdf/presentations/en docbook_presentations_EN_IMAGES_cp)
+docbook_to_html(presentation docbook_presentations_EN html/presentations/en docbook_presentations_EN_IMAGES_cp)
+docbook_to_pdf(presentation docbook_presentations_EN pdf/presentations/en docbook_presentations_EN_IMAGES_cp)
 
 # Local Variables:
 # tab-width: 8
Index: doc/docbook/specifications/en/CMakeLists.txt
===================================================================
--- doc/docbook/specifications/en/CMakeLists.txt	(revision 54114)
+++ doc/docbook/specifications/en/CMakeLists.txt	(working copy)
@@ -2,9 +2,9 @@
   BRL_CAD_g_format_V5.xml
   )
 
-DOCBOOK_TO_HTML(specification docbook_specifications_EN html/specifications/en "")
+docbook_to_html(specification docbook_specifications_EN html/specifications/en "")
 
-DOCBOOK_TO_PDF(specification docbook_specifications_EN pdf/specifications/en "")
+docbook_to_pdf(specification docbook_specifications_EN pdf/specifications/en "")
 
 # Local Variables:
 # tab-width: 8
Index: doc/docbook/system/man5/en/CMakeLists.txt
===================================================================
--- doc/docbook/system/man5/en/CMakeLists.txt	(revision 54114)
+++ doc/docbook/system/man5/en/CMakeLists.txt	(working copy)
@@ -7,11 +7,11 @@
   plot3.xml
   )
 
-DOCBOOK_TO_HTML(man5 docbook_man5_EN html/man5/en "")
-DOCBOOK_TO_MAN(man5 docbook_man5_EN 5 5 man5 "")
+docbook_to_html(man5 docbook_man5_EN html/man5/en "")
+docbook_to_man(man5 docbook_man5_EN 5 5 man5 "")
 
 if(BRLCAD_EXTRADOCS_PDF_MAN)
-  DOCBOOK_TO_PDF(man5 docbook_man5_EN pdf/man5/en "")
+  docbook_to_pdf(man5 docbook_man5_EN pdf/man5/en "")
 endif(BRLCAD_EXTRADOCS_PDF_MAN)
 
 # Local Variables:
Index: doc/docbook/system/mann/CMakeLists.txt
===================================================================
--- doc/docbook/system/mann/CMakeLists.txt	(revision 54114)
+++ doc/docbook/system/mann/CMakeLists.txt	(working copy)
@@ -1,5 +1,5 @@
 add_subdirectory(en)
-CMAKEFILES(mged_cmd_template.xml)
+cmakefiles(mged_cmd_template.xml)
 
 # Local Variables:
 # tab-width: 8
Index: doc/docbook/system/mann/en/CMakeLists.txt
===================================================================
--- doc/docbook/system/mann/en/CMakeLists.txt	(revision 54114)
+++ doc/docbook/system/mann/en/CMakeLists.txt	(working copy)
@@ -255,12 +255,12 @@
 # extra outputs without being told.
 set_source_files_properties(gr.xml PROPERTIES EXTRA_MAN_OUTPUTS "dg.nged")
 
-DOCBOOK_TO_HTML(mann docbook_mann_EN html/mann/en "")
-DOCBOOK_TO_HTML(mann docbook_mann_INTRO html/mann/en "")
-DOCBOOK_TO_MAN(mann docbook_mann_EN n nged mann "")
+docbook_to_html(mann docbook_mann_EN html/mann/en "")
+docbook_to_html(mann docbook_mann_INTRO html/mann/en "")
+docbook_to_man(mann docbook_mann_EN n nged mann "")
 
 if(BRLCAD_EXTRADOCS_PDF_MAN)
-  DOCBOOK_TO_PDF(mann docbook_mann_EN pdf/mann/en "")
+  docbook_to_pdf(mann docbook_mann_EN pdf/mann/en "")
 endif(BRLCAD_EXTRADOCS_PDF_MAN)
 
 # Local Variables:
Index: doc/docbook/system/man1/en/CMakeLists.txt
===================================================================
--- doc/docbook/system/man1/en/CMakeLists.txt	(revision 54114)
+++ doc/docbook/system/man1/en/CMakeLists.txt	(working copy)
@@ -242,14 +242,14 @@
 # extra outputs without being told.
 set_source_files_properties(pix2asc.xml PROPERTIES EXTRA_MAN_OUTPUTS "asc2pix.1")
 
-DOCBOOK_TO_HTML(man1 docbook_man1_EN html/man1/en "")
-DOCBOOK_TO_MAN(man1 docbook_man1_EN 1 1 man1 "")
+docbook_to_html(man1 docbook_man1_EN html/man1/en "")
+docbook_to_man(man1 docbook_man1_EN 1 1 man1 "")
 
 if(BRLCAD_EXTRADOCS_PDF_MAN)
-  DOCBOOK_TO_PDF(man1 docbook_man1_EN pdf/man1/en "")
+  docbook_to_pdf(man1 docbook_man1_EN pdf/man1/en "")
 endif(BRLCAD_EXTRADOCS_PDF_MAN)
 
-CMAKEFILES(pictx.xml)
+cmakefiles(pictx.xml)
 
 # Local Variables:
 # tab-width: 8
Index: doc/docbook/system/CMakeLists.txt
===================================================================
--- doc/docbook/system/CMakeLists.txt	(revision 54114)
+++ doc/docbook/system/CMakeLists.txt	(working copy)
@@ -3,7 +3,7 @@
 add_subdirectory(man5)
 add_subdirectory(mann)
 
-CMAKEFILES(README)
+cmakefiles(README)
 
 # Local Variables:
 # tab-width: 8
Index: doc/docbook/system/man3/en/CMakeLists.txt
===================================================================
--- doc/docbook/system/man3/en/CMakeLists.txt	(revision 54114)
+++ doc/docbook/system/man3/en/CMakeLists.txt	(working copy)
@@ -9,11 +9,11 @@
   redblack.xml
   )
 
-DOCBOOK_TO_HTML(man3 docbook_man3_EN html/man3/en "")
-DOCBOOK_TO_MAN(man3 docbook_man3_EN 3 3 man3 "")
+docbook_to_html(man3 docbook_man3_EN html/man3/en "")
+docbook_to_man(man3 docbook_man3_EN 3 3 man3 "")
 
 if(BRLCAD_EXTRADOCS_PDF_MAN)
-  DOCBOOK_TO_PDF(man3 docbook_man3_EN pdf/man3/en "")
+  docbook_to_pdf(man3 docbook_man3_EN pdf/man3/en "")
 endif(BRLCAD_EXTRADOCS_PDF_MAN)
 
 # Local Variables:
Index: doc/docbook/articles/ru/CMakeLists.txt
===================================================================
--- doc/docbook/articles/ru/CMakeLists.txt	(revision 54114)
+++ doc/docbook/articles/ru/CMakeLists.txt	(working copy)
@@ -2,10 +2,10 @@
   about_ru.xml
   )
 
-DOCBOOK_TO_HTML(article docbook_articles_RU html/articles/ru "")
+docbook_to_html(article docbook_articles_RU html/articles/ru "")
 
 if(BRLCAD_EXTRADOCS_PDF)
-  DOCBOOK_TO_PDF(article docbook_articles_RU pdf/articles/ru "")
+  docbook_to_pdf(article docbook_articles_RU pdf/articles/ru "")
 endif(BRLCAD_EXTRADOCS_PDF)
 
 # Local Variables:
Index: doc/docbook/articles/it/CMakeLists.txt
===================================================================
--- doc/docbook/articles/it/CMakeLists.txt	(revision 54114)
+++ doc/docbook/articles/it/CMakeLists.txt	(working copy)
@@ -13,12 +13,12 @@
   images/brlcad-overview-data-flow.png
   images/sflogo.png
   )
-ADD_DOC(docbook_articles_IT_IMAGES html/articles/it/images)
+add_doc(docbook_articles_IT_IMAGES html/articles/it/images)
 
-DOCBOOK_TO_HTML(article docbook_articles_IT html/articles/it docbook_articles_IT_IMAGES_cp)
+docbook_to_html(article docbook_articles_IT html/articles/it docbook_articles_IT_IMAGES_cp)
 
 if(BRLCAD_EXTRADOCS_PDF)
-  DOCBOOK_TO_PDF(article docbook_articles_IT pdf/articles/it docbook_articles_IT_IMAGES_cp)
+  docbook_to_pdf(article docbook_articles_IT pdf/articles/it docbook_articles_IT_IMAGES_cp)
 endif(BRLCAD_EXTRADOCS_PDF)
 
 # Local Variables:
Index: doc/docbook/articles/hy/CMakeLists.txt
===================================================================
--- doc/docbook/articles/hy/CMakeLists.txt	(revision 54114)
+++ doc/docbook/articles/hy/CMakeLists.txt	(working copy)
@@ -2,10 +2,10 @@
   about_hy.xml
   )
 
-DOCBOOK_TO_HTML(article docbook_articles_HY html/articles/hy "")
+docbook_to_html(article docbook_articles_HY html/articles/hy "")
 
 if(BRLCAD_EXTRADOCS_PDF)
-  DOCBOOK_TO_PDF(article docbook_articles_HY pdf/articles/hy "")
+  docbook_to_pdf(article docbook_articles_HY pdf/articles/hy "")
 endif(BRLCAD_EXTRADOCS_PDF)
 
 # Local Variables:
Index: doc/docbook/articles/en/CMakeLists.txt
===================================================================
--- doc/docbook/articles/en/CMakeLists.txt	(revision 54114)
+++ doc/docbook/articles/en/CMakeLists.txt	(working copy)
@@ -102,15 +102,15 @@
   images/tire_fig13.png
   images/tire_fig14.png
   )
-ADD_DOC(docbook_articles_EN_IMAGES html/articles/en/images)
+add_doc(docbook_articles_EN_IMAGES html/articles/en/images)
 
-DOCBOOK_TO_HTML(article docbook_articles_EN html/articles/en docbook_articles_EN_IMAGES_cp)
+docbook_to_html(article docbook_articles_EN html/articles/en docbook_articles_EN_IMAGES_cp)
 
 if(BRLCAD_EXTRADOCS_PDF)
-  DOCBOOK_TO_PDF(article docbook_articles_EN pdf/articles/en docbook_articles_EN_IMAGES_cp)
+  docbook_to_pdf(article docbook_articles_EN pdf/articles/en docbook_articles_EN_IMAGES_cp)
 endif(BRLCAD_EXTRADOCS_PDF)
 
-CMAKEFILES(images/tire_fig12.svg images/tire_fig13.svg)
+cmakefiles(images/tire_fig12.svg images/tire_fig13.svg)
 
 # Local Variables:
 # tab-width: 8
Index: doc/docbook/lessons/en/CMakeLists.txt
===================================================================
--- doc/docbook/lessons/en/CMakeLists.txt	(revision 54114)
+++ doc/docbook/lessons/en/CMakeLists.txt	(working copy)
@@ -130,10 +130,10 @@
   images/mged16_radio_structure_3.png
   images/mged16_radio_cutaways.png
   )
-ADD_DOC(docbook_lessons_EN_IMAGES html/lessons/en/images)
+add_doc(docbook_lessons_EN_IMAGES html/lessons/en/images)
 
-DOCBOOK_TO_HTML(lesson docbook_lessons_EN html/lessons/en docbook_lessons_EN_IMAGES_cp)
-DOCBOOK_TO_PDF(lesson docbook_lessons_EN pdf/lessons/en docbook_lessons_EN_IMAGES_cp)
+docbook_to_html(lesson docbook_lessons_EN html/lessons/en docbook_lessons_EN_IMAGES_cp)
+docbook_to_pdf(lesson docbook_lessons_EN pdf/lessons/en docbook_lessons_EN_IMAGES_cp)
 
 # Local Variables:
 # tab-width: 8
Index: doc/docbook/lessons/es/CMakeLists.txt
===================================================================
--- doc/docbook/lessons/es/CMakeLists.txt	(revision 54114)
+++ doc/docbook/lessons/es/CMakeLists.txt	(working copy)
@@ -126,10 +126,10 @@
   images/mged16_radio_wireframe_circ_board.png
   images/mged16_radio_with_mater_props.png
   )
-ADD_DOC(docbook_lessons_ES_IMAGES html/lessons/es/images)
+add_doc(docbook_lessons_ES_IMAGES html/lessons/es/images)
 
-DOCBOOK_TO_HTML(lesson_ES docbook_lessons_ES html/lessons/es docbook_lessons_ES_IMAGES_cp)
-DOCBOOK_TO_PDF(lesson_ES docbook_lessons_ES pdf/lessons/es docbook_lessons_ES_IMAGES_cp)
+docbook_to_html(lesson_ES docbook_lessons_ES html/lessons/es docbook_lessons_ES_IMAGES_cp)
+docbook_to_pdf(lesson_ES docbook_lessons_ES pdf/lessons/es docbook_lessons_ES_IMAGES_cp)
 
 # Local Variables:
 # tab-width: 8
Index: doc/docbook/resources/other/expand.cmake
===================================================================
--- doc/docbook/resources/other/expand.cmake	(revision 54114)
+++ doc/docbook/resources/other/expand.cmake	(working copy)
@@ -2,21 +2,21 @@
 # Define the commands to expand the third party components we will need to handle
 # DocBook processing from their archives into the build directory
 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resources/other/docbook-schema)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/resources/other/docbook-schema)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/resources/other/docbook-schema)
 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts/dejavu-lgc)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts/dejavu-lgc)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts/dejavu-lgc)
 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts/stix)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts/stix)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts/stix)
 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resources/other/offo)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/resources/other/offo/source)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/resources/other/offo/binary)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/resources/other/offo/README)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/resources/other/offo/source)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/resources/other/offo/binary)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/resources/other/offo/README)
 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard/svg)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard/svg)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard/svg)
 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard/xsl)
-DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard/xsl)
+distclean(${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard/xsl)
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
 	OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/resources/other/docbook-schema/schema.sentinel
 	COMMAND ${CMAKE_COMMAND} -E tar xjf	${CMAKE_CURRENT_SOURCE_DIR}/resources/other/docbook-5.0.tar.bz2
 	COMMAND ${CMAKE_COMMAND} -E copy	${CMAKE_CURRENT_SOURCE_DIR}/resources/other/docbookxi.nvdl ${CMAKE_CURRENT_BINARY_DIR}/resources/other/docbook-schema/docbookxi.nvdl
@@ -24,36 +24,36 @@
 	DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/resources/other/docbookxi.nvdl ${CMAKE_CURRENT_SOURCE_DIR}/resources/other/docbook-5.0.tar.bz2
 	WORKING_DIRECTORY	${CMAKE_CURRENT_BINARY_DIR}/resources/other
 	)
-ADD_CUSTOM_TARGET(schema-expand DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources/other/docbook-schema/schema.sentinel)
+add_custom_target(schema-expand DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources/other/docbook-schema/schema.sentinel)
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
 	OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts/dejavu-lgc/dejavu-lgc.sentinel
 	COMMAND ${CMAKE_COMMAND} -E tar xjf ${CMAKE_CURRENT_SOURCE_DIR}/resources/other/fonts/dejavu-lgc-fonts.tar.bz2
 	COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts/dejavu-lgc/dejavu-lgc.sentinel
 	DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/resources/other/fonts/dejavu-lgc-fonts.tar.bz2
 	WORKING_DIRECTORY	${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts
 	)
-ADD_CUSTOM_TARGET(fonts-dejavu-expand DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts/dejavu-lgc/dejavu-lgc.sentinel)
+add_custom_target(fonts-dejavu-expand DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts/dejavu-lgc/dejavu-lgc.sentinel)
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
 	OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts/stix/stix.sentinel
 	COMMAND ${CMAKE_COMMAND} -E tar xjf ${CMAKE_CURRENT_SOURCE_DIR}/resources/other/fonts/stix-fonts.tar.bz2
 	COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts/stix/stix.sentinel
 	DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/resources/other/fonts/stix-fonts.tar.bz2
 	WORKING_DIRECTORY	${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts
 	)
-ADD_CUSTOM_TARGET(fonts-stix-expand DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts/stix/stix.sentinel)
+add_custom_target(fonts-stix-expand DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources/other/fonts/stix/stix.sentinel)
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
 	OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/resources/other/offo/offo2_0.sentinel
 	COMMAND ${CMAKE_COMMAND} -E tar xjf ${CMAKE_CURRENT_SOURCE_DIR}/resources/other/offo/offo-2.0.tar.bz2
 	COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/resources/other/offo/offo2_0.sentinel
 	DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/resources/other/offo/offo-2.0.tar.bz2
 	WORKING_DIRECTORY	${CMAKE_CURRENT_BINARY_DIR}/resources/other/
 	)
-ADD_CUSTOM_TARGET(offo-2-expand DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources/other/offo/offo2_0.sentinel)
+add_custom_target(offo-2-expand DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources/other/offo/offo2_0.sentinel)
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
 	OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard/svg/svg.sentinel
 	COMMAND ${CMAKE_COMMAND} -E tar xjf	${CMAKE_CURRENT_SOURCE_DIR}/resources/other/standard/w3_svg_dtd.tar.bz2
 	COMMAND ${CMAKE_COMMAND} -E copy	${CMAKE_CURRENT_SOURCE_DIR}/resources/other/standard/met-fonts.xsl	${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard/svg/met-fonts.xsl
@@ -61,15 +61,15 @@
 	DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/resources/other/standard/met-fonts.xsl ${CMAKE_CURRENT_SOURCE_DIR}/resources/other/standard/w3_svg_dtd.tar.bz2
 	WORKING_DIRECTORY	${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard
 	)
-ADD_CUSTOM_TARGET(svg-dtd-expand DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard/svg/svg.sentinel)
+add_custom_target(svg-dtd-expand DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard/svg/svg.sentinel)
 
-ADD_CUSTOM_COMMAND(
+add_custom_command(
 	OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard/xsl/xsl.sentinel
 	COMMAND ${CMAKE_COMMAND} -E tar xjf	${CMAKE_CURRENT_SOURCE_DIR}/resources/other/standard/docbook-xsl-ns.tar.bz2
 	COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard/xsl/xsl.sentinel
 	DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/resources/other/standard/docbook-xsl-ns.tar.bz2
 	WORKING_DIRECTORY	${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard
 	)
-ADD_CUSTOM_TARGET(xsl-expand DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard/xsl/xsl.sentinel)
+add_custom_target(xsl-expand DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources/other/standard/xsl/xsl.sentinel)
 
-SET(DOCBOOK_RESOURCE_FILES schema-expand fonts-dejavu-expand fonts-stix-expand offo-2-expand svg-dtd-expand xsl-expand)
+set(DOCBOOK_RESOURCE_FILES schema-expand fonts-dejavu-expand fonts-stix-expand offo-2-expand svg-dtd-expand xsl-expand)
Index: doc/docbook/books/CMakeLists.txt
===================================================================
--- doc/docbook/books/CMakeLists.txt	(revision 54114)
+++ doc/docbook/books/CMakeLists.txt	(working copy)
@@ -3,7 +3,7 @@
 set(XSL_FO_STYLESHEET "${CMAKE_SOURCE_DIR}/doc/docbook/resources/brlcad/brlcad-fo-stylesheet.xsl")
 
 add_subdirectory(en)
-CMAKEFILES(README)
+cmakefiles(README)
 
 # Local Variables:
 # tab-width: 8
Index: doc/docbook/books/en/CMakeLists.txt
===================================================================
--- doc/docbook/books/en/CMakeLists.txt	(revision 54114)
+++ doc/docbook/books/en/CMakeLists.txt	(working copy)
@@ -51,7 +51,7 @@
   images/v4-image010.jpg
   images/v4-image011.jpg
   )
-ADD_DOC(docbook_books_EN_IMAGES html/books/en/images)
+add_doc(docbook_books_EN_IMAGES html/books/en/images)
 
 set(docbook_books_EN
   BRL-CAD_Tutorial_Series-VolumeI.xml
@@ -59,7 +59,7 @@
   BRL-CAD_Tutorial_Series-VolumeIII.xml
   BRL-CAD_Tutorial_Series-VolumeIV.xml
   )
-DOCBOOK_TO_HTML(book docbook_books_EN html/books/en docbook_books_EN_IMAGES_cp)
+docbook_to_html(book docbook_books_EN html/books/en docbook_books_EN_IMAGES_cp)
 
 # The PDFs need some special logic to generate custom
 # covers.
@@ -122,7 +122,7 @@
     endif(CMAKE_CONFIGURATION_TYPES)
     set(fo_outfile ${outfile})
     set(CURRENT_XSL_STYLESHEET ${CMAKE_CURRENT_BINARY_DIR}/${filename_root}.xsl)
-    DB_SCRIPT("${filename_root}_book_fo" "${targetdir}" "${XSLT_EXECUTABLE}")
+    db_script("${filename_root}_book_fo" "${targetdir}" "${XSLT_EXECUTABLE}")
     add_custom_command(
       OUTPUT ${outfile}
       COMMAND ${CMAKE_COMMAND} -P ${scriptfile}
@@ -130,7 +130,7 @@
       )
     set(outfile ${bin_root}/${DATA_DIR}/${DOC_DIR}/${targetdir}/${filename_root}.pdf)
     set(targetname "${filename_root}_book_pdf")
-    DB_SCRIPT("${targetname}" "${targetdir}" "${PDF_CONV_EXECUTABLE}")
+    db_script("${targetname}" "${targetdir}" "${PDF_CONV_EXECUTABLE}")
     add_custom_command(
       OUTPUT ${outfile}
       COMMAND ${CMAKE_COMMAND} -P ${scriptfile}
@@ -149,7 +149,7 @@
   endforeach(filename ${docbook_books_EN})
 endif(BRLCAD_EXTRADOCS_PDF)
 
-CMAKEFILES(tutorial_series_authors.xml)
+cmakefiles(tutorial_series_authors.xml)
 
 # Local Variables:
 # tab-width: 8
Index: doc/docbook/CMakeLists.txt
===================================================================
--- doc/docbook/CMakeLists.txt	(revision 54114)
+++ doc/docbook/CMakeLists.txt	(working copy)
@@ -93,9 +93,9 @@
 	${BRLCAD_EXTRADOCS_PDF_TARGETS})
 endif(BRLCAD_EXTRADOCS_HTML OR BRLCAD_EXTRADOCS_MAN OR BRLCAD_EXTRADOCS_PDF)
 
-CMAKEFILES(README fop.xconf.in log4j.properties resources)
-CMAKEFILES(README.DB_authors_notes)
-CMAKEFILES(css/brlcad.css)
+cmakefiles(README fop.xconf.in log4j.properties resources)
+cmakefiles(README.DB_authors_notes)
+cmakefiles(css/brlcad.css)
 
 # Local Variables:
 # tab-width: 8
Index: sh/CMakeLists.txt
===================================================================
--- sh/CMakeLists.txt	(revision 54114)
+++ sh/CMakeLists.txt	(working copy)
@@ -52,9 +52,9 @@
   template.sh
   ws.sh
   )
-CMAKEFILES(${sh_SCRIPTS})
-CMAKEFILES(${noinst_SCRIPTS})
-CMAKEFILES(Makefile.am)
+cmakefiles(${sh_SCRIPTS})
+cmakefiles(${noinst_SCRIPTS})
+cmakefiles(Makefile.am)
 
 # Local Variables:
 # tab-width: 8
Index: regress/mged/CMakeLists.txt
===================================================================
--- regress/mged/CMakeLists.txt	(revision 54114)
+++ regress/mged/CMakeLists.txt	(working copy)
@@ -84,7 +84,7 @@
 foreach(testfile ${MGED_TESTS})
   file(READ ${CMAKE_CURRENT_SOURCE_DIR}/${testfile} TEST_CONTENTS)
   file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/regress_${testfile} "source ${CMAKE_CURRENT_SOURCE_DIR}/regression_resources.tcl\n\n${TEST_CONTENTS}")
-  DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/regress_${testfile})
+  distclean(${CMAKE_CURRENT_BINARY_DIR}/regress_${testfile})
 endforeach(testfile ${MGED_TESTS})
 
 set(G_FILENAME "regress_mged_cmd_functionality.g")
Index: regress/CMakeLists.txt
===================================================================
--- regress/CMakeLists.txt	(revision 54114)
+++ regress/CMakeLists.txt	(working copy)
@@ -113,7 +113,7 @@
 
 endif(SH_EXEC)
 
-CMAKEFILES(
+cmakefiles(
   Makefile.am
   analyze.asc
   asc2dsp.sh
Index: regress/gcv/CMakeLists.txt
===================================================================
--- regress/gcv/CMakeLists.txt	(revision 54114)
+++ regress/gcv/CMakeLists.txt	(working copy)
@@ -9,7 +9,7 @@
 
 add_custom_target(dem-regress DEPENDS dem-g ${CMAKE_CURRENT_BINARY_DIR}/dem/hawaii-c.done)
 
-CMAKEFILES(dem)
+cmakefiles(dem)
 
 # Local Variables:
 # tab-width: 8
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 54114)
+++ CMakeLists.txt	(working copy)
@@ -89,17 +89,17 @@
 # comparison
 if(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
   configure_file(${CMAKE_BINARY_DIR}/CMakeCache.txt ${CMAKE_BINARY_DIR}/CMakeCache.txt.prev COPYONLY)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/CMakeCache.txt.prev)
+  distclean(${CMAKE_BINARY_DIR}/CMakeCache.txt.prev)
 endif(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
-DISTCLEAN(${CMAKE_BINARY_DIR}/CMakeCache.txt)
+distclean(${CMAKE_BINARY_DIR}/CMakeCache.txt)
 
 # Minimum required version of CMake
 cmake_minimum_required(VERSION 2.8.4)
 if(COMMAND CMAKE_POLICY)
-  CMAKE_POLICY(SET CMP0003 NEW)
-  CMAKE_POLICY(SET CMP0007 OLD)
+  cmake_policy(SET CMP0003 NEW)
+  cmake_policy(SET CMP0007 OLD)
   if(${CMAKE_VERSION} VERSION_GREATER 2.8.3)
-    CMAKE_POLICY(SET CMP0017 OLD)
+    cmake_policy(SET CMP0017 OLD)
   endif(${CMAKE_VERSION} VERSION_GREATER 2.8.3)
 endif(COMMAND CMAKE_POLICY)
 
@@ -112,7 +112,7 @@
 if(NOT BRLCAD_IS_SUBBUILD)
   set(DELTA_START "${CMAKE_BINARY_DIR}/CMakeTmp/DELTA_START")
   configure_file(${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/timedelta_start.c.in ${CMAKE_BINARY_DIR}/CMakeTmp/timedelta_start.c)
-  TRY_RUN(TIME_RESULT TIME_COMPILED
+  try_run(TIME_RESULT TIME_COMPILED
     ${CMAKE_BINARY_DIR}/CMakeTmp
     ${CMAKE_BINARY_DIR}/CMakeTmp/timedelta_start.c
     OUTPUT_VARIABLE COMPILEMESSAGES)
@@ -378,7 +378,7 @@
   # on the lib prefix for libraries if the target name is lib<target>
   function(add_library name)
     _add_library(${name} ${ARGN})
-    CMAKEFILES(${ARGN})
+    cmakefiles(${ARGN})
     if(${name} MATCHES "^lib*")
       set_target_properties(${name} PROPERTIES PREFIX "")
     endif(${name} MATCHES "^lib*")
@@ -388,7 +388,7 @@
   # Override and wrap add_executable
   function(add_executable name)
     _add_executable(${name} ${ARGN})
-    CMAKEFILES(${ARGN})
+    cmakefiles(${ARGN})
     set_property(GLOBAL APPEND PROPERTY CMAKE_EXEC_TARGET_LIST ${name})
   endfunction(add_executable)
 
@@ -423,12 +423,12 @@
       get_filename_component(item_absolute ${file} ABSOLUTE)
       # If we're not in the source dir, we can do some extra checking.
       if(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
-	IS_SUBPATH("${CMAKE_BINARY_DIR}" "${item_absolute}" SUBPATH_TEST)
+	is_subpath("${CMAKE_BINARY_DIR}" "${item_absolute}" SUBPATH_TEST)
       else(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
 	set(SUBPATH_TEST "0")
       endif(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
       if("${SUBPATH_TEST}" STREQUAL "0")
-	IS_SUBPATH("${CMAKE_SOURCE_DIR}" "${item_absolute}" SUBPATH_TEST)
+	is_subpath("${CMAKE_SOURCE_DIR}" "${item_absolute}" SUBPATH_TEST)
 	if("${SUBPATH_TEST}" STREQUAL "1")
 	  set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_FILES "${item_absolute}")
 	endif("${SUBPATH_TEST}" STREQUAL "1")
@@ -437,7 +437,7 @@
       endif("${SUBPATH_TEST}" STREQUAL "0")
     endif(NOT IS_GENERATED)
     if(NOT ${targetfile} MATCHES "distclean")
-      DISTCLEAN(${targetfile})
+      distclean(${targetfile})
     endif(NOT ${targetfile} MATCHES "distclean")
   endfunction(configure_file)
 
@@ -446,10 +446,10 @@
     _add_subdirectory(${name} ${ARGN})
     set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${name}")
     set_property(GLOBAL APPEND PROPERTY CMAKE_IGNORE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${name}/CMakeLists.txt")
-    DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/${name}/CMakeFiles)
-    DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/${name}/cmake_install.cmake)
+    distclean(${CMAKE_CURRENT_BINARY_DIR}/${name}/CMakeFiles)
+    distclean(${CMAKE_CURRENT_BINARY_DIR}/${name}/cmake_install.cmake)
     foreach(clearpattern ${DISTCLEAN_OUTFILES})
-      DISTCLEAN(${CMAKE_CURRENT_BINARY_DIR}/${name}/${clearpattern})
+      distclean(${CMAKE_CURRENT_BINARY_DIR}/${name}/${clearpattern})
     endforeach(clearpattern ${DISTCLEAN_OUTFILES})
   endfunction(add_subdirectory)
 
@@ -514,10 +514,10 @@
     set(${status_var} 1)
   endif(UMASK_HAVE_R AND "${umask_x}" STREQUAL "xxx")
 endmacro(CHECK_UMASK)
-IF(NOT WIN32)
+if(NOT WIN32)
   exec_program(umask ARGS -S OUTPUT_VARIABLE umask_curr)
   string(STRIP "${umask_curr}" umask_curr)
-  CHECK_UMASK("${umask_curr}" UMASK_OK)
+  check_umask("${umask_curr}" UMASK_OK)
   if (NOT UMASK_OK)
     message(" ")
     message(WARNING "umask is set to ${umask_curr} - this setting is not recommended if one of the goals of this build is to generate packages. Use 'umask 022' for improved package behavior.")
@@ -525,7 +525,7 @@
       execute_process(COMMAND ${SLEEP_EXEC} 1)
     endif(SLEEP_EXEC)
   endif (NOT UMASK_OK)
-ENDIF(NOT WIN32)
+endif(NOT WIN32)
 
 #---------------------------------------------------------------------
 # Unfortunately, CMake doesn't give you variables with current day,
@@ -537,12 +537,12 @@
 set(CONFIG_TIME_MONTH_FILE "${BRLCAD_BINARY_DIR}/include/conf/CONFIG_TIME_MONTH")
 set(CONFIG_TIME_YEAR_FILE "${BRLCAD_BINARY_DIR}/include/conf/CONFIG_TIME_YEAR")
 set(CONFIG_TIMESTAMP_FILE "${BRLCAD_BINARY_DIR}/include/conf/CONFIG_TIMESTAMP")
-DISTCLEAN(${CONFIG_TIME_DAY_FILE} ${CONFIG_TIME_MONTH_FILE}
+distclean(${CONFIG_TIME_DAY_FILE} ${CONFIG_TIME_MONTH_FILE}
   ${CONFIG_TIME_YEAR_FILE} ${CONFIG_TIMESTAMP_FILE})
 file(MAKE_DIRECTORY "${BRLCAD_BINARY_DIR}/include")
 file(MAKE_DIRECTORY "${BRLCAD_BINARY_DIR}/include/conf")
 configure_file(${BRLCAD_CMAKE_DIR}/test_srcs/time.c.in ${CMAKE_BINARY_DIR}/CMakeTmp/time.c)
-TRY_RUN(TIME_RESULT TIME_COMPILED
+try_run(TIME_RESULT TIME_COMPILED
   ${CMAKE_BINARY_DIR}/CMakeTmp
   ${CMAKE_BINARY_DIR}/CMakeTmp/time.c
   OUTPUT_VARIABLE COMPILEMESSAGES)
@@ -560,7 +560,7 @@
 
 #---------------------------------------------------------------------
 # print out the title with a pretty box computed to wrap around
-BOX_PRINT("*** Configuring BRL-CAD Release ${BRLCAD_VERSION}, Build ${CONFIG_DATE} ***" "*")
+box_print("*** Configuring BRL-CAD Release ${BRLCAD_VERSION}, Build ${CONFIG_DATE} ***" "*")
 
 #---------------------------------------------------------------------
 # CMake by default provides four different configurations for multi-
@@ -749,32 +749,32 @@
   endmacro(CONFIG_H_APPEND NEW_CONTENTS)
 endif(NOT COMMAND CONFIG_H_APPEND)
 
-CONFIG_H_APPEND(BRLCAD "/**** Define statements for CMake ****/\n")
-CONFIG_H_APPEND(BRLCAD "#ifndef __CONFIG_H__\n")
-CONFIG_H_APPEND(BRLCAD "#define __CONFIG_H__\n")
+config_h_append(BRLCAD "/**** Define statements for CMake ****/\n")
+config_h_append(BRLCAD "#ifndef __CONFIG_H__\n")
+config_h_append(BRLCAD "#define __CONFIG_H__\n")
 
 # If we're building on Windows, start off with the config_win.h file
 if(WIN32)
-  CONFIG_H_APPEND(BRLCAD "#include \"config_win_cmake.h\"\n")
+  config_h_append(BRLCAD "#include \"config_win_cmake.h\"\n")
 endif(WIN32)
 
 # Set up some of the define statements for path information and other basics
-CONFIG_H_APPEND(BRLCAD "#define PACKAGE \"brlcad\"\n")
-CONFIG_H_APPEND(BRLCAD "#define PACKAGE_BUGREPORT \"http://brlcad.org\"\n")
-CONFIG_H_APPEND(BRLCAD "#define PACKAGE_NAME \"BRL-CAD\"\n")
-CONFIG_H_APPEND(BRLCAD "#define PACKAGE_STRING \"BRL-CAD ${BRLCAD_VERSION}\"\n")
-CONFIG_H_APPEND(BRLCAD "#define PACKAGE_TARNAME \"brlcad\"\n")
-CONFIG_H_APPEND(BRLCAD "#define BRLCAD_DATA \"${CMAKE_INSTALL_PREFIX}/${DATA_DIR}\"\n")
-CONFIG_H_APPEND(BRLCAD "#define BRLCAD_DATA_SUBPATH \"${DATA_DIR}\"\n")
-CONFIG_H_APPEND(BRLCAD "#define BRLCAD_ROOT \"${CMAKE_INSTALL_PREFIX}\"\n")
-CONFIG_H_APPEND(BRLCAD "#define BRLCAD_BIN_DIR \"${BIN_DIR}\"\n")
-CONFIG_H_APPEND(BRLCAD "#define BRLCAD_LIB_DIR \"${LIB_DIR}\"\n")
-CONFIG_H_APPEND(BRLCAD "#define BRLCAD_INCLUDE_DIR \"${INCLUDE_DIR}\"\n")
-CONFIG_H_APPEND(BRLCAD "#define BRLCAD_DATA_DIR \"${DATA_DIR}\"\n")
-CONFIG_H_APPEND(BRLCAD "#define BRLCAD_DOC_DIR \"${DOC_DIR}\"\n")
-CONFIG_H_APPEND(BRLCAD "#define BRLCAD_MAN_DIR \"${MAN_DIR}\"\n")
-CONFIG_H_APPEND(BRLCAD "#define PACKAGE_VERSION \"${BRLCAD_VERSION}\"\n")
-CONFIG_H_APPEND(BRLCAD "#define VERSION \"${BRLCAD_VERSION}\"\n")
+config_h_append(BRLCAD "#define PACKAGE \"brlcad\"\n")
+config_h_append(BRLCAD "#define PACKAGE_BUGREPORT \"http://brlcad.org\"\n")
+config_h_append(BRLCAD "#define PACKAGE_NAME \"BRL-CAD\"\n")
+config_h_append(BRLCAD "#define PACKAGE_STRING \"BRL-CAD ${BRLCAD_VERSION}\"\n")
+config_h_append(BRLCAD "#define PACKAGE_TARNAME \"brlcad\"\n")
+config_h_append(BRLCAD "#define BRLCAD_DATA \"${CMAKE_INSTALL_PREFIX}/${DATA_DIR}\"\n")
+config_h_append(BRLCAD "#define BRLCAD_DATA_SUBPATH \"${DATA_DIR}\"\n")
+config_h_append(BRLCAD "#define BRLCAD_ROOT \"${CMAKE_INSTALL_PREFIX}\"\n")
+config_h_append(BRLCAD "#define BRLCAD_BIN_DIR \"${BIN_DIR}\"\n")
+config_h_append(BRLCAD "#define BRLCAD_LIB_DIR \"${LIB_DIR}\"\n")
+config_h_append(BRLCAD "#define BRLCAD_INCLUDE_DIR \"${INCLUDE_DIR}\"\n")
+config_h_append(BRLCAD "#define BRLCAD_DATA_DIR \"${DATA_DIR}\"\n")
+config_h_append(BRLCAD "#define BRLCAD_DOC_DIR \"${DOC_DIR}\"\n")
+config_h_append(BRLCAD "#define BRLCAD_MAN_DIR \"${MAN_DIR}\"\n")
+config_h_append(BRLCAD "#define PACKAGE_VERSION \"${BRLCAD_VERSION}\"\n")
+config_h_append(BRLCAD "#define VERSION \"${BRLCAD_VERSION}\"\n")
 
 #----------------------------------------------------------------------
 # Decide whether to do a 32 or a 64 bit build.
@@ -799,7 +799,7 @@
 endif(MSVC)
 
 # calculate the size of a pointer if we haven't already
-CHECK_TYPE_SIZE("void *" CMAKE_SIZEOF_VOID_P)
+check_type_size("void *" CMAKE_SIZEOF_VOID_P)
 
 # still not defined?
 if(NOT CMAKE_SIZEOF_VOID_P)
@@ -828,7 +828,7 @@
 else(${BRLCAD_WORD_SIZE} MATCHES "AUTO")
   set(CMAKE_WORD_SIZE "${BRLCAD_WORD_SIZE}")
 endif(${BRLCAD_WORD_SIZE} MATCHES "AUTO")
-CONFIG_H_APPEND(BRLCAD "#define SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P}\n")
+config_h_append(BRLCAD "#define SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P}\n")
 
 # Enable/disable 64-bit build settings for MSVC, which is apparently
 # determined at the CMake generator level - need to override other
@@ -871,7 +871,7 @@
 if(PREVIOUS_CONFIGURE_TYPE)
   if(NOT ${PREVIOUS_CONFIGURE_TYPE} MATCHES ${CMAKE_WORD_SIZE})
     include(${BRLCAD_CMAKE_DIR}/ResetCache.cmake)
-    RESET_CACHE_file()
+    reset_cache_file()
   endif(NOT ${PREVIOUS_CONFIGURE_TYPE} MATCHES ${CMAKE_WORD_SIZE})
 endif(PREVIOUS_CONFIGURE_TYPE)
 
@@ -928,7 +928,7 @@
 # when OFF.  For multi-configuration options the build type determination
 # is made at build time, so just default to "ON".
 if(NOT CMAKE_CONFIGURATION_TYPES)
-  AUTO_OPTION(BRLCAD_BUILD_STATIC_LIBS BUILD_STATIC_LIBS "OFF" "ON")
+  auto_option(BRLCAD_BUILD_STATIC_LIBS BUILD_STATIC_LIBS "OFF" "ON")
 else(NOT CMAKE_CONFIGURATION_TYPES)
   if("${BRLCAD_BUILD_STATIC_LIBS}" STREQUAL "")
     set(BRLCAD_BUILD_STATIC_LIBS ON)
@@ -946,8 +946,8 @@
 # Option for librtserver, used to help Java programs interface with librt.
 # Find Java and JNI, and conditionalize the default setting on Java's
 # availability
-FIND_PACKAGE(Java)
-FIND_PACKAGE(JNI)
+find_package(Java)
+find_package(JNI)
 if(JNI_FOUND AND JAVA_FOUND)
   option(BRLCAD_ENABLE_RTSERVER "Enable the librtserver target." ON)
 else(JNI_FOUND AND JAVA_FOUND)
@@ -979,7 +979,7 @@
 else(MSVC)
   set(BRLCAD_BUNDLED_LIBS_DEFAULT "AUTO")
 endif(MSVC)
-BRLCAD_OPTION(${BRLCAD_BUNDLED_LIBS_DEFAULT} BRLCAD_BUNDLED_LIBS BRLCAD_BUNDLED_LIBS_ALIASES BRLCAD_BUNDLED_LIBS_DESCRIPTION)
+brlcad_option(${BRLCAD_BUNDLED_LIBS_DEFAULT} BRLCAD_BUNDLED_LIBS BRLCAD_BUNDLED_LIBS_ALIASES BRLCAD_BUNDLED_LIBS_DESCRIPTION)
 set_property(CACHE BRLCAD_BUNDLED_LIBS PROPERTY STRINGS AUTO BUNDLED SYSTEM)
 string(TOUPPER "${BRLCAD_BUNDLED_LIBS}" BRLCAD_BUNDLED_LIBS_UPPER)
 set(BRLCAD_BUNDLED_LIBS "${BRLCAD_BUNDLED_LIBS_UPPER}" CACHE STRING "Build bundled libraries." FORCE)
@@ -1066,7 +1066,7 @@
 Default depends on whether OpenGL is successfully detected -
 if it is, default is to enable.
 ")
-BRLCAD_OPTION(${OPENGL_FOUND} BRLCAD_ENABLE_OPENGL	BRLCAD_ENABLE_OPENGL_ALIASES BRLCAD_ENABLE_OPENGL_DESCRIPTION)
+brlcad_option(${OPENGL_FOUND} BRLCAD_ENABLE_OPENGL	BRLCAD_ENABLE_OPENGL_ALIASES BRLCAD_ENABLE_OPENGL_DESCRIPTION)
 
 # Enable RTGL.  Requires an enabled OpenGL.
 option(BRLCAD_ENABLE_RTGL "Enable experimental RTGL code." OFF)
@@ -1110,7 +1110,7 @@
 Default is "ON", and should only be disabled for read-only render
 work where performance is critical.
 ")
-BRLCAD_OPTION(ON BRLCAD_ENABLE_RUNTIME_DEBUG BRLCAD_ENABLE_RUNTIME_DEBUG_ALIASES BRLCAD_ENABLE_RUNTIME_DEBUG_DESCRIPTION)
+brlcad_option(ON BRLCAD_ENABLE_RUNTIME_DEBUG BRLCAD_ENABLE_RUNTIME_DEBUG_ALIASES BRLCAD_ENABLE_RUNTIME_DEBUG_DESCRIPTION)
 mark_as_advanced(BRLCAD_ENABLE_RUNTIME_DEBUG)
 if(NOT BRLCAD_ENABLE_RUNTIME_DEBUG)
   message("}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}")
@@ -1121,14 +1121,14 @@
   message("in the inevitable event of a user encountering a bug.")
   message("You have been warned.  Proceed at your own risk.")
   message("{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{")
-  CONFIG_H_APPEND(BRLCAD "/*Define to not do anything for macros that only bomb on a fatal error. */\n")
-  CONFIG_H_APPEND(BRLCAD "#define NO_BOMBING_MACROS 1\n")
-  CONFIG_H_APPEND(BRLCAD "/*Define to not perform magic number checking */\n")
-  CONFIG_H_APPEND(BRLCAD "#define NO_MAGIC_CHECKING 1\n")
-  CONFIG_H_APPEND(BRLCAD "/*Define to not check for divide by zero during ray shots */\n")
-  CONFIG_H_APPEND(BRLCAD "#define NO_BADRAY_CHECKING 1\n")
-  CONFIG_H_APPEND(BRLCAD "/*Define to not provide run-time debug facilities via rt_g.debug */\n")
-  CONFIG_H_APPEND(BRLCAD "#define NO_DEBUG_CHECKING 1\n")
+  config_h_append(BRLCAD "/*Define to not do anything for macros that only bomb on a fatal error. */\n")
+  config_h_append(BRLCAD "#define NO_BOMBING_MACROS 1\n")
+  config_h_append(BRLCAD "/*Define to not perform magic number checking */\n")
+  config_h_append(BRLCAD "#define NO_MAGIC_CHECKING 1\n")
+  config_h_append(BRLCAD "/*Define to not check for divide by zero during ray shots */\n")
+  config_h_append(BRLCAD "#define NO_BADRAY_CHECKING 1\n")
+  config_h_append(BRLCAD "/*Define to not provide run-time debug facilities via rt_g.debug */\n")
+  config_h_append(BRLCAD "#define NO_DEBUG_CHECKING 1\n")
 endif(NOT BRLCAD_ENABLE_RUNTIME_DEBUG)
 
 # Enable debug flags during compilation - we always want to use these
@@ -1141,12 +1141,12 @@
 set(BRLCAD_FLAGS_DEBUG_DESCRIPTION "
 Add compiler flags to aid in program debugging.  Defaults to ON.
 ")
-BRLCAD_OPTION(ON BRLCAD_FLAGS_DEBUG BRLCAD_FLAGS_DEBUG_ALIASES BRLCAD_FLAGS_DEBUG_DESCRIPTION)
+brlcad_option(ON BRLCAD_FLAGS_DEBUG BRLCAD_FLAGS_DEBUG_ALIASES BRLCAD_FLAGS_DEBUG_DESCRIPTION)
 
 # A variety of debugging messages in the code key off of the DEBUG
 # definition - set it according to whether we're using debug flags.
 if(BRLCAD_FLAGS_DEBUG)
-  CONFIG_H_APPEND(BRLCAD "#define DEBUG 1\n")
+  config_h_append(BRLCAD "#define DEBUG 1\n")
 endif(BRLCAD_FLAGS_DEBUG)
 
 # Build with compiler warning flags
@@ -1157,7 +1157,7 @@
 set(BRLCAD_ENABLE_COMPILER_WARNINGS_DESCRIPTION "
 Use extra compiler warning flags when compiling C/C++ code.  Defaults to ON.
 ")
-BRLCAD_OPTION(ON BRLCAD_ENABLE_COMPILER_WARNINGS
+brlcad_option(ON BRLCAD_ENABLE_COMPILER_WARNINGS
   BRLCAD_ENABLE_COMPILER_WARNINGS_ALIASES
   BRLCAD_ENABLE_COMPILER_WARNINGS_DESCRIPTION)
 mark_as_advanced(BRLCAD_ENABLE_COMPILER_WARNINGS)
@@ -1177,15 +1177,15 @@
 discovered by these flags whenever possible rather than disabling strict
 mode.
 ")
-BRLCAD_OPTION(ON BRLCAD_ENABLE_STRICT BRLCAD_ENABLE_STRICT_ALIASES BRLCAD_ENABLE_STRICT_DESCRIPTION)
+brlcad_option(ON BRLCAD_ENABLE_STRICT BRLCAD_ENABLE_STRICT_ALIASES BRLCAD_ENABLE_STRICT_DESCRIPTION)
 if(BRLCAD_ENABLE_STRICT)
   mark_as_advanced(BRLCAD_ENABLE_STRICT)
-  CONFIG_H_APPEND(BRLCAD "#define STRICT_FLAGS 1\n")
+  config_h_append(BRLCAD "#define STRICT_FLAGS 1\n")
 endif(BRLCAD_ENABLE_STRICT)
 
 # Build with compiler optimization flags.  This should normally be on for
 # release builds.
-AUTO_OPTION(BRLCAD_FLAGS_OPTIMIZATION BRLCAD_OPTIMIZED_BUILD "OFF" "ON")
+auto_option(BRLCAD_FLAGS_OPTIMIZATION BRLCAD_OPTIMIZED_BUILD "OFF" "ON")
 
 # By default, we don't want any error reports at all from src/other
 option(BRLCAD_DISABLE_SRC_OTHER_WARN "Disable warnings for src/other" ON)
@@ -1207,7 +1207,7 @@
 option(BRLCAD_ENABLE_DTRACE "Build with dtrace support" OFF)
 mark_as_advanced(BRLCAD_ENABLE_DTRACE)
 if(BRLCAD_ENABLE_DTRACE)
-  BRLCAD_INCLUDE_FILE(sys/sdt.h HAVE_SYS_SDT_H)
+  brlcad_include_file(sys/sdt.h HAVE_SYS_SDT_H)
   if(NOT HAVE_SYS_SDT_H)
     set(BRLCAD_ENABLE_DTRACE OFF)
   endif(NOT HAVE_SYS_SDT_H)
@@ -1221,7 +1221,7 @@
 endif(WIN32 AND BRLCAD_ENABLE_SMP)
 mark_as_advanced(BRLCAD_ENABLE_SMP)
 if(BRLCAD_ENABLE_SMP)
-  CONFIG_H_APPEND(BRLCAD "#define PARALLEL 1\n")
+  config_h_append(BRLCAD "#define PARALLEL 1\n")
 endif(BRLCAD_ENABLE_SMP)
 
 #----------------------------------------------------------------------
@@ -1277,7 +1277,7 @@
 to point to your locally installed fop executable file (which on Linux is
 usually a shell script with 0755 permissions).
 ")
-BRLCAD_OPTION(${EXTRADOCS_DEFAULT} BRLCAD_EXTRADOCS BRLCAD_EXTRADOCS_ALIASES BRLCAD_EXTRADOCS_DESCRIPTION)
+brlcad_option(${EXTRADOCS_DEFAULT} BRLCAD_EXTRADOCS BRLCAD_EXTRADOCS_ALIASES BRLCAD_EXTRADOCS_DESCRIPTION)
 
 include(CMakeDependentOption)
 
@@ -1285,7 +1285,7 @@
 # as well as being the most likely candidate for external viewers. Turn this
 # on unless explicitly instructed otherwise by the user or all extra
 # documentation is disabled.
-CMAKE_DEPENDENT_OPTION(BRLCAD_EXTRADOCS_HTML "Build MAN page output from DocBook documentation" ON "BRLCAD_EXTRADOCS" OFF)
+cmake_dependent_option(BRLCAD_EXTRADOCS_HTML "Build MAN page output from DocBook documentation" ON "BRLCAD_EXTRADOCS" OFF)
 mark_as_advanced(BRLCAD_EXTRADOCS_HTML)
 
 # Normally, we'll turn on man page output by default, but there is
@@ -1293,7 +1293,7 @@
 # files aren't useful and it *seriously* increases the target build
 # count/build time.  Conditionalize on the CMake MSVC variable NOT
 # being set.
-CMAKE_DEPENDENT_OPTION(BRLCAD_EXTRADOCS_MAN "Build MAN page output from DocBook documentation" ON "BRLCAD_EXTRADOCS;NOT MSVC" OFF)
+cmake_dependent_option(BRLCAD_EXTRADOCS_MAN "Build MAN page output from DocBook documentation" ON "BRLCAD_EXTRADOCS;NOT MSVC" OFF)
 mark_as_advanced(BRLCAD_EXTRADOCS_MAN)
 
 # Don't do PDF by default, and hide the option unless the tools to do it are
@@ -1312,8 +1312,8 @@
 Option that enables building of BRL-CAD's DocBook PDF-based documentation
 for man pages only.  Defaults to OFF.
 ")
-CMAKE_DEPENDENT_OPTION(BRLCAD_EXTRADOCS_PDF "Build PDF output from DocBook documentation" OFF "BRLCAD_EXTRADOCS;APACHE_FOP" OFF)
-CMAKE_DEPENDENT_OPTION(BRLCAD_EXTRADOCS_PDF_MAN "Build PDF output from DocBook documentation for man pages" ON "BRLCAD_EXTRADOCS_PDF" OFF)
+cmake_dependent_option(BRLCAD_EXTRADOCS_PDF "Build PDF output from DocBook documentation" OFF "BRLCAD_EXTRADOCS;APACHE_FOP" OFF)
+cmake_dependent_option(BRLCAD_EXTRADOCS_PDF_MAN "Build PDF output from DocBook documentation for man pages" ON "BRLCAD_EXTRADOCS_PDF" OFF)
 
 # Provide an option to enable/disable XML validation as part
 # of the DocBook build - sort of a "strict flags" mode for DocBook.
@@ -1324,7 +1324,7 @@
 # unless build target counts >1800 are beyond MSVC's practical
 # limit.  Until we either find a resolution or a way to reduce
 # the target count on MSVC, disable validation there.
-CMAKE_DEPENDENT_OPTION(BRLCAD_EXTRADOCS_VALIDATE "Perform validation for DocBook documentation" ON "BRLCAD_EXTRADOCS;BRLCAD_ENABLE_STRICT" OFF)
+cmake_dependent_option(BRLCAD_EXTRADOCS_VALIDATE "Perform validation for DocBook documentation" ON "BRLCAD_EXTRADOCS;BRLCAD_ENABLE_STRICT" OFF)
 mark_as_advanced(BRLCAD_EXTRADOCS_VALIDATE)
 
 
@@ -1367,7 +1367,7 @@
 
 # determine whether the compiler supports an 'inline' keyword variant
 include(${BRLCAD_CMAKE_DIR}/CheckCInline.cmake)
-CHECK_C_INLINE(C_INLINE)
+check_c_inline(C_INLINE)
 if(NOT C_INLINE STREQUAL "inline")
   add_definitions("-Dinline=${C_INLINE}")
 endif(NOT C_INLINE STREQUAL "inline")
@@ -1389,7 +1389,7 @@
 # functions (e.g., memcpy), and provides run-time checks on buffer
 # lengths and memory regions.
 if(${BRLCAD_DEBUG_BUILD} MATCHES "ON")
-  CONFIG_H_APPEND(BRLCAD "#define _FORTIFY_SOURCE 2\n")
+  config_h_append(BRLCAD "#define _FORTIFY_SOURCE 2\n")
 endif(${BRLCAD_DEBUG_BUILD} MATCHES "ON")
 
 #CHECK_C_COMPILER_FLAG("Wl,--no-undefined" NO_UNDEFINED_LINKER_FLAG)
@@ -1412,29 +1412,29 @@
 # The variable CMAKE_THREAD_LIBS_INIT is the one of interest
 # when writing target_link_libraries lists.
 find_package(Threads)
-BRLCAD_INCLUDE_FILE(pthread.h HAVE_PTHREAD_H)
+brlcad_include_file(pthread.h HAVE_PTHREAD_H)
 
 # Check for the C++ STL library - need to link it explicitly in
 # some compilation situations
 find_package(STL)
 
 # Check for the daemon function in -lbsd and/or -lc for adrt
-BRLCAD_CHECK_LIBRARY(BSD bsd daemon)
-BRLCAD_CHECK_LIBRARY(BSD c daemon)
+brlcad_check_library(BSD bsd daemon)
+brlcad_check_library(BSD c daemon)
 
 # Check for CoreFoundation, Carbon and Cocoa on Apple
 if(APPLE)
   include(CMakeFindFrameworks)
-  CMAKE_FIND_FRAMEWORKS(CoreFoundation)
+  cmake_find_frameworks(CoreFoundation)
   if(CoreFoundation_FRAMEWORKS)
     set(CoreFoundation_LIBRARIES "-framework CoreFoundation" CACHE FILEPATH "CoreFoundation framework" FORCE)
   endif(CoreFoundation_FRAMEWORKS)
-  CMAKE_FIND_FRAMEWORKS(Carbon)
+  cmake_find_frameworks(Carbon)
   if(Carbon_FRAMEWORKS)
     set(Carbon_LIBRARIES "-framework Carbon" CACHE FILEPATH "Carbon framework" FORCE)
   endif(Carbon_FRAMEWORKS)
-  BRLCAD_INCLUDE_FILE(Carbon/Carbon.h HAVE_CARBON_CARBON_H)
-  CMAKE_FIND_FRAMEWORKS(Cocoa)
+  brlcad_include_file(Carbon/Carbon.h HAVE_CARBON_CARBON_H)
+  cmake_find_frameworks(Cocoa)
   if(Cocoa_FRAMEWORKS)
     set(Cocoa_LIBRARIES "-framework Cocoa" CACHE FILEPATH "Cocoa framework" FORCE)
   endif(Cocoa_FRAMEWORKS)
@@ -1443,13 +1443,13 @@
 endif(APPLE)
 
 # crypt library (needed on some platforms for enigma)
-FIND_LIBRARY(CRYPT_LIBRARY NAMES crypt)
+find_library(CRYPT_LIBRARY NAMES crypt)
 mark_as_advanced(CRYPT_LIBRARY)
 
 # Do some extra Java related checks.
 if(JNI_FOUND AND JAVA_FOUND)
-  BRLCAD_INCLUDE_FILE(JavaVM/jni.h HAVE_JAVAVM_JNI_H)
-  BRLCAD_INCLUDE_FILE(jni.h HAVE_JNI_H "${JNI_INCLUDE_DIRS}")
+  brlcad_include_file(JavaVM/jni.h HAVE_JAVAVM_JNI_H)
+  brlcad_include_file(jni.h HAVE_JNI_H "${JNI_INCLUDE_DIRS}")
   if(NOT HAVE_JNI_H AND NOT HAVE_JAVAVM_JNI_H AND BRLCAD_ENABLE_RTSERVER)
     set(BRLCAD_ENABLE_RTSERVER OFF CACHE BOOL "RT server disabled due to unsatisfied Java requirements" FORCE)
     message("librtserver build requested, but JNI header not found - disabling")
@@ -1466,31 +1466,31 @@
 if(BRLCAD_ENABLE_X11)
   if(X11_Xlib_INCLUDE_PATH AND CONFIG_H_FILE)
     set(HAVE_X11_XLIB_H 1)
-    CONFIG_H_APPEND(BRLCAD "#cmakedefine HAVE_X11_XLIB_H 1\n")
+    config_h_append(BRLCAD "#cmakedefine HAVE_X11_XLIB_H 1\n")
   endif(X11_Xlib_INCLUDE_PATH AND CONFIG_H_FILE)
 endif(BRLCAD_ENABLE_X11)
 
 # math library
-BRLCAD_CHECK_LIBRARY(M m cos)
+brlcad_check_library(M m cos)
 
 # network socket library (linux, bsd)
-BRLCAD_CHECK_LIBRARY(SOCKET socket socket)
+brlcad_check_library(SOCKET socket socket)
 
 # network socket library (solaris)
-BRLCAD_CHECK_LIBRARY(NSL nsl gethostbyaddr)
+brlcad_check_library(NSL nsl gethostbyaddr)
 
 # network socket library (haiku, beos)
-BRLCAD_CHECK_LIBRARY(NETWORK network socket)
+brlcad_check_library(NETWORK network socket)
 
 # malloc library
-BRLCAD_CHECK_LIBRARY(MALLOC c mallopt)
-BRLCAD_CHECK_LIBRARY(MALLOC malloc mallopt)
+brlcad_check_library(MALLOC c mallopt)
+brlcad_check_library(MALLOC malloc mallopt)
 
 # dynamic link library
-BRLCAD_CHECK_LIBRARY(DL dl dlopen)
+brlcad_check_library(DL dl dlopen)
 
 # Solaris lexer library
-BRLCAD_CHECK_LIBRARY(SOLARIS_LEXER l yyless)
+brlcad_check_library(SOLARIS_LEXER l yyless)
 
 # *******************************************************************
 # ***             Check for Headers - Stage 5 of 9                ***
@@ -1520,91 +1520,91 @@
 # Because libtclcad, bwish and mged include Tcl headers, we need to define
 # STDC_HEADERS here - the Tcl headers do need the definition.  Just
 # define it - we require C89, so the test itself is not needed.
-CONFIG_H_APPEND(BRLCAD "#define STDC_HEADERS 1\n")
+config_h_append(BRLCAD "#define STDC_HEADERS 1\n")
 
 # AC_HEADER_SYS_WAIT
-BRLCAD_HEADER_SYS_WAIT()
+brlcad_header_sys_wait()
 # dirent.h is POSIX.1, but not present on Windows (grr)
 # so we need to check for it
-BRLCAD_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
+brlcad_include_file(dirent.h HAVE_DIRENT_H)
 
 # Need to compare this with the configure.ac list
-BRLCAD_INCLUDE_FILE(arpa/inet.h HAVE_ARPA_INET_H)
-BRLCAD_INCLUDE_FILE(curses.h HAVE_CURSES_H)
-BRLCAD_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
-BRLCAD_INCLUDE_FILE(dslib.h HAVE_DSLIB_H)
-BRLCAD_INCLUDE_FILE(emmintrin.h HAVE_EMMINTRIN_H)
-BRLCAD_INCLUDE_FILE(getopt.h HAVE_GETOPT_H)
-BRLCAD_INCLUDE_FILE(gl/device.h HAVE_GL_DEVICE_H)
-BRLCAD_INCLUDE_FILE(gl/glext.h HAVE_GL_GLEXT_H)
-BRLCAD_INCLUDE_FILE(gl/wglext.h HAVE_GL_WGLEXT_H)
-BRLCAD_INCLUDE_FILE(grp.h HAVE_GRP_H)
-BRLCAD_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
-BRLCAD_INCLUDE_FILE(io.h HAVE_IO_H)
-BRLCAD_INCLUDE_FILE(libgen.h HAVE_LIBGEN_H)
-BRLCAD_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
-BRLCAD_INCLUDE_FILE(ncurses.h HAVE_NCURSES_H)
-BRLCAD_INCLUDE_FILE(netdb.h HAVE_NETDB_H)
-BRLCAD_INCLUDE_FILE(netinet/in.h HAVE_NETINET_IN_H)
-BRLCAD_INCLUDE_FILE(poll.h HAVE_POLL_H)
-BRLCAD_INCLUDE_FILE(pwd.h HAVE_PWD_H)
-BRLCAD_INCLUDE_FILE(rle.h HAVE_RLE_H)
-BRLCAD_INCLUDE_FILE(sched.h HAVE_SCHED_H)
-BRLCAD_INCLUDE_FILE(sgtty.h HAVE_SGTTY_H)
-BRLCAD_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
-BRLCAD_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
-BRLCAD_INCLUDE_FILE(string.h HAVE_STRING_H)
-BRLCAD_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
-BRLCAD_INCLUDE_FILE(sys/_ioctl.h HAVE_SYS__IOCTL_H)
-BRLCAD_INCLUDE_FILE(sys/file.h HAVE_SYS_FILE_H)
-BRLCAD_INCLUDE_FILE(sys/ioctl.h HAVE_SYS_IOCTL_H)
-BRLCAD_INCLUDE_FILE(sys/ioctl_compat.h HAVE_SYS_IOCTL_COMPAT_H)
-BRLCAD_INCLUDE_FILE(sys/machd.h HAVE_SYS_MACHD_H)
-BRLCAD_INCLUDE_FILE(sys/mman.h HAVE_SYS_MMAN_H)
-BRLCAD_INCLUDE_FILE(sys/mount.h HAVE_SYS_MOUNT_H)
-BRLCAD_INCLUDE_FILE(sys/param.h HAVE_SYS_PARAM_H)
-BRLCAD_INCLUDE_FILE(sys/prctl.h HAVE_SYS_PRCTL_H)
-BRLCAD_INCLUDE_FILE(sys/resource.h HAVE_SYS_RESOURCE_H)
-BRLCAD_INCLUDE_FILE(sys/sched.h HAVE_SYS_SCHED_H)
-BRLCAD_INCLUDE_FILE(sys/select.h HAVE_SYS_SELECT_H)
-BRLCAD_INCLUDE_FILE(sys/socket.h HAVE_SYS_SOCKET_H)
-BRLCAD_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
-BRLCAD_INCLUDE_FILE(sys/sysctl.h HAVE_SYS_SYSCTL_H)
-BRLCAD_INCLUDE_FILE(sys/sysinfo.h HAVE_SYS_SYSINFO_H)
-BRLCAD_INCLUDE_FILE(sys/sysmp.h HAVE_SYS_SYSMP_H)
-BRLCAD_INCLUDE_FILE(sys/time.h HAVE_SYS_TIME_H)
-BRLCAD_INCLUDE_FILE(sys/times.h HAVE_SYS_TIMES_H)
-BRLCAD_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
-BRLCAD_INCLUDE_FILE(sys/un.h HAVE_SYS_UN_H)
-BRLCAD_INCLUDE_FILE(sys/wait.h HAVE_SYS_WAIT_H)
-BRLCAD_INCLUDE_FILE(syslog.h HAVE_SYSLOG_H)
-BRLCAD_INCLUDE_FILE(term.h HAVE_TERM_H)
-BRLCAD_INCLUDE_FILE(termcap.h HAVE_TERMCAP_H)
-BRLCAD_INCLUDE_FILE(terminfo.h HAVE_TERMINFO_H)
-BRLCAD_INCLUDE_FILE(termio.h HAVE_TERMIO_H)
-BRLCAD_INCLUDE_FILE(termios.h HAVE_TERMIOS_H)
-BRLCAD_INCLUDE_FILE(termlib.h HAVE_TERMLIB_H)
-BRLCAD_INCLUDE_FILE(tinfo.h HAVE_TINFO_H)
-BRLCAD_INCLUDE_FILE(ulocks.h HAVE_ULOCKS_H)
-BRLCAD_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
-BRLCAD_INCLUDE_FILE(windows.h HAVE_WINDOWS_H) # for QueryPerformanceCounter() on Windows
-BRLCAD_INCLUDE_FILE(winsock.h HAVE_WINSOCK_H)
+brlcad_include_file(arpa/inet.h HAVE_ARPA_INET_H)
+brlcad_include_file(curses.h HAVE_CURSES_H)
+brlcad_include_file(dlfcn.h HAVE_DLFCN_H)
+brlcad_include_file(dslib.h HAVE_DSLIB_H)
+brlcad_include_file(emmintrin.h HAVE_EMMINTRIN_H)
+brlcad_include_file(getopt.h HAVE_GETOPT_H)
+brlcad_include_file(gl/device.h HAVE_GL_DEVICE_H)
+brlcad_include_file(gl/glext.h HAVE_GL_GLEXT_H)
+brlcad_include_file(gl/wglext.h HAVE_GL_WGLEXT_H)
+brlcad_include_file(grp.h HAVE_GRP_H)
+brlcad_include_file(inttypes.h HAVE_INTTYPES_H)
+brlcad_include_file(io.h HAVE_IO_H)
+brlcad_include_file(libgen.h HAVE_LIBGEN_H)
+brlcad_include_file(memory.h HAVE_MEMORY_H)
+brlcad_include_file(ncurses.h HAVE_NCURSES_H)
+brlcad_include_file(netdb.h HAVE_NETDB_H)
+brlcad_include_file(netinet/in.h HAVE_NETINET_IN_H)
+brlcad_include_file(poll.h HAVE_POLL_H)
+brlcad_include_file(pwd.h HAVE_PWD_H)
+brlcad_include_file(rle.h HAVE_RLE_H)
+brlcad_include_file(sched.h HAVE_SCHED_H)
+brlcad_include_file(sgtty.h HAVE_SGTTY_H)
+brlcad_include_file(stdint.h HAVE_STDINT_H)
+brlcad_include_file(stdlib.h HAVE_STDLIB_H)
+brlcad_include_file(string.h HAVE_STRING_H)
+brlcad_include_file(strings.h HAVE_STRINGS_H)
+brlcad_include_file(sys/_ioctl.h HAVE_SYS__IOCTL_H)
+brlcad_include_file(sys/file.h HAVE_SYS_FILE_H)
+brlcad_include_file(sys/ioctl.h HAVE_SYS_IOCTL_H)
+brlcad_include_file(sys/ioctl_compat.h HAVE_SYS_IOCTL_COMPAT_H)
+brlcad_include_file(sys/machd.h HAVE_SYS_MACHD_H)
+brlcad_include_file(sys/mman.h HAVE_SYS_MMAN_H)
+brlcad_include_file(sys/mount.h HAVE_SYS_MOUNT_H)
+brlcad_include_file(sys/param.h HAVE_SYS_PARAM_H)
+brlcad_include_file(sys/prctl.h HAVE_SYS_PRCTL_H)
+brlcad_include_file(sys/resource.h HAVE_SYS_RESOURCE_H)
+brlcad_include_file(sys/sched.h HAVE_SYS_SCHED_H)
+brlcad_include_file(sys/select.h HAVE_SYS_SELECT_H)
+brlcad_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
+brlcad_include_file(sys/stat.h HAVE_SYS_STAT_H)
+brlcad_include_file(sys/sysctl.h HAVE_SYS_SYSCTL_H)
+brlcad_include_file(sys/sysinfo.h HAVE_SYS_SYSINFO_H)
+brlcad_include_file(sys/sysmp.h HAVE_SYS_SYSMP_H)
+brlcad_include_file(sys/time.h HAVE_SYS_TIME_H)
+brlcad_include_file(sys/times.h HAVE_SYS_TIMES_H)
+brlcad_include_file(sys/types.h HAVE_SYS_TYPES_H)
+brlcad_include_file(sys/un.h HAVE_SYS_UN_H)
+brlcad_include_file(sys/wait.h HAVE_SYS_WAIT_H)
+brlcad_include_file(syslog.h HAVE_SYSLOG_H)
+brlcad_include_file(term.h HAVE_TERM_H)
+brlcad_include_file(termcap.h HAVE_TERMCAP_H)
+brlcad_include_file(terminfo.h HAVE_TERMINFO_H)
+brlcad_include_file(termio.h HAVE_TERMIO_H)
+brlcad_include_file(termios.h HAVE_TERMIOS_H)
+brlcad_include_file(termlib.h HAVE_TERMLIB_H)
+brlcad_include_file(tinfo.h HAVE_TINFO_H)
+brlcad_include_file(ulocks.h HAVE_ULOCKS_H)
+brlcad_include_file(unistd.h HAVE_UNISTD_H)
+brlcad_include_file(windows.h HAVE_WINDOWS_H) # for QueryPerformanceCounter() on Windows
+brlcad_include_file(winsock.h HAVE_WINSOCK_H)
 
 # C++
-BRLCAD_INCLUDE_FILE_CXX(istream HAVE_ISTREAM)
-BRLCAD_INCLUDE_FILE_CXX(limits HAVE_LIMITS)
+brlcad_include_file_cxx(istream HAVE_ISTREAM)
+brlcad_include_file_cxx(limits HAVE_LIMITS)
 
 # Other special-case tests that need custom macros
-BRLCAD_CHECK_BASENAME()
-BRLCAD_CHECK_DIRNAME()
+brlcad_check_basename()
+brlcad_check_dirname()
 
 # OpenGL headers
 if(BRLCAD_ENABLE_OPENGL)
   if(OPENGL_INCLUDE_DIR_GL)
-    CONFIG_H_APPEND(BRLCAD "#define HAVE_GL_GL_H 1\n")
+    config_h_append(BRLCAD "#define HAVE_GL_GL_H 1\n")
   endif(OPENGL_INCLUDE_DIR_GL)
   if(OPENGL_INCLUDE_DIR_GLX)
-    CONFIG_H_APPEND(BRLCAD "#define HAVE_GL_GLX_H 1\n")
+    config_h_append(BRLCAD "#define HAVE_GL_GLX_H 1\n")
   endif(OPENGL_INCLUDE_DIR_GLX)
 endif(BRLCAD_ENABLE_OPENGL)
 
@@ -1613,27 +1613,27 @@
 # ***         Check for Types/Structures - Stage 6 of 9           ***
 # *******************************************************************
 
-BRLCAD_STRUCT_MEMBER("struct stat" st_blksize sys/stat.h STRUCT_STAT_ST_BLKSIZE)
-BRLCAD_STRUCT_MEMBER("struct stat" st_blocks sys/stat.h STRUCT_STAT_ST_BLOCKS)
-BRLCAD_STRUCT_MEMBER("struct stat" st_rdev sys/stat.h STRUCT_STAT_ST_RDEV)
+brlcad_struct_member("struct stat" st_blksize sys/stat.h STRUCT_STAT_ST_BLKSIZE)
+brlcad_struct_member("struct stat" st_blocks sys/stat.h STRUCT_STAT_ST_BLOCKS)
+brlcad_struct_member("struct stat" st_rdev sys/stat.h STRUCT_STAT_ST_RDEV)
 
 # socklen_t
-BRLCAD_TYPE_SIZE("socklen_t" "sys/types.h")
+brlcad_type_size("socklen_t" "sys/types.h")
 if(NOT HAVE_SOCKLEN_T)
-  BRLCAD_TYPE_SIZE("socklen_t" "sys/socket.h")
+  brlcad_type_size("socklen_t" "sys/socket.h")
 endif(NOT HAVE_SOCKLEN_T)
 
-BRLCAD_TYPE_SIZE("int" "")
-BRLCAD_TYPE_SIZE("long" "")
-BRLCAD_TYPE_SIZE("long long" "")
-BRLCAD_TYPE_SIZE("size_t" "")
-BRLCAD_TYPE_SIZE("ssize_t" "")
-BRLCAD_TYPE_SIZE("uint64_t" "")
-BRLCAD_TYPE_SIZE("uintptr_t" "")
-BRLCAD_TYPE_SIZE("sig_t" "signal.h")
+brlcad_type_size("int" "")
+brlcad_type_size("long" "")
+brlcad_type_size("long long" "")
+brlcad_type_size("size_t" "")
+brlcad_type_size("ssize_t" "")
+brlcad_type_size("uint64_t" "")
+brlcad_type_size("uintptr_t" "")
+brlcad_type_size("sig_t" "signal.h")
 
 # see if the compiler supports %z as a size_t print width specifier
-BRLCAD_CHECK_C99_FORMAT_SPECIFIERS()
+brlcad_check_c99_format_specifiers()
 
 
 # *******************************************************************
@@ -1641,47 +1641,47 @@
 # *******************************************************************
 
 # ALLOCA test - based on AC_FUNC_ALLOCA
-BRLCAD_ALLOCA()
+brlcad_alloca()
 
-BRLCAD_FUNCTION_EXISTS(XQueryExtension HAVE_XQUERYEXTENSION)
-BRLCAD_FUNCTION_EXISTS(alarm HAVE_ALARM)
-BRLCAD_FUNCTION_EXISTS(dlopen HAVE_DLOPEN)
-BRLCAD_FUNCTION_EXISTS(drand48 HAVE_DRAND48)
-BRLCAD_FUNCTION_EXISTS(fchmod HAVE_FCHMOD)
-BRLCAD_FUNCTION_EXISTS(fsync HAVE_FSYNC)
-BRLCAD_FUNCTION_EXISTS(getcwd HAVE_GETCWD)
-BRLCAD_FUNCTION_EXISTS(getegid HAVE_GETEGID)
-BRLCAD_FUNCTION_EXISTS(geteuid HAVE_GETEUID)
-BRLCAD_FUNCTION_EXISTS(gethostname HAVE_GETHOSTNAME)
-BRLCAD_FUNCTION_EXISTS(getloadavg HAVE_GETLOADAVG)
-BRLCAD_FUNCTION_EXISTS(getopt_long HAVE_GETOPT_LONG)
-BRLCAD_FUNCTION_EXISTS(getprogname HAVE_GETPROGNAME)
-BRLCAD_FUNCTION_EXISTS(kill HAVE_KILL)
-BRLCAD_FUNCTION_EXISTS(lrand48 HAVE_LRAND48)
-BRLCAD_FUNCTION_EXISTS(memset HAVE_MEMSET)
-BRLCAD_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP)
-BRLCAD_FUNCTION_EXISTS(pipe HAVE_PIPE)
-BRLCAD_FUNCTION_EXISTS(popen HAVE_POPEN)
-BRLCAD_FUNCTION_EXISTS(random HAVE_RANDOM)
-BRLCAD_FUNCTION_EXISTS(realpath HAVE_REALPATH)
-BRLCAD_FUNCTION_EXISTS(sbrk HAVE_SBRK)
-BRLCAD_FUNCTION_EXISTS(setenv HAVE_SETENV)
-BRLCAD_FUNCTION_EXISTS(setpgid HAVE_SETPGID)
-BRLCAD_FUNCTION_EXISTS(setpriority HAVE_SETPRIORITY)
-BRLCAD_FUNCTION_EXISTS(setprogname HAVE_SETPROGNAME)
-BRLCAD_FUNCTION_EXISTS(srand48 HAVE_SRAND48)
-BRLCAD_FUNCTION_EXISTS(strchr HAVE_STRCHR)
-BRLCAD_FUNCTION_EXISTS(strdup HAVE_STRDUP)
-BRLCAD_FUNCTION_EXISTS(strlcat HAVE_STRLCAT)
-BRLCAD_FUNCTION_EXISTS(strlcpy HAVE_STRLCPY)
-BRLCAD_FUNCTION_EXISTS(strsep HAVE_STRSEP)
-BRLCAD_FUNCTION_EXISTS(strtok HAVE_STRTOK)
-BRLCAD_FUNCTION_EXISTS(sync HAVE_SYNC)
-BRLCAD_FUNCTION_EXISTS(sysctl HAVE_SYSCTL)
-BRLCAD_FUNCTION_EXISTS(sysmp HAVE_SYSMP)
-BRLCAD_FUNCTION_EXISTS(vfork HAVE_VFORK)
-BRLCAD_FUNCTION_EXISTS(vsscanf HAVE_VSSCANF)
-BRLCAD_FUNCTION_EXISTS(writev HAVE_WRITEV)
+brlcad_function_exists(XQueryExtension HAVE_XQUERYEXTENSION)
+brlcad_function_exists(alarm HAVE_ALARM)
+brlcad_function_exists(dlopen HAVE_DLOPEN)
+brlcad_function_exists(drand48 HAVE_DRAND48)
+brlcad_function_exists(fchmod HAVE_FCHMOD)
+brlcad_function_exists(fsync HAVE_FSYNC)
+brlcad_function_exists(getcwd HAVE_GETCWD)
+brlcad_function_exists(getegid HAVE_GETEGID)
+brlcad_function_exists(geteuid HAVE_GETEUID)
+brlcad_function_exists(gethostname HAVE_GETHOSTNAME)
+brlcad_function_exists(getloadavg HAVE_GETLOADAVG)
+brlcad_function_exists(getopt_long HAVE_GETOPT_LONG)
+brlcad_function_exists(getprogname HAVE_GETPROGNAME)
+brlcad_function_exists(kill HAVE_KILL)
+brlcad_function_exists(lrand48 HAVE_LRAND48)
+brlcad_function_exists(memset HAVE_MEMSET)
+brlcad_function_exists(mkstemp HAVE_MKSTEMP)
+brlcad_function_exists(pipe HAVE_PIPE)
+brlcad_function_exists(popen HAVE_POPEN)
+brlcad_function_exists(random HAVE_RANDOM)
+brlcad_function_exists(realpath HAVE_REALPATH)
+brlcad_function_exists(sbrk HAVE_SBRK)
+brlcad_function_exists(setenv HAVE_SETENV)
+brlcad_function_exists(setpgid HAVE_SETPGID)
+brlcad_function_exists(setpriority HAVE_SETPRIORITY)
+brlcad_function_exists(setprogname HAVE_SETPROGNAME)
+brlcad_function_exists(srand48 HAVE_SRAND48)
+brlcad_function_exists(strchr HAVE_STRCHR)
+brlcad_function_exists(strdup HAVE_STRDUP)
+brlcad_function_exists(strlcat HAVE_STRLCAT)
+brlcad_function_exists(strlcpy HAVE_STRLCPY)
+brlcad_function_exists(strsep HAVE_STRSEP)
+brlcad_function_exists(strtok HAVE_STRTOK)
+brlcad_function_exists(sync HAVE_SYNC)
+brlcad_function_exists(sysctl HAVE_SYSCTL)
+brlcad_function_exists(sysmp HAVE_SYSMP)
+brlcad_function_exists(vfork HAVE_VFORK)
+brlcad_function_exists(vsscanf HAVE_VSSCANF)
+brlcad_function_exists(writev HAVE_WRITEV)
 
 # On Windows, we need to check for hypot etc..  This test pertains
 # to the windows specific config file, not CONFIG_H_FILE - hence,
@@ -1691,13 +1691,13 @@
   # consider all warnings as errors (MSVC)
   set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} /WX)
 
-  CHECK_SYMBOL_EXISTS(hypot "math.h" HAVE_HYPOT)
+  check_symbol_exists(hypot "math.h" HAVE_HYPOT)
   #If we don't have it, need to define it as _hypot in config_win
   if(NOT HAVE_HYPOT)
     set(hypot 1)
   endif(NOT HAVE_HYPOT)
 
-  CHECK_SYMBOL_EXISTS(asinh "math.h" HAVE_ASINH)
+  check_symbol_exists(asinh "math.h" HAVE_ASINH)
   #If we don't have it, need to define it in config_win
   if(NOT HAVE_ASINH)
     set(asinh 1)
@@ -1734,7 +1734,7 @@
 # Enable CTest Testing support - this is done after src/other is
 # added to avoid incorporating src/other CTests into BRL-CAD's own
 # testing.  TODO - probably should control this with an option.
-ENABLE_TESTING()
+enable_testing()
 
 # We've done the toplevel configure steps, now add the subdirectories
 add_subdirectory(src)
@@ -1748,11 +1748,11 @@
   add_subdirectory(bench)
   add_subdirectory(regress)
 else(NOT BRLCAD_ENABLE_TARGETS OR "${BRLCAD_ENABLE_TARGETS}" GREATER 2)
-  CMAKEFILES(doc pix bench regress db)
+  cmakefiles(doc pix bench regress db)
 endif(NOT BRLCAD_ENABLE_TARGETS OR "${BRLCAD_ENABLE_TARGETS}" GREATER 2)
 
 # Now that all the tests are done, configure the brlcad_config.h file:
-CONFIG_H_APPEND(BRLCAD "#endif /* __CONFIG_H__ */\n")
+config_h_append(BRLCAD "#endif /* __CONFIG_H__ */\n")
 get_property(CONFIG_H_FILE_CONTENTS GLOBAL PROPERTY ${CMAKE_PROJECT_NAME}_CONFIG_H_CONTENTS)
 file(WRITE ${CONFIG_H_FILE} "${CONFIG_H_FILE_CONTENTS}")
 configure_file(${CONFIG_H_FILE} ${BRLCAD_BINARY_DIR}/include/brlcad_config.h)
@@ -1767,7 +1767,7 @@
   NEWS
   README
   )
-BRLCAD_ADDDATA(toplevel_DOCFILES ".")
+brlcad_adddata(toplevel_DOCFILES ".")
 
 # Generate the windows specific file, if needed
 if(WIN32)
@@ -1908,13 +1908,13 @@
 # HOST
 configure_file(${BRLCAD_CMAKE_DIR}/test_srcs/report_hostname.c.in ${CMAKE_BINARY_DIR}/CMakeTmp/report_hostname.c)
 if(NOT MSVC)
-  TRY_RUN(TIME_RESULT TIME_COMPILED
+  try_run(TIME_RESULT TIME_COMPILED
     ${CMAKE_BINARY_DIR}/CMakeTmp
     ${CMAKE_BINARY_DIR}/CMakeTmp/report_hostname.c
     OUTPUT_VARIABLE COMPILEMESSAGES)
 else(NOT MSVC)
   set(CMAKE_REQUIRED_LIBRARIES ws2_32.lib)
-  TRY_RUN(TIME_RESULT TIME_COMPILED
+  try_run(TIME_RESULT TIME_COMPILED
     ${CMAKE_BINARY_DIR}/CMakeTmp
     ${CMAKE_BINARY_DIR}/CMakeTmp/report_hostname.c
     OUTPUT_VARIABLE COMPILEMESSAGES
@@ -1924,11 +1924,11 @@
 file(APPEND ${BRLCAD_BINARY_DIR}/include/conf/HOST.tmp "\n")
 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${BRLCAD_BINARY_DIR}/include/conf/HOST.tmp ${BRLCAD_BINARY_DIR}/include/conf/HOST)
 execute_process(COMMAND ${CMAKE_COMMAND} -E remove	${BRLCAD_BINARY_DIR}/include/conf/HOST.tmp)
-DISTCLEAN(${BRLCAD_BINARY_DIR}/include/conf/HOST)
+distclean(${BRLCAD_BINARY_DIR}/include/conf/HOST)
 
 # USER
 configure_file(${BRLCAD_CMAKE_DIR}/test_srcs/report_username.c.in ${CMAKE_BINARY_DIR}/CMakeTmp/report_username.c)
-TRY_RUN(TIME_RESULT TIME_COMPILED
+try_run(TIME_RESULT TIME_COMPILED
   ${CMAKE_BINARY_DIR}/CMakeTmp
   ${CMAKE_BINARY_DIR}/CMakeTmp/report_username.c
   OUTPUT_VARIABLE COMPILEMESSAGES)
@@ -1936,7 +1936,7 @@
 file(APPEND ${BRLCAD_BINARY_DIR}/include/conf/USER.tmp "\n")
 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${BRLCAD_BINARY_DIR}/include/conf/USER.tmp ${BRLCAD_BINARY_DIR}/include/conf/USER)
 execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${BRLCAD_BINARY_DIR}/include/conf/USER.tmp)
-DISTCLEAN(${BRLCAD_BINARY_DIR}/include/conf/USER)
+distclean(${BRLCAD_BINARY_DIR}/include/conf/USER)
 
 # PATH
 if(CMAKE_CONFIGURATION_TYPES)
@@ -1975,7 +1975,7 @@
   execute_process(COMMAND ${CMAKE_COMMAND} -E remove	${BRLCAD_BINARY_DIR}/include/conf/PATH.tmp)
 
 endif(CMAKE_CONFIGURATION_TYPES)
-DISTCLEAN(${BRLCAD_BINARY_DIR}/include/conf/PATH)
+distclean(${BRLCAD_BINARY_DIR}/include/conf/PATH)
 
 # COUNT - Count how many times the configuration has changed.  Currently
 # we are detecting a configuration change by looking at the previous version
@@ -1987,7 +1987,7 @@
 
 if(EXISTS ${BRLCAD_BINARY_DIR}/include/conf/COUNT)
   include(${BRLCAD_CMAKE_DIR}/DiffCache.cmake)
-  DIFF_CACHE_file()
+  diff_cache_file()
   if(INCREMENT_COUNT_FILE)
     file(READ ${BRLCAD_BINARY_DIR}/include/conf/COUNT buildCounter_raw)
     string(STRIP ${buildCounter_raw} buildCounter)
@@ -1998,7 +1998,7 @@
   set(buildCounter 0)
   file(WRITE ${BRLCAD_BINARY_DIR}/include/conf/COUNT "${buildCounter}\n")
 endif(EXISTS ${BRLCAD_BINARY_DIR}/include/conf/COUNT)
-DISTCLEAN(${BRLCAD_BINARY_DIR}/include/conf/COUNT)
+distclean(${BRLCAD_BINARY_DIR}/include/conf/COUNT)
 
 # DATE - Increment this when we increment the COUNT, to avoid triggering
 # excessive relinking (an RFC2822 timestamp changes every second).
@@ -2009,7 +2009,7 @@
   execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${BRLCAD_BINARY_DIR}/include/conf/DATE.tmp ${BRLCAD_BINARY_DIR}/include/conf/DATE)
   execute_process(COMMAND ${CMAKE_COMMAND} -E remove	${BRLCAD_BINARY_DIR}/include/conf/DATE.tmp)
 endif(INCREMENT_COUNT_FILE OR NOT EXISTS ${BRLCAD_BINARY_DIR}/include/conf/DATE)
-DISTCLEAN(${BRLCAD_BINARY_DIR}/include/conf/DATE)
+distclean(${BRLCAD_BINARY_DIR}/include/conf/DATE)
 
 # CPack is used to produce tgz files, RPMS, etc.  If SUBBUILD is enabled this
 # becomes the responsibility of the parent project.
@@ -2122,24 +2122,24 @@
     Makefile.am
     CMakeLists.txt
     )
-  CMAKEFILES(${toplevel_ignore_files})
+  cmakefiles(${toplevel_ignore_files})
 
   # Handle some toplevel distclean listings
-  DISTCLEAN(${CMAKE_BINARY_DIR}/cmakefiles.cmake)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/cmakedirs.cmake)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/cmake_install.cmake)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/install_manifest.txt)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/OPTIONS)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/CMakeFiles)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/CMakeTmp)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/configure.new)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/INSTALL.new)
-  DISTCLEAN(${CMAKE_BINARY_DIR}/include/brlcad_config.h.in)
+  distclean(${CMAKE_BINARY_DIR}/cmakefiles.cmake)
+  distclean(${CMAKE_BINARY_DIR}/cmakedirs.cmake)
+  distclean(${CMAKE_BINARY_DIR}/cmake_install.cmake)
+  distclean(${CMAKE_BINARY_DIR}/install_manifest.txt)
+  distclean(${CMAKE_BINARY_DIR}/OPTIONS)
+  distclean(${CMAKE_BINARY_DIR}/CMakeFiles)
+  distclean(${CMAKE_BINARY_DIR}/CMakeTmp)
+  distclean(${CMAKE_BINARY_DIR}/configure.new)
+  distclean(${CMAKE_BINARY_DIR}/INSTALL.new)
+  distclean(${CMAKE_BINARY_DIR}/include/brlcad_config.h.in)
   foreach(clearpattern ${DISTCLEAN_OUTFILES})
-    DISTCLEAN(${CMAKE_BINARY_DIR}/${clearpattern})
+    distclean(${CMAKE_BINARY_DIR}/${clearpattern})
   endforeach(clearpattern ${DISTCLEAN_OUTFILES})
   if("${CMAKE_GENERATOR}" MATCHES "Ninja")
-    DISTCLEAN(${CMAKE_BINARY_DIR}/.ninja_log)
+    distclean(${CMAKE_BINARY_DIR}/.ninja_log)
   endif("${CMAKE_GENERATOR}" MATCHES "Ninja")
 
   # ----------------------------------------------------------------------------
@@ -2151,19 +2151,19 @@
   # Define some custom distcheck targets for distcheck-full (not run by default)
   #
   # CREATE_DISTCHECK(TARGET_SUFFIX CMAKE_OPTS source_dir build_dir install_dir [custom_template])
-  CREATE_DISTCHECK(default_build_type "-DBRLCAD_BUNDLED_LIBS=AUTO" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "build" "install")
-  CREATE_DISTCHECK(no_tk "-DCMAKE_BUILD_TYPE=Debug -DBRLCAD_BUNDLED_LIBS=BUNDLED -DBRLCAD_ENABLE_TK=OFF" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "build" "install")
-  CREATE_DISTCHECK(autodetect_debug "-DCMAKE_BUILD_TYPE=Debug -DBRLCAD_BUNDLED_LIBS=AUTO" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "build" "install")
-  CREATE_DISTCHECK(autodetect_release "-DCMAKE_BUILD_TYPE=Release -DBRLCAD_BUNDLED_LIBS=AUTO" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "build" "install")
-  CREATE_DISTCHECK(odd_pathnames "-DCMAKE_BUILD_TYPE=Debug -DBRLCAD_BUNDLED_LIBS=BUNDLED" "1 Odd_ source dir ++" "1 Odd_ build dir ++" "1 Odd_ install dir ++")
-  CREATE_DISTCHECK(in_src_dir "-DCMAKE_BUILD_TYPE=Debug -DBRLCAD_BUNDLED_LIBS=BUNDLED" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "install" distcheck_in_src_dir.cmake.in)
+  create_distcheck(default_build_type "-DBRLCAD_BUNDLED_LIBS=AUTO" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "build" "install")
+  create_distcheck(no_tk "-DCMAKE_BUILD_TYPE=Debug -DBRLCAD_BUNDLED_LIBS=BUNDLED -DBRLCAD_ENABLE_TK=OFF" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "build" "install")
+  create_distcheck(autodetect_debug "-DCMAKE_BUILD_TYPE=Debug -DBRLCAD_BUNDLED_LIBS=AUTO" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "build" "install")
+  create_distcheck(autodetect_release "-DCMAKE_BUILD_TYPE=Release -DBRLCAD_BUNDLED_LIBS=AUTO" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "build" "install")
+  create_distcheck(odd_pathnames "-DCMAKE_BUILD_TYPE=Debug -DBRLCAD_BUNDLED_LIBS=BUNDLED" "1 Odd_ source dir ++" "1 Odd_ build dir ++" "1 Odd_ install dir ++")
+  create_distcheck(in_src_dir "-DCMAKE_BUILD_TYPE=Debug -DBRLCAD_BUNDLED_LIBS=BUNDLED" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "install" distcheck_in_src_dir.cmake.in)
 
   # The following target can (and should) be removed once Autotools
   # deprecation is complete
-  CREATE_DISTCHECK(autotools "" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "install" distcheck_autotools.cmake.in)
+  create_distcheck(autotools "" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "${CPACK_SOURCE_PACKAGE_FILE_NAME}" "install" distcheck_autotools.cmake.in)
 
   # Now that we're set up and have added the extra targets we want for distcheck-full, define the build targets
-  DEFINE_DISTCHECK_TARGET(STD)
+  define_distcheck_target(STD)
 endif(NOT BRLCAD_IS_SUBBUILD)
 
 # ----------------------------------------------------------------------------
@@ -2239,7 +2239,7 @@
 # end of the CMake configure, the preparation of the final distclean
 # list must account for it.  Also, the distclean script itself must
 # be added to the list, as it is generated by CMake
-DISTCLEAN(${CMAKE_BINARY_DIR}/CMakeTmp/timedelta_end.c)
+distclean(${CMAKE_BINARY_DIR}/CMakeTmp/timedelta_end.c)
 get_property(CMAKE_DISTCLEAN_TARGET_LIST GLOBAL PROPERTY CMAKE_DISTCLEAN_TARGET_LIST)
 list(REMOVE_DUPLICATES CMAKE_DISTCLEAN_TARGET_LIST)
 configure_file(${BRLCAD_CMAKE_DIR}/distclean.cmake.in	${BRLCAD_BINARY_DIR}/distclean.cmake @ONLY)
@@ -2267,7 +2267,7 @@
 if(NOT BRLCAD_IS_SUBBUILD)
   set(DELTA_END "${CMAKE_BINARY_DIR}/CMakeTmp/DELTA_END")
   configure_file(${BRLCAD_CMAKE_DIR}/test_srcs/timedelta_end.c.in ${CMAKE_BINARY_DIR}/CMakeTmp/timedelta_end.c)
-  TRY_RUN(TIME_RESULT TIME_COMPILED
+  try_run(TIME_RESULT TIME_COMPILED
     ${CMAKE_BINARY_DIR}/CMakeTmp
     ${CMAKE_BINARY_DIR}/CMakeTmp/timedelta_end.c
     OUTPUT_VARIABLE COMPILEMESSAGES)
Index: bench/CMakeLists.txt
===================================================================
--- bench/CMakeLists.txt	(revision 54114)
+++ bench/CMakeLists.txt	(working copy)
@@ -6,7 +6,7 @@
   -DCONSOLE
 )
 
-BRLCAD_ADDEXEC(pixcmp pixcmp.c libbu)
+brlcad_addexec(pixcmp pixcmp.c libbu)
 
 configure_file(run.sh ${CMAKE_CURRENT_BINARY_DIR}/benchmark COPYONLY)
 install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/benchmark DESTINATION ${BIN_DIR})
@@ -23,7 +23,7 @@
 file(APPEND ${CMAKE_BINARY_DIR}/CMakeTmp/benchmsg.cmake "message(\"Run 'make benchmark-clean' in the bench directory to delete the logic\")\n")
 file(APPEND ${CMAKE_BINARY_DIR}/CMakeTmp/benchmsg.cmake "message(\"and image files generated during the benchmark analysis.\")\n")
 
-CMAKEFILES(lgt.sh run.sh try.sh viewdiff.sh Makefile.am)
+cmakefiles(lgt.sh run.sh try.sh viewdiff.sh Makefile.am)
 
 if(SH_EXEC)
 	add_custom_target(benchmark
