ATLAS Offline Software
Functions | Variables
python.scripts.cmake_newskeleton Namespace Reference

Functions

def main (args)
 

Variables

 __version__
 
 __author__
 
 __doc__
 
 name
 functions --------------------------------------------------------------— More...
 
 help
 

Function Documentation

◆ main()

def python.scripts.cmake_newskeleton.main (   args)
create a new skeleton package

ex:
 $ acmd cmake new-skeleton MyPackage

Definition at line 32 of file cmake_newskeleton.py.

32 def main(args):
33  """create a new skeleton package
34 
35  ex:
36  $ acmd cmake new-skeleton MyPackage
37  """
38  sc = 0
39 
40  full_pkg_name = args.pkgname
41 
42  #make new package
43  res = subprocess.getstatusoutput('acmd cmake new-pkg %s' % full_pkg_name)
44  if res[0]!=0:
45  print("::: ERROR could not create new package")
46  return -1
47 
48 
49  #add algorithm
50  res = subprocess.getstatusoutput('cd %s;acmd cmake new-analysisalg --newJobo %sAlg' % (full_pkg_name,full_pkg_name))
51  if res[0]!=0:
52  print("::: ERROR could not create new alg")
53  return -1
54 
55  pkg_name = full_pkg_name
56 
57  # overwrite CMakeLists with our skeleton
58  with open(os.path.join(full_pkg_name,'CMakeLists.txt'), 'w') as req:
59  print(textwrap.dedent("""\
60  ## automatically generated CMakeLists.txt file
61 
62  # Declare the package
63  atlas_subdir( %(pkg_name)s )
64 
65  # Declare external dependencies ... default here is to include ROOT
66  find_package( ROOT COMPONENTS MathCore RIO Core Tree Hist )
67 
68  # Declare package as a library
69  # Note the convention that library names get "Lib" suffix
70  # Any package you depend on you should add
71  # to LINK_LIBRARIES line below (see the example)
72  atlas_add_library( %(pkg_name)sLib src/*.cxx
73  PUBLIC_HEADERS %(pkg_name)s
74  INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
75  LINK_LIBRARIES ${ROOT_LIBRARIES}
76  AthAnalysisBaseCompsLib
77  )
78 
79  # if you add athena components (tools, algorithms) to this package
80  # these lines are needed so you can configure them in joboptions
81  atlas_add_component( %(pkg_name)s src/components/*.cxx
82  NOCLIDDB
83  LINK_LIBRARIES %(pkg_name)sLib
84  )
85 
86  # if you add an application (exe) to this package
87  # declare it like this (note convention that apps go in the util dir)
88  # atlas_add_executable( MyApp util/myApp.cxx
89  # LINK_LIBRARIES %(pkg_name)sLib
90  # )
91 
92  # Install python modules, joboptions, and share content
93  atlas_install_python_modules( python/*.py )
94  atlas_install_joboptions( share/*.py )
95  atlas_install_data( data/* )
96  atlas_install_scripts( scripts/* )
97  # You can access your data from code using path resolver, e.g.
98  # PathResolverFindCalibFile("%(pkg_name)s/file.txt")
99 
100 
101  """%locals()), file=req)
102 
103 
104 
105 
106  #need to reconfigure cmake so it knows about the new files
107  #rely on the WorkDir_DIR env var for this
108 # workDir = os.environ.get("WorkDir_DIR")
109 # if workDir == None:
110 # print("::: ERROR No WorkDir_DIR env var, did you forget to source the setup.sh script?")
111 # print("::: ERROR Please do this and reconfigure cmake manually!")
112 # else:
113 # print("::: INFO Reconfiguring cmake %s/../." % workDir)
114 # res = subprocess.getstatusoutput('cmake %s/../.' % workDir)
115 # if res[0]!=0:
116 # print ("::: WARNING reconfigure unsuccessful. Please reconfigure manually!")
117 
118 

Variable Documentation

◆ __author__

python.scripts.cmake_newskeleton.__author__
private

Definition at line 11 of file cmake_newskeleton.py.

◆ __doc__

python.scripts.cmake_newskeleton.__doc__
private

Definition at line 12 of file cmake_newskeleton.py.

◆ __version__

python.scripts.cmake_newskeleton.__version__
private

Definition at line 10 of file cmake_newskeleton.py.

◆ help

python.scripts.cmake_newskeleton.help

Definition at line 28 of file cmake_newskeleton.py.

◆ name

python.scripts.cmake_newskeleton.name

functions --------------------------------------------------------------—

Definition at line 24 of file cmake_newskeleton.py.

python.scripts.cmake_newskeleton.main
def main(args)
Definition: cmake_newskeleton.py:32
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
Trk::open
@ open
Definition: BinningType.h:40