10 __version__ =
"$Revision: 795362 $"
11 __author__ =
"Will Buttinger"
12 __doc__ =
"streamline and ease the creation of new AthAnalysisAlgorithm in a new package"
18 import PyUtils.acmdlib
as acmdlib
24 name=
'cmake.new-skeleton'
28 help=
"name of the new pkg"
33 """create a new skeleton package
36 $ acmd cmake new-skeleton MyPackage
40 full_pkg_name = args.pkgname
43 res = subprocess.getstatusoutput(
'acmd cmake new-pkg %s' % full_pkg_name)
45 print(
"::: ERROR could not create new package")
50 res = subprocess.getstatusoutput(
'cd %s;acmd cmake new-analysisalg --newJobo %sAlg' % (full_pkg_name,full_pkg_name))
52 print(
"::: ERROR could not create new alg")
55 pkg_name = full_pkg_name
58 with open(os.path.join(full_pkg_name,
'CMakeLists.txt'),
'w')
as req:
59 print(textwrap.dedent(
"""\
60 ## automatically generated CMakeLists.txt file
63 atlas_subdir( %(pkg_name)s )
65 # Declare external dependencies ... default here is to include ROOT
66 find_package( ROOT COMPONENTS MathCore RIO Core Tree Hist )
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
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
83 LINK_LIBRARIES %(pkg_name)sLib
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
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")
101 """%locals()), file=req)