Revision: 77460
          http://sourceforge.net/p/brlcad/code/77460
Author:   starseeker
Date:     2020-10-16 04:24:56 +0000 (Fri, 16 Oct 2020)
Log Message:
-----------
Try to clean up, simplify and reorganize this logic.

Modified Paths:
--------------
    
brlcad/branches/thirdparty_rework/src/superbuild/CMake/ExternalProject_Target.cmake
    brlcad/branches/thirdparty_rework/src/superbuild/bson.cmake
    brlcad/branches/thirdparty_rework/src/superbuild/gdal.cmake
    brlcad/branches/thirdparty_rework/src/superbuild/itcl.cmake
    brlcad/branches/thirdparty_rework/src/superbuild/itk.cmake
    brlcad/branches/thirdparty_rework/src/superbuild/iwidgets.cmake
    brlcad/branches/thirdparty_rework/src/superbuild/netpbm.cmake
    brlcad/branches/thirdparty_rework/src/superbuild/perplex.cmake
    brlcad/branches/thirdparty_rework/src/superbuild/png.cmake
    brlcad/branches/thirdparty_rework/src/superbuild/proj4.cmake
    brlcad/branches/thirdparty_rework/src/superbuild/regex.cmake
    brlcad/branches/thirdparty_rework/src/superbuild/stepcode.cmake
    brlcad/branches/thirdparty_rework/src/superbuild/tcl.cmake
    brlcad/branches/thirdparty_rework/src/superbuild/tk.cmake
    brlcad/branches/thirdparty_rework/src/superbuild/zlib.cmake

Modified: 
brlcad/branches/thirdparty_rework/src/superbuild/CMake/ExternalProject_Target.cmake
===================================================================
--- 
brlcad/branches/thirdparty_rework/src/superbuild/CMake/ExternalProject_Target.cmake
 2020-10-15 18:34:28 UTC (rev 77459)
+++ 
brlcad/branches/thirdparty_rework/src/superbuild/CMake/ExternalProject_Target.cmake
 2020-10-16 04:24:56 UTC (rev 77460)
@@ -21,38 +21,42 @@
   set(EXTPROJ_VERBOSE 0)
 endif(NOT DEFINED EXTPROJ_VERBOSE)
 
+# cmake -E copy follows symlinks to get the final file, which is not what we
+# want in this situation.  To avoid this, we create a copy script which uses
+# file(COPY) and run that script with cmake -P
+file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/cp.cmake" 
"get_filename_component(DDIR \${DEST} DIRECTORY)\nfile(COPY \${SRC} DESTINATION 
\${DDIR})")
+
 # When staging files in the build directory, we have to be aware of multiple
 # configurations.  This is done post-ExternalProject build, at the parent build
 # time, so it needs to be a custom command. Until add_custom_command outputs
 # can use $<CONFIG>, we need to handle multi-config situations manually with
-# multiple copy commands.
+# multiple copy commands. The absence of $<CONFIG> support makes this clunky -
+# we need the root dirs and the relative subdirs passed in separately, so we
+# can construct configuration specific paths to cover all the necessary copy
+# operations.
 #
-# cmake -E copy follows symlinks to get the final file, which is not what we
-# want in this situation.  To avoid this, we create a copy script which uses
-# file(COPY) and run that script with cmake -P
-file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/cp.cmake" 
"get_filename_component(DDIR \${DEST} DIRECTORY)\nfile(COPY \${SRC} DESTINATION 
\${DDIR})")
-
-function(fcfgcpy outvar extproj root dir ofile tfile)
-  #message("extproj: ${extproj}")
-  #message("root: ${root}")
-  #message("dir: ${dir}")
-  #message("ofile: ${ofile}")
-  #message("tfile: ${tfile}")
+# There are practical limits to how flexible we can make this right now...  The
+# implicit assumption is that the tree structures under each configuration root
+# are the same.  Doing anything else would make this much more convoluted, and
+# it's already bad enough - don't make it any worse until it's proven that we
+# have to.
+function(fcfgcpy outvar extproj root ofile dir tfile)
+  string(REPLACE "${CMAKE_BINARY_DIR}/" "" rdir "${dir}")
   if (NOT CMAKE_CONFIGURATION_TYPES)
     add_custom_command(
-      OUTPUT "${CMAKE_BINARY_DIR}/${dir}/${tfile}"
-      COMMAND ${CMAKE_COMMAND} -DSRC="${root}/${ofile}" 
-DDEST="${CMAKE_BINARY_DIR}/${dir}/${tfile}" -P 
"${CMAKE_BINARY_DIR}/CMakeFiles/cp.cmake"
+      OUTPUT "${CMAKE_BINARY_DIR}/${rdir}/${tfile}"
+      COMMAND ${CMAKE_COMMAND} -DSRC="${root}/${rdir}/${ofile}" 
-DDEST="${CMAKE_BINARY_DIR}/${rdir}/${tfile}" -P 
"${CMAKE_BINARY_DIR}/CMakeFiles/cp.cmake"
       DEPENDS ${extproj}
       )
-    set(TOUT ${TOUT} "${CMAKE_BINARY_DIR}/${dir}/${tfile}")
+    set(TOUT ${TOUT} "${CMAKE_BINARY_DIR}/${rdir}/${tfile}")
   else (NOT CMAKE_CONFIGURATION_TYPES)
     foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
       add_custom_command(
-       OUTPUT "${CMAKE_BINARY_DIR}/${CFG_TYPE}/${dir}/${tfile}"
-       COMMAND ${CMAKE_COMMAND} -DSRC="${root}/${ofile}" 
-DDEST="${CMAKE_BINARY_DIR}/${CFG_TYPE}/${dir}/${tfile}" -P 
"${CMAKE_BINARY_DIR}/CMakeFiles/cp.cmake"
+       OUTPUT "${CMAKE_BINARY_DIR}/${CFG_TYPE}/${rdir}/${tfile}"
+       COMMAND ${CMAKE_COMMAND} -DSRC="${root}${CFG_TYPE}/${rdir}/${ofile}" 
-DDEST="${CMAKE_BINARY_DIR}/${CFG_TYPE}/${rdir}/${tfile}" -P 
"${CMAKE_BINARY_DIR}/CMakeFiles/cp.cmake"
        DEPENDS ${extproj}
        )
-      set(TOUT ${TOUT} "${CMAKE_BINARY_DIR}/${CFG_TYPE}/${dir}/${tfile}")
+      set(TOUT ${TOUT} "${CMAKE_BINARY_DIR}/${CFG_TYPE}/${rdir}/${tfile}")
     endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
   endif (NOT CMAKE_CONFIGURATION_TYPES)
   set(${outvar} ${TOUT} PARENT_SCOPE)
@@ -65,7 +69,7 @@
 configure_file(${${CMAKE_PROJECT_NAME}_CMAKE_DIR}/buildpath_replace.cxx.in 
${CMAKE_CURRENT_BINARY_DIR}/buildpath_replace.cxx)
 add_executable(buildpath_replace 
${CMAKE_CURRENT_BINARY_DIR}/buildpath_replace.cxx)
 
-function(ExternalProject_ByProducts etarg extproj extroot E_IMPORT_PREFIX 
target_dir)
+function(ExternalProject_ByProducts etarg extproj extroot dir)
 
   cmake_parse_arguments(E "FIXPATH;NOINSTALL" "" "" ${ARGN})
 
@@ -94,24 +98,17 @@
 
   set(ALL_TOUT)
   foreach (bpf ${E_UNPARSED_ARGUMENTS})
-    # If a relative prefix was specified, construct the "source" file using it.
-    # This is used to save verbosity in ByProducts input lists.
-    if (E_IMPORT_PREFIX)
-      set(ofile ${E_IMPORT_PREFIX}/${bpf})
-    else (E_IMPORT_PREFIX)
-      set(ofile ${bpf})
-    endif (E_IMPORT_PREFIX)
 
     unset(TOUT)
-    fcfgcpy(TOUT ${extproj} ${extroot} "${target_dir}" ${ofile} ${bpf})
+    fcfgcpy(TOUT ${extproj} ${extroot} ${bpf} "${dir}" ${bpf})
     set(ALL_TOUT ${ALL_TOUT} ${TOUT})
 
     if (NOT E_NOINSTALL)
-      install(FILES "${CMAKE_BINARY_DIR}/$<CONFIG>/${target_dir}/${bpf}" 
DESTINATION "${target_dir}/")
+      install(FILES "${CMAKE_BINARY_DIR}/$<CONFIG>/${dir}/${bpf}" DESTINATION 
"${dir}/")
       if (E_FIXPATH)
        # Note - proper quoting for install(CODE) is extremely important for 
CPack, see
        # https://stackoverflow.com/a/48487133
