Esempio n. 1
0
    def build_type(self, build_type):
        os.chdir(self.path)
        helpers.mkdir(self.bldpath)
        os.chdir(self.bldpath)
        helpers.mkdir(build_type)
        os.chdir(build_type)

        cmdline = [
            "cmake", self.path, "-G", "Visual Studio 14 2015 Win64",
            '-DCMAKE_BUILD_TYPE=Release'.format(build_type),
            '-DCMAKE_INSTALL_PREFIX={}'.format(self.env.getInstallDir())
        ]

        result = helpers.execute(cmdline, "configure-out.txt",
                                 "configure-err.txt")
        if not result:
            print("Cannot configure.")
            return False

        cmdline = ["cmake", "--build", ".", "--config", build_type]

        result = helpers.execute(cmdline, "compile-out.txt", "compile-err.txt")
        if result:
            self.setBuilt()
        return result
Esempio n. 2
0
    def compile(self, btype):
        os.chdir(self.path)
        helpers.mkdir (self.bldpath)
        os.chdir(self.bldpath)

        os.environ.putenv("OSGEO4W_ROOT", os.path.join(self.env.getInstallDir()))
        os.environ.putenv("GMP_DIR", os.path.join(self.env.getInstallDir()))
        os.environ.putenv("MPFR_DIR", os.path.join(self.env.getInstallDir()))
        os.environ.putenv("BOOST_ROOT", os.path.join(self.env.getInstallDir()))

        cmdline = ["cmake", self.path,
                   "-G", "Visual Studio 14 2015 Win64",
                   '-DCMAKE_BUILD_TYPE={}'.format(btype), 
                   ]

        result = helpers.execute(cmdline, "configure-out.txt", "configure-err.txt")
        if not result:
            print("Cannot configure.")
            return False

        cmdline = ["cmake", "--build", ".", "--config", btype]

        result = helpers.execute(cmdline, "compile-out.txt", "compile-err.txt")
        if result:
            self.setBuilt()
        return result
Esempio n. 3
0
    def compile(self, btype):
        os.chdir(self.path)
        shutil.copy(
            os.path.join(self.env.getDataDir(), "geos",
                         "GenerateSourceGroups.cmake"),
            os.path.join("cmake", "modules"))
        helpers.mkdir(self.bldpath)
        os.chdir(self.bldpath)

        os.environ.putenv("OSGEO4W_ROOT",
                          os.path.join(self.env.getInstallDir()))
        os.environ.putenv("GMP_DIR", os.path.join(self.env.getInstallDir()))
        os.environ.putenv("MPFR_DIR", os.path.join(self.env.getInstallDir()))
        os.environ.putenv("BOOST_ROOT", os.path.join(self.env.getInstallDir()))

        cmdline = [
            "cmake", self.path, "-G", "Visual Studio 14 2015 Win64",
            '-DCMAKE_BUILD_TYPE={}'.format(btype),
            '-DCMAKE_INSTALL_PREFIX={}'.format(self.env.getInstallDir())
        ]

        result = helpers.execute(cmdline, "configure-out.txt",
                                 "configure-err.txt")
        if not result:
            print("Cannot configure.")
            return False

        cmdline = ["cmake", "--build", ".", "--config", btype]

        result = helpers.execute(cmdline, "compile-out.txt", "compile-err.txt")
        if result:
            self.setBuilt()
        return result
