Build Problems on Windows due to incomplete CMake configure

Revision as of 05:19, 7 June 2014 by BradWhitlock (talk | contribs) (New page: Using this configuration on Windows, the VisIt build was not working properly due to the inclusion of truncated Qt library paths in the Windows project files for the viewer, viswindow, vtk...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Using this configuration on Windows, the VisIt build was not working properly due to the inclusion of truncated Qt library paths in the Windows project files for the viewer, viswindow, vtkqt, and libV libraries. This very frustrating because the build worked fine on a checkout from June 2, 2014. There were no obvious changes to the 2.7.3 release that looks responsible for this. This happened on 2 different computers.

Configuration:

  • Windows 8.1
  • Visual Studio 2010
  • CMake 2.8.12.2
  • VisIt 2.7.3 RC checkout

I used the following script to filter out the offending libraries to get the build working:

import os, stat, string, random

root = "C:/2.7RC/build"

def tmpfilename():
    f = "temp%04d" % random.Random().randint(0,1000)
    return f

def isDir(path):
    ret = False
    try:
        s = os.stat(path)
        if (s.st_mode & stat.S_IFDIR) > 0:
            ret = True
    except:
        pass
    return ret

def FindProjects(path):
    p = []
    allfiles = os.listdir(path)
    for f in allfiles:
        filepath = os.path.join(path,f)
        if f[-8:] == ".vcxproj":
            p = p + [string.replace(filepath, "\\", "/")]
        elif isDir(filepath):
            p = p + FindProjects(filepath)
    return p

def write_filtered_line(f, line):
    toks = [";\\QtNetwork4.lib", ";\\QtCore4.lib", ";\\QtGui4.lib", ";\\QtOpenGL4.lib"]
    s = line
    count = 0
    for t in toks:
        if t in s:
            count = count + 1
            s = string.replace(s, t, "")
    f.write(s)
    return count

def FixupProject(p, overwrite):
    f = open(p, "rt")
    lines = f.readlines()
    f.close()

    tmpName = os.path.join(os.path.abspath(os.curdir), tmpfilename())
    f = open(tmpName, "wt")
    changedLines = 0
    for line in lines:
        changedLines = changedLines + write_filtered_line(f, line)
    f.close()
    if overwrite and changedLines > 0:
        os.unlink(p)
        os.rename(tmpName, p)
        print "Replaced ",p
    else:
        os.unlink(tmpName)

def main():
    proj = FindProjects(root)
    print proj
    print len(proj)
    for p in proj:
        FixupProject(p, True)

#FixupProject(root + "/vtkqt/vtkqt.vcxproj", True)
main()