def __CreateCMakeSection_Sources(self, cmakeUIHInputVar, cmakeUICppInputVar, cmakeMocInputVar): """ Add sources to the target in the CMakeLists.txt """ sources = self.project.GetSources() if not self.__HasCompilableFiles(): sources.append(csnUtility.GetDummyCppFilename()) if self.project.type == "executable": self.file.write( "ADD_EXECUTABLE(%s %s %s %s %s)\n" % (self.project.name, cmakeUIHInputVar, cmakeUICppInputVar, cmakeMocInputVar, csnUtility.Join(sources, _addQuotes=1))) elif self.project.type == "library": self.file.write( "ADD_LIBRARY(%s STATIC %s %s %s %s)\n" % (self.project.name, cmakeUIHInputVar, cmakeUICppInputVar, cmakeMocInputVar, csnUtility.Join(sources, _addQuotes=1))) elif self.project.type == "dll": self.file.write( "ADD_LIBRARY(%s SHARED %s %s %s %s)\n" % (self.project.name, cmakeUIHInputVar, cmakeUICppInputVar, cmakeMocInputVar, csnUtility.Join(sources, _addQuotes=1))) elif self.project.type == "container": self.file.write("# Container project\n") else: raise NameError, "Unknown project type %s" % self.project.type
def GetCompileManager(self): if len(self.__compileManagerUpdates) > 0: for function, parameters in self.__compileManagerUpdates: function(**parameters) self.__compileManagerUpdates = list() if (len(self.__compileManager.sources) == 0): dummySource = csnUtility.GetDummyCppFilename() self.__compileManager.AddSources([dummySource]) return self.__compileManager
# Copyright 2007 Pompeu Fabra University (Computational Imaging Laboratory), Barcelona, Spain. Web: www.cilab.upf.edu. # This software is distributed WITHOUT ANY WARRANTY; # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Used to build all MeshLib applications import csnBuild import csnCilab import csnUtility from csnToolkitOpen import * meshLibApps = csnCilab.CilabModuleProject("MeshLibApps", "library") meshLibApps.AddSources([csnUtility.GetDummyCppFilename()]) meshLibApps.AddProjects([meshLib]) meshLibApps.AddApplications( ["meAppTools", "meAppPolyline", "meAppSegValidationTools"], _holderName="MeshLibApplications")
# Copyright 2007 Pompeu Fabra University (Computational Imaging Laboratory), Barcelona, Spain. Web: www.cilab.upf.edu. # This software is distributed WITHOUT ANY WARRANTY; # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Used to build all DcmAPI applications import csnBuild import csnCilab import csnUtility from csnToolkitOpen import * dcmAPIApps = csnCilab.CilabModuleProject("DcmAPIApps", "library") dcmAPIApps.AddSources( [csnUtility.GetDummyCppFilename()] ) dcmAPIApps.AddProjects( [dcmAPI] ) dcmAPIApps.AddApplications([ "viewer" ], _holderName="dcmapps") dcmAPIApps.AddDefinitions(["/bigobj"], _WIN32 = 1)
def GetDummyCppFilename(self): """ Returns the filename of an empty cpp file. """ return csnUtility.GetDummyCppFilename()
import csnBuild import csnCilab import csnUtility from csnGIMIASDef import * csnGMDataHandlingApps = csnCilab.CilabModuleProject("csnGMDataHandlingApps", "library") csnGMDataHandlingApps.AddSources([csnUtility.GetDummyCppFilename()]) csnGMDataHandlingApps.AddProjects([gmDataHandling])