-       install(CODE "execute_process(COMMAND $<TARGET_FILE:buildpath_replace> 
\"\${CMAKE_INSTALL_PREFIX}/${E_IMPORT_PREFIX}/${bpf}\")")
+       install(CODE "execute_process(COMMAND $<TARGET_FILE:buildpath_replace> 
\"\${CMAKE_INSTALL_PREFIX}/${dir}/${bpf}\")")
       endif (E_FIXPATH)
     endif (NOT E_NOINSTALL)
 
@@ -126,23 +123,12 @@
 endfunction(ExternalProject_ByProducts)
 
 
-function(ET_target_props etarg IN_IMPORT_PREFIX IN_LINK_TARGET)
+function(ET_target_props etarg IMPORT_PREFIX LINK_TARGET)
 
-  cmake_parse_arguments(ET "STATIC;EXEC" 
"LINK_TARGET_DEBUG;STATIC_LINK_TARGET_DEBUG" "" ${ARGN})
+  cmake_parse_arguments(ET "SHARED" "LINK_TARGET_DEBUG" "" ${ARGN})
 
   if(NOT CMAKE_CONFIGURATION_TYPES)
 
-    if(ET_STATIC)
-      set(IMPORT_PREFIX "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
-    elseif(ET_EXEC)
-      set(IMPORT_PREFIX "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
-    else()
-      set(IMPORT_PREFIX "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
-    endif(ET_STATIC)
-    if(IN_IMPORT_PREFIX)
-      set(IMPORT_PREFIX "${IMPORT_PREFIX}/${IN_IMPORT_PREFIX}")
-    endif(IN_IMPORT_PREFIX)
-
     # Note: per https://stackoverflow.com/a/49390802 need to set
     # IMPORTED_NO_SONAME to get working linking for what we're trying to do
     # here.  Without that property set, build dir copies of libraries will use
@@ -150,10 +136,20 @@
     set_property(TARGET ${etarg} APPEND PROPERTY IMPORTED_CONFIGURATIONS 
NOCONFIG)
     set_target_properties(${etarg} PROPERTIES
       IMPORTED_NO_SONAME TRUE
-      IMPORTED_LOCATION_NOCONFIG "${IMPORT_PREFIX}/${IN_LINK_TARGET}"
-      IMPORTED_SONAME_NOCONFIG "${IN_LINK_TARGET}"
+      IMPORTED_LOCATION_NOCONFIG "${IMPORT_PREFIX}/${LINK_TARGET}"
+      IMPORTED_SONAME_NOCONFIG "${LINK_TARGET}"
       )
 
+    # For Windows, IMPORTED_IMPLIB is important for shared libraries.
+    # It is that property that will tell a toplevel target what to link against
+    # when building - pointing out the dll isn't enough by itself.
+    if(ET_SHARED AND MSVC)
+      string(REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}" ".lib" IMPLIB_FILE 
"${LINK_TARGET}")
+      set_target_properties(${etarg} PROPERTIES
+       IMPORTED_IMPLIB_NOCONFIG "${IMPORT_PREFIX}/${IMPLIB_FILE}"
+       )
+    endif(ET_SHARED AND MSVC)
+
   else(NOT CMAKE_CONFIGURATION_TYPES)
 
     foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
@@ -160,53 +156,31 @@
       string(TOUPPER "${CFG_TYPE}" CFG_TYPE_UPPER)
 
       # The config variables are the ones set in this mode.
-      if(ET_STATIC)
-       set(IMPORT_PREFIX "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}}")
-       if("${CFG_TYPE_UPPER}" STREQUAL "DEBUG" AND ET_STATIC_LINK_TARGET_DEBUG)
-         set(LINK_TARGET ${ET_STATIC_LINK_TARGET_DEBUG})
-       else()
-         set(LINK_TARGET ${IN_LINK_TARGET})
-       endif()
-      elseif(ET_EXEC)
-       set(IMPORT_PREFIX "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}}")
-       set(LINK_TARGET ${IN_LINK_TARGET})
+      if("${CFG_TYPE_UPPER}" STREQUAL "DEBUG" AND ET_LINK_TARGET_DEBUG)
+       set(C_LINK_TARGET ${ET_LINK_TARGET_DEBUG})
       else()
-       set(IMPORT_PREFIX "${CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}}")
-       if("${CFG_TYPE_UPPER}" STREQUAL "DEBUG" AND ET_LINK_TARGET_DEBUG)
-         set(LINK_TARGET ${ET_LINK_TARGET_DEBUG})
-       else()
-         set(LINK_TARGET ${IN_LINK_TARGET})
-       endif()
-      endif(ET_STATIC)
+       set(C_LINK_TARGET ${LINK_TARGET})
+      endif()
 
-      if(IN_IMPORT_PREFIX)
-       set(IMPORT_PREFIX "${IMPORT_PREFIX}/${IN_IMPORT_PREFIX}")
-      endif(IN_IMPORT_PREFIX)
-
+      # If we're multiconfig, define properties for each configuration
       set_target_properties(${etarg} PROPERTIES
-         IMPORTED_NO_SONAME TRUE
-       IMPORTED_LOCATION_${CFG_TYPE_UPPER} "${IMPORT_PREFIX}/${LINK_TARGET}"
-       IMPORTED_SONAME_${CFG_TYPE_UPPER} "${LINK_TARGET}"
+       IMPORTED_NO_SONAME_${CFG_TYPE_UPPER} TRUE
+       IMPORTED_LOCATION_${CFG_TYPE_UPPER} "${IMPORT_PREFIX}/${CLINK_TARGET}"
+       IMPORTED_SONAME_${CFG_TYPE_UPPER} "${CLINK_TARGET}"
        )
 
-      if(NOT ET_STATIC AND NOT ET_EXEC AND MSVC)
-       # For Windows, IMPORTED_IMPLIB is important for shared libraries.
-       # It is that property that will tell a toplevel target what to link 
against
-       # when building - pointing out the dll isn't enough by itself.
-       string(REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}" ".lib" IMPLIB_FILE 
"${LINK_TARGET}")
+      # For Windows, IMPORTED_IMPLIB is important for shared libraries.
+      # It is that property that will tell a toplevel target what to link 
against
+      # when building - pointing out the dll isn't enough by itself.
+      if(ET_SHARED AND MSVC)
+       string(REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}" ".lib" IMPLIB_FILE 
"${CLINK_TARGET}")
        set_target_properties(${etarg} PROPERTIES
          IMPORTED_IMPLIB_${CFG_TYPE_UPPER} "${IMPORT_PREFIX}/${IMPLIB_FILE}"
          )
-      endif(NOT ET_STATIC AND NOT ET_EXEC AND MSVC)
+      endif(ET_SHARED AND MSVC)
 
     endforeach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
 
-    # For everything except Debug, use the Release version
-    #set_target_properties(TARGET ${etarg} PROPERTIES
-    #  MAP_IMPORTED_CONFIG_MINSIZEREL Release
-    #  MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release
-    #  )
-
   endif(NOT CMAKE_CONFIGURATION_TYPES)
 
 endfunction(ET_target_props)
@@ -241,8 +215,18 @@
 # CMake outputs, and requires that the external project build in such a way
 # that the rpath settings in the build outputs are compatible with this
 # mechanism.
-function(ET_RPath LIB_DIR OUTPUT_DIR SUB_DIR E_OUTPUT_FILE)
-  get_filename_component(RRPATH 
"${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/${SUB_DIR}" REALPATH)
+#
+# When specifying OFILE, the path should be given relative to the root 
directory:
+# For example:
+#
+# /usr/lib/libfoo.so -> lib/libfoo.so
+# /usr/lib/bar-1.0/libbar.so -> lib/foo-1.0/libfoo.so
+# /usr/bin/baz -> bin/baz
+# /usr/bin/mypkg/baz -> bin/mypkg/baz
+#
+function(ET_RPath OFILE)
+  get_filename_component(OFPATH "${OFILE}" DIRECTORY)
+  get_filename_component(RRPATH "${CMAKE_INSTALL_PREFIX}/${OFPATH}" REALPATH)
   set(OPATH)
   ET_Origin_Path(OPATH "${RRPATH}")
   if (NOT APPLE)
