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 34 of file cmake_newskeleton.py.

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

Variable Documentation

◆ __author__

python.scripts.cmake_newskeleton.__author__
private

Definition at line 13 of file cmake_newskeleton.py.

◆ __doc__

python.scripts.cmake_newskeleton.__doc__
private

Definition at line 14 of file cmake_newskeleton.py.

◆ __version__

python.scripts.cmake_newskeleton.__version__
private

Definition at line 12 of file cmake_newskeleton.py.

◆ help

python.scripts.cmake_newskeleton.help

Definition at line 30 of file cmake_newskeleton.py.

◆ name

python.scripts.cmake_newskeleton.name

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

Definition at line 26 of file cmake_newskeleton.py.

python.scripts.cmake_newskeleton.main
def main(args)
Definition: cmake_newskeleton.py:34
Trk::open
@ open
Definition: BinningType.h:40
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70