Esempio n. 4
0
    def compile(self, btype):
        os.chdir(self.path)
        if os.path.exists("src\\CGAL_ImageIO"):
            shutil.rmtree("src\\CGAL_ImageIO")
        if os.path.exists("src\\CGAL_Qt5"):
            shutil.rmtree("src\\CGAL_Qt5")

        helpers.mkdir(self.bldpath)
        os.chdir(self.bldpath)

        os.environ.putenv("GMP_DIR", os.path.join(self.env.getInstallDir()))
        os.environ.putenv("MPFR_DIR", os.path.join(self.env.getInstallDir()))
        os.environ.putenv("BOOST_ROOT", os.path.join(self.env.getInstallDir()))

        cmdline = [
            "cmake",
            self.path,
            "-G",
            "Visual Studio 14 2015 Win64",
            '-DCMAKE_BUILD_TYPE={}'.format(btype),
        ]
        #'-DCMAKE_INSTALL_PREFIX={}'.format(self.env.getInstallDir()),

        result = helpers.execute(cmdline, "configure-out.txt",
                                 "configure-err.txt")
        if not result:
            print("Cannot configure.")
            return False

        #cmdline = ["msbuild", "CGAL.sln", "/p:BuildInParallel=true", "/p:Platform=x64"]
        #cmdline.append('/p:Configuration={}'.format(self.BuildType))
        cmdline = ["cmake", "--build", ".", "--config", btype]

        result = helpers.execute(cmdline, "compile-out.txt", "compile-err.txt")
        return result
Esempio n. 5
0
    def installType(self, btype):
        relpath = os.path.join(self.bldpath,
                               'dll_mpir_{}'.format(self.Processor), "x64",
                               btype)
        os.chdir(relpath)
        hdrdir = self.env.getInstallIncludeDir()
        libdir = self.env.getInstallLibDir()

        helpers.mkdir(hdrdir)
        helpers.copy(glob.glob("*.h"), hdrdir)
        #print ('Copy: {} from {} to {}'.format(glob.glob("*.h"), relpath, hdrdir))
        helpers.copy(glob.glob("*.dll"), libdir)
        helpers.copy(glob.glob("*.lib"), libdir)
        return True
Esempio n. 6
0
    def compile(self):
        os.chdir(self.path)

        with open("nmake.local", "w") as cfg:
            cfg.write('GDAL_HOME={}\n'.format(self.env.getInstallDir()))
            cfg.write("WIN64=YES\n")
            cfg.write("PLATFORM=x64")
            cfg.write('GEOS_DIR={}\n'.format(self.env.getInstallDir()))
            cfg.write('GEOS_CFLAGS = -I{}\\include -DHAVE_GEOS\n'.format(self.env.getInstallDir()))
            cfg.write('GEOS_LIB = {}\\lib\\geos_c.lib\n'.format(self.env.getInstallDir()))
            cfg.write('PROJ_INCLUDE = -I{}'.format(self.env.getInstallIncludeDir()))
            cfg.write('PROJ_LIBRARY = {}\proj_4_9.lib'.format(self.env.getInstallLibDir()))

        with open("nmake.opt", "a") as nm:
            nm.write("\nEXTERNAL_LIBS =	$(EXTERNAL_LIBS) legacy_stdio_definitions.lib\n")

        helpers.mkdir (self.bldpath)
        os.chdir(self.bldpath)

        shutil.copy(os.path.join(self.env.getDataDir(), "gdal","cpl_config.h"),
                    "port")

        cmdline = ["nmake", "/f", "makefile.vc",
                   'GDAL_ROOT={}'.format(self.path),
                   'INCDIR={}\include\gdal'.format(self.path),
                   "MSC_VER=1900", "WIN64=YES"
                   ]

        result = helpers.execute(cmdline, "build-out.txt", "build-err.txt")
        if not result:
            print("Cannot configure.")
            return False

        if result:
            self.setBuilt()
        return result
Esempio n. 7
0
 def prepare(self):
     if not os.path.exists(env.getBuildDir()):
         pathlib.Path(env.getBuildDir()).mkdir(parents=True, exist_ok=True)
     if not os.path.exists(env.getInstallDir()):
         pathlib.Path(env.getInstallDir()).mkdir(parents=True, exist_ok=True)
     if not os.path.exists(env.getStateDir()):
         pathlib.Path(env.getStateDir()).mkdir(parents=True, exist_ok=True)
     helpers.mkdir(env.getInstallBinDir())
     helpers.mkdir(env.getInstallLibDir())
     helpers.mkdir(env.getInstallIncludeDir())