@@ -253,11 +237,6 @@
   if (NOT DEFINED CMAKE_BUILD_RPATH)
     message(FATAL_ERROR "ET_RPath run without CMAKE_BUILD_RPATH defined - run 
cmake_set_rpath before defining external projects.")
   endif (NOT DEFINED CMAKE_BUILD_RPATH)
-  if (NOT "${SUB_DIR}" STREQUAL "")
-    set(OFINAL "${SUB_DIR}/${E_OUTPUT_FILE}")
-  else (NOT "${SUB_DIR}" STREQUAL "")
-    set(OFINAL "${E_OUTPUT_FILE}")
-  endif (NOT "${SUB_DIR}" STREQUAL "")
   # Note - proper quoting for install(CODE) is extremely important for CPack, 
see
   # https://stackoverflow.com/a/48487133
   install(CODE "
@@ -269,127 +248,162 @@
 endfunction(ET_RPath)
 
 
+# etype = EXEC;SHARED;STATIC
+#
+function(ExternalProject_Target etype etarg extproj extroot fname)
 
-function(ExternalProject_Target etarg extproj extroot)
+  cmake_parse_arguments(E "RPATH" "LINK_TARGET;LINK_TARGET_DEBUG;SUBDIR" 
"SYMLINKS" ${ARGN})
 
-  cmake_parse_arguments(E "RPATH" 
"EXEC;SHARED;STATIC;LINK_TARGET;LINK_TARGET_DEBUG;STATIC_LINK_TARGET;STATIC_LINK_TARGET_DEBUG;SUBDIR"
 "SYMLINKS;DEPS" ${ARGN})
+  message("etype: ${etype}")
+  message("etarg: ${etarg}")
+  message("extproj: ${extproj}")
+  message("extroot: ${extroot}")
+  message("fname: ${fname}")
 
+  # If we have a static target but BUILD_STATIC_LIBS is off, we're done
+  if ("${etype}" STREQUAL "STATIC" AND NOT BUILD_STATIC_LIBS)
+    return()
+  endif ("${etype}" STREQUAL "STATIC" AND NOT BUILD_STATIC_LIBS)
+
+  # If we have something that's not a target, fatal error - this is a problem 
with the build logic
   if(NOT TARGET ${extproj})
     message(FATAL_ERROR "${extprog} is not a target")
   endif(NOT TARGET ${extproj})
 
-  # Protect against redefinition of already defined targets.
+  # Protect against redefinition of already defined targets - each etarg name 
should be unique, corresponding
+  # to a single executable or library from the foreign build.
   if(TARGET ${etarg})
     message(FATAL_ERROR "Target ${etarg} is already defined\n")
   endif(TARGET ${etarg})
-  if(E_STATIC AND TARGET ${etarg}-static)
-    message(FATAL_ERROR "Target ${etarg}-static is already defined\n")
-  endif(E_STATIC AND TARGET ${etarg}-static)
 
-  if (E_LINK_TARGET AND NOT MSVC)
-    set(LINK_TARGET "${E_LINK_TARGET}")
-  endif (E_LINK_TARGET AND NOT MSVC)
-  if (NOT MSVC)
+  # For some platforms, we may want to target a symbolic link rather than the
+  # target itself for linking purposes.  We also (grr) may need to target a
+  # configuration specific link.  Go through the permutations and figure out
+  # what LINK_TARGET should be in this case.
+  unset(LINK_TARGET)
+  unset(LINK_TARGET_DEBUG)
+
+  if ("${etype}" STREQUAL "SHARED" AND NOT MSVC)
+
+    if (E_LINK_TARGET)
+      set(LINK_TARGET "${E_LINK_TARGET}")
+    endif (E_LINK_TARGET)
+    if (NOT LINK_TARGET)
+      # In case we have a relative path for fname, make sure we're using just
+      # the filename for linking purposes.
+      get_filename_component(LFILE "${fname}" NAME)
+      set(LINK_TARGET "${LFILE}")
+    endif (NOT LINK_TARGET)
+
     if (E_LINK_TARGET_DEBUG)
       set(LINK_TARGET_DEBUG "${E_LINK_TARGET_DEBUG}")
-    elseif (E_LINK_TARGET)
-      set(LINK_TARGET_DEBUG "${E_LINK_TARGET}")
-    else (E_LINK_TARGET_DEBUG)
-      set(LINK_TARGET_DEBUG "${E_SHARED}")
-    endif (E_LINK_TARGET_DEBUG)
-  endif (NOT MSVC)
-  if (E_STATIC_LINK_TARGET AND NOT MSVC AND BUILD_STATIC_LIBS)
-    set(STATIC_LINK_TARGET "${E_STATIC_LINK_TARGET}")
-  endif (E_STATIC_LINK_TARGET AND NOT MSVC AND BUILD_STATIC_LIBS)
-  if (E_STATIC_LINK_TARGET_DEBUG AND NOT MSVC AND BUILD_STATIC_LIBS)
-    set(STATIC_LINK_TARGET_DEBUG "${E_STATIC_LINK_TARGET_DEBUG}")
-  endif (E_STATIC_LINK_TARGET_DEBUG AND NOT MSVC AND BUILD_STATIC_LIBS)
+    else (LINK_TARGET)
+      set(LINK_TARGET_DEBUG "${LINK_TARGET}")
+    endif ()
 
+  endif ("${etype}" STREQUAL "SHARED" AND NOT MSVC)
+
   # Create imported target - need to both make the target itself
   # and set the necessary properties.  See also
   # 
https://gitlab.kitware.com/cmake/community/wikis/doc/tutorials/Exporting-and-Importing-Targets
 
   # Because the outputs are not properly build target outputs of the primary
-  # CMake project, we need to install as either FILES or PROGRAMS
+  # CMake project, we need to install as either FILES or PROGRAMS.  Collect
+  # the file copying targets in a variable for later use.
   set(TOUT)
 
-  # Handle shared library
-  if (E_SHARED)
-    if (MSVC)
-      set(SHARED_DIR ${BIN_DIR})
-    else (MSVC)
-      set(SHARED_DIR ${LIB_DIR})
-    endif (MSVC)
+  # Shared library logic
+  if ("${etype}" STREQUAL "SHARED")
+
     add_library(${etarg} SHARED IMPORTED GLOBAL)
-    string(REPLACE "${SHARED_DIR}/" ""  ENAME ${E_SHARED})
-    fcfgcpy(TOUT ${extproj} ${extroot} ${SHARED_DIR} ${E_SHARED} ${ENAME})
-    if (E_LINK_TARGET AND NOT MSVC)
-      ET_target_props(${etarg} "${E_IMPORT_PREFIX}" ${E_LINK_TARGET} 
LINK_TARGET_DEBUG "${LINK_TARGET_DEBUG}")
-    else (E_LINK_TARGET AND NOT MSVC)
-      ET_target_props(${etarg} "${E_IMPORT_PREFIX}" ${ENAME} LINK_TARGET_DEBUG 
"${LINK_TARGET_DEBUG}")
-    endif (E_LINK_TARGET AND NOT MSVC)
 
-    install(FILES "${CMAKE_BINARY_DIR}/$<CONFIG>/${E_SHARED}" DESTINATION 
${SHARED_DIR}/${E_SUBDIR})
+    fcfgcpy(TOUT ${extproj} ${extroot} ${fname} 
${CMAKE_LIBRARY_OUTPUT_DIRECTORY} ${fname})
 
-    # Perform RPath magic
-    if (E_RPATH AND NOT MSVC)
-      ET_RPath("${LIB_DIR}" "${LIB_DIR}" "" "${E_SHARED}")
-    endif (E_RPATH AND NOT MSVC)
+    get_filename_component(LDIR "${fname}" DIRECTORY)
+    ET_target_props(${etarg} "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${LDIR}" 
${LINK_TARGET} SHARED LINK_TARGET_DEBUG "${LINK_TARGET_DEBUG}")
 
-  endif (E_SHARED)
+    install(FILES 
"${CMAKE_BINARY_DIR}/$<CONFIG>/${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${fname}" 
DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${E_SUBDIR})
 
-  # If we do have a static lib as well, handle that
-  if (E_STATIC AND BUILD_STATIC_LIBS)
-    add_library(${etarg}-static STATIC IMPORTED GLOBAL)
-    string(REPLACE "${LIB_DIR}/" ""  ENAME ${E_STATIC})
-    if (E_STATIC_LINK_TARGET AND NOT MSVC)
-      ET_target_props(${etarg}-static "${E_IMPORT_PREFIX}" 
${E_STATIC_LINK_TARGET} STATIC_LINK_TARGET_DEBUG "${STATIC_LINK_TARGET_DEBUG}" 
STATIC)
-    else (E_STATIC_LINK_TARGET AND NOT MSVC)
-      ET_target_props(${etarg}-static "${E_IMPORT_PREFIX}" ${ENAME} 
STATIC_LINK_TARGET_DEBUG "${STATIC_LINK_TARGET_DEBUG}" STATIC)
-    endif (E_STATIC_LINK_TARGET AND NOT MSVC)
-    string(REPLACE "${LIB_DIR}/" ""  ENAME ${E_STATIC})
-    fcfgcpy(TOUT ${extproj} ${extroot} ${LIB_DIR} ${E_STATIC} ${ENAME})
-    install(FILES "${CMAKE_BINARY_DIR}/$<CONFIG>/${E_STATIC}" DESTINATION 
${LIB_DIR}/${E_SUBDIR})
     # Let CMake know there is a target dependency here, despite this being an 
import target
-    add_dependencies(${etarg}-static ${extproj})
-  endif (E_STATIC AND BUILD_STATIC_LIBS)
+    add_dependencies(${etarg} ${extproj})
 
-  if (E_EXEC)
+    # additional (non-MSVC) work specific to shared libraries:
+    if (NOT MSVC)
+
+      # Perform RPath magic
+      if (E_RPATH)
+       ET_RPath("${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${fname}")
+      endif (E_RPATH)
+
+      # Add install rules for any symlinks the caller has listed
+      foreach(slink ${E_SYMLINKS})
+       fcfgcpy(TOUT ${extproj} ${extroot} ${slink} 
${CMAKE_LIBRARY_OUTPUT_DIRECTORY} ${slink})
+       install(FILES 
"${CMAKE_BINARY_DIR}/$<CONFIG>/${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${slink}" 
DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${E_SUBDIR})
+      endforeach(slink ${E_SYMLINKS})
+
+    endif (NOT MSVC)
+
+  endif ("${etype}" STREQUAL "SHARED")
+
+  # Static library logic
+  if ("${etype}" STREQUAL "STATIC" AND BUILD_STATIC_LIBS)
+
+    add_library(${etarg} STATIC IMPORTED GLOBAL)
+
+    fcfgcpy(TOUT ${extproj} ${extroot} ${fname} 
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} ${fname})
+
+    ET_target_props(${etarg} "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}" ${fname} 
STATIC LINK_TARGET_DEBUG "${LINK_TARGET_DEBUG}")
+    install(FILES 
"${CMAKE_BINARY_DIR}/$<CONFIG>/${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${fname}" 
DESTINATION ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${E_SUBDIR})
+
+    # Let CMake know there is a target dependency here, despite this being an 
import target
+    add_dependencies(${etarg} ${extproj})
+
+    # additional (non-MSVC) work specific to shared libraries:
+    if (NOT MSVC)
+
+      # Add install rules for any symlinks the caller has listed
+      foreach(slink ${E_SYMLINKS})
+       fcfgcpy(TOUT ${extproj} ${extroot} ${slink} 
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} ${slink})
+       install(FILES 
"${CMAKE_BINARY_DIR}/$<CONFIG>/${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${slink}" 
DESTINATION ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
+      endforeach(slink ${E_SYMLINKS})
+
+    endif (NOT MSVC)
+
+  endif ("${etype}" STREQUAL "STATIC" AND BUILD_STATIC_LIBS)
+
+  # Executable logic
+  if ("${etype}" STREQUAL "EXEC")
+
     add_executable(${etarg} IMPORTED GLOBAL)
 
-    string(REPLACE "${BIN_DIR}/" ""  ENAME ${E_EXEC})
-    fcfgcpy(TOUT ${extproj} ${extroot} ${BIN_DIR} ${E_EXEC} ${ENAME})
-    string(REPLACE "${BIN_DIR}/" ""  ENAME ${E_EXEC})
-    ET_target_props(${etarg} "${E_IMPORT_PREFIX}" ${ENAME} EXEC)
-    install(PROGRAMS "${CMAKE_BINARY_DIR}/$<CONFIG>/${E_EXEC}" DESTINATION 
${BIN_DIR}/${E_SUBDIR})
+    fcfgcpy(TOUT ${extproj} ${extroot} ${fname} 
${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${fname})
+    
+    ET_target_props(${etarg} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" ${fname})
 
+    install(PROGRAMS 
"${CMAKE_BINARY_DIR}/$<CONFIG>/${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${fname}" 
DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${E_SUBDIR})
+
     # Let CMake know there is a target dependency here, despite this being an 
import target
     add_dependencies(${etarg} ${extproj})
 
-    # Perform RPath magic
-    if (E_RPATH AND NOT MSVC)
-      ET_RPath("${LIB_DIR}" "${BIN_DIR}" "" "${E_EXEC}")
-    endif (E_RPATH AND NOT MSVC)
-  endif (E_EXEC)
+    # additional (non-MSVC) work specific to shared libraries:
+    if (NOT MSVC)
+ 
+      # Perform RPath magic
+      if (E_RPATH)
+       ET_RPath("${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${fname}")
+      endif (E_RPATH)
 
-    # Add install rules for any symlinks the caller has listed
-  if(E_SYMLINKS AND NOT MSVC)
-    foreach(slink ${E_SYMLINKS})
-      string(REPLACE "${LIB_DIR}/" ""  ENAME ${slink})
-      if (NOT BUILD_STATIC_LIBS)
-       if (NOT "${slink}" MATCHES ".*${CMAKE_STATIC_LIBRARY_SUFFIX}")
-         fcfgcpy(TOUT ${extproj} ${extroot} ${LIB_DIR} ${slink} ${ENAME})
-         install(FILES "${CMAKE_BINARY_DIR}/$<CONFIG>/${LIB_DIR}/${ENAME}" 
DESTINATION ${LIB_DIR})
-       endif (NOT "${slink}" MATCHES ".*${CMAKE_STATIC_LIBRARY_SUFFIX}")
-      else (NOT BUILD_STATIC_LIBS)
-       fcfgcpy(TOUT ${extproj} ${extroot} ${LIB_DIR} ${slink} ${ENAME})
-       install(FILES "${CMAKE_BINARY_DIR}/$<CONFIG>/${LIB_DIR}/${ENAME}" 
DESTINATION ${LIB_DIR})
-      endif (NOT BUILD_STATIC_LIBS)
-    endforeach(slink ${E_SYMLINKS})
-  endif(E_SYMLINKS AND NOT MSVC)
+    endif (NOT MSVC)
+  
+  endif ("${etype}" STREQUAL "EXEC")
 
-  # Let CMake know there is a target dependency here, despite this being an 
import target
-
+  # Set up the staging targets - these copy the files we are interested in 
from the
+  # 3rd party install directory to BRL-CAD's build tree.  This allows us to 
achieve
+  # file level dependencies despite using ExternalProject_Add, since each 
output
+  # file uses a custom command to do the copy that depends on the external 
target
+  # and the staging target depends on all of those output files individually.  
In
+  # essence, those copy commands provide our CMake system with the explicit 
file
+  # information we could not otherwise get from ExternalProject_Add.
   if (TOUT)
     if (NOT TARGET ${etarg}_stage)
       add_custom_target(${etarg}_stage ALL DEPENDS ${TOUT})
@@ -398,12 +412,11 @@
     endif (NOT TARGET ${etarg}_stage)
   endif (TOUT)
 
-  if (TARGET ${etarg})
-    add_dependencies(${etarg} ${etarg}_stage ${extproj})
-  endif (TARGET ${etarg})
-  if (TARGET ${etarg}-static AND BUILD_STATIC_LIBS)
-    add_dependencies(${etarg}-static ${etarg}_stage ${extproj})
-  endif (TARGET ${etarg}-static AND BUILD_STATIC_LIBS)
+  # Set up dependencies for the imported target that will be used in *_LIBRARY 
variables
+  # to depend on the staging targets.  This completes the dependency chain, 
and targets
+  # depending on the *_LIBRARY variables will now depend on the correct 
execution of
+  # the ExternalProject_Add system.
+  add_dependencies(${etarg} ${etarg}_stage)
 
 endfunction(ExternalProject_Target)
 

Modified: brlcad/branches/thirdparty_rework/src/superbuild/bson.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/bson.cmake 2020-10-15 
18:34:28 UTC (rev 77459)
+++ brlcad/branches/thirdparty_rework/src/superbuild/bson.cmake 2020-10-16 
04:24:56 UTC (rev 77460)
@@ -36,16 +36,17 @@
     )
 
   # Tell the parent build about files and libraries
-  file(APPEND "${SUPERBUILD_OUT}" "
-  ExternalProject_Target(bson BSON_BLD
-    OUTPUT_FILE ${BSON_BASENAME}${BSON_SUFFIX}
-    STATIC_OUTPUT_FILE ${BSON_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
-    SYMLINKS 
\"${BSON_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX};${BSON_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${BSON_MAJOR_VERSION}\"
-    LINK_TARGET \"${BSON_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}\"
-    STATIC_LINK_TARGET \"${BSON_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}\"
+  ExternalProject_Target(SHARED bson BSON_BLD
+    ${BSON_BASENAME}${BSON_SUFFIX}
+    SYMLINKS 
"${BSON_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX};${BSON_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${BSON_MAJOR_VERSION}"
+    LINK_TARGET ${BSON_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
     RPATH
     )
-  ExternalProject_ByProducts(BSON_BLD ${INCLUDE_DIR}
+  ExternalProject_Target(STATIC bson-static BSON_BLD
+    ${BSON_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+    )
+ 
+  ExternalProject_ByProducts(bson BSON_BLD ${BSON_INSTDIR} ${INCLUDE_DIR}
     libbson-1.0/bson-endian.h
     libbson-1.0/bson-md5.h
     libbson-1.0/bson-value.h
@@ -73,7 +74,6 @@
     libbson-1.0/bson-config.h
     libbson-1.0/bson-clock.h
     )
-  \n")
 
   list(APPEND BRLCAD_DEPS BSON_BLD)
 

Modified: brlcad/branches/thirdparty_rework/src/superbuild/gdal.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/gdal.cmake 2020-10-15 
18:34:28 UTC (rev 77459)
+++ brlcad/branches/thirdparty_rework/src/superbuild/gdal.cmake 2020-10-16 
04:24:56 UTC (rev 77460)
@@ -53,19 +53,22 @@
     )
 
   # Tell the parent build about files and libraries
-  ExternalProject_Target(gdal GDAL_BLD ${GDAL_INSTDIR}
-    SHARED ${LIB_DIR}/${GDAL_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
-    STATIC ${LIB_DIR}/${GDAL_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+  ExternalProject_Target(SHARED gdal GDAL_BLD ${GDAL_INSTDIR}
+    ${GDAL_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
     RPATH
     )
+  ExternalProject_Target(STATIC gdal-static GDAL_BLD ${GDAL_INSTDIR}
+    ${GDAL_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+    )
+
   set(GDAL_EXECUTABLES gdalinfo gdallocationinfo gdal_translate gdaltransform 
gdaldem gdalwarp gdalbuildvrt)
   foreach(GDALEXEC ${GDAL_EXECUTABLES})
-    ExternalProject_Target(${GDALEXEC}_exe GDAL_BLD ${GDAL_INSTDIR}
-      EXEC ${BIN_DIR}/${GDALEXEC}${CMAKE_EXECUTABLE_SUFFIX}
+    ExternalProject_Target(EXEC ${GDALEXEC}_exe GDAL_BLD ${GDAL_INSTDIR}
+      ${GDALEXEC}${CMAKE_EXECUTABLE_SUFFIX}
       RPATH
       )
   endforeach(GDALEXEC ${GDAL_EXECUTABLES})
-  ExternalProject_ByProducts(gdal GDAL_BLD ${GDAL_INSTDIR} ${DATA_DIR}/gdal 
${DATA_DIR}/gdal
+  ExternalProject_ByProducts(gdal GDAL_BLD ${GDAL_INSTDIR} ${DATA_DIR}/gdal
     LICENSE.TXT
     GDALLogoBW.svg
     GDALLogoColor.svg
@@ -157,7 +160,7 @@
     vertcs.override.csv
     )
 
-  ExternalProject_ByProducts(gdal GDAL_BLD ${GDAL_INSTDIR} include/gdal 
${INCLUDE_DIR}/gdal
+  ExternalProject_ByProducts(gdal GDAL_BLD ${GDAL_INSTDIR} ${INCLUDE_DIR}/gdal
     NOINSTALL
     cpl_config.h
     )

Modified: brlcad/branches/thirdparty_rework/src/superbuild/itcl.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/itcl.cmake 2020-10-15 
18:34:28 UTC (rev 77459)
+++ brlcad/branches/thirdparty_rework/src/superbuild/itcl.cmake 2020-10-16 
04:24:56 UTC (rev 77460)
@@ -110,13 +110,18 @@
     endif (NOT MSVC)
 
     # Tell the parent build about files and libraries
-    ExternalProject_Target(itcl ITCL_BLD ${ITCL_INSTDIR}
+    ExternalProject_Target(SHARED itcl ITCL_BLD ${ITCL_INSTDIR}
+      itcl${ITCL_VERSION}/${ITCL_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
       SUBDIR  itcl${ITCL_VERSION}
-      SHARED 
${LIB_DIR}/itcl${ITCL_VERSION}/${ITCL_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
-      STATIC 
${LIB_DIR}/itcl${ITCL_VERSION}/${ITCL_STUBNAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
       )
 
-    ExternalProject_ByProducts(itcl ITCL_BLD ${ITCL_INSTDIR} ${INCLUDE_DIR} 
${INCLUDE_DIR}
+    ExternalProject_Target(STATIC itcl-static ITCL_BLD ${ITCL_INSTDIR}
+      itcl${ITCL_VERSION}/${ITCL_STUBNAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+      SUBDIR  itcl${ITCL_VERSION}
+      )
+
+
+    ExternalProject_ByProducts(itcl ITCL_BLD ${ITCL_INSTDIR} ${INCLUDE_DIR}
       itcl.h
       itclDecls.h
       itclInt.h
@@ -123,14 +128,14 @@
       itclIntDecls.h
       )
 
-    ExternalProject_ByProducts(itcl ITCL_BLD ${ITCL_INSTDIR} 
${LIB_DIR}/itcl${ITCL_VERSION} ${LIB_DIR}/itcl${ITCL_VERSION}
+    ExternalProject_ByProducts(itcl ITCL_BLD ${ITCL_INSTDIR} 
${LIB_DIR}/itcl${ITCL_VERSION}
       itcl.tcl
       )
-    ExternalProject_ByProducts(itcl ITCL_BLD ${ITCL_INSTDIR} 
${LIB_DIR}/itcl${ITCL_VERSION} ${LIB_DIR}/itcl${ITCL_VERSION}
+    ExternalProject_ByProducts(itcl ITCL_BLD ${ITCL_INSTDIR} 
${LIB_DIR}/itcl${ITCL_VERSION}
       pkgIndex.tcl
       FIXPATH
       )
-    ExternalProject_ByProducts(itcl ITCL_BLD ${ITCL_INSTDIR} ${LIB_DIR} 
${LIB_DIR}
+    ExternalProject_ByProducts(itcl ITCL_BLD ${ITCL_INSTDIR} ${LIB_DIR}
       itclConfig.sh
       FIXPATH
       )

Modified: brlcad/branches/thirdparty_rework/src/superbuild/itk.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/itk.cmake  2020-10-15 
18:34:28 UTC (rev 77459)
+++ brlcad/branches/thirdparty_rework/src/superbuild/itk.cmake  2020-10-16 
04:24:56 UTC (rev 77460)
@@ -100,17 +100,17 @@
     endif (NOT MSVC)
 
     # Tell the parent build about files and libraries
-    ExternalProject_Target(itk ITK_BLD ${ITK_INSTDIR}
+    ExternalProject_Target(SHARED itk ITK_BLD ${ITK_INSTDIR}
+      itk${ITK_VERSION}/${ITK_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
       SUBDIR itk${ITK_VERSION}
-      SHARED 
${LIB_DIR}/itk${ITK_VERSION}/${ITK_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
       )
 
-    ExternalProject_ByProducts(itk ITK_BLD ${ITK_INSTDIR} ${INCLUDE_DIR} 
${INCLUDE_DIR}
+    ExternalProject_ByProducts(itk ITK_BLD ${ITK_INSTDIR} ${INCLUDE_DIR}
       itk.h
       itkDecls.h
       )
 
-    ExternalProject_ByProducts(itk ITK_BLD ${ITK_INSTDIR} 
${LIB_DIR}/itk${ITK_VERSION} ${LIB_DIR}/itk${ITK_VERSION}
+    ExternalProject_ByProducts(itk ITK_BLD ${ITK_INSTDIR} 
${LIB_DIR}/itk${ITK_VERSION}
       Archetype.itk
       Toplevel.itk
       Widget.itk
@@ -118,7 +118,7 @@
       tclIndex
       )
 
-    ExternalProject_ByProducts(itk ITK_BLD ${ITK_INSTDIR} 
${LIB_DIR}/itk${ITK_VERSION} ${LIB_DIR}/itk${ITK_VERSION}
+    ExternalProject_ByProducts(itk ITK_BLD ${ITK_INSTDIR} 
${LIB_DIR}/itk${ITK_VERSION}
       pkgIndex.tcl
       FIXPATH
       )

Modified: brlcad/branches/thirdparty_rework/src/superbuild/iwidgets.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/iwidgets.cmake     
2020-10-15 18:34:28 UTC (rev 77459)
+++ brlcad/branches/thirdparty_rework/src/superbuild/iwidgets.cmake     
2020-10-16 04:24:56 UTC (rev 77460)
@@ -88,13 +88,13 @@
     endif (NOT MSVC)
 
     # Tell the parent build about files and libraries
-    ExternalProject_ByProducts(iwidgets IWIDGETS_BLD ${IWIDGETS_INSTDIR} 
${LIB_DIR}/iwidgets${IWIDGETS_VERSION} ${LIB_DIR}/iwidgets${IWIDGETS_VERSION}
+    ExternalProject_ByProducts(iwidgets IWIDGETS_BLD ${IWIDGETS_INSTDIR} 
${LIB_DIR}/iwidgets${IWIDGETS_VERSION}
       iwidgets.tcl
       license.terms
       pkgIndex.tcl
       )
 
-    ExternalProject_ByProducts(iwidgets IWIDGETS_BLD ${IWIDGETS_INSTDIR} 
${LIB_DIR}/iwidgets${IWIDGETS_VERSION}/scripts 
${LIB_DIR}/iwidgets${IWIDGETS_VERSION}/scripts
+    ExternalProject_ByProducts(iwidgets IWIDGETS_BLD ${IWIDGETS_INSTDIR} 
${LIB_DIR}/iwidgets${IWIDGETS_VERSION}/scripts
       buttonbox.itk
       calendar.itk
       canvasprintbox.itk

Modified: brlcad/branches/thirdparty_rework/src/superbuild/netpbm.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/netpbm.cmake       
2020-10-15 18:34:28 UTC (rev 77459)
+++ brlcad/branches/thirdparty_rework/src/superbuild/netpbm.cmake       
2020-10-16 04:24:56 UTC (rev 77460)
@@ -29,13 +29,15 @@
     )
 
  # Tell the parent build about files and libraries
- ExternalProject_Target(netpbm NETPBM_BLD ${NETPBM_INSTDIR}
-   SHARED ${LIB_DIR}/${NETPBM_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
-   STATIC ${LIB_DIR}/${NETPBM_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+ ExternalProject_Target(SHARED netpbm NETPBM_BLD ${NETPBM_INSTDIR}
+   ${NETPBM_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
    RPATH
    )
+ ExternalProject_Target(STATIC netpbm-static NETPBM_BLD ${NETPBM_INSTDIR}
+   ${NETPBM_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+   )
 
- ExternalProject_ByProducts(netpbm NETPBM_BLD ${NETPBM_INSTDIR} 
${INCLUDE_DIR}/netpbm ${INCLUDE_DIR}/netpbm
+ ExternalProject_ByProducts(netpbm NETPBM_BLD ${NETPBM_INSTDIR} 
${INCLUDE_DIR}/netpbm
    bitio.h
    colorname.h
    pam.h

Modified: brlcad/branches/thirdparty_rework/src/superbuild/perplex.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/perplex.cmake      
2020-10-15 18:34:28 UTC (rev 77459)
+++ brlcad/branches/thirdparty_rework/src/superbuild/perplex.cmake      
2020-10-16 04:24:56 UTC (rev 77460)
@@ -10,22 +10,22 @@
     )
 
   # Tell the parent about files and libraries
-  ExternalProject_Target(perplex_lemon PERPLEX_BLD ${PERPLEX_BLD_ROOT}
-    EXEC ${BIN_DIR}/lemon${EXE_EXT}
+  ExternalProject_Target(EXEC perplex_lemon PERPLEX_BLD ${PERPLEX_BLD_ROOT}
+    lemon${CMAKE_EXECUTABLE_SUFFIX}
     RPATH
     )
-  ExternalProject_Target(perplex_re2c PERPLEX_BLD ${PERPLEX_BLD_ROOT}
-    EXEC ${BIN_DIR}/re2c${EXE_EXT}
+  ExternalProject_Target(EXEC perplex_re2c PERPLEX_BLD ${PERPLEX_BLD_ROOT}
+    re2c${CMAKE_EXECUTABLE_SUFFIX}
     RPATH
     )
-  ExternalProject_Target(perplex_perplex PERPLEX_BLD ${PERPLEX_BLD_ROOT}
-    EXEC ${BIN_DIR}/perplex${EXE_EXT}
+  ExternalProject_Target(EXEC perplex_perplex PERPLEX_BLD ${PERPLEX_BLD_ROOT}
+    perplex${CMAKE_EXECUTABLE_SUFFIX}
     RPATH
     )
-  ExternalProject_ByProducts(perplex_lemon PERPLEX_BLD ${PERPLEX_BLD_ROOT} 
${DATA_DIR}/lemon ${DATA_DIR}/lemon
+  ExternalProject_ByProducts(perplex_lemon PERPLEX_BLD ${PERPLEX_BLD_ROOT} 
${DATA_DIR}/lemon
     lempar.c
     )
-  ExternalProject_ByProducts(perplex_perplex PERPLEX_BLD ${PERPLEX_BLD_ROOT} 
${DATA_DIR}/perplex ${DATA_DIR}/perplex
+  ExternalProject_ByProducts(perplex_perplex PERPLEX_BLD ${PERPLEX_BLD_ROOT} 
${DATA_DIR}/perplex
     perplex_template.c
     )
 

Modified: brlcad/branches/thirdparty_rework/src/superbuild/png.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/png.cmake  2020-10-15 
18:34:28 UTC (rev 77459)
+++ brlcad/branches/thirdparty_rework/src/superbuild/png.cmake  2020-10-16 
04:24:56 UTC (rev 77460)
@@ -59,15 +59,17 @@
     )
 
   # Tell the parent build about files and libraries
-  ExternalProject_Target(png PNG_BLD ${PNG_INSTDIR}
-    SHARED ${LIB_DIR}/${PNG_BASENAME}${PNG_SUFFIX}
-    STATIC ${LIB_DIR}/${PNG_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
-    SYMLINKS 
${LIB_DIR}/${PNG_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX};${LIB_DIR}/${PNG_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${PNG_VERSION_MAJOR};${LIB_DIR}/${PNG_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+  ExternalProject_Target(SHARED png PNG_BLD ${PNG_INSTDIR}
+    ${PNG_BASENAME}${PNG_SUFFIX}
+    SYMLINKS 
${PNG_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX};${PNG_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${PNG_VERSION_MAJOR};${PNG_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
     LINK_TARGET ${PNG_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
-    STATIC_LINK_TARGET ${PNG_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
     RPATH
     )
-  ExternalProject_ByProducts(png PNG_BLD ${PNG_INSTDIR} ${INCLUDE_DIR} 
${INCLUDE_DIR}
+  ExternalProject_Target(STATIC png-static PNG_BLD ${PNG_INSTDIR}
+    ${PNG_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+    )
+
+  ExternalProject_ByProducts(png PNG_BLD ${PNG_INSTDIR} ${INCLUDE_DIR}
     png.h
     pngconf.h
     pnglibconf.h

Modified: brlcad/branches/thirdparty_rework/src/superbuild/proj4.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/proj4.cmake        
2020-10-15 18:34:28 UTC (rev 77459)
+++ brlcad/branches/thirdparty_rework/src/superbuild/proj4.cmake        
2020-10-16 04:24:56 UTC (rev 77460)
@@ -38,16 +38,17 @@
     )
 
   # Tell the parent build about files and libraries
-  ExternalProject_Target(proj PROJ4_BLD ${PROJ4_INSTDIR}
-    SHARED ${LIB_DIR}/${PROJ_BASENAME}${PROJ_SUFFIX}
-    STATIC ${LIB_DIR}/${PROJ_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
-    SYMLINKS 
${LIB_DIR}/${PROJ_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX};${LIB_DIR}/${PROJ_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${PROJ_API_VERSION}
+  ExternalProject_Target(SHARED proj PROJ4_BLD ${PROJ4_INSTDIR}
+    ${PROJ_BASENAME}${PROJ_SUFFIX}
+    SYMLINKS 
${PROJ_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX};${PROJ_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${PROJ_API_VERSION}
     LINK_TARGET ${PROJ_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
-    STATIC_LINK_TARGET \"${PROJ_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}\"
     RPATH
     )
+  ExternalProject_Target(STATIC proj-static PROJ4_BLD ${PROJ4_INSTDIR}
+    ${PROJ_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+    )
 
-  ExternalProject_ByProducts(proj PROJ4_BLD ${PROJ4_INSTDIR} ${DATA_DIR}/proj 
${DATA_DIR}/proj
+  ExternalProject_ByProducts(proj PROJ4_BLD ${PROJ4_INSTDIR} ${DATA_DIR}/proj
     epsg
     esri
     world
@@ -62,7 +63,7 @@
     CH
     )
 
-  ExternalProject_ByProducts(proj PROJ4_BLD ${PROJ4_INSTDIR} 
${INCLUDE_DIR}/proj ${INCLUDE_DIR}/proj
+  ExternalProject_ByProducts(proj PROJ4_BLD ${PROJ4_INSTDIR} 
${INCLUDE_DIR}/proj
     projects.h
     proj_api.h
     geodesic.h

Modified: brlcad/branches/thirdparty_rework/src/superbuild/regex.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/regex.cmake        
2020-10-15 18:34:28 UTC (rev 77459)
+++ brlcad/branches/thirdparty_rework/src/superbuild/regex.cmake        
2020-10-16 04:24:56 UTC (rev 77460)
@@ -36,15 +36,18 @@
     )
 
   # Tell the parent build about files and libraries
-  ExternalProject_Target(regex REGEX_BLD ${REGEX_INSTDIR}
-    SHARED ${LIB_DIR}/${REGEX_BASENAME}${REGEX_SUFFIX}
-    STATIC ${LIB_DIR}/${REGEX_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
-    SYMLINKS 
${LIB_DIR}/${REGEX_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX};${LIB_DIR}/${REGEX_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.1
+  ExternalProject_Target(SHARED regex REGEX_BLD ${REGEX_INSTDIR}
+    ${REGEX_BASENAME}${REGEX_SUFFIX}
+    SYMLINKS 
${REGEX_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX};${REGEX_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.1
     LINK_TARGET ${REGEX_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
-    STATIC_LINK_TARGET ${REGEX_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
     RPATH
     )
-  ExternalProject_ByProducts(regex REGEX_BLD ${REGEX_INSTDIR} ${INCLUDE_DIR} 
${INCLUDE_DIR}
+  ExternalProject_Target(STATIC regex-static REGEX_BLD ${REGEX_INSTDIR}
+    ${REGEX_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+    RPATH
+    )
+ 
+  ExternalProject_ByProducts(regex REGEX_BLD ${REGEX_INSTDIR} ${INCLUDE_DIR}
     regex.h
     )
 

Modified: brlcad/branches/thirdparty_rework/src/superbuild/stepcode.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/stepcode.cmake     
2020-10-15 18:34:28 UTC (rev 77459)
+++ brlcad/branches/thirdparty_rework/src/superbuild/stepcode.cmake     
2020-10-16 04:24:56 UTC (rev 77460)
@@ -50,9 +50,9 @@
   # Tell the parent build about files and libraries
   set(STEPCODE_LIBS base express exppp stepcore stepeditor stepdai steputils)
   foreach(SCLIB ${STEPCODE_LIBS})
-    ExternalProject_Target(lib${SCLIB} STEPCODE_BLD ${STEPCODE_INSTDIR}
-      SHARED ${LIB_DIR}/${SC_PREFIX}${SCLIB}${SC_SUFFIX}
-      SYMLINKS 
${LIB_DIR}/${SC_PREFIX}${SCLIB}${CMAKE_SHARED_LIBRARY_SUFFIX};${LIB_DIR}/${SC_PREFIX}${SCLIB}${CMAKE_SHARED_LIBRARY_SUFFIX}.2
+    ExternalProject_Target(SHARED lib${SCLIB} STEPCODE_BLD ${STEPCODE_INSTDIR}
+      ${SC_PREFIX}${SCLIB}${SC_SUFFIX}
+      SYMLINKS 
${SC_PREFIX}${SCLIB}${CMAKE_SHARED_LIBRARY_SUFFIX};${SC_PREFIX}${SCLIB}${CMAKE_SHARED_LIBRARY_SUFFIX}.2
       LINK_TARGET ${SC_PREFIX}${SCLIB}${CMAKE_SHARED_LIBRARY_SUFFIX}
       RPATH
       )
@@ -59,13 +59,16 @@
   endforeach(SCLIB ${STEPCODE_LIBS})
   set(STEPCODE_EXECS check-express exppp exp2cxx)
   foreach(SCEXEC ${STEPCODE_EXECS})
-    ExternalProject_Target(${SCEXEC}_exe STEPCODE_BLD ${STEPCODE_INSTDIR}
-      EXEC ${BIN_DIR}/${SCEXEC}${CMAKE_EXECUTABLE_SUFFIX}
+    ExternalProject_Target(EXEC ${SCEXEC}_exe STEPCODE_BLD ${STEPCODE_INSTDIR}
+      ${SCEXEC}${CMAKE_EXECUTABLE_SUFFIX}
       RPATH
       )
+    foreach(SCLIB ${STEPCODE_LIBS})
+      add_dependencies(${SCEXEC}_exe lib${SCLIB}_stage)
+    endforeach(SCLIB ${STEPCODE_LIBS})
   endforeach(SCEXEC ${STEPCODE_EXECS})
 
-  ExternalProject_ByProducts(libstepcore_stage STEPCODE_BLD 
${STEPCODE_INSTDIR} ${INCLUDE_DIR}/stepcode ${INCLUDE_DIR}/stepcode
+  ExternalProject_ByProducts(libstepcore STEPCODE_BLD ${STEPCODE_INSTDIR} 
${INCLUDE_DIR}/stepcode
     cldai/sdaiApplication_instance_set.h
     cldai/sdaiSession_instance.h
     cldai/sdaiObject.h
@@ -146,6 +149,7 @@
     clstepcore/Registry.h
     clstepcore/complexSupport.h
     )
+
   set(SYS_INCLUDE_PATTERNS ${SYS_INCLUDE_PATTERNS} stepcode  CACHE STRING 
"Bundled system include dirs" FORCE)
 
   set(STEPCODE_BASE_DIR 
${CMAKE_BINARY_DIR}/$<CONFIG>/${INCLUDE_DIR}/stepcode/base CACHE STRING 
"Building bundled STEPCODE" FORCE)

Modified: brlcad/branches/thirdparty_rework/src/superbuild/tcl.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/tcl.cmake  2020-10-15 
18:34:28 UTC (rev 77459)
+++ brlcad/branches/thirdparty_rework/src/superbuild/tcl.cmake  2020-10-16 
04:24:56 UTC (rev 77460)
@@ -60,7 +60,6 @@
       DEPENDS ${ZLIB_TARGET} tcl_replace rpath_replace
       )
     set(TCL_APPINIT tclAppInit.c)
-    set(SHARED_DIR ${LIB_DIR})
 
   else (NOT MSVC)
 
@@ -77,32 +76,30 @@
       INSTALL_COMMAND ${VCVARS_BAT} && nmake -f makefile.vc install 
INSTALLDIR=${TCL_INSTDIR} SUFX=
       )
     set(TCL_APPINIT)
-    set(SHARED_DIR ${BIN_DIR})
 
   endif (NOT MSVC)
 
   # Tell the parent build about files and libraries
-  # TODO - LIB_DIR is wrong with MSVC... we adjust for it here, but we're still
-  # copying to the wrong place in ExternalProject_Target's logic...
-  ExternalProject_Target(tcl TCL_BLD ${TCL_INSTDIR}
-    SHARED ${SHARED_DIR}/${TCL_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
+  ExternalProject_Target(SHARED tcl TCL_BLD ${TCL_INSTDIR}
+    ${TCL_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
     RPATH
     )
 
-  ExternalProject_Target(tclstub TCL_BLD ${TCL_INSTDIR}
-    STATIC ${LIB_DIR}/${TCL_STUBNAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+  ExternalProject_Target(STATIC tclstub TCL_BLD ${TCL_INSTDIR}
+    ${TCL_STUBNAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
     )
 
-  ExternalProject_Target(tclsh_exe TCL_BLD ${TCL_INSTDIR}
-    EXEC ${BIN_DIR}/${TCL_EXECNAME}${EXE_EXT}
+  ExternalProject_Target(EXEC tclsh_exe TCL_BLD ${TCL_INSTDIR}
+    ${TCL_EXECNAME}${CMAKE_EXECUTABLE_SUFFIX}
     RPATH
     )
-  ExternalProject_ByProducts(tcl TCL_BLD ${TCL_INSTDIR} ${LIB_DIR} ${LIB_DIR}
+
+  ExternalProject_ByProducts(tcl TCL_BLD ${TCL_INSTDIR} ${LIB_DIR}
     tclConfig.sh
     tclooConfig.sh
     FIXPATH
     )
-  ExternalProject_ByProducts(tcl  TCL_BLD ${TCL_INSTDIR} 
${LIB_DIR}/tcl8.${TCL_MINOR_VERSION} ${LIB_DIR}/tcl8.${TCL_MINOR_VERSION}
+  ExternalProject_ByProducts(tcl TCL_BLD ${TCL_INSTDIR} 
${LIB_DIR}/tcl8.${TCL_MINOR_VERSION}
     auto.tcl
     clock.tcl
     encoding/ascii.enc
@@ -325,11 +322,11 @@
     word.tcl
     )
 
-  ExternalProject_ByProducts(tcl TCL_BLD ${TCL_INSTDIR} ${LIB_DIR}/tcl8/8.5 
${LIB_DIR}/tcl8/8.5
+  ExternalProject_ByProducts(tcl TCL_BLD ${TCL_INSTDIR} ${LIB_DIR}/tcl8/8.5
     msgcat-1.6.1.tm
     )
 
-  ExternalProject_ByProducts(tcl TCL_BLD ${TCL_INSTDIR} ${INCLUDE_DIR} 
${INCLUDE_DIR}
+  ExternalProject_ByProducts(tcl TCL_BLD ${TCL_INSTDIR} ${INCLUDE_DIR}
     tclDecls.h
     tcl.h
     tclOODecls.h
@@ -340,11 +337,11 @@
     )
 
   # Anything building against the stub will want the headers, etc. in place
-  add_dependencies(tclstub-static tcl_stage)
+  add_dependencies(tclstub tcl_stage)
 
   set(TCL_LIBRARY tcl CACHE STRING "Building bundled tcl" FORCE)
   set(TCL_LIBRARIES tcl CACHE STRING "Building bundled tcl" FORCE)
-  set(TCL_STUB_LIBRARY tclstub-static CACHE STRING "Building bundled tcl" 
FORCE)
+  set(TCL_STUB_LIBRARY tclstub CACHE STRING "Building bundled tcl" FORCE)
   set(TCL_TCLSH tclsh_exe CACHE STRING "Building bundled tcl" FORCE)
   set(TCL_INCLUDE_PATH "${CMAKE_BINARY_DIR}/$<CONFIG>/${INCLUDE_DIR}" CACHE 
STRING "Directory containing tcl headers." FORCE)
   set(TCL_INCLUDE_DIRS "${CMAKE_BINARY_DIR}/$<CONFIG>/${INCLUDE_DIR}" CACHE 
STRING "Directory containing tcl headers." FORCE)

Modified: brlcad/branches/thirdparty_rework/src/superbuild/tk.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/tk.cmake   2020-10-15 
18:34:28 UTC (rev 77459)
+++ brlcad/branches/thirdparty_rework/src/superbuild/tk.cmake   2020-10-16 
04:24:56 UTC (rev 77460)
@@ -54,7 +54,6 @@
       DEPENDS ${TCL_TARGET} rpath_replace
       )
 
-    set(SHARED_DIR ${LIB_DIR})
     set(TK_APPINIT tkAppInit.c)
 
   else (NOT MSVC)
@@ -73,33 +72,32 @@
       DEPENDS ${TCL_TARGET}
       )
 
-    set(SHARED_DIR ${BIN_DIR})
     set(TK_APPINIT)
 
   endif (NOT MSVC)
 
   # Tell the parent build about files and libraries
-  ExternalProject_Target(tk TK_BLD ${TK_INSTDIR}
-    SHARED ${SHARED_DIR}/${TK_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
+  ExternalProject_Target(SHARED tk TK_BLD ${TK_INSTDIR}
+    ${TK_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
     RPATH
     )
-  ExternalProject_Target(tkstub TK_BLD ${TK_INSTDIR}
-    STATIC ${LIB_DIR}/${TK_STUBNAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+  ExternalProject_Target(STATIC tkstub TK_BLD ${TK_INSTDIR}
+    ${TK_STUBNAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
     )
 
-  ExternalProject_Target(wish_exe TK_BLD ${TK_INSTDIR}
-    EXEC ${BIN_DIR}/${TK_WISHNAME}${CMAKE_EXECUTABLE_SUFFIX}
+  ExternalProject_Target(EXEC wish_exe TK_BLD ${TK_INSTDIR}
+    ${TK_WISHNAME}${CMAKE_EXECUTABLE_SUFFIX}
     RPATH
     )
 
   if (NOT MSVC)
-    ExternalProject_ByProducts(tk TK_BLD ${TK_INSTDIR} ${LIB_DIR} ${LIB_DIR}
+    ExternalProject_ByProducts(tk TK_BLD ${TK_INSTDIR} ${LIB_DIR}
       tkConfig.sh
       FIXPATH
       )
   endif (NOT MSVC)
 
-  ExternalProject_ByProducts(tk TK_BLD ${TK_INSTDIR} 
${LIB_DIR}/tk8.${TCL_MINOR_VERSION} ${LIB_DIR}/tk8.${TCL_MINOR_VERSION}
+  ExternalProject_ByProducts(tk TK_BLD ${TK_INSTDIR} 
${LIB_DIR}/tk8.${TCL_MINOR_VERSION}
     bgerror.tcl
     button.tcl
     choosedir.tcl
@@ -136,7 +134,7 @@
     xmfbox.tcl
     )
 
-  ExternalProject_ByProducts(tk TK_BLD ${TK_INSTDIR} 
${LIB_DIR}/tk8.${TCL_MINOR_VERSION}/images 
${LIB_DIR}/tk8.${TCL_MINOR_VERSION}/images
+  ExternalProject_ByProducts(tk TK_BLD ${TK_INSTDIR} 
${LIB_DIR}/tk8.${TCL_MINOR_VERSION}/images
     README
     logo.eps
     logo100.gif
@@ -152,7 +150,7 @@
     tai-ku.gif
     )
 
-  ExternalProject_ByProducts(tk TK_BLD ${TK_INSTDIR} 
${LIB_DIR}/tk8.${TCL_MINOR_VERSION}/msgs 
${LIB_DIR}/tk8.${TCL_MINOR_VERSION}/msgs
+  ExternalProject_ByProducts(tk TK_BLD ${TK_INSTDIR} 
${LIB_DIR}/tk8.${TCL_MINOR_VERSION}/msgs
     cs.msg
     da.msg
     de.msg
@@ -171,7 +169,7 @@
     sv.msg
     )
 
-  ExternalProject_ByProducts(tk TK_BLD ${TK_INSTDIR} 
${LIB_DIR}/tk8.${TCL_MINOR_VERSION}/ttk ${LIB_DIR}/tk8.${TCL_MINOR_VERSION}/ttk
+  ExternalProject_ByProducts(tk TK_BLD ${TK_INSTDIR} 
${LIB_DIR}/tk8.${TCL_MINOR_VERSION}/ttk
     altTheme.tcl
     aquaTheme.tcl
     button.tcl
@@ -198,7 +196,7 @@
     xpTheme.tcl
     )
 
-  ExternalProject_ByProducts(tk TK_BLD ${TK_INSTDIR} ${INCLUDE_DIR} 
${INCLUDE_DIR}
+  ExternalProject_ByProducts(tk TK_BLD ${TK_INSTDIR} ${INCLUDE_DIR}
     tkDecls.h
     tk.h
     tkPlatDecls.h
@@ -205,7 +203,7 @@
     )
 
   if (MSVC)
-    ExternalProject_ByProducts(tk TK_BLD ${TK_INSTDIR} ${INCLUDE_DIR} 
${INCLUDE_DIR}
+    ExternalProject_ByProducts(tk TK_BLD ${TK_INSTDIR} ${INCLUDE_DIR}
       tkIntXlibDecls.h
       X11/ap_keysym.h
       X11/cursorfont.h
@@ -224,11 +222,11 @@
   endif (MSVC)
 
   # If something uses the stub, we're going to want the headers, etc. in place
-  add_dependencies(tkstub-static tk_stage)
+  add_dependencies(tkstub tk_stage)
 
   set(TK_LIBRARY tk CACHE STRING "Building bundled tk" FORCE)
   set(TK_LIBRARIES tk CACHE STRING "Building bundled tk" FORCE)
-  set(TK_STUB_LIBRARY tkstub-static CACHE STRING "Building bundled tk" FORCE)
+  set(TK_STUB_LIBRARY tkstub CACHE STRING "Building bundled tk" FORCE)
   #set(TTK_STUB_LIBRARY ttkstub CACHE STRING "Building bundled tk" FORCE)
   set(TK_WISH wish_exe CACHE STRING "Building bundled tk" FORCE)
   set(TK_INCLUDE_PATH "${CMAKE_BINARY_DIR}/$<CONFIG>/${INCLUDE_DIR}" CACHE 
STRING "Directory containing tcl headers." FORCE)

Modified: brlcad/branches/thirdparty_rework/src/superbuild/zlib.cmake
===================================================================
--- brlcad/branches/thirdparty_rework/src/superbuild/zlib.cmake 2020-10-15 
18:34:28 UTC (rev 77459)
+++ brlcad/branches/thirdparty_rework/src/superbuild/zlib.cmake 2020-10-16 
04:24:56 UTC (rev 77460)
@@ -39,14 +39,17 @@
     )
 
   # Tell the parent build about files and libraries
-  ExternalProject_Target(zlib ZLIB_BLD ${ZLIB_INSTDIR}
-    SHARED ${LIB_DIR}/${ZLIB_BASENAME}${ZLIB_SUFFIX}
-    STATIC ${LIB_DIR}/${ZLIB_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
-    SYMLINKS 
"${LIB_DIR}/${ZLIB_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX};${LIB_DIR}/${ZLIB_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.1"
+  ExternalProject_Target(SHARED zlib ZLIB_BLD ${ZLIB_INSTDIR}
+    ${ZLIB_BASENAME}${ZLIB_SUFFIX}
+    SYMLINKS 
"${ZLIB_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX};${ZLIB_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.1"
     LINK_TARGET "${ZLIB_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}"
     RPATH
     )
-  ExternalProject_ByProducts(zlib ZLIB_BLD ${ZLIB_INSTDIR} ${INCLUDE_DIR} 
${INCLUDE_DIR}
+  ExternalProject_Target(STATIC zlib-static ZLIB_BLD ${ZLIB_INSTDIR}
+    ${ZLIB_BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+    )
+ 
+  ExternalProject_ByProducts(zlib ZLIB_BLD ${ZLIB_INSTDIR} ${INCLUDE_DIR}
     zconf.h
     zlib.h
     )

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to